From 15fd0c5bbb6b3374459f3bbcdf94809785abc2de Mon Sep 17 00:00:00 2001 From: tyson Date: Wed, 28 Dec 2022 10:58:13 -0600 Subject: [PATCH] Delete oldwasm/wasm directory --- oldwasm/wasm/.vscode/settings.json | 31 - oldwasm/wasm/README.md | 3 - oldwasm/wasm/asconfig.json | 20 - oldwasm/wasm/assembly/aegis.ts | 10 - oldwasm/wasm/assembly/index.ts | 182 - oldwasm/wasm/assembly/neural-net.ts | 433 -- oldwasm/wasm/assembly/test.ts | 23 - oldwasm/wasm/assembly/tsconfig.json | 4 - oldwasm/wasm/build/optimized.wasm | Bin 25454 -> 0 bytes oldwasm/wasm/build/optimized.wasm.map | 1 - oldwasm/wasm/build/optimized.wat | 7591 -------------------- oldwasm/wasm/build/untouched.wasm | Bin 38013 -> 0 bytes oldwasm/wasm/build/untouched.wasm.map | 1 - oldwasm/wasm/build/untouched.wat | 9566 ------------------------- oldwasm/wasm/index.js | 111 - oldwasm/wasm/package.json | 13 - oldwasm/wasm/tests/index.js | 23 - 17 files changed, 18012 deletions(-) delete mode 100644 oldwasm/wasm/.vscode/settings.json delete mode 100644 oldwasm/wasm/README.md delete mode 100644 oldwasm/wasm/asconfig.json delete mode 100644 oldwasm/wasm/assembly/aegis.ts delete mode 100644 oldwasm/wasm/assembly/index.ts delete mode 100644 oldwasm/wasm/assembly/neural-net.ts delete mode 100644 oldwasm/wasm/assembly/test.ts delete mode 100644 oldwasm/wasm/assembly/tsconfig.json delete mode 100644 oldwasm/wasm/build/optimized.wasm delete mode 100644 oldwasm/wasm/build/optimized.wasm.map delete mode 100644 oldwasm/wasm/build/optimized.wat delete mode 100644 oldwasm/wasm/build/untouched.wasm delete mode 100644 oldwasm/wasm/build/untouched.wasm.map delete mode 100644 oldwasm/wasm/build/untouched.wat delete mode 100644 oldwasm/wasm/index.js delete mode 100644 oldwasm/wasm/package.json delete mode 100644 oldwasm/wasm/tests/index.js diff --git a/oldwasm/wasm/.vscode/settings.json b/oldwasm/wasm/.vscode/settings.json deleted file mode 100644 index 7925fc07..00000000 --- a/oldwasm/wasm/.vscode/settings.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "yaml.customTags": [ - "!And", - "!And sequence", - "!If", - "!If sequence", - "!Not", - "!Not sequence", - "!Equals", - "!Equals sequence", - "!Or", - "!Or sequence", - "!FindInMap", - "!FindInMap sequence", - "!Base64", - "!Join", - "!Join sequence", - "!Cidr", - "!Ref", - "!Sub", - "!Sub sequence", - "!GetAtt", - "!GetAZs", - "!ImportValue", - "!ImportValue sequence", - "!Select", - "!Select sequence", - "!Split", - "!Split sequence" - ] -} diff --git a/oldwasm/wasm/README.md b/oldwasm/wasm/README.md deleted file mode 100644 index e00112a8..00000000 --- a/oldwasm/wasm/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# assembly - -An example of an [Aegis](https://github.com/module-federation/aegis) WebAssembly component / federated microservice written in AssemblyScript. diff --git a/oldwasm/wasm/asconfig.json b/oldwasm/wasm/asconfig.json deleted file mode 100644 index 28989bd0..00000000 --- a/oldwasm/wasm/asconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "targets": { - "debug": { - "binaryFile": "build/untouched.wasm", - "textFile": "build/untouched.wat", - "sourceMap": true, - "debug": true - }, - "release": { - "binaryFile": "build/optimized.wasm", - "textFile": "build/optimized.wat", - "sourceMap": true, - "optimizeLevel": 3, - "shrinkLevel": 0, - "converge": false, - "noAssert": false - } - }, - "options": {} -} diff --git a/oldwasm/wasm/assembly/aegis.ts b/oldwasm/wasm/assembly/aegis.ts deleted file mode 100644 index f3ed7048..00000000 --- a/oldwasm/wasm/assembly/aegis.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare function log(s: string): void -export declare function addListener( - eventName: string, - callbackName: string -): void -export declare function fireEvent( - eventName: string, - eventData: string[][], - forward: number -): void diff --git a/oldwasm/wasm/assembly/index.ts b/oldwasm/wasm/assembly/index.ts deleted file mode 100644 index a8929085..00000000 --- a/oldwasm/wasm/assembly/index.ts +++ /dev/null @@ -1,182 +0,0 @@ -import * as aegis from './aegis' -import * as nn from './neural-net' -//import * as nn from "./neural-net"; -//import * as tst from "./test"; - -const key: i32 = 0 -const val: i32 = 1 - -class ModelSpec { - modelName: string - endpoint: string - constructor(name: string, endpoint: string) { - this.modelName = name - this.endpoint = endpoint - } -} - -export function getModelSpec(): ModelSpec { - return new ModelSpec('wasm', 'wasm') -} - -export const ArrayOfStrings_ID = idof() - -function findVal(key: string, keys: string[], vals: string[]): string { - for (let i: i32 = 0; i < keys.length; i++) { - if (keys[i] == key) { - return vals[i].toString() - } - } - return '' -} - -export function modelFactory(keys: string[], values: string[]): string[][] { - const arr = new Array(3) - arr[0] = ['key1', findVal('key1', keys, values)] - arr[1] = ['key2', findVal('key2', keys, values)] - arr[2] = ['fibonacci', findVal('fibonacci', keys, values)] - return arr -} - -export function getPorts(keys: string[], vals: string[]): string[][] { - //aegis.log("getPorts called " + keys[0] + ":" + vals[0]); - const ports = new Array(2) - //service,type,consumesEvent,producesEvent,callback,undo - ports[0] = ['port1', 'dFlow,outbound,dFlow_start,port1_done,port1Cb,1'] - ports[1] = ['port2', 'dFlow,outbound,port1_done,port2_done,port2Cb,1'] - return ports -} - -export function port1Cb(keys: string[], vals: string[]): string[][] { - const cfg = [ - ['port', 'port1'], - ['callback', 'port1Cb'], - ['consumesEvent', 'dFlow_start'], - ['producesEvent', 'port1_done'], - ] - aegis.log( - 'porf invokced' + cfg[0][0] + ' ' + cfg[0][1] + ' ' + cfg[0][2] + cfg[0][3] - ) - return cfg -} - -export function port2Cb(keys: string[], vals: string[]): string[][] { - const cfg = [ - ['port', 'port2'], - ['callback', 'port2Cb'], - ['consumesEvent', 'port1_done'], - ['producesEvent', 'port2_done'], - ] - aegis.log( - 'porf invoked' + cfg[0][0] + ' ' + cfg[0][1] + ' ' + cfg[0][2] + cfg[0][3] - ) - return cfg -} - -export function getCommands(): string[][] { - const commands = new Array(7) - commands[0] = ['serviceMeshListen', 'tell wasm module to begin listening'] - commands[1] = ['serviceMeshNotify', 'tell wasm module to send broadcast'] - commands[2] = ['serviceMeshCallback', 'subscribed event fired'] - commands[3] = ['runFibonacci', 'remote calculate fibonacci'] - commands[4] = ['fibonacci', 'calculate fibonacci for a number'] - commands[5] = ['deployModule', 'request deployment of a module'] - commands[6] = ['commandEx', 'command example'] - return commands -} - -export function commandEx(keys: string[], vals: string[]): string[][] { - aegis.log('\ncommandEx called ' + keys[0] + ':' + vals[0]) - const retval = new Array(1) - retval[0] = ['key1', 'commandEx_update!'] - return retval -} - -export function serviceMeshListen(keys: string[], vals: string[]): void { - aegis.log('serviceMeshListen: ' + keys[0] + ': ' + vals[0]) - const eventName = findVal('eventName', keys, vals) - aegis.addListener(eventName, 'serviceMeshCallback') -} - -export function serviceMeshNotify(keys: string[], vals: string[]): void { - const modelName = findVal('modelName', keys, vals) - const modelId = findVal('modelId', keys, vals) - const eventName = findVal('eventName', keys, vals) - const eventData = new Array(3) - aegis.log('wasm notify called with args: ' + modelName + ': ' + modelId) - eventData[0] = [keys[0], vals[0]] - eventData[1] = ['modelName', modelName] - eventData[2] = ['modelId', modelId] - aegis.fireEvent(eventName || 'wasmWebListen', eventData, 1) -} - -export function serviceMeshCallback( - keys: string[], - vals: string[] -): string[][] { - aegis.log('websocket callback fired: ' + keys[0] + ': ' + vals[0]) - const eventName = findVal('eventName', keys, vals) - const eventData = new Array(2) - eventData[0] = [keys[0], vals[0]] - eventData[1] = [keys[1], vals[1]] - aegis.fireEvent(eventName + 'callback', eventData, 1) - return [['key1', 'serviceMeshCallback']] -} - -export function fibonacci(x: number): number { - if (x === 0) { - return 0 - } - if (x === 1) { - return 1 - } - return fibonacci(x - 1) + fibonacci(x - 2) -} - -export function runFibonacci(keys: string[], vals: string[]): string[][] { - let val: number = 0 - let startTime: i64 = Date.now() - - for (let i = 0; i < keys.length; i++) { - if ('fibonacci' == keys[i]) { - val = parseInt(vals[i]) - break - } - } - const sum = fibonacci(val) - const ret = new Array(2) - ret[0] = ['result', sum.toString()] - ret[1] = ['time', (Date.now() - startTime).toString()] - return ret -} - -export function portEx(keys: string[], vals: string[]): void { - aegis.log('portEx calling port wasmTestPort' + keys[0] + ':' + vals[0]) - return -} - -export function onUpdate(keys: string[], vals: string[]): string[][] { - return [['updatedByWasm', new Date(Date.now()).toISOString()]] -} - -export function onDelete(keys: string[], vals: string[]): i8 { - // return negative to stop the action - aegis.log('onDelete called') - return -1 -} - -export function validate(keys: string[], vals: string[]): void { - aegis.log('onUpdate called') - return -} - -export function test(keys: string[], values: string[]): string[][] { - const key1 = keys[0] == 'key1' ? values[0] : 'default' - const key2 = keys[1] == 'key2' ? values[1] : 'default' - const arr = new Array(3) - arr[0] = ['key1', key1] - arr[1] = ['key2', key2] - arr[2] = ['key3', 'alwaysThisValue'] - aegis.log('test called') - return arr -} diff --git a/oldwasm/wasm/assembly/neural-net.ts b/oldwasm/wasm/assembly/neural-net.ts deleted file mode 100644 index 0d446ce9..00000000 --- a/oldwasm/wasm/assembly/neural-net.ts +++ /dev/null @@ -1,433 +0,0 @@ -/* Copyright 2016 Google Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -/** - * A node in a neural network. Each node has a state - * (total input, output, and their respectively derivatives) which changes - * after every forward and back propagation run. - */ -export class Node { - id: string - /** List of input links. */ - inputLinks: Link[] = [] - bias: number = 0.1 - /** List of output links. */ - outputs: Link[] = [] - totalInput: number = 0 - output: number = 0 - /** Error derivative with respect to this node's output. */ - outputDer: number = 0 - /** Error derivative with respect to this node's total input. */ - inputDer: number = 0 - /** - * Accumulated error derivative with respect to this node's total input since - * the last update. This derivative equals dE/db where b is the node's - * bias term. - */ - accInputDer: number = 0 - /** - * Number of - * - * accumulated err. derivatives with respect to the total input - * since the last update. - */ - numAccumulatedDers: number = 0 - /** Activation function that takes total input and returns node's output */ - activation: ActivationFunction - - /** - * Creates a new node with the provided id and activation function. - */ - constructor(id: string, activation: ActivationFunction, initZero?: boolean) { - this.id = id - this.activation = activation - if (initZero) { - this.bias = 0 - } - } - - /** Recomputes the node's output and returns it. */ - updateOutput(): number { - // Stores total input into the node. - this.totalInput = this.bias - for (let j = 0; j < this.inputLinks.length; j++) { - let link = this.inputLinks[j] - this.totalInput += link.weight * link.source.output - } - this.output = this.activation.output(this.totalInput) - return this.output - } -} - -/** - * An error function and its derivative. - */ -export interface IErrorFunction { - error: (output: number, target: number) => number - der: (output: number, target: number) => number -} - -/** A node's activation function and its derivative. */ -export interface ActivationFunction { - output: (input: number) => number - der: (input: number) => number -} - -/** Function that computes a penalty cost for a given weight in the network. */ -export interface IRegularizationFunction { - output(weight: number): number - der(weight: number): number -} - -/** Built-in error functions */ -// class Errors { -// public static SQUARE: IErrorFunction = { -// error: (output: number, target: number) => -// 0.5 * Math.pow(output - target, 2), -// der: (output: number, target: number) => output - target -// } -// } - -/** Polyfill for TANH */ -// (Math as any).tanh = -// (Math as any).tanh || -// function tanh (x: number): number { -// if (x === Infinity) { -// return 1 -// } else if (x === -Infinity) { -// return -1 -// } else { -// let e2x = Math.exp(2 * x) -// return (e2x - 1) / (e2x + 1) -// } -// } - -/** Built-in activation functions */ -class Activations { - // public static TANH: ActivationFunction = { - // output: (x: number) => (Math as any).tanh(x), - // der: (x: number) => { - // let output = Activations.TANH.output(x) - // return 1 - output * output - // } - // } - // public static RELU: ActivationFunction = { - // output: (x: number) => Math.max(0, x), - // der: (x: number) => (x <= 0 ? 0 : 1) - // } - // public static SIGMOID: ActivationFunction = { - // output: (x: number) => 1 / (1 + Math.exp(-x)), - // der: (x: number) => { - // let output = Activations.SIGMOID.output(x) - // return output * (1 - output) - // } - // } - // public static LINEAR: ActivationFunction = { - // output: x => x, - // der: x => 1 - // } -} - -// Activations.SIGMOID.output(d) - -/** Build-in regularization functions */ -export class RegularizationFunction { - // public static L1: IRegularizationFunction = { - // output: w => Math.abs(w), - // der: w => (w < 0 ? -1 : w > 0 ? 1 : 0) - // } - public static L2: IRegularizationFunction - L2: IRegularizationFunction = { - output: (w: number) => { - return 0.5 * w * w - }, - der: (w: number): number => { - return w - }, - } -} - -/** - * A link in a neural network. Each link has a weight and a source and - * destination node. Also it has an internal state (error derivative - * with respect to a particular input) which gets updated after - * a run of back propagation. - */ -export class Link { - id: string - source: Node - dest: Node - weight: number = Math.random() - 0.5 - isDead: bool = false - /** Error derivative with respect to this weight. */ - errorDer: number = 0 - /** Accumulated error derivative since the last update. */ - accErrorDer: number = 0 - /** Number of accumulated derivatives since the last update. */ - numAccumulatedDers: number = 0 - regularization: IRegularizationFunction - - /** - * Constructs a link in the neural network initialized with random weight. - * - * @param source The source node. - * @param dest The destination node. - * @param regularization The regularization function that computes the - * penalty for this weight. If null, there will be no regularization. - */ - constructor( - source: Node, - dest: Node, - regularization: IRegularizationFunction, - initZero?: boolean - ) { - this.id = source.id + '-' + dest.id - this.source = source - this.dest = dest - this.regularization = regularization - if (initZero) { - this.weight = 0 - } - } -} - -/** - * Builds a neural network. - * - * @param networkShape The shape of the network. E.g. [1, 2, 3, 1] means - * the network will have one input node, 2 nodes in first hidden layer, - * 3 nodes in second hidden layer and 1 output node. - * @param activation The activation function of every hidden node. - * @param outputActivation The activation function for the output nodes. - * @param regularization The regularization function that computes a penalty - * for a given weight (parameter) in the network. If null, there will be - * no regularization. - * @param inputIds List of ids for the input nodes. - */ -export function buildNetwork( - networkShape: number[], - activation: ActivationFunction, - outputActivation: ActivationFunction, - regularization: IRegularizationFunction, - inputIds: string[], - initZero?: boolean -): Node[][] { - let numLayers = networkShape.length - let id = 1 - /** List of layers, with each layer being a list of nodes. */ - let network: Node[][] = [] - for (let layerIdx = 0; layerIdx < numLayers; layerIdx++) { - let isOutputLayer = layerIdx === numLayers - 1 - let isInputLayer = layerIdx === 0 - let currentLayer: Node[] = [] - network.push(currentLayer) - let numNodes = networkShape[layerIdx] - for (let i = 0; i < numNodes; i++) { - let nodeId = id.toString() - if (isInputLayer) { - nodeId = inputIds[i] - } else { - id++ - } - let node = new Node( - nodeId, - isOutputLayer ? outputActivation : activation, - initZero - ) - currentLayer.push(node) - if (layerIdx >= 1) { - // Add links from nodes in the previous layer to this node. - for (let j = 0; j < network[layerIdx - 1].length; j++) { - let prevNode = network[layerIdx - 1][j] - let link = new Link(prevNode, node, regularization, initZero) - prevNode.outputs.push(link) - node.inputLinks.push(link) - } - } - } - } - return network -} - -/** - * Runs a forward propagation of the provided input through the provided - * network. This method modifies the internal state of the network - the - * total input and output of each node in the network. - * - * @param network The neural network. - * @param inputs The input array. Its length should match the number of input - * nodes in the network. - * @return The final output of the network. - */ -export function forwardProp(network: Node[][], inputs: number[]): number { - let inputLayer = network[0] - if (inputs.length !== inputLayer.length) { - throw new Error( - 'The number of inputs must match the number of nodes in' + - ' the input layer' - ) - } - // Update the input layer. - for (let i = 0; i < inputLayer.length; i++) { - let node = inputLayer[i] - node.output = inputs[i] - } - for (let layerIdx = 1; layerIdx < network.length; layerIdx++) { - let currentLayer = network[layerIdx] - // Update all the nodes in this layer. - for (let i = 0; i < currentLayer.length; i++) { - let node = currentLayer[i] - node.updateOutput() - } - } - return network[network.length - 1][0].output -} - -/** - * Runs a backward propagation using the provided target and the - * computed output of the previous call to forward propagation. - * This method modifies the internal state of the network - the error - * derivatives with respect to each node, and each weight - * in the network. - */ -export function backProp( - network: Node[][], - target: number, - errorFunc: IErrorFunction -): void { - // The output node is a special case. We use the user-defined error - // function for the derivative. - let outputNode = network[network.length - 1][0] - outputNode.outputDer = errorFunc.der(outputNode.output, target) - - // Go through the layers backwards. - for (let layerIdx = network.length - 1; layerIdx >= 1; layerIdx--) { - let currentLayer = network[layerIdx] - // Compute the error derivative of each node with respect to: - // 1) its total input - // 2) each of its input weights. - for (let i = 0; i < currentLayer.length; i++) { - let node = currentLayer[i] - node.inputDer = node.outputDer * node.activation.der(node.totalInput) - node.accInputDer += node.inputDer - node.numAccumulatedDers++ - } - - // Error derivative with respect to each weight coming into the node. - for (let i = 0; i < currentLayer.length; i++) { - let node = currentLayer[i] - for (let j = 0; j < node.inputLinks.length; j++) { - let link = node.inputLinks[j] - if (link.isDead) { - continue - } - link.errorDer = node.inputDer * link.source.output - link.accErrorDer += link.errorDer - link.numAccumulatedDers++ - } - } - if (layerIdx === 1) { - continue - } - let prevLayer = network[layerIdx - 1] - for (let i = 0; i < prevLayer.length; i++) { - let node = prevLayer[i] - // Compute the error derivative with respect to each node's output. - node.outputDer = 0 - for (let j = 0; j < node.outputs.length; j++) { - let output = node.outputs[j] - node.outputDer += output.weight * output.dest.inputDer - } - } - } -} - -/** - * Updates the weights of the network using the previously accumulated error - * derivatives. - */ -export function updateWeights( - network: Node[][], - learningRate: number, - regularizationRate: number -): void { - for (let layerIdx = 1; layerIdx < network.length; layerIdx++) { - let currentLayer = network[layerIdx] - for (let i = 0; i < currentLayer.length; i++) { - let node = currentLayer[i] - // Update the node's bias. - if (node.numAccumulatedDers > 0) { - node.bias -= (learningRate * node.accInputDer) / node.numAccumulatedDers - node.accInputDer = 0 - node.numAccumulatedDers = 0 - } - // Update the weights coming into this node. - for (let j = 0; j < node.inputLinks.length; j++) { - let link = node.inputLinks[j] - if (link.isDead) { - continue - } - let regulDer = link.regularization - ? link.regularization.der(link.weight) - : 0 - if (link.numAccumulatedDers > 0) { - // Update the weight based on dE/dw. - link.weight = - link.weight - - (learningRate / link.numAccumulatedDers) * link.accErrorDer - // Further update the weight based on regularization. - let newLinkWeight = - link.weight - learningRate * regularizationRate * regulDer - if ( - link.regularization === RegularizationFunction.L1 && - link.weight * newLinkWeight < 0 - ) { - // The weight crossed 0 due to the reg ularization term. Set it to 0. - link.weight = 0 - link.isDead = true - } else { - link.weight = newLinkWeight - } - link.accErrorDer = 0 - link.numAccumulatedDers = 0 - } - } - } - } -} - -/** Iterates over every node in the network/ */ -export function forEachNode( - network: Node[][], - ignoreInputs: boolean, - accessor: (node: Node) => any -): void { - for ( - let layerIdx = ignoreInputs ? 1 : 0; - layerIdx < network.length; - layerIdx++ - ) { - let currentLayer = network[layerIdx] - for (let i = 0; i < currentLayer.length; i++) { - let node = currentLayer[i] - accessor(node) - } - } -} - -/** Returns the output node in the network. */ -export function getOutputNode(network: Node[][]): Node { - return network[network.length - 1][0] -} diff --git a/oldwasm/wasm/assembly/test.ts b/oldwasm/wasm/assembly/test.ts deleted file mode 100644 index 2ce727d3..00000000 --- a/oldwasm/wasm/assembly/test.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface ActivationFunction { - output(input: number): number - der(input: number): number -} - -export class Me implements ActivationFunction { - output(input: number): number { - throw new Error('Method not implemented.' + input.toString()) - } - public static outputStatic(input: number): number { - throw new Error('Method not implemented.' + input.toString()) - } - der(input: number): number { - throw new Error('Method not implemented.' + input.toString()) - } -} - -export function callMe(): Me { - const me = new Me() - me.der(2) - me.output(3) - return me -} diff --git a/oldwasm/wasm/assembly/tsconfig.json b/oldwasm/wasm/assembly/tsconfig.json deleted file mode 100644 index 798b474e..00000000 --- a/oldwasm/wasm/assembly/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "assemblyscript/std/assembly.json", - "include": ["./**/*.ts"] -} diff --git a/oldwasm/wasm/build/optimized.wasm b/oldwasm/wasm/build/optimized.wasm deleted file mode 100644 index 66feb0c35c4977d7d8e68143cc3975a692c89fc4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 25454 zcmeHw3w#yTx$l~py|Z^RJIMe6B0-tGcR*Ag36Bs2B`X321+m4~_1HpyfXNO?NW!ZI zk{*?E+gPdXRaAOStqN^p#nXpei#1vwXerX8ZD~z~`Zx!b*4(}>Jv?&%|FvfJBSED1 zo}SNhoTu@n~gT}%Ai$Uzb;s{tf8qzgo9Ppt7@99x`tK4 z)Yo>^iWLiLnp>*ttDA(O+p<^IG*!=8S6$yCvIDcLTB@!3hV{a>DrT9cm1P=+l@$_T z+rp2?iR4vQtGGK$o!F`Irj+YHhC-kBjn&JoA(2(pEy-IkW{_-Z zs@k|{<>Hp6n)+4EOXknEgpDCrG^}1-RllNHjD=#BHPlxvUtS{$gG-jwSFaa?aBi%r z7j9_DlC|}`ie@iavb>?Lu6lWkh}lb)G_|zUELm37Tx}I(t*&0((6rGMSxcH*s$h`O z!;|#mpmgbKGIw>=>S|G%*3+EPGig{ROm+Q=#)cZ$YI0f!L6RL)hNd8vH`F(`G_76U z($FNPMijldRlM6M%EDmb8u&@Gm=t|Yvq%hBXN4Q;uWMWZ zhZ7aJoLya4jY}C`S5;S|S}OxB)y*y9ikuU77_*icMw=_fngQ9mCT7eDR7l|p31iP^ zYq&_Y$j-3r6LPR4gq?4zj+jXH+-69JJ+9%3GBfM~0r6RDT%)PX4A>9D)!X8xE9M3& zG_0mWtY0zY1sb;41Y#!`x1tz1){MjqX)Fx1Nh3%P9BT^Km=EsSvt@U-941F9x zGLMwvfRY7?m%goNRf} z=2rw?y}Uj0lE8Q8K7RLJ#)irGYM<$3$HSUx>zb&rpg`C7gw`WfEG^tfK~+BJn?cBe zTBleWfj|)hgfE0ulyHy)1CpF8rk$*KNE)@pA=}?%q7@?o>!M~*j>6T+zP>(~LZ9as#mrR+ng(hKB-Tl%8OF9`2yHe7 zIrEjmhR^rB4#;=-$iY!K8c?Q-1wka}252=mfa`!8q@QWDEw$2Yap@6DU4zmoVty;3 zmbw9m1-fcnEI@DA?3(M>z*|6pu0lV6rs;O*vevIDGX>4J&oYAAOSJ4S8`?dz!mM0gSZ+`Td~3mmw7J9t#YtJ*GdQgT zeWVX2TT6YT8E&veNr_-UZ-^;lVotgi+XMFN24*5~npgRL{MV$b$sx6}aSa%bq90fA zSa?EbBxX|iXbRLOy}upes8D2rPbUF~16qV0p%`}(cGR$g021=yNDAssO9lx=5sU<; zQvnbn@IXeG7!<;6G@6tMzWh`}8178xs71F)Ga$T`fi;{B$F}dGRI@}(NMjyjrz;W_ zLW+4o6bXR}VarZ3 zz~a(ipivZ_|G6W!=@tEl- zAS~u&13|zO$se1+gP+#UK;NU?k8(UaDj*pU7sJrSNsfzQz2bl!G3~e+!w7{C*pc*F z*A$!30#s_PL9>qS?;!aoFVm@+4C_guPT^oYs3ZU|1V|L)4rh1)q+0}Ga}ds)Tsxk_ z+^YRr$ow_*k0O;~b$l|AKuHi2{&6T;5j0{#qh>B=E){SyTju23aVv%pq~j&Vz&Bxo zfGq{OLiS-p?T=vzn$Mvya3o<>Sgsoao7uCXf7;=<(&%r&^bjX;7XIJcJ`INK0G z5c@E@m>$fGuA}R)5+*48H8}`M_km+3G^I80OHP3T+TUFdg0)oe6D+Vr|jX(b0{B?mHF z29oVzuN@N^{tz>1RL)$i6mSG zS=4Ucw6pCWV!eaJD37sn06fYgRyVhsaugjh9*k$9)vS>1PSgYy)5(K>#F^6L!N)51 z8JjEL5$!u=d$_hZ3lj|L6j$aFFb3tvvl8f;FLPSZi|~smRSW3k1c?P%p6FD@%mCt; z4X;@8d^H=`7hzQz3F6966L!pW@?#b_KZfkNBhyuMLk zHs3~c5;0VxShwJ-Nn(Owwgnau9FAsP1TQx5^-1bPhHK#|m`})iz#Bk8jiI?LwJ}ze zc!?+`1IJD@aPJyCv7~}zfdq0LkeC_?PC9uCdyajF4Hs zIBUF6LC0k9G@0kXhsBB=z$m8G+*5(wixIRmDo^x;}NiuE7-ssCU^CQm{B5LU1nAM`Q90A6Z=IyC(u28NKJ7LY4WQ-u<< zLVuK;klHIE6lW+hlMwpKxKwDYN!@|Mnbc=NSf#Q-NtGFZ3AdoSEL^7?TuC1UFd758 zQLQJ(n%R1!r5in+=Ej0)BR^Wb3{NcLGnofQXapodPpL-PT8YEt;W0Zn$*c(ghs-)@ z%w_=?jp$*c$83%si5@n3%;tgF)X1|i%LMH)3p^^;f22DqeGW;oXaS&*EQZrq41q;7 zLept1+Il23oyKB5SWJ!lXcjRA;JZl&^CpP$i!^Ug9vAbckA;Z~EhBchV!TkpsDFeM ze*~RD+2IUB{}YTN?@$57QPR<=Y*t(8bNfG5RcB!-6+zC8C2g71456vKV5HW{%J{lC z(`G!=yrM4p1s(fL`UJ{18N64${jgBoKiF zf)s>Vz$=Uk%*hQ9DnV>45&a3Sf;qCEmX=W*K$sHV)Iqvo@q`8i$#ercD(i5p8m#ie zN22toax~VV%x-DSxhMcK`9u98uw8+UGjT*dQX@2T>3mSaRDTKsI2|Flj^JwEY{6cK z&Pm|f3EA6BBa94#T;yWQuL46@`f#hSJt9vCIZV}FTw}(<#E$fZ+QeLk0u9okPV5t` z)ehPmKUkJjWN7)%W z4J?pD5Ej)A`XbJtSdJUgH;$^>f>#we1#S*@INU63p14^F)FhUhtrmAIUZ4S<=uegu z5F8hJ7fZNE$Pwj3D5Zwl9js&GLs3=~55;N6%Ss`;v3Ng%10RZr4%Yl8oy;#~l*mwE z`aM>HT-Fd>ZShcfFjwXF_)t1Mq)?{7x(=0L0ZJ1~S>Gw}hGS~jp9JHxh4)hxs7PM3 zr1EZhXQeuNXJvGJ-6>2C6BW4Yv>y$a*bit;V_dQ5;X2+%c$5cRM!=AUY&V)@r!f~- z*$Ej~*uQb{+?&=o$;+y`(U5Dg~70| zWGSZhOTZo%T#6AY%PWeK5=VoI{3YaTJa>7)D~I)$#RquCznG-~nD%`NUPLypl$_rs z3LB)MaVHw4bepiqdrR$v81h4~Ou3Ka%uN$u;kE^6vpSGw)M8JebReqWU`6*_vAyav8R)f5!%3xl8JDEi4}OrzBkJZv;{T; zx!4rNer6>?16L;Du9(;ovn!2FvB+)FZ1!*688e|!Q+D2&MP`HY9ih)Tix4@2XxMf@ zERyi=pgbB{REuyJl$amIHgT^U>d{T_s8R4DQ|9QF9FBo$pie1q z$>|UU8Z2F#XjBAWq%8zEL>t*VhHAnRc8x5lMLlmTHAF*hwrf7-hP$@3#t>R=1Y9Vd zS6iHiZtOE|n@~Fy@etin?s)>w@5j`}LY!(rC>rhqi{A)i3peLlwMXUVpar)^Yb@K% z*>pYdqlbGjK#hsWZD#g*JCcaZTwDa;WXOC#X;tQIMwOS16Br72ZH12px^Ax&pHd=W z-clr-v`EIzGsy(5+{kUQ>>IJ6;LC$8KJXbzq=^MeXOfD$y}ne2Clx%GQrVQsfK-N? zefefbYDl0i8r70iIe-CCuqdTGOz0NPO%C^H#q+)~bzkXjxgB)| zRi)zXI|8#;MKeq`ABT|!gLMG&8Jp@==z@>raK++eFov4^JjV_{0Ik1-23p zyAf9X=tjlsknBY_?Ffu+h9BLK7`^CbFns9fhQ?%c!?hpXz!7H;Sd0m$$hG8nc?q^2 zW*9msGf`njhw)j744*I)zNT0^Fi&R6k(D7wFjJ0Xlx7&B9Ed$SN~`##qBMh+iqeRo zo*XI+YB{{Xs-iTmeL1i#MQ$?X2x>XF&y2+Zf4&ef?akEvY~lSZkL3kg5zORxnqJ%w ziS4IjMrFJHIo>C3tDJ%y6Oo1+DU#ns9h?t;MoQ9|tuJ(&8+ZD`oiXvPSOjuLo?KQdt+m7x!IN;1LVV4YyDqFnX28f>#q(p?URw<7c{~YqtS+PKvFfY#p)4Ivcb4Iv%iFlqf(#@;2pWucwtKD;~ zwXaE)(%q9)ys3o4Fo=uFS@4iRQA}vcNP4KU1qzeD+r-5>4PgTcW+kt~Chg}G1xXp+ zd;g>FKmN9HEq%SRz4NP&+zeKJpQvMe01%%pMLbs-wwJ7n}@o)^VNMv_PzauwwvT&1>L^w zhfn?DvEE$3BPOdyBPmW1CV>(Y_a+r7{bXeT((7o4A~|65rkxOytY7pj6eYON>>3+85D&d6h*Rh6@E|@$)Jd5xqfg*V=}no+6#(&D3$aPm9`Nf=_9(v z?6IsFr;$W)DOwkt2AT>uhpnmgtB9JG7yf!N_b|# z#}Zso6E#@y*mX1B?Xjl|AYtupRm5RZCvODvu#Iy@!@vhf_AI3gaEEe{I~1sCkj3G< zpscogP~F5VaA!Fv-}QF4%JCSCC(3r0p|+9CivAzS9p+mcdD+4+tw1m<6wbz0H&?zy zDU`r$fyi-w>(@Q}b|q+xi!=jNQlk`AjfNcSjevn1r_iwGP(@R|E$kW*AI29Eq)|K! zFDktrmItvhA><+d;$YY=w$u|SK3hh;w5}M5UOt>7J99X2mw(ZjV;6_f^L&o%Rz3Ut zi*EE}+n+-Hib)VYd(cGyQ2Sp(?zUNP>N8A7 zn=H5lENM9tq5%X%!*K=@WW)Bt~e$V-t zJrq~d>AfJchm%eBw7Z!-sIi=3zTyr0fMpr2W}C4YO@+|DiL|Hota7P6ON*;cVI+P& z|8)Yp)jE$e$_=PBH9)rIDH~%$bpmRSp=z%Tjj#jlfs$X_Lt8^Q=c#I%#WGfIdegvk z3h^{|s5GHj?yT_=x)sjE7}V-eyO_#lrh3LLyGJ|RT}yKqGVE`vnX`rWgPko7qnVG4 zR+9zJVSYW?zf5_HiIYF9eGG=-+ znn%RhCljhkH9yq};a3?~pYU*>cdkB-)u$4DD%U62ltbp}(>3~ZqZ}#2C}u3VyIbHj z&jJ{pd#89~$CM?i3%j5{7TD(Hb|u0-JeUy^?#eKoC9Qc0EEvVrNJ(f3$3obsc;I=# z4Q)(rq!|>8MKZ8j-Moz?jJtQl>V&$#OZRTGR$~jdwiest4Or}8;|Dc`m{(LAg->Ch zfO|)y*5cg@*KBr1(dX1dYbdpQva%6N5T}Gr=wK+fZ!s0Het8}y#ItQ)z@LY!0q_$y zjKqSyR|*1YuW>^utT%dCZw8p@l=#H1MLsp1;r>jS2PD{#;Wh*kKJh>`3z%~;#y}@- zXG51D>fg=;;@v~bOxOWuw0mMqam7WJQ`x@fzKcGGwE@qS0>!&nT-1seD}M8au^QZA zh9WY8*_i;R)Uy#5$)888oYqMZ8wX-X+%gj`fOCpiu}2J86)~LCh#h&|%AhsQqctUy z*4Rv1BRyJhK26JuCRj63Fd!u`=;9nM@s!dnoon2JD>FQ>x8LB^l! ztgO(%cO&R%@JiWznKP6THH2aPf*FcRAZFq$M7kNoD2N+3q~5{tyU>U^#JjK?s%&rH z_TC?V^jhO$b=`YU$Fp7e*EOLm>%B~NUM>#{8CSJm2>pFe-gnU^oW*}DQf|_=Qy%-% zC46`akNR^sfs?qpNIvoB@M>(&VUvNEb$E>$9pAI-+28dwv!0s@7+#-{zccHja9LRQ zcV-=Jyw2OZO7L}*U>z3l@;+mA6mPZy<~~C;1ObS*mj@xzuSaXnJXE&ep?EMP#jdXf zM5JIYs8!O(2P=8wgLHymT-U~RpiKkjy%?br0fbLtpwWVlh?1W(V4!q;Lq+`pDf+d- z^#UM_kf2R~axSTSn451d`bN;VbU_*l`eQGH3rs|7JIc!1zg{r(W1^3%qEwhAG6xm4 zzfRN)fPf-_GfAiu0y*z6Tlzm-dsfJq`q2~m=(XNMGz&P?lO*h*B6T^ipn9x?lg6$E zP~igDRUU(KRN-dWE$6OC)(d<_=sg_#K*)=IelQ`xH_CIyzNFgmiannSekkNvJ^ltXJbt_ZvEtOYfH@Y3X3;U6LGV#CP{9D~W;q4wks$0PAve{l@)e|{Rzf^0&Fa^e zld`K?(y$L1M%Fp7p_qWF_D+U$sJc-$;FY4x=YE_KXg03m3rmztISJmzMC@191=A=4 zC7w*i@YJIM*Vq_E{;RKx8R`KCW+)%3;%R3sq8}yzQ*02Ml4?m~xgpgYz;3rwz*ny@ zCP4Y|2$jor=)$LK*_Y`GKP@1gX@WpoTECDhN*C2!+gG03`T#ocgwhivecE^q_O~+< z`1fIi6BZLmO;~!meYKV;@-a1)rDZ}Gq)hNJ#$}*_IrMrbqG$hWW@^2WS#q0r1g-Sq z;lTUlDVnM%H<@XlFVDIfbgDiuENus>*MLo9f*fw_ruda|82`tc({Df{9w&6fFD%s3J=4% z=NYawu=ah>NI70VrDnLAnZ9&YD)ke(T6|FZO7tW7SUPzXkxH`AlU`JH4$AB?*yC~L zGl;cj|D5usb*>CnXi53XQUd(|li{Lf+EgF`dy+c_-5zTN(granByJIdKv0 z^!zntr|WHNzyZ}H#bO1G>8lmQUwH(>xXw7jC73r(m3;v7=8;M^sa}+!%5M$i1_XeS zY8H1#Q^8BEUcBJtrbX8?3!mH~J9~8f+k`(7O$qN!#zJ`{s^+S9PvJXbIzx2EAfDIm z3-2uv`QEve>SY$=r0oVIvtoBlXBMRi-0vQt>JFS8;FD?M4~*RJ@s|fNh}C*O;RodF zaes^L=>jfd53GZQug@6Atspz&T87TJ*N#`(xPToXTNY}6w0p$>cFp8LfV%ir zy9d64(N2XjM5ZfLm5c*5$k@+?t%)^tvJN1-@Gk~YBoMB?ROI*T2&}fzotghBWHJY- zkPm@%_5pX^N{)cYFd2md07+OUudyU5JL4W;FdYyzB>}OU(pl_g;b|V#DO}6j@9UlA zz*pqBl&23g^&$Sg8wUNoO?|NV41RyG`0wcV@Fk{BZm^RF0VU`h&9s$iS8nz9FTdub zsxJ)ws24N2HdB*O*YE<-@ghcB|4{{g`!xCZqhBb<05tI{Sjjg)&s4a3Nq|$o5Gp$| zGvyCna7P@R`R|tmMxM>rdN}o`H;`I~^-&8ptG~lw@7j|6bD+P%pwW?Zwe8i3wr3&gB{6y$ zS7%&-Vjn$%=O=tw6C?0K1Fd1-dFh`FAv?mhF;mFxVf#Wu2;t(`Eb2s! zSSBWlCeecL8hkGot3|VzfU9QwZlZ=c9=0zbOfio6qF$^J)nWrMG>Ekr$MZ^jH;F3r ztwNvd%C?PhLhi}7iwIXRfR=~92jjrg(QF$pL<%t$hXhY`z_=XPTEI~QaJsl^z{f>T z73e4$JvkaS#~w}C3kJ}b2&g(pvC@}jhiw}p@#xmJ^9d2gu^#xEA+g+xK5)Db4?5X5 z5(gz+hkoj4g`!=pf6_tGL;R6a1n_-yO~E&)Xy+PofW6*_vmcXMnH4I93ARGG&!2*l0QKWLKWTwhj022F|LKQE6}n+_`OS%tdyk%?J1l~ zFou3nozZ#)u#CgVCSZaO?$1|T_2k<*v~)#Ch@~MIPB$OVAIK~O?r;>d+a0@x%r5&_ zX3x&lBylEICy9Qnb_`Oi?ii$5rDwWf=v6oG8I-b&PfqUFeLWsXH$WhvJcec%?D!yi zIQhp;u$oA8k!5g->6wj<(NDiKH5^nncR;Nm?%AiJ$|x^K$T9N}|8vJ-cIx+e%XHyL%S_i@jMRo;b z8>*1(8fs@#HWLQ|`Ci?+f2c-Ho4}N^2hFg_(V+wNtvx|@3{&WK3`^;|7d&<8=Dl7s z^+HznqZ#-P4I3zFy1&Vj8oXn8O46k^cpt9f=C0xPMdUq(qZ!I&EMnBwk!qFFA>(%nC$+i?S}Rn-?=RGB z?zV;K1)Du+o(Y15AIIj^Ai_kklA&$Kd5XdD~BOo_I>vDuWp5(^hII}LV0HTaZ*rOqjj<6>aa-4!(3)0OX+5~YJ z-^omMaz?o-_BN?@xuZxi)K#PzD#^tp&V@434ByySWRD`+LL3Z-^)T3guzd_;7a&#? z*?8+uh$(6;(+>5?R6^`x8W8f#ci| zk_cxWvzQCk8C$50CWv>wCUw3hs~aqI%kQZK@(n-7OUGg#U>DwR1I zD_7&gDrp5G{1ZX*p9oYxi=8k5@@UuShQzEAxu=^+8foZm1GIg z?tlcEXM#lZV*Q-&@pv-h$tz1^mtW=Uuj}@BgXr;>?qf^E~%#dBW zdCzEj2vv-*re*^ZdL0nU{ks3qXginvFsUd(QCk8Z(LKl0dZ^T^VYV?^z%eQFj90}p zV@JJG3X4!ZYTuYtrNV+cW6Z7#?LEP*=E!j8&+q!TbP}^_6^VGVo>q^`c!@l_b z)B~Ts^1oNUI(|m=b>G^Zxc~5+5tmu7j`){XUcCRM;intFy{KpJk4`?ZzAy5Ng#7T! z*Z*kd$+m5ejXHSeZTDYSI`-yIzV`i>AARhut~Fo#$rpbgUmx4?{_4dWD!x2_|95UU z@Pkip96a+Mr(J(yVcA!m=N4_BSKjdcJ=7S-vd}3AkKh2o+;y)jLec$a*{q(gF7ta383-`P{`iBP|Onl|`N0x0WuIqZ^ zFTY-rd*jM)e`C!5{_&e%IsVok_q6wYYu97n|Na-RY^@6}S@!wGCC^S-+PC-R>&86w z<&Hb9zUS%97c~~I|Lftq_Po32!KV*D`qfP>TVGxB&Eu~=ufBw`5BL>~Q zBK+>&{adeT$lkxVV_fxlZ{0Zj$)CZb_^H^zZ|9NMkD}`Bdf|f&kKLaA)#Dqc&-&bV zhlXCh^}xN|jW@r4>w!s|@4BV^y>CBU{?9+36T5%-mjNj8*$?kruwdN}N9?Hh z!G~Y^_7}(9e#4{AhocT&RQl!j-hJ44;A@c`UqA7H^RE~EX~wc&xnsNTcy;GzKXcXW z_VK^zvMSz*K66*!?9WWxvFb~5Psfh04WIn_H;dl>-raAU_dkEN{_s=v&)oAt;`hA| z%rHOyI37KWv%h1^JaNN`rV||}cAj|lM9+!8oEUU++{w8ot4`i}@}84Voczhje>o{m z6`h)T>Y7uDQ+J%|JoVJ6pP%~hRL<$qr)QnM>2%BKyH0=e^z)|=pZ@FVg1!lT^ZSr5IO=aithnigBeFSBi0^7)LA|F-d(U<9iB@sW{4TOv6!*W4fY5EF3Xe zeWu`hDvmN7({PmIn69`XC1T--De5y7-(@(a;V8#3U2#lqNQqcDVygO-;d>g6avakE zMajrDIU+S;nu>#;X*kMpOve?ar)1=s9FZC^aTGu0IHu#98lv=+j9il=QX?jg;%7QO zT8q>WrKe=%njDcDF>#dKU#hcuX=>rf3YoQxJchnjRDGqXN@TGt+1$-&s&((7$0e%wTCjovE;3olo65u&^&c&lA1Aa2# zCj)*m;3orqGT=Gy&c)NG0DcPKrvQEm;HLn73g9_s&t(Qo1^iUNPX+u`z)uDIRKTC> z%qRnV8Q{wRUk3Oxz?T93TxZNQz)u7GG{8>-{4~H%1N^zpq;kNQ1HK&a<$x~-d^zCH zb%sp`{B*!i2mExvPY3*Tz|*Vf8MH1fL@iTOl$IQmDj}=XNAJjRmQ?}13h?wudKEo` z)}@80WonAjl4DXOaW=+X2_dKSHd7N(V`X=;lS zlWS5YG(Rix(X)^VCS^j)V>8sE^Y{#V5o5wU9Gub2 z4~*rEyNr?49yuq}DwOCoq86oe9U>$P`bMke(2}mAdS>Tvy?jr^cq@t-osXBJ5s_#VT;$<*7Z<#fZc8*p|RDtVj1A zP3z@~+Uq^3d$-O?!CnhkZp{LA$1H_;S6c54=;JmodiUzyeQCYd!WwHmy1MshTJKzy zqZI5(-Mh70qzEro!fV24=OPh*8pV!rBaS=z*Nnn`0gi1rcH=mRqZbF?6WLDyE``$( zy5dTpWImI}y#C{v{c|DBGWK^otKqlfoZJR?vG>5-iT*CHe@|w=gqNuP{a*i}%znae zRP??6a~^%1)9ACmPSN-J_hj}<^si$7ey{&fX8&Ty*Qn@w{l_!=7hxW8 z&qQ|o*rShg8h!50tyA>9{ymxfvw?rPqR)P;bPwTNMuU~$Sn6UA0Y@i}ZX8E&h$wbg za8%$}ilZGzCys7xL456b{P{@B3<@h~1n?(Spmwy-tb1@y?$wTmxL*4qoRd$3@E3St zuxnv#_Rd6=g!5Cv3dBQ1{n(%aJ+4X{k*@JTi%ym$pKjHep93u?8^f=DR z&3GM_s+8flkB;Y;>;|rLUGUadfe9mCqlzX z4`atm!rKjqV{XJj3Jq$~;GEpFr>J^g%->{C;_l~I5I%%+DOGeajzyRYwHU8`f&{s@ z##})kZUiIs_$c@e{BH|{-;VP{!jByQuOD3LEtY=J{J$DR8$neg{s)Ft*L`Y1!GwtojV(2+Yd%}OV#0d-FB=n9 HS2g}$gOQ&F diff --git a/oldwasm/wasm/build/optimized.wasm.map b/oldwasm/wasm/build/optimized.wasm.map deleted file mode 100644 index dd811b15..00000000 --- a/oldwasm/wasm/build/optimized.wasm.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["~lib/rt/common.ts","~lib/rt/tlsf.ts","~lib/shared/typeinfo.ts","~lib/rt/itcms.ts","assembly/index.ts","~lib/rt.ts","~lib/util/error.ts","~lib/memory.ts","~lib/util/memory.ts","~lib/util/number.ts","~lib/util/math.ts","~lib/util/string.ts","~lib/util/sort.ts","~lib/array.ts","~lib/string.ts","~lib/date.ts","~lib/number.ts","~lib/builtins.ts","~lib/staticarray.ts"],"names":[],"mappings":"g0BG6HI,AAAI,AADO,AA/Be,KAAqB,QAiClC,AAAO,EAAqB,EAA0B,KAA/C,yBAIT,AAAO,AADP,wBAEX,EAAY,KACZ,AAlCA,EAAqB,AAA0B,KAAqB,GAA/C,YAgDrB,AAAI,AAAQ,EAAR,KAA4B,wBAAd,AAAO,KACzB,IACY,IA7BL,AADI,OACI,QElGjB,AAAI,AAAK,AADC,OACN,KAAqC,cFkGN,AEjGnC,AAAO,AAA2C,EAAK,GAA3B,QFiG2B,MA6BX,AAAK,IAAS,KAXxD,AAAW,OACX,EAAqB,EAA0B,MAC/C,EAAY,KACZ,AA1CA,EAAqB,AAA0B,KAAqB,GAA/C,MA2CrB,EAAY,UAuJd,AAAI,AAAC,OACM,AAAO,mBAElB,AAAI,AAAe,EAAf,AAhMS,AA+LD,AAAmB,EAAW,QA/LR,MAmMhC,AAAI,AADc,AAlMP,AAiME,AAAmB,EAAY,QAjMZ,KAmMb,AAAK,MAEtB,AAGE,EAGA,EANE,MAQC,AAAI,AAA8B,EAAS,KAAvC,EAAe,MAExB,2DA1JJ,AAAW,AA/DiB,AA8DnB,OA9DwC,KAgEjD,EAAO,EAAQ,KACF,AAAO,AAvDP,KAAqB,GAuDA,mBAChC,AAAgB,EAA0B,KAC1C,AAAO,AAnEmB,KAAqB,YAoOjD,AAAI,AAAC,OAGL,AAAI,AAAa,EAAb,AA7NS,AA2NH,AAAmB,EAAM,QA3ND,MA8NhC,IACA,AAAE,cF3DO,AAAO,AADF,OACc,oBAEnB,AAAO,AADP,EAAY,KACG,mBAI1B,AAAI,EAAO,MAET,AAAK,AAAM,EAAQ,MAInB,AAAK,EAAM,AAAW,AADJ,AAAI,EAAM,sBAE5B,AAAK,AAAO,EAAgB,EAAK,IAAa,KAC9C,EAAM,MAEG,AAAO,AAAgB,EAAK,KAArB,EAAK,qBAIvB,AAAW,OACX,AAAI,AAFO,SAED,EAAY,MACtB,AAAI,IAAM,EAAY,MAGtB,AAAI,AAAS,AAhIX,AAA2B,AAAC,AAAkB,EAAjB,EAAM,IAAyB,GAA5D,MAgIE,KACF,AAxHA,AAA2B,AAAC,AAAkB,EAAjB,EAAM,IAAyB,GAA5D,GACA,KA0HA,AAAI,AAAC,KAEa,AAzJlB,AAA2B,EAAM,GAAjC,QAyJ2B,EAAO,MAjJpC,AACE,EACA,KAkJE,AAAI,AAAC,KAAO,OAAc,EAAO,gBArG1B,AAAO,mBAEP,AAAO,AADF,OACc,oBAM1B,AAHY,AADJ,qBAII,KAAhB,EACE,AAAY,EAAM,IAClB,EAAe,AAAY,EAAY,GAAkB,WAE7C,AADJ,AAnHe,EAA2B,GAAkB,KAAe,aAyHrF,AAAI,EAAY,KAGH,AAAO,AADH,AADJ,AAhIM,EAA2B,aAkIf,oBAC7B,AAAY,EAAM,IAElB,EAAe,AAAY,EAAW,GAAkB,EAAY,UAItE,EAAe,EAAY,MAKhB,AAAO,AADP,EAAY,KACG,mBACf,AAAO,AAA4C,EAA5C,EAA2B,IAAyB,mBAGtE,AAAa,EAA2B,GAAiB,KAc9C,AAAO,AAAgB,AAVlC,AAAI,EAAO,MAEJ,AAAM,EAAQ,IAMnB,AAFK,EAAM,AAAW,AADJ,AAAI,EAAM,sBAGtB,KADD,AAAO,EAAgB,EAAK,IAAa,MAGT,KAArB,EAAK,qBAGvB,AAAW,AAzFT,AAA2B,AAAC,AAAkB,EAAjB,EAAM,IAAyB,GAA5D,QA0FF,OACA,EAAa,KACb,AAAI,IAAM,EAAY,MACtB,AApFE,AAA2B,AAAC,AAAkB,EAAjB,EAAM,IAAyB,GAA5D,GACA,KAsFF,OAAe,EAAK,OACpB,AA3GE,AAA2B,EAAM,GAAjC,KACA,AA0Gc,AApHd,KAoHiC,EAAK,aAmH7B,AAAO,EAAS,mBAC3B,AAAQ,AAAC,AAAC,QAAgD,KAC1D,EAAO,KAIP,AAAI,AAFO,AArMT,UAwMW,AAAO,EAAS,EAA0B,oBAIrD,AAAI,AAAwB,EAAxB,EAAQ,MACV,EACA,AAAW,OADX,EAAS,QAON,AACE,EAAS,EAA0B,sBAK5C,AAAI,AADO,EAAM,KACN,OAOX,AADW,EACG,AAAmB,EAAW,GAA9B,AAFC,EAAO,KAEG,OACzB,OACA,OAIA,AADO,AAA2C,EAAzB,EAAQ,WAEjC,AA/NE,EACA,MAgOF,AAAY,EAAM,UAkDlB,AAAI,AAAc,AAFA,IACA,KACe,AAAY,EAAc,KAAe,WAE1E,SACA,AAAQ,WACgB,EAAK,KAC3B,AAAY,KAAN,UACD,AAAc,MAAG,EAAK,KACzB,AAAkB,EAAJ,SAAN,UAD0B,AAAE,WAFF,AAAE,WAY5B,IAAM,IAAU,EAAiB,KAE7C,AAAO,sBEjTC,SAEJ,AAAQ,IACR,AAAa,IACb,EACA,AAAO,OAIP,AAAY,AAAK,KACjB,AAAM,AAjGkB,KAAqB,KAkG7C,EAAO,AAAO,EAAP,KACL,AAAO,IACP,AAAI,AA1FG,KAAqB,GA0FX,KACf,AAtFN,EAAqB,AAAqC,EAApC,KAAqB,OAuFrC,AAAa,IACb,AAAgB,EAAyB,QAG3C,AAAM,AA1GgB,KAAqB,SA4G7C,AAAa,IACb,EAEA,AAAI,AAAO,EAAP,AA/GoB,KAAqB,MAyEjD,AAAU,IACV,EAAO,EAAM,OACX,AAAQ,AAAY,OACpB,EAAO,SAqCH,AAAM,AAjHgB,KAAqB,KAkH3C,EAAO,AAAO,EAAP,KACL,AAAI,AAzGC,KAAqB,GAyGT,KACf,AArGR,EAAqB,AAAqC,EAApC,KAAqB,OAsGnC,AAAgB,EAAyB,MAE3C,AAAM,AAvHc,KAAqB,SAyH3C,AAAW,IACX,AAAY,IACZ,AAAU,IACV,AAAQ,IACR,AAAO,AA7He,KAAqB,KA8H3C,AAAQ,QAMV,AAAI,AADE,IACK,KACT,AAAO,AArIe,OAAqB,KAsIhC,AAAO,AAAa,AAAK,GAAlB,AA5HX,EAAqB,oBA6H5B,AAcF,EAAyB,OAC3B,OACA,QAEA,EAAS,AArIgB,KAAc,GAAhC,MAyIP,AF+UE,AE/UK,EAAyB,KF+UxB,OACV,AAAI,AAAC,KAAM,GACD,IA9BV,AAAY,AAAkB,EAAM,KACpC,AACgB,EAAM,KAApB,QACE,KAAe,oBAEnB,IAXe,KAAe,MAC9B,AAAY,EAAM,MEnUL,IAET,MAAwB,KACxB,EAAe,KACf,AAAQ,KAIZ,IAnDW,QFiIX,AAAI,EAAO,MAET,AAAK,AAAM,EAAQ,MASnB,AAAK,AAAO,EAJM,EAAO,SAIb,AAHR,AAAQ,EAAM,EAAW,AAAW,KAApC,GAA8C,SAGtB,AADvB,EAAM,AAAW,MACW,IAAa,KAC9C,EAAM,MAEG,AAAO,AAAgB,EAAK,KAArB,EAAK,qBAKlB,AAFO,AAAY,KAAN,MAAa,EAAM,QAc5B,AAtLP,AAA2B,AAAC,AAAkB,AAsLZ,GAtLL,EAAM,IAAyB,GAA5D,OA6KA,AAAK,AADO,KAAc,EAAO,EAAK,SAMzB,AAAO,AADV,AApMV,AAA2B,AAmMpB,AAAW,KAnMe,GAAjC,yBAsMS,AAAkB,AAAS,GAAb,SAAN,iBMnUjB,ECsLA,AAAI,ADtLW,KCwLf,AAAU,EAAM,KAChB,AAAU,AAFC,EAAO,KAED,GAAG,KACpB,AAAI,EAAK,KACT,AAAU,EAAM,KAChB,AAAU,EAAM,KAChB,AAAU,EAAO,GAAG,KACpB,AAAU,EAAO,GAAG,KACpB,AAAI,EAAK,KACT,AAAU,EAAM,KAChB,AAAU,EAAO,GAAG,KACpB,AAAI,EAAK,KAYT,AAAW,AARX,EAAQ,AADO,EAAC,GAAO,QASN,KACjB,AAAW,AAFJ,EAAO,AALd,AADA,EAAK,GACA,QAOa,GAAG,KACrB,AAAI,EAAK,KACT,AAAW,EAAM,KACjB,AAAW,EAAM,KACjB,AAAW,EAAO,GAAI,KACtB,AAAW,EAAO,GAAG,KACrB,AAAI,EAAK,KACT,AAAW,EAAM,KACjB,AAAW,EAAM,KACjB,AAAW,EAAM,KACjB,AAAW,EAAM,KACjB,AAAW,EAAO,GAAI,KACtB,AAAW,EAAO,GAAI,KACtB,AAAW,EAAO,GAAI,KACtB,AAAW,EAAO,GAAI,KAItB,EAAQ,AADJ,AAAM,EAAO,GAAb,QAEJ,EAAK,KAIL,EAAO,EAAK,KACV,AAAW,EAAM,KACjB,AAAW,EAAM,KACjB,AAAW,EAAM,KACjB,AAAW,EAAM,KACjB,EAAK,KACL,EAAQ,gBLGZ,AAAI,EAAQ,SAAgC,eAC5C,AAAI,EAAS,KAAW,EA2IxB,AAAoB,KACpB,EACE,EAAU,KACV,AAAI,KAEF,AAAY,AAAQ,GAAa,IAAa,KAAO,SAIhD,EAAS,MAElB,AAAY,IAAQ,AAAc,AAAM,EAAQ,GAAY,IAAxC,QArJiB,AAAkB,EAAlB,KFmTrC,AAAI,AAAC,KAAM,GAC4B,MAhHvC,AAAI,AAgHyC,EAhHlC,SAA+B,eAmCtC,AAAC,AADO,AAAY,EAzCjB,EAAQ,KACX,GACA,AAAC,AAAC,KAAmC,GAAY,aAZrD,AAAI,AAAY,AAJE,IAGiB,AADjB,AAAO,AAAC,AARtB,EAAO,SAED,AAAC,EAAM,EAAW,AAAW,KAAU,GAA/C,OAKM,EAAkB,AAAqD,AA9P7E,MA8P8B,AAAC,EAAsB,GAAM,MAC5B,KAAU,KAAa,aAEzB,KAC7B,AAAI,AAAY,IAAe,QAGvB,EAAM,EAAsB,GAAI,EAAqB,KAmDlD,AAAO,AADV,AAA8B,EAAM,wBAGnC,AAAO,AAAC,KAAe,GAAe,mBACjD,AAAY,EAAM,IA/IlB,AAAgB,AAgJG,OA/IR,AAAS,AAAC,EAAO,GAAkB,mBAI9C,AAAI,AADY,AAAC,EAAY,GAAc,KAC1B,KACf,EAAe,AAAQ,EAAY,GAApB,MAGf,AADY,AAA8D,EAA5C,EAA2B,MAC1C,AAAC,EAAY,GAAkB,MAC9C,AAAY,EAAM,KAIlB,EAAe,EAAY,MAC3B,AAlRuB,AAkRd,EAlRyC,GAAkB,KAAe,MAkRnF,KAA0B,SE5GjB,KACX,EAAa,KA9HX,AAAW,AA+HF,SA9HT,EAAqB,AAA0B,EAA1B,MACrB,EAAY,KACZ,AA1CA,EAAqB,AAA0B,KAAqB,GAA/C,MA2CrB,EAAY,KA4Hd,EAAS,AAxJkB,AFwcpB,KExckC,GAAhC,MA2JT,AAAY,AAFF,EAAyB,KAEf,IACpB,QWhKE,AAAI,EAAS,KAAc,IAC3B,AAAI,AAAiB,IAAjB,MAAwC,IAE5C,AAAI,AADa,AA7DV,AAAmB,EAA0B,MAA0B,KA8D5D,AA9DX,AAAmB,EAA0B,MAA0B,MA8DvC,IAEvC,AAAQ,EHkfgB,AACR,AAAE,AAAC,AGnfC,IHmfM,GAAM,EAAO,MAAnC,AGnfmC,IHmf5B,SACT,AACM,AAAU,KAAS,AAAU,QACjC,EAAQ,KACR,EAAQ,KAED,AADP,EAAQ,KACM,QAGpB,EAAO,aAGL,AAAI,AAFI,AAAe,OAEd,AADD,AAAe,UACJ,EAAI,MACvB,EAAQ,KACR,EAAQ,SAEV,UHjnBA,EAAO,AAAM,EAAM,KAAZ,KACK,SAAiB,SAA3B,AAAU,EAAQ,AAAS,QAC3B,WAIF,AAAI,AAAC,EAAO,MACV,EAAO,EAAK,KACV,AAAW,EAAW,AAAU,QAChC,AAAW,EAAW,AAAU,QAChC,AAAW,EAAW,AAAU,QAChC,AAAW,EAAW,AAAU,QAChC,EAAO,KAAI,EAAQ,KAAI,EAAK,SAE9B,AAAI,EAAI,KAGN,EAFA,AAAW,EAAU,AAAU,QAC/B,AAAW,EAAU,AAAU,QACpB,EAAO,KAAlB,EAAQ,OAEV,AAAI,EAAI,KAEN,EADA,AAAW,EAAM,AAAU,QAChB,EAAO,KAAlB,EAAQ,OAEV,AAAI,EAAI,KAEN,EADA,AAAW,EAAM,AAAU,QAChB,EAAO,KAAlB,EAAQ,OAEV,AAAI,EAAI,KACN,AAAU,EAAQ,AAAS,WAO/B,AAAI,EAAK,KACP,QAAQ,EAAY,aAGhB,AAAI,AAAU,OACd,AAAU,EAAQ,AAAS,QAC3B,EAAkB,QACR,YAAiB,YAA3B,AAAU,EAAQ,AAAS,QAC3B,EAAK,KACL,EAAO,EAAK,KAEV,AAAW,EAAM,AAAU,AADvB,AAAU,OACkB,GAAf,EAAK,OAEtB,AAAW,EAAU,AAAU,AAD3B,AAAU,OACsB,GAAf,EAAK,OAE1B,AAAW,EAAU,AAAU,AAD3B,AAAU,OACsB,GAAf,EAAK,OAE1B,AAAW,EAAW,AAAU,AAD5B,AAAU,OACuB,GAAf,EAAK,OAC3B,EAAO,KAAI,EAAQ,KAAI,EAAK,YAK9B,AAAI,AAAU,OACd,AAAU,EAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,QAClB,EAAK,KACL,EAAO,EAAK,KAEV,AAAW,EAAM,AAAU,AADvB,AAAU,OACkB,GAAf,EAAK,OAEtB,AAAW,EAAU,AAAU,AAD3B,AAAU,OACsB,GAAf,EAAK,OAE1B,AAAW,EAAU,AAAU,AAD3B,AAAU,OACsB,GAAf,EAAK,OAE1B,AAAW,EAAW,AAAU,AAD5B,AAAU,OACuB,GAAf,EAAK,OAC3B,EAAO,KAAI,EAAQ,KAAI,EAAK,YAK9B,AAAI,AAAU,OACJ,SAAiB,SAA3B,AAAU,EAAQ,AAAS,QAC3B,EAAK,KACL,EAAO,EAAK,KAEV,AAAW,EAAM,AAAS,AADtB,AAAU,OACiB,GAAd,EAAK,OAEtB,AAAW,EAAU,AAAS,AAD1B,AAAU,OACqB,GAAd,EAAK,OAE1B,AAAW,EAAU,AAAS,AAD1B,AAAU,OACqB,GAAd,EAAK,OAE1B,AAAW,EAAW,AAAS,AAD3B,AAAU,OACsB,GAAd,EAAK,OAC3B,EAAO,KAAI,EAAQ,KAAI,EAAK,WAQpC,AAAI,EAAI,OACN,AAAU,EAAQ,AAAS,QAC3B,EAAkB,QAClB,AAAU,OAAQ,AAAS,sBAC3B,EAAkB,QAClB,AAAU,OAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,QAClB,AAAU,EAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,QAClB,AAAU,EAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,QAClB,AAAU,EAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,QAClB,AAAU,EAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,QAClB,AAAU,EAAQ,AAAS,QAAjB,OACV,EAAkB,iBAEpB,AAAI,EAAI,OACN,AAAU,EAAQ,AAAS,QAC3B,EAAkB,QAClB,AAAU,OAAQ,AAAS,sBAC3B,EAAkB,QAClB,AAAU,OAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,QAClB,AAAU,EAAQ,AAAS,QAAjB,OACV,EAAkB,iBAEpB,AAAI,EAAI,OACN,AAAU,EAAQ,AAAS,QAC3B,EAAkB,QAClB,AAAU,OAAQ,AAAS,oBAC3B,EAAkB,iBAEpB,AAAI,EAAI,KACN,AAAU,EAAQ,AAAS,QAAjB,SAAiB,SAC3B,EAAkB,SAEpB,AAAI,EAAI,KACN,AAAU,EAAQ,AAAS,eDhH3B,EAAkB,ICuHpB,AAAI,EAAS,KACa,AACpB,EAAM,GAAO,GAAK,EAAE,EAAK,OAC3B,AAAO,EAAM,EAAK,OAItB,AAAI,EAAO,KACiB,AACpB,AAAC,EAAM,GAAO,EAAO,MACvB,EAAO,EAAO,KACZ,AAAI,AAAC,KACL,AAAE,OACQ,SAAiB,SAA3B,AAAU,EAAQ,AAAS,YAE7B,EAAO,EAAK,KACV,AAAW,EAAM,AAAU,QAC3B,EAAQ,KACR,EAAQ,KACR,EAAQ,UAId,EAAO,IACK,SAAiB,SAA3B,AAAU,EAAQ,AAAS,QAC3B,AAAE,YAGsB,AACpB,AAAC,EAAM,GAAO,EAAO,MACvB,EAAO,AAAC,EAAO,GAAK,KAClB,AAAI,AAAC,KACL,AAAU,AAAO,AAAE,OAAT,GAAY,AAAS,EAAM,aAEvC,EAAO,EAAK,KAEV,AAAW,AAAO,AADlB,EAAK,KACM,GAAU,AAAU,EAAM,cAI3C,EAAO,IACL,AAAU,AAAO,AAAE,OAAT,GAAY,AAAS,EAAM,kBKzDvC,AAAS,KAAkB,EAAgB,IAAe,KACtC,AACX,EAAyB,EAA0B,UAX5D,AAAI,AAAc,AAAK,KAAnB,KACF,AAAI,EAAQ,KAAwB,eACpC,AA3GA,AA2GwC,EAAQ,OA3GtC,AADI,AA4GC,OA3GW,MAC5B,AAAI,EAAU,SAAkD,cAOhE,AAAY,AADE,EV8PhB,AAAI,AU9P6B,AADJ,AAAI,AAAI,EAAe,KAAG,kBAAgB,AADnD,AAAI,EAAS,QAAa,eVgQlC,AAAC,AAFA,AAAmB,AU5PR,AALR,AAAkB,SViQO,QAEZ,GAAM,MACjC,EAAgB,KACT,KAKT,AAAY,AADC,AAAM,EAAM,SACL,EAAQ,AAAI,EAAM,eACtC,KUrQwB,GAAgB,EAAc,KACpD,AAAI,EAAY,KACd,AAAa,EAAO,KACpB,AAAa,EAAO,KACpB,AAAO,EAAO,EAA4B,KAE5C,AAAW,EAAO,MA8FhB,EAAe,MAEjB,EAAY,EAAO,mDC5EnB,AAAO,AAAmB,EAA0B,MAA0B,QAA9E,AAAO,AAAmB,EAA0B,MAA0B,qEAmC9E,KVwCF,AAAI,EAAM,YACD,WAGT,AAAI,EAAM,YACD,WAGT,AAAO,AAAU,EAAI,YAAK,AAAU,EAAI,qBO0gBxC,AAAI,AAAC,AADK,AG5lBD,AAAmB,EAA0B,MAA0B,mBHwmBhF,AAAW,AADD,OAIV,EAAO,EA9JP,AAIS,AAAC,AAAC,EAAI,IAAS,IAAS,EAAI,GAAQ,IAJzC,EAAI,OAMR,AAA0C,EAAtC,EAAI,IAAU,MAClB,MACO,QACA,SACA,SACA,SACA,SACA,SACA,UAAe,KAEtB,KA+IE,AAAO,AAAe,EAAO,UAC7B,AAAE,WAIJ,AAAc,WACd,AAAI,EAA0B,EAAQ,GAAlC,EAAQ,MAcV,EAbA,AAAI,AAAC,AAAE,qBAWL,AAFF,AAES,kBAFL,EAAQ,MAIL,AAAe,EAAO,YA0B7B,AAAI,AAAuB,EAAM,KAA7B,EAAQ,MACV,MAAQ,AAAe,KAAU,KAC1B,QAKA,QAKA,SATH,EAAO,KAAG,EAAO,KACjB,AAAQ,OAIR,EAAO,KAAG,EAAO,KACjB,AAAQ,OAIR,EAAO,KAAG,EAAO,KACjB,AAAQ,MAKF,AAAZ,EAAoB,EAAf,OAMP,EAAO,aASL,AAAI,AAPJ,AAAI,AADG,AAAe,OACX,GAAc,KACvB,EAAQ,IACH,AAAI,EAAO,IAAc,KAC9B,EAAQ,IACH,AACL,EAAQ,MADC,EAAO,IAAc,QAGpB,KACV,AAAI,AAAC,mCAYP,AAAM,EAAM,IAAQ,MACpB,EAAO,UAGT,AAAO,EAAO,WFzKd,AAAe,EAAS,KAGxB,AAAS,EAAS,AALJ,AADA,AAAC,EAAW,AAD1B,AAAc,EAAC,WAES,QAOQ,AAHvB,AAAI,EAAU,QAGvB,AAtdI,EAAQ,OACN,EAAQ,MACH,AAAI,AAAI,EAAS,GAAjB,IAEA,AAAI,AAAI,EAAS,KAAjB,GAA0B,AAAI,EAAS,OAG5C,EAAQ,QACH,AAAI,AAAI,EAAS,KAAjB,IAEA,AAAI,AAAI,EAAS,OAAjB,GAA+B,AAAI,EAAS,WA+cvD,EAAO,EAAQ,KAEb,wBAAQ,mBACK,AAAI,EAAK,SAAY,EAAM,YAC3B,AAAI,EAAM,QAAW,EAAO,WAC5B,AAAI,EAAO,QAAU,EAAQ,WAC7B,AAAI,EAAQ,OAAS,EAAS,UAC9B,AAAI,EAAS,OAAQ,EAAU,UAC/B,AAAI,EAAU,OAAO,EAAW,UAChC,AAAI,EAAW,MAAM,EAAY,SACjC,AAAI,EAAY,MAAK,EAAa,SAClC,AAAI,EAAa,KAAI,EAAc,QACnC,AAAI,IAAiB,AAAe,OACtC,AAAM,KAGjB,AAAI,AAAI,EAAJ,KAA8B,SAArB,AAAW,AAAU,EAAS,GAAnB,IAAuB,AAAc,OAAd,OAE/C,AAAE,OAEF,AAAI,AADM,AAAyB,EAAxB,AAAC,GAAY,OACb,KACT,AAAM,EAAN,KACoC,AAAe,AAAY,EAAgB,GAA5B,OAAgD,MAAhF,2FACZ,UAMT,EAAS,KAGT,AAAI,AADI,AAHR,EAAS,KAGK,MACN,SAA0B,SAArB,AAAW,AAAU,EAAS,GAAnB,IAAuB,AAAc,QAAd,OAG/C,AAAE,OACE,AAAK,EAAL,AAFJ,EAAM,SAGJ,AAAM,EAAN,KAE+B,IAAa,AADhC,AAAe,AAAY,EAAQ,GAAS,GAA7B,OAA3B,KAjHJ,AAAY,AAAU,AADV,AAAU,AAAC,EAAY,cAEnC,EACE,AACA,AAAgB,EAAhB,EAAQ,MADR,EAAO,MAEL,EACA,EAAO,GAAO,EAAO,KAAY,IADjC,AAAmB,EAAnB,UAIF,AAAE,OACF,EAAQ,SAEV,AAAW,EAAO,aAtWlB,EAAO,EAAO,OAGZ,AAAQ,EAAM,OACd,AAAM,AAFE,EAAM,OAWd,AAAW,AAAU,AADrB,EAAU,KACqB,GAApB,GAAwB,AAJN,AAAU,AAH9B,EAAI,IAGuC,GAAvB,OAIiB,AAHjB,AAAU,AAH9B,EAAI,IAGuC,GAAvB,OAG4B,WAY3D,AAAI,EATJ,AAAI,EAAO,MASP,EAHF,AAAW,AAAU,AAFrB,EAAU,KAEqB,GAApB,GAAwB,AADZ,AAAU,AAHxB,EAAM,IAG+B,GAAvB,UAFjB,AAFG,EAAM,WAQN,KAGT,AAAW,AAAU,AAFrB,EAAU,GAEqB,GAApB,GAAwB,AADZ,AAAU,EAAc,GAAxB,WAKvB,AAAW,AAAU,AAFrB,EAAU,GAEqB,GAApB,GAAwB,AADT,EAAd,aAgcd,AAAI,AAAC,KACH,AAAW,AAAU,EAAU,GAApB,GAAwB,QAC5B,EAAS,KAId,AAAgB,AADX,EAAS,KACQ,KAAtB,EAAU,QAES,EAAI,KACvB,AAAW,AAAU,EAAK,GAAf,GAAmB,KADH,AAAE,WAG/B,AAAW,AAAU,EAAM,GAAhB,GAAoB,QACxB,EAAK,IACH,AAAU,EAAM,KAAhB,EAAK,MAGd,AACE,AAFkB,EAAM,GAAhB,KAEF,GACN,EACA,EAAC,GAAK,KAER,AAAW,EAAoB,KACxB,EAAS,IACP,AAAW,EAAM,KAAjB,AAAK,EAAL,MAGT,AACE,AAAU,AAFC,EAAI,KAEK,GAApB,GACA,EACA,EAAU,KAEZ,AAAW,EAAQ,QACd,AAAQ,MAAG,EAAI,KAClB,AAAW,AAAU,EAAK,GAAf,GAAmB,KADJ,AAAE,WAGvB,EAAS,IACP,EAAU,KAEnB,AAAW,EAAQ,MACE,IAAS,KAzjB5B,EAyjB+B,EAAK,yBAzjB5B,OACN,EAAQ,MACH,AAAI,AAAI,EAAS,GAAjB,IAEA,AAAI,AAAI,EAAS,KAAjB,GAA0B,AAAI,EAAS,OAG5C,EAAQ,QACH,AAAI,AAAI,EAAS,KAAjB,IAEA,AAAI,AAAI,EAAS,OAAjB,GAA+B,AAAI,EAAS,oCAgjB9C,EAAS,IAGhB,AACE,EAAS,GACT,EAAS,GACT,AAJQ,EAAU,KAIZ,KAER,AAAW,EAAc,KACzB,AAAW,EAAS,KAAK,MACH,IAAe,KApkBnC,EA0gBA,AADO,AA2D+B,EAAK,KA3DhC,OAEe,AADhB,EAAC,WA1gBH,OACN,EAAQ,MACH,AAAI,AAAI,EAAS,GAAjB,IAEA,AAAI,AAAI,EAAS,KAAjB,GAA0B,AAAI,EAAS,OAG5C,EAAQ,QACH,AAAI,AAAI,EAAS,KAAjB,IAEA,AAAI,AAAI,EAAS,OAAjB,GAA+B,AAAI,EAAS,WAkgBvD,AA7WiB,IAAa,AA4Wf,EAAoB,OAEnC,EAAmB,AAAiB,EAAgB,EAAe,MAwD1D,AADG,EAAV,GACgB,eApMlB,AAHU,AAqDJ,AAAY,AAHR,AAAK,AADL,AA4JV,AAAI,AADO,AAAI,EAAQ,cAGrB,AAAW,GAAQ,KADX,AAAC,UA5JS,YAAwB,MAGrB,EAAG,GAAQ,MArDpB,GAGN,AAFE,AAAc,AAFd,AAAC,AAwDU,AAHX,AAAwB,AADxB,EAAK,UACJ,AAAI,EAAO,IAAM,MArDZ,GAAK,YAQrB,AAAa,AALb,EAAQ,MAMR,AAAa,AAAC,AAAC,EAAK,AAHpB,AAAQ,AAAI,AAAI,EAAK,UAAb,OAGiB,GAAM,EAAI,GAAI,OACvC,AAAO,IA8BP,AAAK,GAAO,AADA,AAAC,AAFb,AADQ,AADR,AAAS,AAAC,EAAM,MAAU,UAAI,eAEzB,AAAS,EAAL,KAES,GAAK,KACF,QACrB,AAAW,AAAU,AAAc,EAAd,SACrB,AAAW,AAAU,AAAc,EAAgB,GAA9B,SAyBD,AANpB,EAAQ,AADgB,sBAOC,2BAGJ,kCAjGrB,AAAS,AAoGY,IApGR,SAOb,AAAQ,AAJC,EAAK,KAFL,GAMU,AADN,EAAL,GACgB,MAyOxB,AAAO,AADQ,AAAU,EAAQ,GAAlB,IAAsB,AAxIZ,4CAAc,AAN1B,qCAA8B,KAMI,AAlFxC,AAAK,EAAL,GAAU,GAkFsC,AAF1C,EAAS,AADT,AArFN,AAXE,EAWF,GAAU,AAHjB,EAAM,IAGe,AAFrB,AAHA,AAFQ,AAAK,EAAL,GAAW,EAAI,QAElB,OAGC,IAuFsC,IAGkB,IAwInB,GAAM,IACpC,mGAllBT,OAAQ,OACN,EAAQ,MACH,AAAI,AAAI,EAAS,GAAjB,IAEA,AAAI,AAAI,EAAS,KAAjB,GAA0B,AAAI,EAAS,OAG5C,EAAQ,QACH,AAAI,AAAI,EAAS,KAAjB,IAEA,AAAI,AAAI,EAAS,OAAjB,GAA+B,AAAI,EAAS,qCAQnD,EAAQ,YACN,EAAQ,UACH,AAAK,AAAI,EAAS,QAAlB,GAAkC,AAAI,EAAS,SAE/C,AAAK,AAAI,EAAS,SAAlB,GAAqC,AAAI,EAAS,YAGvD,EAAQ,aACH,AAAK,AAAI,EAAS,UAAlB,IAEA,AAAK,AAAI,EAAS,YAAlB,GAA0C,AAAI,EAAS,+BA4DlE,EAAO,EAAO,QAiBZ,AAAW,AAAU,AADrB,EAAU,KACqB,GAApB,GAAwB,AAJN,AAAU,AAH9B,AAJD,AAJA,AAAQ,EAAM,AADd,EAAM,QACY,UAId,OAIC,IAGuC,GAAvB,OAIiB,AAHjB,AAAU,AAH9B,EAAI,IAGuC,GAAvB,OAG4B,OAMzD,AAAW,AAAU,AADrB,EAAU,KACqB,GAApB,GAAwB,AAJV,AAAU,AAX1B,AAHD,EAAI,OAGC,IAWmC,GAAvB,OAIqB,AAHrB,AAAU,AAX1B,EAAI,IAWmC,GAAvB,OAGgC,WAG3D,AAAe,EAAQ,GAAU,yBOxJ/B,uEPsCE,mBAAQ,OACN,EAAQ,MACH,AAAI,AAAI,EAAS,GAAjB,IAEA,AAAI,AAAI,EAAS,KAAjB,GAA0B,AAAI,EAAS,OAG5C,EAAQ,QACH,AAAI,AAAI,EAAS,KAAjB,IAEA,AAAI,AAAI,EAAS,OAAjB,GAA+B,AAAI,EAAS,sDOpErD,ObkQF,AAAI,IAEF,AAAI,AAxOO,AAuOD,AAAmB,EAAM,QAvOH,GAwOf,KACC,gBAElB,IAzMA,AAAW,AA0MA,SAzMX,AAyMA,EAzMqB,EAA0B,MAC/C,EAAY,KACZ,AA1CA,EAAqB,AAA0B,KAAqB,GAA/C,MA2CrB,EAAY,MAwMd,OAMA,AAAI,AAAC,OAEL,AAAI,AAtPS,AAqPH,AAAmB,EAAM,QArPD,GAsPjB,KACC,gBAElB,AAAI,EAAS,KAIX,KAEA,IA7NA,AAAW,AA8NA,SA7NX,EAAqB,AAA0B,EAA1B,MACrB,EAAY,KACZ,AA1CA,EAAqB,AAA0B,KAAqB,GAA/C,MA2CrB,EAAY,SAkOd,AAAI,EAAQ,KAEV,EAAO,eAIT,EAAO,WACP,AAAY,AAAQ,GAAa,IAAa,KAAO,WU2JjD,AAAU,AADA,OACO,AAAO,KAAgB,MACxC,EAAO,EAAM,KAEX,AAAI,AADM,AAAY,SACb,AAAQ,KACjB,EAAO,SAGX,AAAQ,AAAkB,sHAA1B,AAAQ,AAAkB,WKpJxB,AAAU,IAAM,AADN,EACmD,SAC7D,EAAO,EAAM,KAEX,AAAI,AADM,AAAY,SACb,AAAQ,KACjB,EAAO,2BflVb,SACA,SACA,uBAFA,SACA,SACA,QAFA,SACA,SACA,uIUoBE,AAAO,yDCujBP,4UDvjBA,AAAO,2DC+jBT,AAAmB,+OE1RjB,2OXxUF,AAAsB,AADT,AAAM,EAAM,MACK,IAAM,eAApC,AAAsB,AADT,AAAM,EAAM,MACK,IAAM,WUwTnB,AADjB,OAAQ,AAAI,OAAQ,WAGpB,AAzCO,AADC,AA0CwB,OAAf,AAAO,AADF,AAAM,UACX,AAFT,aAAoB,gBAAsB,AA7C1C,AAAS,EAAI,MAAb,GAA0B,KA6ClC,KAxCY,KACA,AAAQ,EAAI,EAAZ,EAAI,4FG7Ld,AAAe,AAA2B,EAAgB,GAA3C,gEAAf,AAAe,AAA2B,KAAgB,GAA3C,iEHQf,AAAO,AAqLT,AAAO,AADC,AApLe,KAoLX,QACA,AAAQ,KAAI,EAAZ,EAAI,MArL4C,iFAI1D,AAAO,AAiLT,AAAO,AADC,AAhLe,KAgLX,QACA,AAAQ,KAAI,EAAZ,EAAI,MAjL6C,gFAI3D,AAAO,AA6KT,AAAO,AADC,AA5Ke,KA4KX,OACA,AAAQ,IAAI,EAAZ,EAAI,MA7K+C,uQAkL/D,AAAQ,EAAS,UAAsB,EAAS,4BAMhD,AAAU,AAjBF,AAAS,AAiBO,AADxB,uBAAK,OAhBgB,OAAb,EAAK,IAAqB,OAmBlC,AAAU,AAAC,AADD,EAAS,EAAM,QACR,EAAM,KAAO,EAAM,MAAQ,EAAM,MAAU,MAG5D,AAAS,AAAC,AAAI,AADJ,EAAO,AAAM,EAAN,IAAY,EAAM,IAAI,EAAM,QACnC,GAAU,GAAK,MACzB,AAAO,EAAM,AAAC,AAAM,EAAN,IAAW,GAAK,IAAI,KAElC,AAAS,AADH,AAAU,EAAI,EAAd,EAAK,IAAX,SAGA,AADA,AANiB,EAAM,IAAZ,GAMH,AAAI,EAAM,skBVtSlB,AAAa,AAAM,EAAM,MACzB,IAAU,AAAY,EAAQ,EAAM,OACpC,uGSQE,AAAO,MAAuE,QAA9E,AAAO,AAAmB,EAA0B,MAA0B,uEPA9E,EAAO,AAAQ,EAAR,KACL,AAAY,EAAM,GAAO,GAAK,IAC9B,AAAS,EAAT","sourceRoot":"./optimized.wasm","sourcesContent":["// Alignment guarantees\n\n// @ts-ignore: decorator\n@inline export const AL_BITS: u32 = 4; // 16 bytes to fit up to v128\n// @ts-ignore: decorator\n@inline export const AL_SIZE: usize = 1 << AL_BITS;\n// @ts-ignore: decorator\n@inline export const AL_MASK: usize = AL_SIZE - 1;\n\n// Extra debugging\n\n// @ts-ignore: decorator\n@inline export const DEBUG = true;\n// @ts-ignore: decorator\n@inline export const TRACE = false;\n// @ts-ignore: decorator\n@inline export const RTRACE = isDefined(ASC_RTRACE);\n// @ts-ignore: decorator\n@inline export const PROFILE = isDefined(ASC_PROFILE);\n\n// Memory manager\n\n// ╒════════════ Memory manager block layout (32-bit) ═════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │ MM info │ -4\n// ╞>ptr═══════════════════════════════════════════════════════════╡\n// │ ... │\n@unmanaged export class BLOCK {\n /** Memory manager info. */\n mmInfo: usize;\n}\n\n/** Overhead of a memory manager block. */\n// @ts-ignore: decorator\n@inline export const BLOCK_OVERHEAD: usize = offsetof();\n\n/** Maximum size of a memory manager block's payload. */\n// @ts-ignore: decorator\n@inline export const BLOCK_MAXSIZE: usize = (1 << 30) - BLOCK_OVERHEAD;\n\n// Garbage collector\n\n// ╒══════════ Garbage collector object layout (32-bit) ═══════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │ Memory manager block │ -20\n// ╞═══════════════════════════════════════════════════════════════╡\n// │ GC info │ -16\n// ├───────────────────────────────────────────────────────────────┤\n// │ GC info │ -12\n// ├───────────────────────────────────────────────────────────────┤\n// │ RT id │ -8\n// ├───────────────────────────────────────────────────────────────┤\n// │ RT size │ -4\n// ╞>ptr═══════════════════════════════════════════════════════════╡\n// │ ... │\n@unmanaged export class OBJECT extends BLOCK {\n /** Garbage collector info. */\n gcInfo: u32;\n /** Garbage collector info. */\n gcInfo2: u32;\n /** Runtime class id. */\n rtId: u32;\n /** Runtime object size. */\n rtSize: u32;\n}\n\n/** Overhead of a garbage collector object. Excludes memory manager block overhead. */\n// @ts-ignore: decorator\n@inline export const OBJECT_OVERHEAD: usize = (offsetof() - BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK;\n\n/** Maximum size of a garbage collector object's payload. */\n// @ts-ignore: decorator\n@inline export const OBJECT_MAXSIZE: usize = BLOCK_MAXSIZE - OBJECT_OVERHEAD;\n\n/** Total of memory manager and garbage collector overhead. */\n// @ts-ignore: decorator\n@inline export const TOTAL_OVERHEAD: usize = BLOCK_OVERHEAD + OBJECT_OVERHEAD;\n","import { AL_BITS, AL_SIZE, AL_MASK, DEBUG, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from \"./common\";\nimport { oninit, onalloc, onresize, onmove, onfree } from \"./rtrace\";\nimport { E_ALLOCATION_TOO_LARGE } from \"../util/error\";\n\n// === The TLSF (Two-Level Segregate Fit) memory allocator ===\n// see: http://www.gii.upv.es/tlsf/\n\n// - `ffs(x)` is equivalent to `ctz(x)` with x != 0\n// - `fls(x)` is equivalent to `sizeof(x) * 8 - clz(x) - 1`\n\n// ╒══════════════ Block size interpretation (32-bit) ═════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┴─┴─┴─╫─┴─┴─┴─┤\n// │ | FL │ SB = SL + AL │ ◄─ usize\n// └───────────────────────────────────────────────┴───────╨───────┘\n// FL: first level, SL: second level, AL: alignment, SB: small block\n\n// @ts-ignore: decorator\n@inline const SL_BITS: u32 = 4;\n// @ts-ignore: decorator\n@inline const SL_SIZE: u32 = 1 << SL_BITS;\n\n// @ts-ignore: decorator\n@inline const SB_BITS: u32 = SL_BITS + AL_BITS;\n// @ts-ignore: decorator\n@inline const SB_SIZE: u32 = 1 << SB_BITS;\n\n// @ts-ignore: decorator\n@inline const FL_BITS: u32 = 31 - SB_BITS;\n\n// [00]: < 256B (SB) [12]: < 1M\n// [01]: < 512B [13]: < 2M\n// [02]: < 1K [14]: < 4M\n// [03]: < 2K [15]: < 8M\n// [04]: < 4K [16]: < 16M\n// [05]: < 8K [17]: < 32M\n// [06]: < 16K [18]: < 64M\n// [07]: < 32K [19]: < 128M\n// [08]: < 64K [20]: < 256M\n// [09]: < 128K [21]: < 512M\n// [10]: < 256K [22]: <= 1G - OVERHEAD\n// [11]: < 512K\n// VMs limit to 2GB total (currently), making one 1G block max (or three 512M etc.) due to block overhead\n\n// Tags stored in otherwise unused alignment bits\n\n// @ts-ignore: decorator\n@inline const FREE: usize = 1 << 0;\n// @ts-ignore: decorator\n@inline const LEFTFREE: usize = 1 << 1;\n// @ts-ignore: decorator\n@inline const TAGS_MASK: usize = FREE | LEFTFREE; // <= AL_MASK\n\n// ╒════════════════════ Block layout (32-bit) ════════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┤ ┐\n// │ size │L│F│ ◄─┐ info overhead\n// ╞>ptr═══════════════════════════════════════════════════════╧═╧═╡ │ ┘\n// │ if free: ◄ prev │ ◄─┤ usize\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ if free: next ► │ ◄─┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... │ │ >= 0\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ if free: back ▲ │ ◄─┘\n// └───────────────────────────────────────────────────────────────┘ >= MIN SIZE\n// F: FREE, L: LEFTFREE\n@unmanaged export class Block extends BLOCK {\n\n /** Previous free block, if any. Only valid if free, otherwise part of payload. */\n prev: Block | null;\n /** Next free block, if any. Only valid if free, otherwise part of payload. */\n next: Block | null;\n\n // If the block is free, there is a 'back'reference at its end pointing at its start.\n}\n\n// Block constants. A block must have a minimum size of three pointers so it can hold `prev`,\n// `next` and `back` if free.\n\n// @ts-ignore: decorator\n@inline const BLOCK_MINSIZE: usize = ((3 * sizeof() + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD; // prev + next + back\n// @ts-ignore: decorator\n// @inline const BLOCK_MAXSIZE: usize = 1 << (FL_BITS + SB_BITS - 1); // exclusive, lives in common.ts\n\n/** Gets the left block of a block. Only valid if the left block is free. */\n// @ts-ignore: decorator\n@inline function GETFREELEFT(block: Block): Block {\n return load(changetype(block) - sizeof());\n}\n\n/** Gets the right block of a block by advancing to the right by its size. */\n// @ts-ignore: decorator\n@inline function GETRIGHT(block: Block): Block {\n return changetype(changetype(block) + BLOCK_OVERHEAD + (block.mmInfo & ~TAGS_MASK));\n}\n\n// ╒═════════════════════ Root layout (32-bit) ════════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ┐\n// │ 0 | flMap S│ ◄────┐\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ slMap[0] S │ ◄─┐ │\n// ├───────────────────────────────────────────────────────────────┤ │ │\n// │ slMap[1] │ ◄─┤ │\n// ├───────────────────────────────────────────────────────────────┤ u32 │\n// │ slMap[22] │ ◄─┘ │\n// ╞═══════════════════════════════════════════════════════════════╡ usize\n// │ head[0] │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ head[367] │ ◄────┤\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ tail │ ◄────┘\n// └───────────────────────────────────────────────────────────────┘ SIZE ┘\n// S: Small blocks map\n@unmanaged class Root {\n /** First level bitmap. */\n flMap: usize;\n}\n\n// Root constants. Where stuff is stored inside of the root structure.\n\n// @ts-ignore: decorator\n@inline const SL_START: usize = sizeof();\n// @ts-ignore: decorator\n@inline const SL_END: usize = SL_START + (FL_BITS << alignof());\n// @ts-ignore: decorator\n@inline const HL_START: usize = (SL_END + AL_MASK) & ~AL_MASK;\n// @ts-ignore: decorator\n@inline const HL_END: usize = HL_START + FL_BITS * SL_SIZE * sizeof();\n// @ts-ignore: decorator\n@inline const ROOT_SIZE: usize = HL_END + sizeof();\n\n// @ts-ignore: decorator\n@lazy export var ROOT: Root;\n\n/** Gets the second level map of the specified first level. */\n// @ts-ignore: decorator\n@inline function GETSL(root: Root, fl: usize): u32 {\n return load(\n changetype(root) + (fl << alignof()),\n SL_START\n );\n}\n\n/** Sets the second level map of the specified first level. */\n// @ts-ignore: decorator\n@inline function SETSL(root: Root, fl: usize, slMap: u32): void {\n store(\n changetype(root) + (fl << alignof()),\n slMap,\n SL_START\n );\n}\n\n/** Gets the head of the free list for the specified combination of first and second level. */\n// @ts-ignore: decorator\n@inline function GETHEAD(root: Root, fl: usize, sl: u32): Block | null {\n return load(\n changetype(root) + (((fl << SL_BITS) + sl) << alignof()),\n HL_START\n );\n}\n\n/** Sets the head of the free list for the specified combination of first and second level. */\n// @ts-ignore: decorator\n@inline function SETHEAD(root: Root, fl: usize, sl: u32, head: Block | null): void {\n store(\n changetype(root) + (((fl << SL_BITS) + sl) << alignof()),\n head,\n HL_START\n );\n}\n\n/** Gets the tail block.. */\n// @ts-ignore: decorator\n@inline function GETTAIL(root: Root): Block {\n return load(\n changetype(root),\n HL_END\n );\n}\n\n/** Sets the tail block. */\n// @ts-ignore: decorator\n@inline function SETTAIL(root: Root, tail: Block): void {\n store(\n changetype(root),\n tail,\n HL_END\n );\n}\n\n/** Inserts a previously used block back into the free list. */\nfunction insertBlock(root: Root, block: Block): void {\n if (DEBUG) assert(block); // cannot be null\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(blockInfo & FREE); // must be free\n\n var right = GETRIGHT(block);\n var rightInfo = right.mmInfo;\n\n // merge with right block if also free\n if (rightInfo & FREE) {\n removeBlock(root, right);\n block.mmInfo = blockInfo = blockInfo + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK); // keep block tags\n right = GETRIGHT(block);\n rightInfo = right.mmInfo;\n // 'back' is set below\n }\n\n // merge with left block if also free\n if (blockInfo & LEFTFREE) {\n let left = GETFREELEFT(block);\n let leftInfo = left.mmInfo;\n if (DEBUG) assert(leftInfo & FREE); // must be free according to right tags\n removeBlock(root, left);\n block = left;\n block.mmInfo = blockInfo = leftInfo + BLOCK_OVERHEAD + (blockInfo & ~TAGS_MASK); // keep left tags\n // 'back' is set below\n }\n\n right.mmInfo = rightInfo | LEFTFREE;\n // reference to right is no longer used now, hence rightInfo is not synced\n\n // we now know the size of the block\n var size = blockInfo & ~TAGS_MASK;\n if (DEBUG) assert(size >= BLOCK_MINSIZE); // must be a valid size\n if (DEBUG) assert(changetype(block) + BLOCK_OVERHEAD + size == changetype(right)); // must match\n\n // set 'back' to itself at the end of block\n store(changetype(right) - sizeof(), block);\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const inv: usize = sizeof() * 8 - 1;\n let boundedSize = min(size, BLOCK_MAXSIZE);\n fl = inv - clz(boundedSize);\n sl = ((boundedSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // perform insertion\n var head = GETHEAD(root, fl, sl);\n block.prev = null;\n block.next = head;\n if (head) head.prev = block;\n SETHEAD(root, fl, sl, block);\n\n // update first and second level maps\n root.flMap |= (1 << fl);\n SETSL(root, fl, GETSL(root, fl) | (1 << sl));\n}\n\n/** Removes a free block from internal lists. */\nfunction removeBlock(root: Root, block: Block): void {\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(blockInfo & FREE); // must be free\n var size = blockInfo & ~TAGS_MASK;\n if (DEBUG) assert(size >= BLOCK_MINSIZE); // must be valid\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const inv: usize = sizeof() * 8 - 1;\n let boundedSize = min(size, BLOCK_MAXSIZE);\n fl = inv - clz(boundedSize);\n sl = ((boundedSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // link previous and next free block\n var prev = block.prev;\n var next = block.next;\n if (prev) prev.next = next;\n if (next) next.prev = prev;\n\n // update head if we are removing it\n if (block == GETHEAD(root, fl, sl)) {\n SETHEAD(root, fl, sl, next);\n\n // clear second level map if head is empty now\n if (!next) {\n let slMap = GETSL(root, fl);\n SETSL(root, fl, slMap &= ~(1 << sl));\n\n // clear first level map if second level is empty now\n if (!slMap) root.flMap &= ~(1 << fl);\n }\n }\n // note: does not alter left/back because it is likely that splitting\n // is performed afterwards, invalidating those changes. so, the caller\n // must perform those updates.\n}\n\n/** Searches for a free block of at least the specified size. */\nfunction searchBlock(root: Root, size: usize): Block | null {\n // size was already asserted by caller\n\n // mapping_search\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl\n const inv: usize = sizeof() * 8 - 1;\n const invRound = inv - SL_BITS;\n let requestSize = size < halfMaxSize\n ? size + (1 << (invRound - clz(size))) - 1\n : size;\n fl = inv - clz(requestSize);\n sl = ((requestSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // search second level\n var slMap = GETSL(root, fl) & (~0 << sl);\n var head: Block | null = null;\n if (!slMap) {\n // search next larger first level\n let flMap = root.flMap & (~0 << (fl + 1));\n if (!flMap) {\n head = null;\n } else {\n fl = ctz(flMap);\n slMap = GETSL(root, fl);\n if (DEBUG) assert(slMap); // can't be zero if fl points here\n head = GETHEAD(root, fl, ctz(slMap));\n }\n } else {\n head = GETHEAD(root, fl, ctz(slMap));\n }\n return head;\n}\n\n/** Prepares the specified block before (re-)use, possibly splitting it. */\nfunction prepareBlock(root: Root, block: Block, size: usize): void {\n // size was already asserted by caller\n\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(!((size + BLOCK_OVERHEAD) & AL_MASK)); // size must be aligned so the new block is\n\n // split if the block can hold another MINSIZE block incl. overhead\n var remaining = (blockInfo & ~TAGS_MASK) - size;\n if (remaining >= BLOCK_OVERHEAD + BLOCK_MINSIZE) {\n block.mmInfo = size | (blockInfo & LEFTFREE); // also discards FREE\n\n let spare = changetype(changetype(block) + BLOCK_OVERHEAD + size);\n spare.mmInfo = (remaining - BLOCK_OVERHEAD) | FREE; // not LEFTFREE\n insertBlock(root, spare); // also sets 'back'\n\n // otherwise tag block as no longer FREE and right as no longer LEFTFREE\n } else {\n block.mmInfo = blockInfo & ~FREE;\n GETRIGHT(block).mmInfo &= ~LEFTFREE;\n }\n}\n\n/** Adds more memory to the pool. */\nfunction addMemory(root: Root, start: usize, end: usize): bool {\n if (DEBUG) assert(start <= end); // must be valid\n start = ((start + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD;\n end &= ~AL_MASK;\n\n var tail = GETTAIL(root);\n var tailInfo: usize = 0;\n if (tail) { // more memory\n if (DEBUG) assert(start >= changetype(tail) + BLOCK_OVERHEAD);\n\n // merge with current tail if adjacent\n const offsetToTail = AL_SIZE;\n if (start - offsetToTail == changetype(tail)) {\n start -= offsetToTail;\n tailInfo = tail.mmInfo;\n } else {\n // We don't do this, but a user might `memory.grow` manually\n // leading to non-adjacent pages managed by TLSF.\n }\n\n } else if (DEBUG) { // first memory\n assert(start >= changetype(root) + ROOT_SIZE); // starts after root\n }\n\n // check if size is large enough for a free block and the tail block\n var size = end - start;\n if (size < BLOCK_OVERHEAD + BLOCK_MINSIZE + BLOCK_OVERHEAD) {\n return false;\n }\n\n // left size is total minus its own and the zero-length tail's header\n var leftSize = size - 2 * BLOCK_OVERHEAD;\n var left = changetype(start);\n left.mmInfo = leftSize | FREE | (tailInfo & LEFTFREE);\n left.prev = null;\n left.next = null;\n\n // tail is a zero-length used block\n tail = changetype(start + BLOCK_OVERHEAD + leftSize);\n tail.mmInfo = 0 | LEFTFREE;\n SETTAIL(root, tail);\n\n insertBlock(root, left); // also merges with free left before tail / sets 'back'\n\n return true;\n}\n\n/** Grows memory to fit at least another block of the specified size. */\nfunction growMemory(root: Root, size: usize): void {\n if (ASC_LOW_MEMORY_LIMIT) {\n unreachable();\n return;\n }\n // Here, both rounding performed in searchBlock ...\n const halfMaxSize = BLOCK_MAXSIZE >> 1;\n if (size < halfMaxSize) { // don't round last fl\n const invRound = (sizeof() * 8 - 1) - SL_BITS;\n size += (1 << (invRound - clz(size))) - 1;\n }\n // and additional BLOCK_OVERHEAD must be taken into account. If we are going\n // to merge with the tail block, that's one time, otherwise it's two times.\n var pagesBefore = memory.size();\n size += BLOCK_OVERHEAD << usize((pagesBefore << 16) - BLOCK_OVERHEAD != changetype(GETTAIL(root)));\n var pagesNeeded = (((size + 0xffff) & ~0xffff) >>> 16);\n var pagesWanted = max(pagesBefore, pagesNeeded); // double memory\n if (memory.grow(pagesWanted) < 0) {\n if (memory.grow(pagesNeeded) < 0) unreachable();\n }\n var pagesAfter = memory.size();\n addMemory(root, pagesBefore << 16, pagesAfter << 16);\n}\n\n/** Computes the size (excl. header) of a block. */\nfunction computeSize(size: usize): usize {\n // Size must be large enough and aligned minus preceeding overhead\n return size <= BLOCK_MINSIZE\n ? BLOCK_MINSIZE\n : ((size + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD;\n}\n\n/** Prepares and checks an allocation size. */\nfunction prepareSize(size: usize): usize {\n if (size > BLOCK_MAXSIZE) throw new Error(E_ALLOCATION_TOO_LARGE);\n return computeSize(size);\n}\n\n/** Initializes the root structure. */\nfunction initialize(): void {\n if (isDefined(ASC_RTRACE)) oninit(__heap_base);\n var rootOffset = (__heap_base + AL_MASK) & ~AL_MASK;\n var pagesBefore = memory.size();\n var pagesNeeded = ((((rootOffset + ROOT_SIZE) + 0xffff) & ~0xffff) >>> 16);\n if (pagesNeeded > pagesBefore && memory.grow(pagesNeeded - pagesBefore) < 0) unreachable();\n var root = changetype(rootOffset);\n root.flMap = 0;\n SETTAIL(root, changetype(0));\n for (let fl: usize = 0; fl < FL_BITS; ++fl) {\n SETSL(root, fl, 0);\n for (let sl: u32 = 0; sl < SL_SIZE; ++sl) {\n SETHEAD(root, fl, sl, null);\n }\n }\n var memStart = rootOffset + ROOT_SIZE;\n if (ASC_LOW_MEMORY_LIMIT) {\n const memEnd = ASC_LOW_MEMORY_LIMIT & ~AL_MASK;\n if (memStart <= memEnd) addMemory(root, memStart, memEnd);\n else unreachable(); // low memory limit already exceeded\n } else {\n addMemory(root, memStart, memory.size() << 16);\n }\n ROOT = root;\n}\n\n/** Allocates a block of the specified size. */\nexport function allocateBlock(root: Root, size: usize): Block {\n var payloadSize = prepareSize(size);\n var block = searchBlock(root, payloadSize);\n if (!block) {\n growMemory(root, payloadSize);\n block = changetype(searchBlock(root, payloadSize));\n if (DEBUG) assert(block); // must be found now\n }\n if (DEBUG) assert((block.mmInfo & ~TAGS_MASK) >= payloadSize); // must fit\n removeBlock(root, block);\n prepareBlock(root, block, payloadSize);\n if (isDefined(ASC_RTRACE)) onalloc(block);\n return block;\n}\n\n/** Reallocates a block to the specified size. */\nexport function reallocateBlock(root: Root, block: Block, size: usize): Block {\n var payloadSize = prepareSize(size);\n var blockInfo = block.mmInfo;\n var blockSize = blockInfo & ~TAGS_MASK;\n\n // possibly split and update runtime size if it still fits\n if (payloadSize <= blockSize) {\n prepareBlock(root, block, payloadSize);\n if (isDefined(ASC_RTRACE)) {\n if (payloadSize != blockSize) onresize(block, BLOCK_OVERHEAD + blockSize);\n }\n return block;\n }\n\n // merge with right free block if merger is large enough\n var right = GETRIGHT(block);\n var rightInfo = right.mmInfo;\n if (rightInfo & FREE) {\n let mergeSize = blockSize + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK);\n if (mergeSize >= payloadSize) {\n removeBlock(root, right);\n block.mmInfo = (blockInfo & TAGS_MASK) | mergeSize;\n prepareBlock(root, block, payloadSize);\n if (isDefined(ASC_RTRACE)) onresize(block, BLOCK_OVERHEAD + blockSize);\n return block;\n }\n }\n\n // otherwise move the block\n return moveBlock(root, block, size);\n}\n\n/** Moves a block to a new one of the specified size. */\nfunction moveBlock(root: Root, block: Block, newSize: usize): Block {\n var newBlock = allocateBlock(root, newSize);\n memory.copy(changetype(newBlock) + BLOCK_OVERHEAD, changetype(block) + BLOCK_OVERHEAD, block.mmInfo & ~TAGS_MASK);\n if (changetype(block) >= __heap_base) {\n if (isDefined(ASC_RTRACE)) onmove(block, newBlock);\n freeBlock(root, block);\n }\n return newBlock;\n}\n\n/** Frees a block. */\nexport function freeBlock(root: Root, block: Block): void {\n if (isDefined(ASC_RTRACE)) onfree(block);\n block.mmInfo = block.mmInfo | FREE;\n insertBlock(root, block);\n}\n\n/** Checks that a used block is valid to be freed or reallocated. */\nfunction checkUsedBlock(ptr: usize): Block {\n var block = changetype(ptr - BLOCK_OVERHEAD);\n assert(\n ptr != 0 && !(ptr & AL_MASK) && // must exist and be aligned\n !(block.mmInfo & FREE) // must be used\n );\n return block;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __alloc(size: usize): usize {\n if (!ROOT) initialize();\n return changetype(allocateBlock(ROOT, size)) + BLOCK_OVERHEAD;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __realloc(ptr: usize, size: usize): usize {\n if (!ROOT) initialize();\n return (ptr < __heap_base\n ? changetype(moveBlock(ROOT, checkUsedBlock(ptr), size))\n : changetype(reallocateBlock(ROOT, checkUsedBlock(ptr), size))\n ) + BLOCK_OVERHEAD;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __free(ptr: usize): void {\n if (ptr < __heap_base) return;\n if (!ROOT) initialize();\n freeBlock(ROOT, checkUsedBlock(ptr));\n}\n","// This file is shared with the compiler and must remain portable\n\n// ╒═══════════════════ Typeinfo interpretation ═══════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ◄─ __rtti_base\n// │ count │\n// ╞═══════════════════════════════════════════════════════════════╡ ┐\n// │ Typeinfo#flags [id=0] │ id < count\n// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤\n// │ Typeinfo#base [id=0] │\n// ├───────────────────────────────────────────────────────────────┤\n// │ ... │\n\n/** Runtime type information data structure. */\n@unmanaged\nexport class Typeinfo {\n /** Flags describing the shape of this class type. */\n flags: TypeinfoFlags = TypeinfoFlags.NONE;\n /** Base class id or `0` if none. */\n base: u32 = 0;\n}\n\n/** Runtime type information flags. */\nexport const enum TypeinfoFlags {\n /** No specific flags. */\n NONE = 0,\n /** Type is an `ArrayBufferView`. */\n ARRAYBUFFERVIEW = 1 << 0,\n /** Type is an `Array`. */\n ARRAY = 1 << 1,\n /** Type is a `StaticArray`. */\n STATICARRAY = 1 << 2,\n /** Type is a `Set`. */\n SET = 1 << 3,\n /** Type is a `Map`. */\n MAP = 1 << 4,\n /** Type has no outgoing pointers. */\n POINTERFREE = 1 << 5,\n /** Value alignment of 1 byte. */\n VALUE_ALIGN_0 = 1 << 6,\n /** Value alignment of 2 bytes. */\n VALUE_ALIGN_1 = 1 << 7,\n /** Value alignment of 4 bytes. */\n VALUE_ALIGN_2 = 1 << 8,\n /** Value alignment of 8 bytes. */\n VALUE_ALIGN_3 = 1 << 9,\n /** Value alignment of 16 bytes. */\n VALUE_ALIGN_4 = 1 << 10,\n /** Value is a signed type. */\n VALUE_SIGNED = 1 << 11,\n /** Value is a float type. */\n VALUE_FLOAT = 1 << 12,\n /** Value type is nullable. */\n VALUE_NULLABLE = 1 << 13,\n /** Value type is managed. */\n VALUE_MANAGED = 1 << 14,\n /** Key alignment of 1 byte. */\n KEY_ALIGN_0 = 1 << 15,\n /** Key alignment of 2 bytes. */\n KEY_ALIGN_1 = 1 << 16,\n /** Key alignment of 4 bytes. */\n KEY_ALIGN_2 = 1 << 17,\n /** Key alignment of 8 bytes. */\n KEY_ALIGN_3 = 1 << 18,\n /** Key alignment of 16 bytes. */\n KEY_ALIGN_4 = 1 << 19,\n /** Key is a signed type. */\n KEY_SIGNED = 1 << 20,\n /** Key is a float type. */\n KEY_FLOAT = 1 << 21,\n /** Key type is nullable. */\n KEY_NULLABLE = 1 << 22,\n /** Key type is managed. */\n KEY_MANAGED = 1 << 23\n}\n","import { BLOCK, BLOCK_OVERHEAD, OBJECT_OVERHEAD, OBJECT_MAXSIZE, TOTAL_OVERHEAD, DEBUG, TRACE, RTRACE, PROFILE } from \"./common\";\nimport { onvisit, oncollect, oninterrupt, onyield } from \"./rtrace\";\nimport { TypeinfoFlags } from \"../shared/typeinfo\";\nimport { E_ALLOCATION_TOO_LARGE, E_ALREADY_PINNED, E_NOT_PINNED } from \"../util/error\";\n\n// === ITCMS: An incremental Tri-Color Mark & Sweep garbage collector ===\n// Adapted from Bach Le's μgc, see: https://github.com/bullno1/ugc\n\n// ╒═════════════╤══════════════ Colors ═══════════════════════════╕\n// │ Color │ Meaning │\n// ├─────────────┼─────────────────────────────────────────────────┤\n// │ WHITE* │ Unprocessed │\n// │ BLACK* │ Processed │\n// │ GRAY │ Processed with unprocessed children │\n// │ TRANSPARENT │ Manually pinned (always reachable) │\n// └─────────────┴─────────────────────────────────────────────────┘\n// * flipped between cycles\n\n// @ts-ignore: decorator\n@lazy var white = 0;\n// @ts-ignore: decorator\n@inline const gray = 2;\n// @ts-ignore: decorator\n@inline const transparent = 3;\n// @ts-ignore: decorator\n@inline const COLOR_MASK = 3;\n\n/** Size in memory of all objects currently managed by the GC. */\n// @ts-ignore: decorator\n@lazy var total: usize = 0;\n\n/** Currently transitioning from SWEEP to MARK state. */\n// @ts-ignore: decorator\n@inline const STATE_IDLE = 0;\n/** Currently marking reachable objects. */\n// @ts-ignore: decorator\n@inline const STATE_MARK = 1;\n/** Currently sweeping unreachable objects. */\n// @ts-ignore: decorator\n@inline const STATE_SWEEP = 2;\n/** Current collector state. */\n// @ts-ignore: decorator\n@lazy var state = STATE_IDLE;\n\n// @ts-ignore: decorator\n@lazy var fromSpace = initLazy(changetype(memory.data(offsetof())));\n// @ts-ignore: decorator\n@lazy var toSpace = initLazy(changetype(memory.data(offsetof())));\n// @ts-ignore: decorator\n@lazy var pinSpace = initLazy(changetype(memory.data(offsetof())));\n// @ts-ignore: decorator\n@lazy var iter: Object; // null\n\nfunction initLazy(space: Object): Object {\n space.nextWithColor = changetype(space);\n space.prev = space;\n return space;\n}\n\n/** Visit cookie indicating scanning of an object. */\n// @ts-ignore: decorator\n@inline const VISIT_SCAN = 0;\n\n// ╒═══════════════ Managed object layout (32-bit) ════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │ Memory manager block │\n// ╞═══════════════════════════════════════════════════════════╤═══╡\n// │ next │ C │ = nextWithColor\n// ├───────────────────────────────────────────────────────────┴───┤\n// │ prev │\n// ├───────────────────────────────────────────────────────────────┤\n// │ rtId │\n// ├───────────────────────────────────────────────────────────────┤\n// │ rtSize │\n// ╞>ptr═══════════════════════════════════════════════════════════╡\n// │ ... │\n// C: color\n\n/** Represents a managed object in memory, consisting of a header followed by the object's data. */\n@unmanaged class Object extends BLOCK {\n /** Pointer to the next object with color flags stored in the alignment bits. */\n nextWithColor: usize; // *u32\n /** Pointer to the previous object. */\n prev: Object; // *u32\n /** Runtime id. */\n rtId: u32;\n /** Runtime size. */\n rtSize: u32;\n\n /** Gets the pointer to the next object. */\n get next(): Object {\n return changetype(this.nextWithColor & ~COLOR_MASK);\n }\n\n /** Sets the pointer to the next object. */\n set next(obj: Object) {\n this.nextWithColor = changetype(obj) | (this.nextWithColor & COLOR_MASK);\n }\n\n /** Gets this object's color. */\n get color(): i32 {\n return i32(this.nextWithColor & COLOR_MASK);\n }\n\n /** Sets this object's color. */\n set color(color: i32) {\n this.nextWithColor = (this.nextWithColor & ~COLOR_MASK) | color;\n }\n\n /** Gets the size of this object in memory. */\n get size(): usize {\n return BLOCK_OVERHEAD + (this.mmInfo & ~3);\n }\n\n /** Tests if this object is pointerfree. */\n get isPointerfree(): bool {\n var rtId = this.rtId;\n return rtId <= idof() || (__typeinfo(rtId) & TypeinfoFlags.POINTERFREE) != 0;\n }\n\n /** Unlinks this object from its list. */\n unlink(): void {\n var next = this.next;\n if (next == null) {\n if (DEBUG) assert(this.prev == null && changetype(this) < __heap_base);\n return; // static data not yet linked\n }\n var prev = this.prev;\n if (DEBUG) assert(prev);\n next.prev = prev;\n prev.next = next;\n }\n\n /** Links this object to the specified list, with the given color. */\n linkTo(list: Object, withColor: i32): void {\n let prev = list.prev;\n this.nextWithColor = changetype(list) | withColor;\n this.prev = prev;\n prev.next = this;\n list.prev = this;\n }\n\n /** Marks this object as gray, that is reachable with unscanned children. */\n makeGray(): void {\n if (this == iter) iter = assert(this.prev);\n this.unlink();\n this.linkTo(toSpace, this.isPointerfree ? i32(!white) : gray);\n }\n}\n\n/** Visits all objects considered to be program roots. */\nfunction visitRoots(cookie: u32): void {\n __visit_globals(cookie);\n var pn = pinSpace;\n var iter = pn.next;\n while (iter != pn) {\n if (DEBUG) assert(iter.color == transparent);\n __visit_members(changetype(iter) + TOTAL_OVERHEAD, cookie);\n iter = iter.next;\n }\n}\n\n/** Visits all objects on the stack. */\nfunction visitStack(cookie: u32): void {\n var ptr = __stack_pointer;\n while (ptr < __heap_base) {\n __visit(load(ptr), cookie);\n ptr += sizeof();\n }\n}\n\n/** Performs a single step according to the current state. */\nfunction step(): usize {\n // Magic constants responsible for pause times. Obtained experimentally\n // using the compiler compiling itself. 2048 budget pro run by default.\n const MARKCOST = isDefined(ASC_GC_MARKCOST) ? ASC_GC_MARKCOST : 1;\n const SWEEPCOST = isDefined(ASC_GC_SWEEPCOST) ? ASC_GC_SWEEPCOST : 10;\n var obj: Object;\n switch (state) {\n case STATE_IDLE: {\n state = STATE_MARK;\n visitCount = 0;\n visitRoots(VISIT_SCAN);\n iter = toSpace;\n return visitCount * MARKCOST;\n }\n case STATE_MARK: {\n let black = i32(!white);\n obj = iter.next;\n while (obj != toSpace) {\n iter = obj;\n if (obj.color != black) { // skip already-blacks (pointerfree)\n obj.color = black;\n visitCount = 0;\n __visit_members(changetype(obj) + TOTAL_OVERHEAD, VISIT_SCAN);\n return visitCount * MARKCOST;\n }\n obj = obj.next;\n }\n visitCount = 0;\n visitRoots(VISIT_SCAN);\n obj = iter.next;\n if (obj == toSpace) {\n visitStack(VISIT_SCAN);\n obj = iter.next;\n while (obj != toSpace) {\n if (obj.color != black) {\n obj.color = black;\n __visit_members(changetype(obj) + TOTAL_OVERHEAD, VISIT_SCAN);\n }\n obj = obj.next;\n }\n let from = fromSpace;\n fromSpace = toSpace;\n toSpace = from;\n white = black;\n iter = from.next;\n state = STATE_SWEEP;\n }\n return visitCount * MARKCOST;\n }\n case STATE_SWEEP: {\n obj = iter;\n if (obj != toSpace) {\n iter = obj.next;\n if (DEBUG) assert(obj.color == i32(!white)); // old white\n free(obj);\n return SWEEPCOST;\n }\n toSpace.nextWithColor = changetype(toSpace);\n toSpace.prev = toSpace;\n state = STATE_IDLE;\n break;\n }\n }\n return 0;\n}\n\n/** Frees an object. */\nfunction free(obj: Object): void {\n if (changetype(obj) < __heap_base) {\n obj.nextWithColor = 0; // may become linked again\n obj.prev = changetype(0);\n } else {\n total -= obj.size;\n if (isDefined(__finalize)) {\n __finalize(changetype(obj) + TOTAL_OVERHEAD);\n }\n __free(changetype(obj) + BLOCK_OVERHEAD);\n }\n}\n\n// Garbage collector interface\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __new(size: usize, id: i32): usize {\n if (size >= OBJECT_MAXSIZE) throw new Error(E_ALLOCATION_TOO_LARGE);\n if (total >= threshold) interrupt();\n var obj = changetype(__alloc(OBJECT_OVERHEAD + size) - BLOCK_OVERHEAD);\n obj.rtId = id;\n obj.rtSize = size;\n obj.linkTo(fromSpace, white); // inits next/prev\n total += obj.size;\n var ptr = changetype(obj) + TOTAL_OVERHEAD;\n // may be visited before being fully initialized, so must fill\n memory.fill(ptr, 0, size);\n return ptr;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __renew(oldPtr: usize, size: usize): usize {\n var oldObj = changetype(oldPtr - TOTAL_OVERHEAD);\n // Update object size if its block is large enough\n if (size <= (oldObj.mmInfo & ~3) - OBJECT_OVERHEAD) {\n oldObj.rtSize = size;\n return oldPtr;\n }\n // If not the same object anymore, we have to move it move it due to the\n // shadow stack potentially still referencing the old object\n var newPtr = __new(size, oldObj.rtId);\n memory.copy(newPtr, oldPtr, min(size, oldObj.rtSize));\n return newPtr;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __link(parentPtr: usize, childPtr: usize, expectMultiple: bool): void {\n // Write barrier is unnecessary if non-incremental\n if (!childPtr) return;\n if (DEBUG) assert(parentPtr);\n var child = changetype(childPtr - TOTAL_OVERHEAD);\n if (child.color == white) {\n let parent = changetype(parentPtr - TOTAL_OVERHEAD);\n let parentColor = parent.color;\n if (parentColor == i32(!white)) {\n // Maintain the invariant that no black object may point to a white object.\n if (expectMultiple) {\n // Move the barrier \"backward\". Suitable for containers receiving multiple stores.\n // Avoids a barrier for subsequent objects stored into the same container.\n parent.makeGray();\n } else {\n // Move the barrier \"forward\". Suitable for objects receiving isolated stores.\n child.makeGray();\n }\n } else if (parentColor == transparent && state == STATE_MARK) {\n // Pinned objects are considered 'black' during the mark phase.\n child.makeGray();\n }\n }\n}\n\n// @ts-ignore: decorator\n@lazy var visitCount = 0;\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __visit(ptr: usize, cookie: i32): void {\n if (!ptr) return;\n let obj = changetype(ptr - TOTAL_OVERHEAD);\n if (RTRACE) if (!onvisit(obj)) return;\n if (obj.color == white) {\n obj.makeGray();\n ++visitCount;\n }\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __pin(ptr: usize): usize {\n if (ptr) {\n let obj = changetype(ptr - TOTAL_OVERHEAD);\n if (obj.color == transparent) {\n throw new Error(E_ALREADY_PINNED);\n }\n obj.unlink(); // from fromSpace\n obj.linkTo(pinSpace, transparent);\n }\n return ptr;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __unpin(ptr: usize): void {\n if (!ptr) return;\n var obj = changetype(ptr - TOTAL_OVERHEAD);\n if (obj.color != transparent) {\n throw new Error(E_NOT_PINNED);\n }\n if (state == STATE_MARK) {\n // We may be right at the point after marking roots for the second time and\n // entering the sweep phase, in which case the object would be missed if it\n // is not only pinned but also a root. Make sure it isn't missed.\n obj.makeGray();\n } else {\n obj.unlink();\n obj.linkTo(fromSpace, white);\n }\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __collect(): void {\n if (TRACE) trace(\"GC (full) at\", 1, total);\n if (state > STATE_IDLE) {\n // finish current cycle\n while (state != STATE_IDLE) step();\n }\n // perform a full cycle\n step();\n while (state != STATE_IDLE) step();\n threshold = (total * IDLEFACTOR / 100) + GRANULARITY;\n if (TRACE) trace(\"GC (full) done at cur/max\", 2, total, memory.size() << 16);\n if (RTRACE || PROFILE) oncollect(total);\n}\n\n// Garbage collector automation\n\n/** How often to interrupt. The default of 1024 means \"interrupt each 1024 bytes allocated\". */\n// @ts-ignore: decorator\n@inline const GRANULARITY: usize = isDefined(ASC_GC_GRANULARITY) ? ASC_GC_GRANULARITY : 1024;\n/** How long to interrupt. The default of 200% means \"run at double the speed of allocations\". */\n// @ts-ignore: decorator\n@inline const STEPFACTOR: usize = isDefined(ASC_GC_SWEEPFACTOR) ? ASC_GC_SWEEPFACTOR : 200;\n/** How long to idle. The default of 200% means \"wait for memory to double before kicking in again\". */\n// @ts-ignore: decorator\n@inline const IDLEFACTOR: usize = isDefined(ASC_GC_IDLEFACTOR) ? ASC_GC_IDLEFACTOR : 200;\n\n/** Threshold of memory used by objects to exceed before interrupting again. */\n// @ts-ignore: decorator\n@lazy var threshold: usize = ((memory.size() << 16) - __heap_base) >> 1;\n\n/** Performs a reasonable amount of incremental GC steps. */\nfunction interrupt(): void {\n if (PROFILE) oninterrupt(total);\n if (TRACE) trace(\"GC (auto) at\", 1, total);\n var budget: isize = GRANULARITY * STEPFACTOR / 100;\n do {\n budget -= step();\n if (state == STATE_IDLE) {\n if (TRACE) trace(\"└ GC (auto) done at cur/max\", 2, total, memory.size() << 16);\n threshold = (total * IDLEFACTOR / 100) + GRANULARITY;\n if (PROFILE) onyield(total);\n return;\n }\n } while (budget > 0);\n if (TRACE) trace(\"└ GC (auto) ongoing at\", 1, total);\n threshold = total + GRANULARITY * usize(total - threshold < GRANULARITY);\n if (PROFILE) onyield(total);\n}\n","import * as aegis from \"./aegis\";\n//import * as nn from \"./neural-net\";\n//import * as tst from \"./test\";\n\nconst key: i32 = 0;\nconst val: i32 = 1;\n\nexport class ModelSpec {\n modelName: string;\n endpoint: string;\n constructor(name: string, endpoint: string) {\n this.modelName = name;\n this.endpoint = endpoint;\n }\n}\n\nexport function getModelSpec(): ModelSpec {\n return new ModelSpec(\"wasm\", \"wasm\");\n}\n\nexport const ArrayOfStrings_ID = idof();\n\nfunction findVal(key: string, keys: string[], vals: string[]): string {\n for (let i: i32 = 0; i < keys.length; i++) {\n if (keys[i] == key) {\n return vals[i].toString();\n }\n }\n return \"\";\n}\n\nexport function modelFactory(keys: string[], values: string[]): string[][] {\n const arr = new Array(3);\n arr[0] = [\"key1\", findVal(\"key1\", keys, values)];\n arr[1] = [\"key2\", findVal(\"key2\", keys, values)];\n arr[2] = [\"fibonacci\", findVal(\"fibonacci\", keys, values)];\n return arr;\n}\n\nexport function getPorts(keys: string[], vals: string[]): string[][] {\n //aegis.log(\"getPorts called \" + keys[0] + \":\" + vals[0]);\n const ports = new Array(2);\n //service,type,consumesEvent,producesEvent,callback,undo\n ports[0] = [\"port1\", \"dFlow,outbound,dFlow_start,port1_done,port1Cb,true\"];\n ports[1] = [\"port2\", \"dFlow,outbound,port1_done,port2_done,port2Cb,true\"];\n return ports;\n}\n\nexport function port1Cb(keys: string[], vals: string[]): string[][] {\n const cfg = [\n [\"port\", \"port1\"],\n [\"callback\", \"port1Cb\"],\n [\"consumesEvent\", \"dFlow_start\"],\n [\"producesEvent\", \"port1_done\"],\n ];\n aegis.log(\n \"porf invokced\" + cfg[0][0] + \" \" + cfg[0][1] + \" \" + cfg[0][2] + cfg[0][3]\n );\n return cfg;\n}\n\nexport function port2Cb(keys: string[], vals: string[]): string[][] {\n const cfg = [\n [\"port\", \"port2\"],\n [\"callback\", \"port2Cb\"],\n [\"consumesEvent\", \"port1_done\"],\n [\"producesEvent\", \"port2_done\"],\n ];\n aegis.log(\n \"porf invokced\" + cfg[0][0] + \" \" + cfg[0][1] + \" \" + cfg[0][2] + cfg[0][3]\n );\n return cfg;\n}\n\nexport function getCommands(): string[][] {\n const commands = new Array(7);\n commands[0] = [\"serviceMeshListen\", \"tell wasm module to begin listening\"];\n commands[1] = [\"serviceMeshNotify\", \"tell wasm module to send broadcast\"];\n commands[2] = [\"serviceMeshCallback\", \"subscribed event fired\"];\n commands[3] = [\"runFibonacci\", \"remote calculate fibonacci\"];\n commands[4] = [\"fibonacci\", \"calculate fibonacci for a number\"];\n commands[5] = [\"deployModule\", \"request deployment of a module\"];\n commands[6] = [\"commandEx\", \"command example\"];\n return commands;\n}\n\nexport function commandEx(keys: string[], vals: string[]): string[][] {\n aegis.log(\"\\ncommandEx called \" + keys[0] + \":\" + vals[0]);\n const retval = new Array(1);\n retval[0] = [\"key1\", \"commandEx_update!\"];\n return retval;\n}\n\nexport function serviceMeshListen(keys: string[], vals: string[]): void {\n aegis.log(\"serviceMeshListen: \" + keys[0] + \": \" + vals[0]);\n const eventName = findVal(\"eventName\", keys, vals);\n aegis.addListener(eventName, \"serviceMeshCallback\");\n}\n\nexport function serviceMeshNotify(keys: string[], vals: string[]): void {\n const modelName = findVal(\"modelName\", keys, vals);\n const modelId = findVal(\"modelId\", keys, vals);\n const eventName = findVal(\"eventName\", keys, vals);\n const eventData = new Array(3);\n aegis.log(\"wasm notify called with args: \" + modelName + \": \" + modelId);\n eventData[0] = [keys[0], vals[0]];\n eventData[1] = [\"modelName\", modelName];\n eventData[2] = [\"modelId\", modelId];\n aegis.fireEvent(eventName || \"wasmWebListen\", eventData, 1);\n}\n\nexport function serviceMeshCallback(\n keys: string[],\n vals: string[]\n): string[][] {\n aegis.log(\"websocket callback fired: \" + keys[0] + \": \" + vals[0]);\n const eventName = findVal(\"eventName\", keys, vals);\n const eventData = new Array(2);\n eventData[0] = [keys[0], vals[0]];\n eventData[1] = [keys[1], vals[1]];\n aegis.fireEvent(eventName+'callback', eventData, 1);\n return [[\"key1\", \"serviceMeshCallback\"]];\n}\n\nexport function fibonacci(x: number): number {\n if (x === 0) {\n return 0;\n }\n\n if (x === 1) {\n return 1;\n }\n\n return fibonacci(x - 1) + fibonacci(x - 2);\n}\n\nexport function runFibonacci(keys: string[], vals: string[]): string[][] {\n let val: number = 0;\n let startTime: i64 = Date.now();\n\n for (let i = 0; i < keys.length; i++) {\n if (\"fibonacci\" == keys[i]) {\n val = parseInt(vals[i]);\n break;\n }\n }\n const sum = fibonacci(val);\n const ret = new Array(2);\n ret[0] = [\"result\", sum.toString()];\n ret[1] = [\"time\", (Date.now() - startTime).toString()];\n return ret;\n}\n\nexport function portEx(keys: string[], vals: string[]): void {\n aegis.log(\"portEx calling port wasmTestPort\" + keys[0] + \":\" + vals[0]);\n return;\n}\n\nexport function onUpdate(keys: string[], vals: string[]): string[][] {\n return [[\"updatedByWasm\", new Date(Date.now()).toISOString()]];\n}\n\nexport function onDelete(keys: string[], vals: string[]): i8 {\n // return negative to stop the action\n aegis.log(\"onDelete called\");\n return -1;\n}\n\nexport function validate(keys: string[], vals: string[]): void {\n aegis.log(\"onUpdate called\");\n return;\n}\n\n// export function inboundPort(keys: string[], vals: string[]): string[][] {\n// aegis.log(\"inbound port called: \" + keys[0] + \": \" + vals[0]);\n// const outval = new Array(1);\n// outval[0] = [\"key1\", \"val1\"];\n// aegis.invokePort(\"task1\", \"task data\", \"task1Event\", 1, 2);\n// return outval;\n// }\n\nexport function test(keys: string[], values: string[]): string[][] {\n const key1 = keys[0] == \"key1\" ? values[0] : \"default\";\n const key2 = keys[1] == \"key2\" ? values[1] : \"default\";\n const arr = new Array(3);\n arr[0] = [\"key1\", key1];\n arr[1] = [\"key2\", key2];\n arr[2] = [\"key3\", \"alwaysThisValue\"];\n aegis.log(\"test called\");\n return arr;\n}\n","import { Typeinfo, TypeinfoFlags } from \"./shared/typeinfo\";\nimport { E_INDEXOUTOFRANGE } from \"./util/error\";\nimport { OBJECT, TOTAL_OVERHEAD } from \"./rt/common\";\nimport { ArrayBufferView } from \"./arraybuffer\";\n\n// @ts-ignore: decorator\n@builtin\nexport declare const __rtti_base: usize;\n\n// @ts-ignore: decorator\n@builtin @unsafe\nexport declare function __visit_globals(cookie: u32): void;\n\n// @ts-ignore: decorator\n@builtin @unsafe\nexport declare function __visit_members(ref: usize, cookie: u32): void;\n\n// @ts-ignore: decorator\n@unsafe\nexport function __typeinfo(id: u32): TypeinfoFlags {\n var ptr = __rtti_base;\n if (id > load(ptr)) throw new Error(E_INDEXOUTOFRANGE);\n return changetype(ptr + sizeof() + id * offsetof()).flags;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __instanceof(ptr: usize, classId: u32): bool { // keyword\n var id = changetype(ptr - TOTAL_OVERHEAD).rtId;\n var rttiBase = __rtti_base;\n if (id <= load(rttiBase)) {\n do if (id == classId) return true;\n while (id = changetype(rttiBase + sizeof() + id * offsetof()).base);\n }\n return false;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __newBuffer(size: usize, id: u32, data: usize = 0): usize {\n var buffer = __new(size, id);\n if (data) memory.copy(buffer, data, size);\n return buffer;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __newArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize {\n var bufferSize = length << alignLog2;\n // make sure `buffer` is tracked by the shadow stack\n var buffer = changetype(__newBuffer(bufferSize, idof(), data));\n // ...since allocating the array may trigger GC steps\n var array = __new(offsetof(), id);\n store(array, changetype(buffer), offsetof(\"buffer\"));\n __link(array, changetype(buffer), false);\n store(array, changetype(buffer), offsetof(\"dataStart\"));\n store(array, bufferSize, offsetof(\"byteLength\"));\n store(array, length, offsetof(\"length_\"));\n return array;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nfunction __tostack(ptr: usize): usize { // eslint-disable-line\n return ptr;\n}\n\n// These are provided by the respective implementation, included as another entry file by asc:\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __alloc(size: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __realloc(ptr: usize, size: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __free(ptr: usize): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __new(size: usize, id: u32): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __renew(ptr: usize, size: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __link(parentPtr: usize, childPtr: usize, expectMultiple: bool): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __collect(): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __visit(ptr: usize, cookie: u32): void;\n","// Common error messages for use across the standard library. Keeping error messages compact\n// and reusing them where possible ensures minimal static data in binaries.\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INDEXOUTOFRANGE: string = \"Index out of range\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_VALUEOUTOFRANGE: string = \"Value out of range\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INVALIDLENGTH: string = \"Invalid length\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_ILLEGALGENTYPE: string = \"Illegal generic type\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_EMPTYARRAY: string = \"Array is empty\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_HOLEYARRAY: string = \"Element type must be nullable if array is holey\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_NOTIMPLEMENTED: string = \"Not implemented\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_KEYNOTFOUND: string = \"Key does not exist\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_ALLOCATION_TOO_LARGE: string = \"Allocation too large\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_ALREADY_PINNED: string = \"Object already pinned\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_NOT_PINNED: string = \"Object is not pinned\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_URI_MALFORMED: string = \"URI malformed\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INVALIDDATE: string = \"Invalid Date\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_UNPAIRED_SURROGATE: string = \"Unpaired surrogate\";\n","import { memcmp, memmove, memset } from \"./util/memory\";\nimport { E_NOTIMPLEMENTED } from \"./util/error\";\n\n/** Memory manager interface. */\nexport namespace memory {\n\n /** Gets the size of the memory in pages. */\n // @ts-ignore: decorator\n @builtin\n export declare function size(): i32;\n\n /** Grows the memory by the given size in pages and returns the previous size in pages. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function grow(pages: i32): i32;\n\n /** Fills a section in memory with the specified byte value. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export function fill(dst: usize, c: u8, n: usize): void {\n memset(dst, c, n); // fallback if \"bulk-memory\" isn't enabled\n }\n\n /** Copies a section of memory to another. Has move semantics. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export function copy(dst: usize, src: usize, n: usize): void {\n memmove(dst, src, n); // fallback if \"bulk-memory\" isn't enabled\n }\n\n /** Initializes a memory segment. */\n // @ts-ignore: decorator\n @unsafe\n export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n /** Drops a memory segment. */\n // @ts-ignore: decorator\n @unsafe\n export function drop(segmentIndex: u32): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n /** Repeats a section of memory at a specific address. */\n // @ts-ignore: decorator\n @unsafe\n export function repeat(dst: usize, src: usize, srcLength: usize, count: usize): void {\n var index: usize = 0;\n var total = srcLength * count;\n while (index < total) {\n memory.copy(dst + index, src, srcLength);\n index += srcLength;\n }\n }\n\n /** Compares a section of memory to another. */\n // @ts-ignore: decorator\n @inline\n export function compare(vl: usize, vr: usize, n: usize): i32 {\n return memcmp(vl, vr, n);\n }\n\n /** Gets a pointer to a static chunk of memory of the given size. */\n // @ts-ignore: decorator\n @builtin\n export declare function data(size: T, align?: i32): usize;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare const __data_end: usize;\n\n// @ts-ignore: decorator\n@builtin\nexport declare var __stack_pointer: usize;\n\n// @ts-ignore: decorator\n@builtin\nexport declare const __heap_base: usize;\n\n/** Heap memory interface. */\nexport namespace heap {\n\n /** Allocates a chunk of memory of at least the specified size. */\n // @ts-ignore: decorator\n @unsafe export function alloc(size: usize): usize {\n return __alloc(size);\n }\n\n /** Reallocates a chunk of memory to have at least the specified size. */\n // @ts-ignore: decorator\n @unsafe export function realloc(ptr: usize, size: usize): usize {\n return __realloc(ptr, size);\n }\n\n /** Frees a chunk of memory. Does hardly anything (most recent block only) with the stub runtime. */\n // @ts-ignore: decorator\n @unsafe export function free(ptr: usize): void {\n __free(ptr);\n }\n\n /** Dangerously resets the entire heap. Specific to the stub runtime. */\n // @ts-ignore: decorator\n @unsafe export function reset(): void {\n if (isDefined(__reset)) {\n __reset();\n } else {\n throw new Error(E_NOTIMPLEMENTED);\n }\n }\n}\n","export function memcpy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memcpy.c\n var w: u32, x: u32;\n\n // copy 1 byte each until src is aligned to 4 bytes\n while (n && (src & 3)) {\n store(dest++, load(src++));\n n--;\n }\n\n // if dst is aligned to 4 bytes as well, copy 4 bytes each\n if ((dest & 3) == 0) {\n while (n >= 16) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n store(dest + 8, load(src + 8));\n store(dest + 12, load(src + 12));\n src += 16; dest += 16; n -= 16;\n }\n if (n & 8) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n dest += 8; src += 8;\n }\n if (n & 4) {\n store(dest, load(src));\n dest += 4; src += 4;\n }\n if (n & 2) { // drop to 2 bytes each\n store(dest, load(src));\n dest += 2; src += 2;\n }\n if (n & 1) { // drop to 1 byte\n store(dest++, load(src++));\n }\n return;\n }\n\n // if dst is not aligned to 4 bytes, use alternating shifts to copy 4 bytes each\n // doing shifts if faster when copying enough bytes (here: 32 or more)\n if (n >= 32) {\n switch (dest & 3) {\n // known to be != 0\n case 1: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 3;\n while (n >= 17) {\n x = load(src + 1);\n store(dest, w >> 24 | x << 8);\n w = load(src + 5);\n store(dest + 4, x >> 24 | w << 8);\n x = load(src + 9);\n store(dest + 8, w >> 24 | x << 8);\n w = load(src + 13);\n store(dest + 12, x >> 24 | w << 8);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 2: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 2;\n while (n >= 18) {\n x = load(src + 2);\n store(dest, w >> 16 | x << 16);\n w = load(src + 6);\n store(dest + 4, x >> 16 | w << 16);\n x = load(src + 10);\n store(dest + 8, w >> 16 | x << 16);\n w = load(src + 14);\n store(dest + 12, x >> 16 | w << 16);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 3: {\n w = load(src);\n store(dest++, load(src++));\n n -= 1;\n while (n >= 19) {\n x = load(src + 3);\n store(dest, w >> 8 | x << 24);\n w = load(src + 7);\n store(dest + 4, x >> 8 | w << 24);\n x = load(src + 11);\n store(dest + 8, w >> 8 | x << 24);\n w = load(src + 15);\n store(dest + 12, x >> 8 | w << 24);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n }\n }\n\n // copy remaining bytes one by one\n if (n & 16) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 8) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 4) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 2) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 1) {\n store(dest++, load(src++));\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c\n if (dest === src) return;\n if (ASC_SHRINK_LEVEL < 1) {\n if (src - dest - n <= -(n << 1)) {\n memcpy(dest, src, n);\n return;\n }\n }\n if (dest < src) {\n if (ASC_SHRINK_LEVEL < 2) {\n if ((src & 7) == (dest & 7)) {\n while (dest & 7) {\n if (!n) return;\n --n;\n store(dest++, load(src++));\n }\n while (n >= 8) {\n store(dest, load(src));\n n -= 8;\n dest += 8;\n src += 8;\n }\n }\n }\n while (n) {\n store(dest++, load(src++));\n --n;\n }\n } else {\n if (ASC_SHRINK_LEVEL < 2) {\n if ((src & 7) == (dest & 7)) {\n while ((dest + n) & 7) {\n if (!n) return;\n store(dest + --n, load(src + n));\n }\n while (n >= 8) {\n n -= 8;\n store(dest + n, load(src + n));\n }\n }\n }\n while (n) {\n store(dest + --n, load(src + n));\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset\n if (ASC_SHRINK_LEVEL > 1) {\n while (n) {\n store(dest++, c);\n --n;\n }\n } else {\n // fill head and tail with minimal branching\n if (!n) return;\n let dend = dest + n;\n store(dest, c);\n store(dend - 1, c);\n if (n <= 2) return;\n store(dest, c, 1);\n store(dest, c, 2);\n store(dend - 2, c);\n store(dend - 3, c);\n if (n <= 6) return;\n store(dest, c, 3);\n store(dend - 4, c);\n if (n <= 8) return;\n\n // advance pointer to align it at 4-byte boundary\n let k: usize = -dest & 3;\n dest += k;\n n -= k;\n n &= -4;\n\n let c32: u32 = -1 / 255 * c;\n\n // fill head/tail up to 28 bytes each in preparation\n dend = dest + n;\n store(dest, c32);\n store(dend - 4, c32);\n if (n <= 8) return;\n store(dest, c32, 4);\n store(dest, c32, 8);\n store(dend - 12, c32);\n store(dend - 8, c32);\n if (n <= 24) return;\n store(dest, c32, 12);\n store(dest, c32, 16);\n store(dest, c32, 20);\n store(dest, c32, 24);\n store(dend - 28, c32);\n store(dend - 24, c32);\n store(dend - 20, c32);\n store(dend - 16, c32);\n\n // align to a multiple of 8\n k = 24 + (dest & 4);\n dest += k;\n n -= k;\n\n // copy 32 bytes each\n let c64: u64 = c32 | (c32 << 32);\n while (n >= 32) {\n store(dest, c64);\n store(dest, c64, 8);\n store(dest, c64, 16);\n store(dest, c64, 24);\n n -= 32;\n dest += 32;\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memcmp(vl: usize, vr: usize, n: usize): i32 {\n if (vl == vr) return 0;\n if (ASC_SHRINK_LEVEL < 2) {\n if ((vl & 7) == (vr & 7)) {\n while (vl & 7) {\n if (!n) return 0;\n let a = load(vl);\n let b = load(vr);\n if (a != b) return a - b;\n n--; vl++; vr++;\n }\n while (n >= 8) {\n if (load(vl) != load(vr)) break;\n vl += 8;\n vr += 8;\n n -= 8;\n }\n }\n }\n while (n--) {\n let a = load(vl);\n let b = load(vr);\n if (a != b) return a - b;\n vl++; vr++;\n }\n return 0;\n}\n","/// \n\nimport { idof } from \"../builtins\";\nimport { CharCode } from \"./string\";\n\n// @ts-ignore: decorator\n@inline\nexport const MAX_DOUBLE_LENGTH = 28;\n\n// @ts-ignore: decorator\n@lazy @inline const POWERS10 = memory.data([\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000\n]);\n\n/*\n Lookup table for pairwise char codes in range [0-99]\n\n \"00\", \"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\",\n \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\",\n \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\",\n \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\",\n \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\",\n \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\",\n \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\",\n \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\",\n \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\",\n \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\"\n*/\n// @ts-ignore: decorator\n@lazy @inline const DIGITS = memory.data([\n 0x00300030, 0x00310030, 0x00320030, 0x00330030, 0x00340030,\n 0x00350030, 0x00360030, 0x00370030, 0x00380030, 0x00390030,\n 0x00300031, 0x00310031, 0x00320031, 0x00330031, 0x00340031,\n 0x00350031, 0x00360031, 0x00370031, 0x00380031, 0x00390031,\n 0x00300032, 0x00310032, 0x00320032, 0x00330032, 0x00340032,\n 0x00350032, 0x00360032, 0x00370032, 0x00380032, 0x00390032,\n 0x00300033, 0x00310033, 0x00320033, 0x00330033, 0x00340033,\n 0x00350033, 0x00360033, 0x00370033, 0x00380033, 0x00390033,\n 0x00300034, 0x00310034, 0x00320034, 0x00330034, 0x00340034,\n 0x00350034, 0x00360034, 0x00370034, 0x00380034, 0x00390034,\n 0x00300035, 0x00310035, 0x00320035, 0x00330035, 0x00340035,\n 0x00350035, 0x00360035, 0x00370035, 0x00380035, 0x00390035,\n 0x00300036, 0x00310036, 0x00320036, 0x00330036, 0x00340036,\n 0x00350036, 0x00360036, 0x00370036, 0x00380036, 0x00390036,\n 0x00300037, 0x00310037, 0x00320037, 0x00330037, 0x00340037,\n 0x00350037, 0x00360037, 0x00370037, 0x00380037, 0x00390037,\n 0x00300038, 0x00310038, 0x00320038, 0x00330038, 0x00340038,\n 0x00350038, 0x00360038, 0x00370038, 0x00380038, 0x00390038,\n 0x00300039, 0x00310039, 0x00320039, 0x00330039, 0x00340039,\n 0x00350039, 0x00360039, 0x00370039, 0x00380039, 0x00390039\n]);\n\n// Lookup table for pairwise char codes in range [0x00-0xFF]\n// @ts-ignore: decorator\n@lazy @inline const HEX_DIGITS =\n\"000102030405060708090a0b0c0d0e0f\\\n101112131415161718191a1b1c1d1e1f\\\n202122232425262728292a2b2c2d2e2f\\\n303132333435363738393a3b3c3d3e3f\\\n404142434445464748494a4b4c4d4e4f\\\n505152535455565758595a5b5c5d5e5f\\\n606162636465666768696a6b6c6d6e6f\\\n707172737475767778797a7b7c7d7e7f\\\n808182838485868788898a8b8c8d8e8f\\\n909192939495969798999a9b9c9d9e9f\\\na0a1a2a3a4a5a6a7a8a9aaabacadaeaf\\\nb0b1b2b3b4b5b6b7b8b9babbbcbdbebf\\\nc0c1c2c3c4c5c6c7c8c9cacbcccdcecf\\\nd0d1d2d3d4d5d6d7d8d9dadbdcdddedf\\\ne0e1e2e3e4e5e6e7e8e9eaebecedeeef\\\nf0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\";\n\n// @ts-ignore: decorator\n@lazy @inline const ANY_DIGITS = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\n// @ts-ignore: decorator\n@lazy @inline const EXP_POWERS = memory.data([/* eslint-disable indent */\n -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,\n -954, -927, -901, -874, -847, -821, -794, -768, -741, -715,\n -688, -661, -635, -608, -582, -555, -529, -502, -475, -449,\n -422, -396, -369, -343, -316, -289, -263, -236, -210, -183,\n -157, -130, -103, -77, -50, -24, 3, 30, 56, 83,\n 109, 136, 162, 189, 216, 242, 269, 295, 322, 348,\n 375, 402, 428, 455, 481, 508, 534, 561, 588, 614,\n 641, 667, 694, 720, 747, 774, 800, 827, 853, 880,\n 907, 933, 960, 986, 1013, 1039, 1066\n/* eslint-enable indent */]);\n\n// 1e-348, 1e-340, ..., 1e340\n// @ts-ignore: decorator\n@lazy @inline const FRC_POWERS = memory.data([\n 0xFA8FD5A0081C0288, 0xBAAEE17FA23EBF76, 0x8B16FB203055AC76, 0xCF42894A5DCE35EA,\n 0x9A6BB0AA55653B2D, 0xE61ACF033D1A45DF, 0xAB70FE17C79AC6CA, 0xFF77B1FCBEBCDC4F,\n 0xBE5691EF416BD60C, 0x8DD01FAD907FFC3C, 0xD3515C2831559A83, 0x9D71AC8FADA6C9B5,\n 0xEA9C227723EE8BCB, 0xAECC49914078536D, 0x823C12795DB6CE57, 0xC21094364DFB5637,\n 0x9096EA6F3848984F, 0xD77485CB25823AC7, 0xA086CFCD97BF97F4, 0xEF340A98172AACE5,\n 0xB23867FB2A35B28E, 0x84C8D4DFD2C63F3B, 0xC5DD44271AD3CDBA, 0x936B9FCEBB25C996,\n 0xDBAC6C247D62A584, 0xA3AB66580D5FDAF6, 0xF3E2F893DEC3F126, 0xB5B5ADA8AAFF80B8,\n 0x87625F056C7C4A8B, 0xC9BCFF6034C13053, 0x964E858C91BA2655, 0xDFF9772470297EBD,\n 0xA6DFBD9FB8E5B88F, 0xF8A95FCF88747D94, 0xB94470938FA89BCF, 0x8A08F0F8BF0F156B,\n 0xCDB02555653131B6, 0x993FE2C6D07B7FAC, 0xE45C10C42A2B3B06, 0xAA242499697392D3,\n 0xFD87B5F28300CA0E, 0xBCE5086492111AEB, 0x8CBCCC096F5088CC, 0xD1B71758E219652C,\n 0x9C40000000000000, 0xE8D4A51000000000, 0xAD78EBC5AC620000, 0x813F3978F8940984,\n 0xC097CE7BC90715B3, 0x8F7E32CE7BEA5C70, 0xD5D238A4ABE98068, 0x9F4F2726179A2245,\n 0xED63A231D4C4FB27, 0xB0DE65388CC8ADA8, 0x83C7088E1AAB65DB, 0xC45D1DF942711D9A,\n 0x924D692CA61BE758, 0xDA01EE641A708DEA, 0xA26DA3999AEF774A, 0xF209787BB47D6B85,\n 0xB454E4A179DD1877, 0x865B86925B9BC5C2, 0xC83553C5C8965D3D, 0x952AB45CFA97A0B3,\n 0xDE469FBD99A05FE3, 0xA59BC234DB398C25, 0xF6C69A72A3989F5C, 0xB7DCBF5354E9BECE,\n 0x88FCF317F22241E2, 0xCC20CE9BD35C78A5, 0x98165AF37B2153DF, 0xE2A0B5DC971F303A,\n 0xA8D9D1535CE3B396, 0xFB9B7CD9A4A7443C, 0xBB764C4CA7A44410, 0x8BAB8EEFB6409C1A,\n 0xD01FEF10A657842C, 0x9B10A4E5E9913129, 0xE7109BFBA19C0C9D, 0xAC2820D9623BF429,\n 0x80444B5E7AA7CF85, 0xBF21E44003ACDD2D, 0x8E679C2F5E44FF8F, 0xD433179D9C8CB841,\n 0x9E19DB92B4E31BA9, 0xEB96BF6EBADF77D9, 0xAF87023B9BF0EE6B\n]);\n\n// @ts-ignore: decorator\n@inline\nexport function isPowerOf2(value: T): bool {\n return popcnt(value) == 1;\n}\n\n// Count number of decimals for u32 values\n// In our case input value always non-zero so we can simplify some parts\nexport function decimalCount32(value: u32): u32 {\n if (value < 100000) {\n if (value < 100) {\n return 1 + u32(value >= 10);\n } else {\n return 3 + u32(value >= 10000) + u32(value >= 1000);\n }\n } else {\n if (value < 10000000) {\n return 6 + u32(value >= 1000000);\n } else {\n return 8 + u32(value >= 1000000000) + u32(value >= 100000000);\n }\n }\n}\n\n// Count number of decimals for u64 values\n// In our case input value always greater than 2^32-1 so we can skip some parts\nexport function decimalCount64High(value: u64): u32 {\n if (value < 1000000000000000) {\n if (value < 1000000000000) {\n return 10 + u32(value >= 100000000000) + u32(value >= 10000000000);\n } else {\n return 13 + u32(value >= 100000000000000) + u32(value >= 10000000000000);\n }\n } else {\n if (value < 100000000000000000) {\n return 16 + u32(value >= 10000000000000000);\n } else {\n return 18 + u32(value >= 10000000000000000000) + u32(value >= 1000000000000000000);\n }\n }\n}\n\nfunction ulog_base(num: u64, base: i32): u32 {\n if (isPowerOf2(base)) {\n return (63 - clz(num)) / (31 - clz(base)) + 1;\n }\n var b64 = u64(base), b = b64, e: u32 = 1;\n while (num >= b) {\n num /= b;\n b *= b;\n e <<= 1;\n }\n while (num >= 1) {\n num /= b64;\n e++;\n }\n return e - 1;\n}\n\nfunction utoa32_dec_lut(buffer: usize, num: u32, offset: usize): void {\n while (num >= 10000) {\n // in most VMs i32/u32 div and modulo by constant can be shared and simplificate\n let t = num / 10000;\n let r = num % 10000;\n num = t;\n\n let d1 = r / 100;\n let d2 = r % 100;\n\n let digits1 = load(DIGITS + (d1 << alignof()));\n let digits2 = load(DIGITS + (d2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n }\n\n if (num >= 100) {\n let t = num / 100;\n let d1 = num % 100;\n num = t;\n offset -= 2;\n let digits = load(DIGITS + (d1 << alignof()));\n store(buffer + (offset << 1), digits);\n }\n\n if (num >= 10) {\n offset -= 2;\n let digits = load(DIGITS + (num << alignof()));\n store(buffer + (offset << 1), digits);\n } else {\n offset -= 1;\n let digit = CharCode._0 + num;\n store(buffer + (offset << 1), digit);\n }\n}\n\nfunction utoa64_dec_lut(buffer: usize, num: u64, offset: usize): void {\n while (num >= 100000000) {\n let t = num / 100000000;\n let r = (num - t * 100000000);\n num = t;\n\n let b = r / 10000;\n let c = r % 10000;\n\n let b1 = b / 100;\n let b2 = b % 100;\n let c1 = c / 100;\n let c2 = c % 100;\n\n let digits1 = load(DIGITS + (c1 << alignof()));\n let digits2 = load(DIGITS + (c2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n\n digits1 = load(DIGITS + (b1 << alignof()));\n digits2 = load(DIGITS + (b2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n }\n\n utoa32_dec_lut(buffer, num, offset);\n}\n\nfunction utoa_hex_lut(buffer: usize, num: u64, offset: usize): void {\n const lut = changetype(HEX_DIGITS);\n while (offset >= 2) {\n offset -= 2;\n store(\n buffer + (offset << 1),\n load(lut + ((num & 0xFF) << alignof()))\n );\n num >>= 8;\n }\n if (offset & 1) {\n store(buffer, load(lut + (num << 6)));\n }\n}\n\nfunction utoa_dec_simple(buffer: usize, num: T, offset: usize): void {\n do {\n let t = num / 10;\n let r = (num % 10);\n num = changetype(t);\n offset--;\n store(buffer + (offset << 1), CharCode._0 + r);\n } while (num);\n}\n\nfunction utoa_hex_simple(buffer: usize, num: T, offset: usize): void {\n do {\n let d = num & 0x0F | CharCode._0;\n d += select(0x27, 0, d > CharCode._9);\n offset--;\n store(buffer + (offset << 1), d);\n // @ts-ignore: type\n num >>= 4;\n } while (num);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function utoa32_dec_core(buffer: usize, num: u32, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_dec_simple(buffer, num, offset);\n } else {\n utoa32_dec_lut(buffer, num, offset);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction utoa32_hex_core(buffer: usize, num: u32, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_hex_simple(buffer, num, offset);\n } else {\n utoa_hex_lut(buffer, num, offset);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction utoa64_dec_core(buffer: usize, num: u64, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_dec_simple(buffer, num, offset);\n } else {\n utoa64_dec_lut(buffer, num, offset);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction utoa64_hex_core(buffer: usize, num: u64, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_hex_simple(buffer, num, offset);\n } else {\n utoa_hex_lut(buffer, num, offset);\n }\n}\n\nfunction utoa64_any_core(buffer: usize, num: u64, offset: usize, radix: i32): void {\n const lut = changetype(ANY_DIGITS);\n var base = u64(radix);\n if ((radix & (radix - 1)) == 0) { // for radix which pow of two\n let shift = u64(ctz(radix) & 7);\n let mask = base - 1;\n do {\n offset--;\n store(buffer + (offset << 1), load(lut + (usize(num & mask) << 1)));\n num >>= shift;\n } while (num);\n } else {\n do {\n offset--;\n let q = num / base;\n store(buffer + (offset << 1), load(lut + (usize(num - q * base) << 1)));\n num = q;\n } while (num);\n }\n}\n\nexport function utoa32(value: u32, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n var out: String;\n\n if (radix == 10) {\n let decimals = decimalCount32(value);\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), value, decimals);\n } else if (radix == 16) {\n let decimals = (31 - clz(value) >> 2) + 1;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_hex_core(changetype(out), value, decimals);\n } else {\n let decimals = ulog_base(value, radix);\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), value, decimals, radix);\n }\n return out;\n}\n\nexport function itoa32(value: i32, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n\n var sign = value >>> 31;\n if (sign) value = -value;\n var out: String;\n\n if (radix == 10) {\n let decimals = decimalCount32(value) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), value, decimals);\n } else if (radix == 16) {\n let decimals = (31 - clz(value) >> 2) + 1 + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_hex_core(changetype(out), value, decimals);\n } else {\n let val32 = u32(value);\n let decimals = ulog_base(val32, radix) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), val32, decimals, radix);\n }\n if (sign) store(changetype(out), CharCode.MINUS);\n return out;\n}\n\nexport function utoa64(value: u64, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n var out: String;\n\n if (radix == 10) {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32);\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), val32, decimals);\n } else {\n let decimals = decimalCount64High(value);\n out = changetype(__new(decimals << 1, idof()));\n utoa64_dec_core(changetype(out), value, decimals);\n }\n } else if (radix == 16) {\n let decimals = (63 - u32(clz(value)) >> 2) + 1;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_hex_core(changetype(out), value, decimals);\n } else {\n let decimals = ulog_base(value, radix);\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), value, decimals, radix);\n }\n return out;\n}\n\nexport function itoa64(value: i64, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n\n var sign = u32(value >>> 63);\n if (sign) value = -value;\n var out: String;\n\n if (radix == 10) {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), val32, decimals);\n } else {\n let decimals = decimalCount64High(value) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_dec_core(changetype(out), value, decimals);\n }\n } else if (radix == 16) {\n let decimals = (63 - u32(clz(value)) >> 2) + 1 + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_hex_core(changetype(out), value, decimals);\n } else {\n let decimals = ulog_base(value, radix) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), value, decimals, radix);\n }\n if (sign) store(changetype(out), CharCode.MINUS);\n return out;\n}\n\n// @ts-ignore: decorator\n@lazy var _K: i32 = 0;\n\n// // @ts-ignore: decorator\n// @lazy\n// var _frc: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _exp: i32 = 0;\n\n// @ts-ignore: decorator\n@lazy var _frc_minus: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _frc_plus: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _frc_pow: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _exp_pow: i32 = 0;\n\n// @ts-ignore: decorator\n@inline\nfunction umul64f(u: u64, v: u64): u64 {\n var u0 = u & 0xFFFFFFFF;\n var v0 = v & 0xFFFFFFFF;\n\n var u1 = u >> 32;\n var v1 = v >> 32;\n\n var l = u0 * v0;\n var t = u1 * v0 + (l >> 32);\n var w = u0 * v1 + (t & 0xFFFFFFFF);\n\n w += 0x7FFFFFFF; // rounding\n\n t >>= 32;\n w >>= 32;\n\n return u1 * v1 + t + w;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction umul64e(e1: i32, e2: i32): i32 {\n return e1 + e2 + 64; // where 64 is significand size\n}\n\n// @ts-ignore: decorator\n@inline\nfunction normalizedBoundaries(f: u64, e: i32): void {\n var frc = (f << 1) + 1;\n var exp = e - 1;\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var m = 1 + i32(f == 0x0010000000000000);\n\n _frc_plus = frc;\n _frc_minus = ((f << m) - 1) << e - m - exp;\n _exp = exp;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction grisuRound(buffer: usize, len: i32, delta: u64, rest: u64, ten_kappa: u64, wp_w: u64): void {\n var lastp = buffer + ((len - 1) << 1);\n var digit = load(lastp);\n while (\n rest < wp_w &&\n delta - rest >= ten_kappa && (\n rest + ten_kappa < wp_w ||\n wp_w - rest > rest + ten_kappa - wp_w\n )\n ) {\n --digit;\n rest += ten_kappa;\n }\n store(lastp, digit);\n}\n\n// @ts-ignore: decorator\n@inline\nfunction getCachedPower(minExp: i32): void {\n const c = reinterpret(0x3FD34413509F79FE); // 1 / lg(10) = 0.30102999566398114\n var dk = (-61 - minExp) * c + 347;\t // dk must be positive, so can do ceiling in positive\n var k = dk;\n k += i32(k != dk); // conversion with ceil\n\n var index = (k >> 3) + 1;\n _K = 348 - (index << 3);\t// decimal exponent no need lookup table\n _frc_pow = load(FRC_POWERS + (index << alignof()));\n _exp_pow = load(EXP_POWERS + (index << alignof()));\n}\n\n// @ts-ignore: decorator\n@inline\nfunction grisu2(value: f64, buffer: usize, sign: i32): i32 {\n\n // frexp routine\n var uv = reinterpret(value);\n var exp = i32((uv & 0x7FF0000000000000) >>> 52);\n var sid = uv & 0x000FFFFFFFFFFFFF;\n var frc = (u64(exp != 0) << 52) + sid;\n exp = select(exp, 1, exp) - (0x3FF + 52);\n\n normalizedBoundaries(frc, exp);\n getCachedPower(_exp);\n\n // normalize\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var frc_pow = _frc_pow;\n var exp_pow = _exp_pow;\n\n var w_frc = umul64f(frc, frc_pow);\n var w_exp = umul64e(exp, exp_pow);\n\n var wp_frc = umul64f(_frc_plus, frc_pow) - 1;\n var wp_exp = umul64e(_exp, exp_pow);\n\n var wm_frc = umul64f(_frc_minus, frc_pow) + 1;\n var delta = wp_frc - wm_frc;\n\n return genDigits(buffer, w_frc, w_exp, wp_frc, wp_exp, delta, sign);\n}\n\nfunction genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i32, delta: u64, sign: i32): i32 {\n var one_exp = -mp_exp;\n var one_frc = (1) << one_exp;\n var mask = one_frc - 1;\n\n var wp_w_frc = mp_frc - w_frc;\n\n var p1 = u32(mp_frc >> one_exp);\n var p2 = mp_frc & mask;\n\n var kappa = decimalCount32(p1);\n var len = sign;\n\n while (kappa > 0) {\n let d: u32;\n switch (kappa) {\n case 10: { d = p1 / 1000000000; p1 %= 1000000000; break; }\n case 9: { d = p1 / 100000000; p1 %= 100000000; break; }\n case 8: { d = p1 / 10000000; p1 %= 10000000; break; }\n case 7: { d = p1 / 1000000; p1 %= 1000000; break; }\n case 6: { d = p1 / 100000; p1 %= 100000; break; }\n case 5: { d = p1 / 10000; p1 %= 10000; break; }\n case 4: { d = p1 / 1000; p1 %= 1000; break; }\n case 3: { d = p1 / 100; p1 %= 100; break; }\n case 2: { d = p1 / 10; p1 %= 10; break; }\n case 1: { d = p1; p1 = 0; break; }\n default: { d = 0; break; }\n }\n\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d);\n\n --kappa;\n let tmp = ((p1) << one_exp) + p2;\n if (tmp <= delta) {\n _K += kappa;\n grisuRound(buffer, len, delta, tmp, load(POWERS10 + (kappa << alignof())) << one_exp, wp_w_frc);\n return len;\n }\n }\n\n while (true) {\n p2 *= 10;\n delta *= 10;\n\n let d = p2 >> one_exp;\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d);\n\n p2 &= mask;\n --kappa;\n if (p2 < delta) {\n _K += kappa;\n wp_w_frc *= load(POWERS10 + (-kappa << alignof()));\n grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc);\n return len;\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction genExponent(buffer: usize, k: i32): i32 {\n var sign = k < 0;\n if (sign) k = -k;\n var decimals = decimalCount32(k) + 1;\n utoa32_dec_core(buffer, k, decimals);\n store(buffer, select(CharCode.MINUS, CharCode.PLUS, sign));\n return decimals;\n}\n\nfunction prettify(buffer: usize, length: i32, k: i32): i32 {\n if (!k) {\n store(buffer + (length << 1), CharCode.DOT | (CharCode._0 << 16));\n return length + 2;\n }\n\n var kk = length + k;\n if (length <= kk && kk <= 21) {\n // 1234e7 -> 12340000000\n for (let i = length; i < kk; ++i) {\n store(buffer + (i << 1), CharCode._0);\n }\n store(buffer + (kk << 1), CharCode.DOT | (CharCode._0 << 16));\n return kk + 2;\n } else if (kk > 0 && kk <= 21) {\n // 1234e-2 -> 12.34\n let ptr = buffer + (kk << 1);\n memory.copy(\n ptr + 2,\n ptr,\n -k << 1\n );\n store(buffer + (kk << 1), CharCode.DOT);\n return length + 1;\n } else if (-6 < kk && kk <= 0) {\n // 1234e-6 -> 0.001234\n let offset = 2 - kk;\n memory.copy(\n buffer + (offset << 1),\n buffer,\n length << 1\n );\n store(buffer, CharCode._0 | (CharCode.DOT << 16));\n for (let i = 2; i < offset; ++i) {\n store(buffer + (i << 1), CharCode._0);\n }\n return length + offset;\n } else if (length == 1) {\n // 1e30\n store(buffer, CharCode.e, 2);\n length = genExponent(buffer + 4, kk - 1);\n return length + 2;\n } else {\n let len = length << 1;\n memory.copy(\n buffer + 4,\n buffer + 2,\n len - 2\n );\n store(buffer, CharCode.DOT, 2);\n store(buffer + len, CharCode.e, 2);\n length += genExponent(buffer + len + 4, kk - 1);\n return length + 2;\n }\n}\n\nfunction dtoa_core(buffer: usize, value: f64): i32 {\n var sign = i32(value < 0);\n if (sign) {\n value = -value;\n store(buffer, CharCode.MINUS);\n }\n // assert(value > 0 && value <= 1.7976931348623157e308);\n var len = grisu2(value, buffer, sign);\n len = prettify(buffer + (sign << 1), len - sign, _K);\n return len + sign;\n}\n\n// @ts-ignore: decorator\n@lazy @inline const dtoa_buf = memory.data(MAX_DOUBLE_LENGTH << 1);\n\nexport function dtoa(value: f64): String {\n if (value == 0) return \"0.0\";\n if (!isFinite(value)) {\n if (isNaN(value)) return \"NaN\";\n return select(\"-Infinity\", \"Infinity\", value < 0);\n }\n var size = dtoa_core(dtoa_buf, value) << 1;\n var result = changetype(__new(size, idof()));\n memory.copy(changetype(result), dtoa_buf, size);\n return result;\n}\n\nexport function itoa_buffered(buffer: usize, value: T): u32 {\n var sign: u32 = 0;\n if (isSigned()) {\n sign = u32(value < 0);\n if (sign) {\n value = changetype(-value);\n store(buffer, CharCode.MINUS);\n }\n }\n if (ASC_SHRINK_LEVEL <= 1) {\n if (isSigned()) {\n if (sizeof() <= 4) {\n if (value < 10) {\n store(buffer + (sign << 1), value | CharCode._0);\n return 1 + sign;\n }\n } else {\n if (value < 10) {\n store(buffer + (sign << 1), value | CharCode._0);\n return 1 + sign;\n }\n }\n } else {\n if (value < 10) {\n store(buffer, value | CharCode._0);\n return 1;\n }\n }\n }\n var decimals = sign;\n if (sizeof() <= 4) {\n decimals += decimalCount32(value);\n utoa32_dec_core(buffer, value, decimals);\n } else {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n decimals += decimalCount32(val32);\n utoa32_dec_core(buffer, val32, decimals);\n } else {\n decimals += decimalCount64High(value);\n utoa64_dec_core(buffer, value, decimals);\n }\n }\n return decimals;\n}\n\nexport function dtoa_buffered(buffer: usize, value: f64): u32 {\n if (value == 0) {\n store(buffer, CharCode._0);\n store(buffer, CharCode.DOT, 2);\n store(buffer, CharCode._0, 4);\n return 3;\n }\n if (!isFinite(value)) {\n if (isNaN(value)) {\n store(buffer, CharCode.N);\n store(buffer, CharCode.a, 2);\n store(buffer, CharCode.N, 4);\n return 3;\n } else {\n let sign = value < 0;\n if (sign) {\n store(buffer, CharCode.MINUS); // -\n buffer += 2;\n }\n store(buffer, 0x690066006E0049, 0); // ifnI\n store(buffer, 0x7900740069006E, 8); // ytin\n return 8 + u32(sign);\n }\n }\n return dtoa_core(buffer, value);\n}\n","//\n// Lookup data for exp2f\n//\n\n// @ts-ignore: decorator\n@inline const EXP2F_TABLE_BITS = 5;\n\n// @ts-ignore: decorator\n@lazy @inline const EXP2F_DATA_TAB = memory.data([\n // exp2f_data_tab[i] = uint(2^(i/N)) - (i << 52-BITS)\n // used for computing 2^(k/N) for an int |k| < 150 N as\n // double(tab[k%N] + (k << 52-BITS))\n 0x3FF0000000000000, 0x3FEFD9B0D3158574, 0x3FEFB5586CF9890F, 0x3FEF9301D0125B51,\n 0x3FEF72B83C7D517B, 0x3FEF54873168B9AA, 0x3FEF387A6E756238, 0x3FEF1E9DF51FDEE1,\n 0x3FEF06FE0A31B715, 0x3FEEF1A7373AA9CB, 0x3FEEDEA64C123422, 0x3FEECE086061892D,\n 0x3FEEBFDAD5362A27, 0x3FEEB42B569D4F82, 0x3FEEAB07DD485429, 0x3FEEA47EB03A5585,\n 0x3FEEA09E667F3BCD, 0x3FEE9F75E8EC5F74, 0x3FEEA11473EB0187, 0x3FEEA589994CCE13,\n 0x3FEEACE5422AA0DB, 0x3FEEB737B0CDC5E5, 0x3FEEC49182A3F090, 0x3FEED503B23E255D,\n 0x3FEEE89F995AD3AD, 0x3FEEFF76F2FB5E47, 0x3FEF199BDD85529C, 0x3FEF3720DCEF9069,\n 0x3FEF5818DCFBA487, 0x3FEF7C97337B9B5F, 0x3FEFA4AFA2A490DA, 0x3FEFD0765B6E4540\n]);\n\n// ULP error: 0.502 (nearest rounding.)\n// Relative error: 1.69 * 2^-34 in [-1/64, 1/64] (before rounding.)\n// Wrong count: 168353 (all nearest rounding wrong results with fma.)\n// @ts-ignore: decorator\n@inline\nexport function exp2f_lut(x: f32): f32 {\n const\n N = 1 << EXP2F_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000) / N, // 0x1.8p+52\n Ox127f = reinterpret(0x7F000000);\n\n const\n C0 = reinterpret(0x3FAC6AF84B912394), // 0x1.c6af84b912394p-5\n C1 = reinterpret(0x3FCEBFCE50FAC4F3), // 0x1.ebfce50fac4f3p-3\n C2 = reinterpret(0x3FE62E42FF0C52D6); // 0x1.62e42ff0c52d6p-1\n\n var xd = x;\n var ix = reinterpret(x);\n var ux = ix >> 20 & 0x7FF;\n if (ux >= 0x430) {\n // |x| >= 128 or x is nan.\n if (ix == 0xFF800000) return 0; // x == -Inf -> 0\n if (ux >= 0x7F8) return x + x; // x == Inf/NaN -> Inf/NaN\n if (x > 0) return x * Ox127f; // x > 0 -> HugeVal (Owerflow)\n if (x <= -150) return 0; // x <= -150 -> 0 (Underflow)\n }\n\n // x = k/N + r with r in [-1/(2N), 1/(2N)] and int k.\n var kd = xd + shift;\n var ki = reinterpret(kd);\n var r = xd - (kd - shift);\n var t: u64, y: f64, s: f64;\n\n // exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1)\n t = load(EXP2F_DATA_TAB + ((ki & N_MASK) << alignof()));\n t += ki << (52 - EXP2F_TABLE_BITS);\n s = reinterpret(t);\n y = C2 * r + 1;\n y += (C0 * r + C1) * (r * r);\n y *= s;\n\n return y;\n}\n\n// ULP error: 0.502 (nearest rounding.)\n// Relative error: 1.69 * 2^-34 in [-ln2/64, ln2/64] (before rounding.)\n// Wrong count: 170635 (all nearest rounding wrong results with fma.)\n// @ts-ignore: decorator\n@inline\nexport function expf_lut(x: f32): f32 {\n const\n N = 1 << EXP2F_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000), // 0x1.8p+52\n InvLn2N = reinterpret(0x3FF71547652B82FE) * N, // 0x1.71547652b82fep+0\n Ox1p127f = reinterpret(0x7F000000);\n\n const\n C0 = reinterpret(0x3FAC6AF84B912394) / N / N / N, // 0x1.c6af84b912394p-5\n C1 = reinterpret(0x3FCEBFCE50FAC4F3) / N / N, // 0x1.ebfce50fac4f3p-3\n C2 = reinterpret(0x3FE62E42FF0C52D6) / N; // 0x1.62e42ff0c52d6p-1\n\n var xd = x;\n var ix = reinterpret(x);\n var ux = ix >> 20 & 0x7FF;\n if (ux >= 0x42B) {\n // |x| >= 88 or x is nan.\n if (ix == 0xFF800000) return 0; // x == -Inf -> 0\n if (ux >= 0x7F8) return x + x; // x == Inf/NaN -> Inf/NaN\n if (x > reinterpret(0x42B17217)) return x * Ox1p127f; // x > log(0x1p128) ~= 88.72 -> HugeVal (Owerflow)\n if (x < reinterpret(0xC2CFF1B4)) return 0; // x < log(0x1p-150) ~= -103.97 -> 0 (Underflow)\n }\n\n // x*N/Ln2 = k + r with r in [-1/2, 1/2] and int k.\n var z = InvLn2N * xd;\n\n // Round and convert z to int, the result is in [-150*N, 128*N] and\n // ideally ties-to-even rule is used, otherwise the magnitude of r\n // can be bigger which gives larger approximation error.\n var kd = (z + shift);\n var ki = reinterpret(kd);\n var r = z - (kd - shift);\n var s: f64, y: f64, t: u64;\n\n // exp(x) = 2^(k/N) * 2^(r/N) ~= s * (C0*r^3 + C1*r^2 + C2*r + 1)\n t = load(EXP2F_DATA_TAB + ((ki & N_MASK) << alignof()));\n t += ki << (52 - EXP2F_TABLE_BITS);\n s = reinterpret(t);\n z = C0 * r + C1;\n y = C2 * r + 1;\n y += z * (r * r);\n y *= s;\n\n return y;\n}\n\n//\n// Lookup data for log2f\n//\n\n// @ts-ignore: decorator\n@inline const LOG2F_TABLE_BITS = 4;\n\n// @ts-ignore: decorator\n@lazy @inline const LOG2F_DATA_TAB = memory.data([\n reinterpret(0x3FF661EC79F8F3BE), reinterpret(0xBFDEFEC65B963019), // 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2,\n reinterpret(0x3FF571ED4AAF883D), reinterpret(0xBFDB0B6832D4FCA4), // 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2,\n reinterpret(0x3FF49539F0F010B0), reinterpret(0xBFD7418B0A1FB77B), // 0x1.49539f0f010bp+0 , -0x1.7418b0a1fb77bp-2,\n reinterpret(0x3FF3C995B0B80385), reinterpret(0xBFD39DE91A6DCF7B), // 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2,\n reinterpret(0x3FF30D190C8864A5), reinterpret(0xBFD01D9BF3F2B631), // 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2,\n reinterpret(0x3FF25E227B0B8EA0), reinterpret(0xBFC97C1D1B3B7AF0), // 0x1.25e227b0b8eap+0 , -0x1.97c1d1b3b7afp-3 ,\n reinterpret(0x3FF1BB4A4A1A343F), reinterpret(0xBFC2F9E393AF3C9F), // 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3,\n reinterpret(0x3FF12358F08AE5BA), reinterpret(0xBFB960CBBF788D5C), // 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4,\n reinterpret(0x3FF0953F419900A7), reinterpret(0xBFAA6F9DB6475FCE), // 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5,\n reinterpret(0x3FF0000000000000), 0, // 0x1p+0, 0x0,\n reinterpret(0x3FEE608CFD9A47AC), reinterpret(0x3FB338CA9F24F53D), // 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4,\n reinterpret(0x3FECA4B31F026AA0), reinterpret(0x3FC476A9543891BA), // 0x1.ca4b31f026aap-1 , 0x1.476a9543891bap-3,\n reinterpret(0x3FEB2036576AFCE6), reinterpret(0x3FCE840B4AC4E4D2), // 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3,\n reinterpret(0x3FE9C2D163A1AA2D), reinterpret(0x3FD40645F0C6651C), // 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2,\n reinterpret(0x3FE886E6037841ED), reinterpret(0x3FD88E9C2C1B9FF8), // 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2,\n reinterpret(0x3FE767DCF5534862), reinterpret(0x3FDCE0A44EB17BCC) // 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2\n]);\n\n// ULP error: 0.752 (nearest rounding.)\n// Relative error: 1.9 * 2^-26 (before rounding.)\n// @ts-ignore: decorator\n@inline\nexport function log2f_lut(x: f32): f32 {\n const\n N_MASK = (1 << LOG2F_TABLE_BITS) - 1,\n Ox1p23f = reinterpret(0x4B000000); // 0x1p23f\n\n const\n A0 = reinterpret(0xBFD712B6F70A7E4D), // -0x1.712b6f70a7e4dp-2\n A1 = reinterpret(0x3FDECABF496832E0), // 0x1.ecabf496832ep-2\n A2 = reinterpret(0xBFE715479FFAE3DE), // -0x1.715479ffae3dep-1\n A3 = reinterpret(0x3FF715475F35C8B8); // 0x1.715475f35c8b8p0\n\n var ux = reinterpret(x);\n // Fix sign of zero with downward rounding when x==1.\n // if (WANT_ROUNDING && predict_false(ix == 0x3f800000)) return 0;\n if (ux - 0x00800000 >= 0x7F800000 - 0x00800000) {\n // x < 0x1p-126 or inf or nan.\n if (ux * 2 == 0) return -Infinity;\n if (ux == 0x7F800000) return x; // log2(inf) == inf.\n if ((ux >> 31) || ux * 2 >= 0xFF000000) return (x - x) / (x - x);\n // x is subnormal, normalize it.\n ux = reinterpret(x * Ox1p23f);\n ux -= 23 << 23;\n }\n // x = 2^k z; where z is in range [OFF,2*OFF] and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ux - 0x3F330000;\n var i = (tmp >> (23 - LOG2F_TABLE_BITS)) & N_MASK;\n var top = tmp & 0xFF800000;\n var iz = ux - top;\n var k = tmp >> 23;\n\n var invc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 0 << alignof());\n var logc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 1 << alignof());\n var z = reinterpret(iz);\n\n // log2(x) = log1p(z/c-1)/ln2 + log2(c) + k\n var r = z * invc - 1;\n var y0 = logc + k;\n\n // Pipelined polynomial evaluation to approximate log1p(r)/ln2.\n var y = A1 * r + A2;\n var p = A3 * r + y0;\n var r2 = r * r;\n y += A0 * r2;\n y = y * r2 + p;\n\n return y;\n}\n\n//\n// Lookup data for logf. See: https://git.musl-libc.org/cgit/musl/tree/src/math/logf.c\n//\n\n// @ts-ignore: decorator\n@inline const LOGF_TABLE_BITS = 4;\n\n// @ts-ignore: decorator\n@lazy @inline const LOGF_DATA_TAB = memory.data([\n reinterpret(0x3FF661EC79F8F3BE), reinterpret(0xBFD57BF7808CAADE), // 0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2,\n reinterpret(0x3FF571ED4AAF883D), reinterpret(0xBFD2BEF0A7C06DDB), // 0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2,\n reinterpret(0x3FF49539F0F010B0), reinterpret(0xBFD01EAE7F513A67), // 0x1.49539f0f010bp+0 , -0x1.01eae7f513a67p-2,\n reinterpret(0x3FF3C995B0B80385), reinterpret(0xBFCB31D8A68224E9), // 0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3,\n reinterpret(0x3FF30D190C8864A5), reinterpret(0xBFC6574F0AC07758), // 0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3,\n reinterpret(0x3FF25E227B0B8EA0), reinterpret(0xBFC1AA2BC79C8100), // 0x1.25e227b0b8eap+0 , -0x1.1aa2bc79c81p-3 ,\n reinterpret(0x3FF1BB4A4A1A343F), reinterpret(0xBFBA4E76CE8C0E5E), // 0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4,\n reinterpret(0x3FF12358F08AE5BA), reinterpret(0xBFB1973C5A611CCC), // 0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4,\n reinterpret(0x3FF0953F419900A7), reinterpret(0xBFA252F438E10C1E), // 0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5,\n reinterpret(0x3FF0000000000000), 0, // 0x1p+0, 0,\n reinterpret(0x3FEE608CFD9A47AC), reinterpret(0x3FAAA5AA5DF25984), // 0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5,\n reinterpret(0x3FECA4B31F026AA0), reinterpret(0x3FBC5E53AA362EB4), // 0x1.ca4b31f026aap-1 , 0x1.c5e53aa362eb4p-4,\n reinterpret(0x3FEB2036576AFCE6), reinterpret(0x3FC526E57720DB08), // 0x1.b2036576afce6p-1, 0x1.526e57720db08p-3,\n reinterpret(0x3FE9C2D163A1AA2D), reinterpret(0x3FCBC2860D224770), // 0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3 ,\n reinterpret(0x3FE886E6037841ED), reinterpret(0x3FD1058BC8A07EE1), // 0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2,\n reinterpret(0x3FE767DCF5534862), reinterpret(0x3FD4043057B6EE09) // 0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2\n]);\n\n// ULP error: 0.818 (nearest rounding.)\n// Relative error: 1.957 * 2^-26 (before rounding.)\n// @ts-ignore: decorator\n@inline\nexport function logf_lut(x: f32): f32 {\n const\n N_MASK = (1 << LOGF_TABLE_BITS) - 1,\n Ox1p23f = reinterpret(0x4B000000); // 0x1p23f\n\n const\n Ln2 = reinterpret(0x3FE62E42FEFA39EF), // 0x1.62e42fefa39efp-1;\n A0 = reinterpret(0xBFD00EA348B88334), // -0x1.00ea348b88334p-2\n A1 = reinterpret(0x3FD5575B0BE00B6A), // 0x1.5575b0be00b6ap-2\n A2 = reinterpret(0xBFDFFFFEF20A4123); // -0x1.ffffef20a4123p-2\n\n var ux = reinterpret(x);\n // Fix sign of zero with downward rounding when x==1.\n // if (WANT_ROUNDING && ux == 0x3f800000) return 0;\n if (ux - 0x00800000 >= 0x7F800000 - 0x00800000) {\n // x < 0x1p-126 or inf or nan.\n if ((ux << 1) == 0) return -Infinity;\n if (ux == 0x7F800000) return x; // log(inf) == inf.\n if ((ux >> 31) || (ux << 1) >= 0xFF000000) return (x - x) / (x - x);\n // x is subnormal, normalize it.\n ux = reinterpret(x * Ox1p23f);\n ux -= 23 << 23;\n }\n // x = 2^k z; where z is in range [OFF,2*OFF] and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ux - 0x3F330000;\n var i = (tmp >> (23 - LOGF_TABLE_BITS)) & N_MASK;\n var k = tmp >> 23;\n var iz = ux - (tmp & 0x1FF << 23);\n\n var invc = load(LOGF_DATA_TAB + (i << (1 + alignof())), 0 << alignof());\n var logc = load(LOGF_DATA_TAB + (i << (1 + alignof())), 1 << alignof());\n\n var z = reinterpret(iz);\n\n // log(x) = log1p(z/c-1) + log(c) + k*Ln2\n var r = z * invc - 1;\n var y0 = logc + k * Ln2;\n\n // Pipelined polynomial evaluation to approximate log1p(r).\n var r2 = r * r;\n var y = A1 * r + A2;\n y += A0 * r2;\n y = y * r2 + (y0 + r);\n\n return y;\n}\n\n//\n// Lookup data for powf. See: https://git.musl-libc.org/cgit/musl/tree/src/math/powf.c\n//\n\n// @ts-ignore: decorator\n@inline\nfunction zeroinfnanf(ux: u32): bool {\n return (ux << 1) - 1 >= (0x7f800000 << 1) - 1;\n}\n\n// Returns 0 if not int, 1 if odd int, 2 if even int. The argument is\n// the bit representation of a non-zero finite floating-point value.\n// @ts-ignore: decorator\n@inline\nfunction checkintf(iy: u32): i32 {\n var e = iy >> 23 & 0xFF;\n if (e < 0x7F ) return 0;\n if (e > 0x7F + 23) return 2;\n e = 1 << (0x7F + 23 - e);\n if (iy & (e - 1)) return 0;\n if (iy & e ) return 1;\n return 2;\n}\n\n// Subnormal input is normalized so ix has negative biased exponent.\n// Output is multiplied by N (POWF_SCALE) if TOINT_INTRINICS is set.\n// @ts-ignore: decorator\n@inline\nfunction log2f_inline(ux: u32): f64 {\n const N_MASK = (1 << LOG2F_TABLE_BITS) - 1;\n\n const\n A0 = reinterpret(0x3FD27616C9496E0B), // 0x1.27616c9496e0bp-2\n A1 = reinterpret(0xBFD71969A075C67A), // -0x1.71969a075c67ap-2\n A2 = reinterpret(0x3FDEC70A6CA7BADD), // 0x1.ec70a6ca7baddp-2\n A3 = reinterpret(0xBFE7154748BEF6C8), // -0x1.7154748bef6c8p-1\n A4 = reinterpret(0x3FF71547652AB82B); // 0x1.71547652ab82bp+0\n\n // x = 2^k z; where z is in range [OFF,2*OFF] and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ux - 0x3F330000;\n var i = ((tmp >> (23 - LOG2F_TABLE_BITS)) & N_MASK);\n var top = tmp & 0xFF800000;\n var uz = ux - top;\n var k = (top >> 23);\n\n var invc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 0 << alignof());\n var logc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 1 << alignof());\n var z = reinterpret(uz);\n\n // log2(x) = log1p(z/c-1)/ln2 + log2(c) + k\n var r = z * invc - 1;\n var y0 = logc + k;\n\n // Pipelined polynomial evaluation to approximate log1p(r)/ln2.\n var y = A0 * r + A1;\n var p = A2 * r + A3;\n var q = A4 * r + y0;\n\n r *= r;\n q += p * r;\n y = y * (r * r) + q;\n\n return y;\n}\n\n// The output of log2 and thus the input of exp2 is either scaled by N\n// (in case of fast toint intrinsics) or not. The unscaled xd must be\n// in [-1021,1023], sign_bias sets the sign of the result.\n// @ts-ignore: decorator\n@inline\nfunction exp2f_inline(xd: f64, signBias: u32): f32 {\n const\n N = 1 << EXP2F_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000) / N; // 0x1.8p+52\n\n const\n C0 = reinterpret(0x3FAC6AF84B912394), // 0x1.c6af84b912394p-5\n C1 = reinterpret(0x3FCEBFCE50FAC4F3), // 0x1.ebfce50fac4f3p-3\n C2 = reinterpret(0x3FE62E42FF0C52D6); // 0x1.62e42ff0c52d6p-1\n\n // x = k/N + r with r in [-1/(2N), 1/(2N)]\n var kd = (xd + shift);\n var ki = reinterpret(kd);\n var r = xd - (kd - shift);\n var t: u64, z: f64, y: f64, s: f64;\n\n // exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1)\n t = load(EXP2F_DATA_TAB + ((ki & N_MASK) << alignof()));\n t += (ki + signBias) << (52 - EXP2F_TABLE_BITS);\n s = reinterpret(t);\n z = C0 * r + C1;\n y = C2 * r + 1;\n y += z * (r * r);\n y *= s;\n return y;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction xflowf(sign: u32, y: f32): f32 {\n return select(-y, y, sign) * y;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction oflowf(sign: u32): f32 {\n return xflowf(sign, reinterpret(0x70000000)); // 0x1p97f\n}\n\n// @ts-ignore: decorator\n@inline\nfunction uflowf(sign: u32): f32 {\n return xflowf(sign, reinterpret(0x10000000)); // 0x1p-95f\n}\n\n// @ts-ignore: decorator\n@inline\nexport function powf_lut(x: f32, y: f32): f32 {\n const\n Ox1p23f = reinterpret(0x4B000000), // 0x1p23f\n UPPER_LIMIT = reinterpret(0x405FFFFFFFD1D571), // 0x1.fffffffd1d571p+6\n LOWER_LIMIT = -150.0,\n SIGN_BIAS = 1 << (EXP2F_TABLE_BITS + 11);\n\n var signBias: u32 = 0;\n var ix = reinterpret(x);\n var iy = reinterpret(y);\n var ny = 0;\n\n if (i32(ix - 0x00800000 >= 0x7f800000 - 0x00800000) | (ny = i32(zeroinfnanf(iy)))) {\n // Either (x < 0x1p-126 or inf or nan) or (y is 0 or inf or nan).\n if (ny) {\n if ((iy << 1) == 0) return 1.0;\n if (ix == 0x3F800000) return NaN; // original: 1.0\n if ((ix << 1) > (0x7F800000 << 1) || (iy << 1) > (0x7F800000 << 1)) return x + y;\n if ((ix << 1) == (0x3F800000 << 1)) return NaN; // original: 1.0\n if (((ix << 1) < (0x3F800000 << 1)) == !(iy >> 31)) return 0; // |x| < 1 && y==inf or |x| > 1 && y==-inf.\n return y * y;\n }\n if (zeroinfnanf(ix)) {\n let x2 = x * x;\n if ((ix >> 31) && checkintf(iy) == 1) x2 = -x2;\n return iy >> 31 ? 1 / x2 : x2;\n }\n // x and y are non-zero finite.\n if (ix >> 31) {\n // Finite x < 0.\n let yint = checkintf(iy);\n if (yint == 0) return (x - x) / (x - x);\n if (yint == 1) signBias = SIGN_BIAS;\n ix &= 0x7FFFFFFF;\n }\n if (ix < 0x00800000) {\n // Normalize subnormal x so exponent becomes negative.\n ix = reinterpret(x * Ox1p23f);\n ix &= 0x7FFFFFFF;\n ix -= 23 << 23;\n }\n }\n var logx = log2f_inline(ix);\n var ylogx = y * logx; // cannot overflow, y is single prec.\n if ((reinterpret(ylogx) >> 47 & 0xFFFF) >= 0x80BF) { // reinterpret(126.0) >> 47\n // |y * log(x)| >= 126\n if (ylogx > UPPER_LIMIT) return oflowf(signBias); // overflow\n if (ylogx <= LOWER_LIMIT) return uflowf(signBias); // underflow\n }\n return exp2f_inline(ylogx, signBias);\n}\n\n//\n// Lookup data for exp. See: https://git.musl-libc.org/cgit/musl/tree/src/math/exp.c\n//\n\n// @ts-ignore: decorator\n@inline const EXP_TABLE_BITS = 7;\n\n// @ts-ignore: decorator\n@lazy @inline const EXP_DATA_TAB = memory.data([\n 0x0000000000000000, 0x3FF0000000000000,\n 0x3C9B3B4F1A88BF6E, 0x3FEFF63DA9FB3335,\n 0xBC7160139CD8DC5D, 0x3FEFEC9A3E778061,\n 0xBC905E7A108766D1, 0x3FEFE315E86E7F85,\n 0x3C8CD2523567F613, 0x3FEFD9B0D3158574,\n 0xBC8BCE8023F98EFA, 0x3FEFD06B29DDF6DE,\n 0x3C60F74E61E6C861, 0x3FEFC74518759BC8,\n 0x3C90A3E45B33D399, 0x3FEFBE3ECAC6F383,\n 0x3C979AA65D837B6D, 0x3FEFB5586CF9890F,\n 0x3C8EB51A92FDEFFC, 0x3FEFAC922B7247F7,\n 0x3C3EBE3D702F9CD1, 0x3FEFA3EC32D3D1A2,\n 0xBC6A033489906E0B, 0x3FEF9B66AFFED31B,\n 0xBC9556522A2FBD0E, 0x3FEF9301D0125B51,\n 0xBC5080EF8C4EEA55, 0x3FEF8ABDC06C31CC,\n 0xBC91C923B9D5F416, 0x3FEF829AAEA92DE0,\n 0x3C80D3E3E95C55AF, 0x3FEF7A98C8A58E51,\n 0xBC801B15EAA59348, 0x3FEF72B83C7D517B,\n 0xBC8F1FF055DE323D, 0x3FEF6AF9388C8DEA,\n 0x3C8B898C3F1353BF, 0x3FEF635BEB6FCB75,\n 0xBC96D99C7611EB26, 0x3FEF5BE084045CD4,\n 0x3C9AECF73E3A2F60, 0x3FEF54873168B9AA,\n 0xBC8FE782CB86389D, 0x3FEF4D5022FCD91D,\n 0x3C8A6F4144A6C38D, 0x3FEF463B88628CD6,\n 0x3C807A05B0E4047D, 0x3FEF3F49917DDC96,\n 0x3C968EFDE3A8A894, 0x3FEF387A6E756238,\n 0x3C875E18F274487D, 0x3FEF31CE4FB2A63F,\n 0x3C80472B981FE7F2, 0x3FEF2B4565E27CDD,\n 0xBC96B87B3F71085E, 0x3FEF24DFE1F56381,\n 0x3C82F7E16D09AB31, 0x3FEF1E9DF51FDEE1,\n 0xBC3D219B1A6FBFFA, 0x3FEF187FD0DAD990,\n 0x3C8B3782720C0AB4, 0x3FEF1285A6E4030B,\n 0x3C6E149289CECB8F, 0x3FEF0CAFA93E2F56,\n 0x3C834D754DB0ABB6, 0x3FEF06FE0A31B715,\n 0x3C864201E2AC744C, 0x3FEF0170FC4CD831,\n 0x3C8FDD395DD3F84A, 0x3FEEFC08B26416FF,\n 0xBC86A3803B8E5B04, 0x3FEEF6C55F929FF1,\n 0xBC924AEDCC4B5068, 0x3FEEF1A7373AA9CB,\n 0xBC9907F81B512D8E, 0x3FEEECAE6D05D866,\n 0xBC71D1E83E9436D2, 0x3FEEE7DB34E59FF7,\n 0xBC991919B3CE1B15, 0x3FEEE32DC313A8E5,\n 0x3C859F48A72A4C6D, 0x3FEEDEA64C123422,\n 0xBC9312607A28698A, 0x3FEEDA4504AC801C,\n 0xBC58A78F4817895B, 0x3FEED60A21F72E2A,\n 0xBC7C2C9B67499A1B, 0x3FEED1F5D950A897,\n 0x3C4363ED60C2AC11, 0x3FEECE086061892D,\n 0x3C9666093B0664EF, 0x3FEECA41ED1D0057,\n 0x3C6ECCE1DAA10379, 0x3FEEC6A2B5C13CD0,\n 0x3C93FF8E3F0F1230, 0x3FEEC32AF0D7D3DE,\n 0x3C7690CEBB7AAFB0, 0x3FEEBFDAD5362A27,\n 0x3C931DBDEB54E077, 0x3FEEBCB299FDDD0D,\n 0xBC8F94340071A38E, 0x3FEEB9B2769D2CA7,\n 0xBC87DECCDC93A349, 0x3FEEB6DAA2CF6642,\n 0xBC78DEC6BD0F385F, 0x3FEEB42B569D4F82,\n 0xBC861246EC7B5CF6, 0x3FEEB1A4CA5D920F,\n 0x3C93350518FDD78E, 0x3FEEAF4736B527DA,\n 0x3C7B98B72F8A9B05, 0x3FEEAD12D497C7FD,\n 0x3C9063E1E21C5409, 0x3FEEAB07DD485429,\n 0x3C34C7855019C6EA, 0x3FEEA9268A5946B7,\n 0x3C9432E62B64C035, 0x3FEEA76F15AD2148,\n 0xBC8CE44A6199769F, 0x3FEEA5E1B976DC09,\n 0xBC8C33C53BEF4DA8, 0x3FEEA47EB03A5585,\n 0xBC845378892BE9AE, 0x3FEEA34634CCC320,\n 0xBC93CEDD78565858, 0x3FEEA23882552225,\n 0x3C5710AA807E1964, 0x3FEEA155D44CA973,\n 0xBC93B3EFBF5E2228, 0x3FEEA09E667F3BCD,\n 0xBC6A12AD8734B982, 0x3FEEA012750BDABF,\n 0xBC6367EFB86DA9EE, 0x3FEE9FB23C651A2F,\n 0xBC80DC3D54E08851, 0x3FEE9F7DF9519484,\n 0xBC781F647E5A3ECF, 0x3FEE9F75E8EC5F74,\n 0xBC86EE4AC08B7DB0, 0x3FEE9F9A48A58174,\n 0xBC8619321E55E68A, 0x3FEE9FEB564267C9,\n 0x3C909CCB5E09D4D3, 0x3FEEA0694FDE5D3F,\n 0xBC7B32DCB94DA51D, 0x3FEEA11473EB0187,\n 0x3C94ECFD5467C06B, 0x3FEEA1ED0130C132,\n 0x3C65EBE1ABD66C55, 0x3FEEA2F336CF4E62,\n 0xBC88A1C52FB3CF42, 0x3FEEA427543E1A12,\n 0xBC9369B6F13B3734, 0x3FEEA589994CCE13,\n 0xBC805E843A19FF1E, 0x3FEEA71A4623C7AD,\n 0xBC94D450D872576E, 0x3FEEA8D99B4492ED,\n 0x3C90AD675B0E8A00, 0x3FEEAAC7D98A6699,\n 0x3C8DB72FC1F0EAB4, 0x3FEEACE5422AA0DB,\n 0xBC65B6609CC5E7FF, 0x3FEEAF3216B5448C,\n 0x3C7BF68359F35F44, 0x3FEEB1AE99157736,\n 0xBC93091FA71E3D83, 0x3FEEB45B0B91FFC6,\n 0xBC5DA9B88B6C1E29, 0x3FEEB737B0CDC5E5,\n 0xBC6C23F97C90B959, 0x3FEEBA44CBC8520F,\n 0xBC92434322F4F9AA, 0x3FEEBD829FDE4E50,\n 0xBC85CA6CD7668E4B, 0x3FEEC0F170CA07BA,\n 0x3C71AFFC2B91CE27, 0x3FEEC49182A3F090,\n 0x3C6DD235E10A73BB, 0x3FEEC86319E32323,\n 0xBC87C50422622263, 0x3FEECC667B5DE565,\n 0x3C8B1C86E3E231D5, 0x3FEED09BEC4A2D33,\n 0xBC91BBD1D3BCBB15, 0x3FEED503B23E255D,\n 0x3C90CC319CEE31D2, 0x3FEED99E1330B358,\n 0x3C8469846E735AB3, 0x3FEEDE6B5579FDBF,\n 0xBC82DFCD978E9DB4, 0x3FEEE36BBFD3F37A,\n 0x3C8C1A7792CB3387, 0x3FEEE89F995AD3AD,\n 0xBC907B8F4AD1D9FA, 0x3FEEEE07298DB666,\n 0xBC55C3D956DCAEBA, 0x3FEEF3A2B84F15FB,\n 0xBC90A40E3DA6F640, 0x3FEEF9728DE5593A,\n 0xBC68D6F438AD9334, 0x3FEEFF76F2FB5E47,\n 0xBC91EEE26B588A35, 0x3FEF05B030A1064A,\n 0x3C74FFD70A5FDDCD, 0x3FEF0C1E904BC1D2,\n 0xBC91BDFBFA9298AC, 0x3FEF12C25BD71E09,\n 0x3C736EAE30AF0CB3, 0x3FEF199BDD85529C,\n 0x3C8EE3325C9FFD94, 0x3FEF20AB5FFFD07A,\n 0x3C84E08FD10959AC, 0x3FEF27F12E57D14B,\n 0x3C63CDAF384E1A67, 0x3FEF2F6D9406E7B5,\n 0x3C676B2C6C921968, 0x3FEF3720DCEF9069,\n 0xBC808A1883CCB5D2, 0x3FEF3F0B555DC3FA,\n 0xBC8FAD5D3FFFFA6F, 0x3FEF472D4A07897C,\n 0xBC900DAE3875A949, 0x3FEF4F87080D89F2,\n 0x3C74A385A63D07A7, 0x3FEF5818DCFBA487,\n 0xBC82919E2040220F, 0x3FEF60E316C98398,\n 0x3C8E5A50D5C192AC, 0x3FEF69E603DB3285,\n 0x3C843A59AC016B4B, 0x3FEF7321F301B460,\n 0xBC82D52107B43E1F, 0x3FEF7C97337B9B5F,\n 0xBC892AB93B470DC9, 0x3FEF864614F5A129,\n 0x3C74B604603A88D3, 0x3FEF902EE78B3FF6,\n 0x3C83C5EC519D7271, 0x3FEF9A51FBC74C83,\n 0xBC8FF7128FD391F0, 0x3FEFA4AFA2A490DA,\n 0xBC8DAE98E223747D, 0x3FEFAF482D8E67F1,\n 0x3C8EC3BC41AA2008, 0x3FEFBA1BEE615A27,\n 0x3C842B94C3A9EB32, 0x3FEFC52B376BBA97,\n 0x3C8A64A931D185EE, 0x3FEFD0765B6E4540,\n 0xBC8E37BAE43BE3ED, 0x3FEFDBFDAD9CBE14,\n 0x3C77893B4D91CD9D, 0x3FEFE7C1819E90D8,\n 0x3C5305C14160CC89, 0x3FEFF3C22B8F71F1\n]);\n\n// Handle cases that may overflow or underflow when computing the result that\n// is scale*(1+TMP) without intermediate rounding. The bit representation of\n// scale is in SBITS, however it has a computed exponent that may have\n// overflown into the sign bit so that needs to be adjusted before using it as\n// a double. (int32_t)KI is the k used in the argument reduction and exponent\n// adjustment of scale, positive k here means the result may overflow and\n// negative k means the result may underflow.\n// @ts-ignore: decorator\n@inline\nfunction specialcase(tmp: f64, sbits: u64, ki: u64): f64 {\n const\n Ox1p_1022 = reinterpret(0x0010000000000000), // 0x1p-1022\n Ox1p1009 = reinterpret(0x7F00000000000000); // 0x1p1009\n\n var scale: f64;\n if (!(ki & 0x80000000)) {\n // k > 0, the exponent of scale might have overflowed by <= 460.\n sbits -= u64(1009) << 52;\n scale = reinterpret(sbits);\n return Ox1p1009 * (scale + scale * tmp); // 0x1p1009\n }\n // k < 0, need special care in the subnormal range.\n sbits += u64(1022) << 52;\n // Note: sbits is signed scale.\n scale = reinterpret(sbits);\n var y = scale + scale * tmp;\n if (abs(y) < 1.0) {\n // Round y to the right precision before scaling it into the subnormal\n // range to avoid double rounding that can cause 0.5+E/2 ulp error where\n // E is the worst-case ulp error outside the subnormal range. So this\n // is only useful if the goal is better than 1 ulp worst-case error.\n let one = copysign(1.0, y);\n let lo = scale - y + scale * tmp;\n let hi = one + y;\n lo = one - hi + y + lo;\n y = (hi + lo) - one;\n // Fix the sign of 0.\n if (y == 0.0) y = reinterpret(sbits & 0x8000000000000000);\n }\n return y * Ox1p_1022;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function exp_lut(x: f64): f64 {\n const\n N = 1 << EXP_TABLE_BITS,\n N_MASK = N - 1;\n\n const\n InvLn2N = reinterpret(0x3FF71547652B82FE) * N, // 0x1.71547652b82fep0\n NegLn2hiN = reinterpret(0xBF762E42FEFA0000), // -0x1.62e42fefa0000p-8\n NegLn2loN = reinterpret(0xBD0CF79ABC9E3B3A), // -0x1.cf79abc9e3b3ap-47\n shift = reinterpret(0x4338000000000000); // 0x1.8p52;\n\n const\n C2 = reinterpret(0x3FDFFFFFFFFFFDBD), // __exp_data.poly[0] (0x1.ffffffffffdbdp-2)\n C3 = reinterpret(0x3FC555555555543C), // __exp_data.poly[1] (0x1.555555555543cp-3)\n C4 = reinterpret(0x3FA55555CF172B91), // __exp_data.poly[2] (0x1.55555cf172b91p-5)\n C5 = reinterpret(0x3F81111167A4D017); // __exp_data.poly[3] (0x1.1111167a4d017p-7)\n\n var ux = reinterpret(x);\n var abstop = (ux >> 52 & 0x7FF);\n if (abstop - 0x3C9 >= 0x03F) {\n if (abstop - 0x3C9 >= 0x80000000) return 1;\n if (abstop >= 0x409) {\n if (ux == 0xFFF0000000000000) return 0;\n if (abstop >= 0x7FF) return 1.0 + x;\n return select(0, Infinity, ux >> 63);\n }\n // Large x is special cased below.\n abstop = 0;\n }\n\n // exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]\n // x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]\n var z = InvLn2N * x;\n // #if TOINT_INTRINSICS\n // \tkd = roundtoint(z);\n // \tki = converttoint(z);\n // #elif EXP_USE_TOINT_NARROW\n // \t// z - kd is in [-0.5-2^-16, 0.5] in all rounding modes.\n // var kd = z + shift;\n // var ki = reinterpret(kd) >> 16;\n // var kd = ki;\n // #else\n // z - kd is in [-1, 1] in non-nearest rounding modes.\n var kd = z + shift;\n var ki = reinterpret(kd);\n kd -= shift;\n // #endif\n var r = x + kd * NegLn2hiN + kd * NegLn2loN;\n // 2^(k/N) ~= scale * (1 + tail).\n var idx = ((ki & N_MASK) << 1);\n var top = ki << (52 - EXP_TABLE_BITS);\n\n var tail = reinterpret(load(EXP_DATA_TAB + (idx << alignof()))); // T[idx]\n // This is only a valid scale when -1023*N < k < 1024*N\n var sbits = load(EXP_DATA_TAB + (idx << alignof()), 1 << alignof()) + top; // T[idx + 1]\n // exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1).\n // Evaluation is optimized assuming superscalar pipelined execution.\n var r2 = r * r;\n // Without fma the worst case error is 0.25/N ulp larger.\n // Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp.\n var tmp = tail + r + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5);\n if (abstop == 0) return specialcase(tmp, sbits, ki);\n var scale = reinterpret(sbits);\n // Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there\n // is no spurious underflow here even without fma.\n return scale + scale * tmp;\n}\n\n//\n// Lookup data for exp2. See: https://git.musl-libc.org/cgit/musl/tree/src/math/exp2.c\n//\n\n// Handle cases that may overflow or underflow when computing the result that\n// is scale*(1+TMP) without intermediate rounding. The bit representation of\n// scale is in SBITS, however it has a computed exponent that may have\n// overflown into the sign bit so that needs to be adjusted before using it as\n// a double. (int32_t)KI is the k used in the argument reduction and exponent\n// adjustment of scale, positive k here means the result may overflow and\n// negative k means the result may underflow.\n// @ts-ignore: decorator\n@inline\nfunction specialcase2(tmp: f64, sbits: u64, ki: u64): f64 {\n const Ox1p_1022 = reinterpret(0x10000000000000); // 0x1p-1022\n var scale: f64;\n if ((ki & 0x80000000) == 0) {\n // k > 0, the exponent of scale might have overflowed by 1\n sbits -= u64(1) << 52;\n scale = reinterpret(sbits);\n return 2 * (scale * tmp + scale);\n }\n // k < 0, need special care in the subnormal range\n sbits += u64(1022) << 52;\n scale = reinterpret(sbits);\n var y = scale * tmp + scale;\n if (y < 1.0) {\n // Round y to the right precision before scaling it into the subnormal\n // range to avoid double rounding that can cause 0.5+E/2 ulp error where\n // E is the worst-case ulp error outside the subnormal range. So this\n // is only useful if the goal is better than 1 ulp worst-case error.\n let hi: f64, lo: f64;\n lo = scale - y + scale * tmp;\n hi = 1.0 + y;\n lo = 1.0 - hi + y + lo;\n y = (hi + lo) - 1.0;\n }\n return y * Ox1p_1022;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function exp2_lut(x: f64): f64 {\n const\n N = 1 << EXP_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000) / N; // 0x1.8p52\n\n const\n C1 = reinterpret(0x3FE62E42FEFA39EF), // 0x1.62e42fefa39efp-1\n C2 = reinterpret(0x3FCEBFBDFF82C424), // 0x1.ebfbdff82c424p-3\n C3 = reinterpret(0x3FAC6B08D70CF4B5), // 0x1.c6b08d70cf4b5p-5\n C4 = reinterpret(0x3F83B2ABD24650CC), // 0x1.3b2abd24650ccp-7\n C5 = reinterpret(0x3F55D7E09B4E3A84); // 0x1.5d7e09b4e3a84p-10\n\n var ux = reinterpret(x);\n var abstop = (ux >> 52 & 0x7ff);\n if (abstop - 0x3C9 >= 0x03F) {\n if (abstop - 0x3C9 >= 0x80000000) return 1.0;\n if (abstop >= 0x409) {\n if (ux == 0xFFF0000000000000) return 0;\n if (abstop >= 0x7FF) return 1.0 + x;\n if (!(ux >> 63)) return Infinity;\n else if (ux >= 0xC090CC0000000000) return 0;\n }\n if ((ux << 1) > 0x811A000000000000) abstop = 0; // Large x is special cased below.\n }\n\n // exp2(x) = 2^(k/N) * 2^r, with 2^r in [2^(-1/2N),2^(1/2N)].\n // x = k/N + r, with int k and r in [-1/2N, 1/2N]\n var kd = x + shift;\n var ki = reinterpret(kd);\n kd -= shift; // k/N for int k\n var r = x - kd;\n // 2^(k/N) ~= scale * (1 + tail)\n var idx = ((ki & N_MASK) << 1);\n var top = ki << (52 - EXP_TABLE_BITS);\n\n var tail = reinterpret(load(EXP_DATA_TAB + (idx << alignof()), 0 << alignof())); // T[idx])\n // This is only a valid scale when -1023*N < k < 1024*N\n var sbits = load(EXP_DATA_TAB + (idx << alignof()), 1 << alignof()) + top; // T[idx + 1]\n // exp2(x) = 2^(k/N) * 2^r ~= scale + scale * (tail + 2^r - 1).\n // Evaluation is optimized assuming superscalar pipelined execution\n var r2 = r * r;\n // Without fma the worst case error is 0.5/N ulp larger.\n // Worst case error is less than 0.5+0.86/N+(abs poly error * 2^53) ulp.\n var tmp = tail + r * C1 + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5);\n if (abstop == 0) return specialcase2(tmp, sbits, ki);\n var scale = reinterpret(sbits);\n // Note: tmp == 0 or |tmp| > 2^-65 and scale > 2^-928, so there\n // is no spurious underflow here even without fma.\n return scale * tmp + scale;\n}\n\n//\n// Lookup data for log2. See: https://git.musl-libc.org/cgit/musl/tree/src/math/log2.c\n//\n\n// @ts-ignore: decorator\n@inline const LOG2_TABLE_BITS = 6;\n\n/* Algorithm:\n\n x = 2^k z\n log2(x) = k + log2(c) + log2(z/c)\n log2(z/c) = poly(z/c - 1)\n\nwhere z is in [1.6p-1; 1.6p0] which is split into N subintervals and z falls\ninto the ith one, then table entries are computed as\n\n tab[i].invc = 1/c\n tab[i].logc = (double)log2(c)\n tab2[i].chi = (double)c\n tab2[i].clo = (double)(c - (double)c)\n\nwhere c is near the center of the subinterval and is chosen by trying +-2^29\nfloating point invc candidates around 1/center and selecting one for which\n\n 1) the rounding error in 0x1.8p10 + logc is 0,\n 2) the rounding error in z - chi - clo is < 0x1p-64 and\n 3) the rounding error in (double)log2(c) is minimized (< 0x1p-68).\n\nNote: 1) ensures that k + logc can be computed without rounding error, 2)\nensures that z/c - 1 can be computed as (z - chi - clo)*invc with close to a\nsingle rounding error when there is no fast fma for z*invc - 1, 3) ensures\nthat logc + poly(z/c - 1) has small error, however near x == 1 when\n|log2(x)| < 0x1p-4, this is not enough so that is special cased. */\n\n// @ts-ignore: decorator\n@lazy @inline const LOG2_DATA_TAB1 = memory.data([\n // invc , logc\n reinterpret(0x3FF724286BB1ACF8), reinterpret(0xBFE1095FEECDB000),\n reinterpret(0x3FF6E1F766D2CCA1), reinterpret(0xBFE08494BD76D000),\n reinterpret(0x3FF6A13D0E30D48A), reinterpret(0xBFE00143AEE8F800),\n reinterpret(0x3FF661EC32D06C85), reinterpret(0xBFDEFEC5360B4000),\n reinterpret(0x3FF623FA951198F8), reinterpret(0xBFDDFDD91AB7E000),\n reinterpret(0x3FF5E75BA4CF026C), reinterpret(0xBFDCFFAE0CC79000),\n reinterpret(0x3FF5AC055A214FB8), reinterpret(0xBFDC043811FDA000),\n reinterpret(0x3FF571ED0F166E1E), reinterpret(0xBFDB0B67323AE000),\n reinterpret(0x3FF53909590BF835), reinterpret(0xBFDA152F5A2DB000),\n reinterpret(0x3FF5014FED61ADDD), reinterpret(0xBFD9217F5AF86000),\n reinterpret(0x3FF4CAB88E487BD0), reinterpret(0xBFD8304DB0719000),\n reinterpret(0x3FF49539B4334FEE), reinterpret(0xBFD74189F9A9E000),\n reinterpret(0x3FF460CBDFAFD569), reinterpret(0xBFD6552BB5199000),\n reinterpret(0x3FF42D664EE4B953), reinterpret(0xBFD56B23A29B1000),\n reinterpret(0x3FF3FB01111DD8A6), reinterpret(0xBFD483650F5FA000),\n reinterpret(0x3FF3C995B70C5836), reinterpret(0xBFD39DE937F6A000),\n reinterpret(0x3FF3991C4AB6FD4A), reinterpret(0xBFD2BAA1538D6000),\n reinterpret(0x3FF3698E0CE099B5), reinterpret(0xBFD1D98340CA4000),\n reinterpret(0x3FF33AE48213E7B2), reinterpret(0xBFD0FA853A40E000),\n reinterpret(0x3FF30D191985BDB1), reinterpret(0xBFD01D9C32E73000),\n reinterpret(0x3FF2E025CAB271D7), reinterpret(0xBFCE857DA2FA6000),\n reinterpret(0x3FF2B404CF13CD82), reinterpret(0xBFCCD3C8633D8000),\n reinterpret(0x3FF288B02C7CCB50), reinterpret(0xBFCB26034C14A000),\n reinterpret(0x3FF25E2263944DE5), reinterpret(0xBFC97C1C2F4FE000),\n reinterpret(0x3FF234563D8615B1), reinterpret(0xBFC7D6023F800000),\n reinterpret(0x3FF20B46E33EAF38), reinterpret(0xBFC633A71A05E000),\n reinterpret(0x3FF1E2EEFDCDA3DD), reinterpret(0xBFC494F5E9570000),\n reinterpret(0x3FF1BB4A580B3930), reinterpret(0xBFC2F9E424E0A000),\n reinterpret(0x3FF19453847F2200), reinterpret(0xBFC162595AFDC000),\n reinterpret(0x3FF16E06C0D5D73C), reinterpret(0xBFBF9C9A75BD8000),\n reinterpret(0x3FF1485F47B7E4C2), reinterpret(0xBFBC7B575BF9C000),\n reinterpret(0x3FF12358AD0085D1), reinterpret(0xBFB960C60FF48000),\n reinterpret(0x3FF0FEF00F532227), reinterpret(0xBFB64CE247B60000),\n reinterpret(0x3FF0DB2077D03A8F), reinterpret(0xBFB33F78B2014000),\n reinterpret(0x3FF0B7E6D65980D9), reinterpret(0xBFB0387D1A42C000),\n reinterpret(0x3FF0953EFE7B408D), reinterpret(0xBFAA6F9208B50000),\n reinterpret(0x3FF07325CAC53B83), reinterpret(0xBFA47A954F770000),\n reinterpret(0x3FF05197E40D1B5C), reinterpret(0xBF9D23A8C50C0000),\n reinterpret(0x3FF03091C1208EA2), reinterpret(0xBF916A2629780000),\n reinterpret(0x3FF0101025B37E21), reinterpret(0xBF7720F8D8E80000),\n reinterpret(0x3FEFC07EF9CAA76B), reinterpret(0x3F86FE53B1500000),\n reinterpret(0x3FEF4465D3F6F184), reinterpret(0x3FA11CCCE10F8000),\n reinterpret(0x3FEECC079F84107F), reinterpret(0x3FAC4DFC8C8B8000),\n reinterpret(0x3FEE573A99975AE8), reinterpret(0x3FB3AA321E574000),\n reinterpret(0x3FEDE5D6F0BD3DE6), reinterpret(0x3FB918A0D08B8000),\n reinterpret(0x3FED77B681FF38B3), reinterpret(0x3FBE72E9DA044000),\n reinterpret(0x3FED0CB5724DE943), reinterpret(0x3FC1DCD2507F6000),\n reinterpret(0x3FECA4B2DC0E7563), reinterpret(0x3FC476AB03DEA000),\n reinterpret(0x3FEC3F8EE8D6CB51), reinterpret(0x3FC7074377E22000),\n reinterpret(0x3FEBDD2B4F020C4C), reinterpret(0x3FC98EDE8BA94000),\n reinterpret(0x3FEB7D6C006015CA), reinterpret(0x3FCC0DB86AD2E000),\n reinterpret(0x3FEB20366E2E338F), reinterpret(0x3FCE840AAFCEE000),\n reinterpret(0x3FEAC57026295039), reinterpret(0x3FD0790AB4678000),\n reinterpret(0x3FEA6D01BC2731DD), reinterpret(0x3FD1AC056801C000),\n reinterpret(0x3FEA16D3BC3FF18B), reinterpret(0x3FD2DB11D4FEE000),\n reinterpret(0x3FE9C2D14967FEAD), reinterpret(0x3FD406464EC58000),\n reinterpret(0x3FE970E4F47C9902), reinterpret(0x3FD52DBE093AF000),\n reinterpret(0x3FE920FB3982BCF2), reinterpret(0x3FD651902050D000),\n reinterpret(0x3FE8D30187F759F1), reinterpret(0x3FD771D2CDEAF000),\n reinterpret(0x3FE886E5EBB9F66D), reinterpret(0x3FD88E9C857D9000),\n reinterpret(0x3FE83C97B658B994), reinterpret(0x3FD9A80155E16000),\n reinterpret(0x3FE7F405FFC61022), reinterpret(0x3FDABE186ED3D000),\n reinterpret(0x3FE7AD22181415CA), reinterpret(0x3FDBD0F2AEA0E000),\n reinterpret(0x3FE767DCF99EFF8C), reinterpret(0x3FDCE0A43DBF4000)\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const LOG2_DATA_TAB2 = memory.data([\n // chi , clo\n reinterpret(0x3FE6200012B90A8E), reinterpret(0x3C8904AB0644B605),\n reinterpret(0x3FE66000045734A6), reinterpret(0x3C61FF9BEA62F7A9),\n reinterpret(0x3FE69FFFC325F2C5), reinterpret(0x3C827ECFCB3C90BA),\n reinterpret(0x3FE6E00038B95A04), reinterpret(0x3C88FF8856739326),\n reinterpret(0x3FE71FFFE09994E3), reinterpret(0x3C8AFD40275F82B1),\n reinterpret(0x3FE7600015590E10), reinterpret(0xBC72FD75B4238341),\n reinterpret(0x3FE7A00012655BD5), reinterpret(0x3C7808E67C242B76),\n reinterpret(0x3FE7E0003259E9A6), reinterpret(0xBC6208E426F622B7),\n reinterpret(0x3FE81FFFEDB4B2D2), reinterpret(0xBC8402461EA5C92F),\n reinterpret(0x3FE860002DFAFCC3), reinterpret(0x3C6DF7F4A2F29A1F),\n reinterpret(0x3FE89FFFF78C6B50), reinterpret(0xBC8E0453094995FD),\n reinterpret(0x3FE8E00039671566), reinterpret(0xBC8A04F3BEC77B45),\n reinterpret(0x3FE91FFFE2BF1745), reinterpret(0xBC77FA34400E203C),\n reinterpret(0x3FE95FFFCC5C9FD1), reinterpret(0xBC76FF8005A0695D),\n reinterpret(0x3FE9A0003BBA4767), reinterpret(0x3C70F8C4C4EC7E03),\n reinterpret(0x3FE9DFFFE7B92DA5), reinterpret(0x3C8E7FD9478C4602),\n reinterpret(0x3FEA1FFFD72EFDAF), reinterpret(0xBC6A0C554DCDAE7E),\n reinterpret(0x3FEA5FFFDE04FF95), reinterpret(0x3C867DA98CE9B26B),\n reinterpret(0x3FEA9FFFCA5E8D2B), reinterpret(0xBC8284C9B54C13DE),\n reinterpret(0x3FEADFFFDDAD03EA), reinterpret(0x3C5812C8EA602E3C),\n reinterpret(0x3FEB1FFFF10D3D4D), reinterpret(0xBC8EFADDAD27789C),\n reinterpret(0x3FEB5FFFCE21165A), reinterpret(0x3C53CB1719C61237),\n reinterpret(0x3FEB9FFFD950E674), reinterpret(0x3C73F7D94194CE00),\n reinterpret(0x3FEBE000139CA8AF), reinterpret(0x3C750AC4215D9BC0),\n reinterpret(0x3FEC20005B46DF99), reinterpret(0x3C6BEEA653E9C1C9),\n reinterpret(0x3FEC600040B9F7AE), reinterpret(0xBC7C079F274A70D6),\n reinterpret(0x3FECA0006255FD8A), reinterpret(0xBC7A0B4076E84C1F),\n reinterpret(0x3FECDFFFD94C095D), reinterpret(0x3C88F933F99AB5D7),\n reinterpret(0x3FED1FFFF975D6CF), reinterpret(0xBC582C08665FE1BE),\n reinterpret(0x3FED5FFFA2561C93), reinterpret(0xBC7B04289BD295F3),\n reinterpret(0x3FED9FFF9D228B0C), reinterpret(0x3C870251340FA236),\n reinterpret(0x3FEDE00065BC7E16), reinterpret(0xBC75011E16A4D80C),\n reinterpret(0x3FEE200002F64791), reinterpret(0x3C89802F09EF62E0),\n reinterpret(0x3FEE600057D7A6D8), reinterpret(0xBC7E0B75580CF7FA),\n reinterpret(0x3FEEA00027EDC00C), reinterpret(0xBC8C848309459811),\n reinterpret(0x3FEEE0006CF5CB7C), reinterpret(0xBC8F8027951576F4),\n reinterpret(0x3FEF2000782B7DCC), reinterpret(0xBC8F81D97274538F),\n reinterpret(0x3FEF6000260C450A), reinterpret(0xBC4071002727FFDC),\n reinterpret(0x3FEF9FFFE88CD533), reinterpret(0xBC581BDCE1FDA8B0),\n reinterpret(0x3FEFDFFFD50F8689), reinterpret(0x3C87F91ACB918E6E),\n reinterpret(0x3FF0200004292367), reinterpret(0x3C9B7FF365324681),\n reinterpret(0x3FF05FFFE3E3D668), reinterpret(0x3C86FA08DDAE957B),\n reinterpret(0x3FF0A0000A85A757), reinterpret(0xBC57E2DE80D3FB91),\n reinterpret(0x3FF0E0001A5F3FCC), reinterpret(0xBC91823305C5F014),\n reinterpret(0x3FF11FFFF8AFBAF5), reinterpret(0xBC8BFABB6680BAC2),\n reinterpret(0x3FF15FFFE54D91AD), reinterpret(0xBC9D7F121737E7EF),\n reinterpret(0x3FF1A00011AC36E1), reinterpret(0x3C9C000A0516F5FF),\n reinterpret(0x3FF1E00019C84248), reinterpret(0xBC9082FBE4DA5DA0),\n reinterpret(0x3FF220000FFE5E6E), reinterpret(0xBC88FDD04C9CFB43),\n reinterpret(0x3FF26000269FD891), reinterpret(0x3C8CFE2A7994D182),\n reinterpret(0x3FF2A00029A6E6DA), reinterpret(0xBC700273715E8BC5),\n reinterpret(0x3FF2DFFFE0293E39), reinterpret(0x3C9B7C39DAB2A6F9),\n reinterpret(0x3FF31FFFF7DCF082), reinterpret(0x3C7DF1336EDC5254),\n reinterpret(0x3FF35FFFF05A8B60), reinterpret(0xBC9E03564CCD31EB),\n reinterpret(0x3FF3A0002E0EAECC), reinterpret(0x3C75F0E74BD3A477),\n reinterpret(0x3FF3E000043BB236), reinterpret(0x3C9C7DCB149D8833),\n reinterpret(0x3FF4200002D187FF), reinterpret(0x3C7E08AFCF2D3D28),\n reinterpret(0x3FF460000D387CB1), reinterpret(0x3C820837856599A6),\n reinterpret(0x3FF4A00004569F89), reinterpret(0xBC89FA5C904FBCD2),\n reinterpret(0x3FF4E000043543F3), reinterpret(0xBC781125ED175329),\n reinterpret(0x3FF51FFFCC027F0F), reinterpret(0x3C9883D8847754DC),\n reinterpret(0x3FF55FFFFD87B36F), reinterpret(0xBC8709E731D02807),\n reinterpret(0x3FF59FFFF21DF7BA), reinterpret(0x3C87F79F68727B02),\n reinterpret(0x3FF5DFFFEBFC3481), reinterpret(0xBC9180902E30E93E)\n]);\n\n// @ts-ignore: decorator\n@inline\nexport function log2_lut(x: f64): f64 {\n const N_MASK = (1 << LOG2_TABLE_BITS) - 1;\n\n const\n LO: u64 = 0x3FEEA4AF00000000, // reinterpret(1.0 - 0x1.5b51p-5)\n HI: u64 = 0x3FF0B55900000000; // reinterpret(1.0 + 0x1.6ab2p-5)\n\n const\n InvLn2hi = reinterpret(0x3FF7154765200000), // 0x1.7154765200000p+0\n InvLn2lo = reinterpret(0x3DE705FC2EEFA200), // 0x1.705fc2eefa200p-33\n Ox1p52 = reinterpret(0x4330000000000000); // 0x1p52\n\n const\n B0 = reinterpret(0xBFE71547652B82FE), // -0x1.71547652b82fep-1\n B1 = reinterpret(0x3FDEC709DC3A03F7), // 0x1.ec709dc3a03f7p-2\n B2 = reinterpret(0xBFD71547652B7C3F), // -0x1.71547652b7c3fp-2\n B3 = reinterpret(0x3FD2776C50F05BE4), // 0x1.2776c50f05be4p-2\n B4 = reinterpret(0xBFCEC709DD768FE5), // -0x1.ec709dd768fe5p-3\n B5 = reinterpret(0x3FCA61761EC4E736), // 0x1.a61761ec4e736p-3\n B6 = reinterpret(0xBFC7153FBC64A79B), // -0x1.7153fbc64a79bp-3\n B7 = reinterpret(0x3FC484D154F01B4A), // 0x1.484d154f01b4ap-3\n B8 = reinterpret(0xBFC289E4A72C383C), // -0x1.289e4a72c383cp-3\n B9 = reinterpret(0x3FC0B32F285AEE66); // 0x1.0b32f285aee66p-3\n\n const\n A0 = reinterpret(0xBFE71547652B8339), // -0x1.71547652b8339p-1\n A1 = reinterpret(0x3FDEC709DC3A04BE), // 0x1.ec709dc3a04bep-2\n A2 = reinterpret(0xBFD7154764702FFB), // -0x1.7154764702ffbp-2\n A3 = reinterpret(0x3FD2776C50034C48), // 0x1.2776c50034c48p-2\n A4 = reinterpret(0xBFCEC7B328EA92BC), // -0x1.ec7b328ea92bcp-3\n A5 = reinterpret(0x3FCA6225E117F92E); // 0x1.a6225e117f92ep-3\n\n var ix = reinterpret(x);\n if (ix - LO < HI - LO) {\n let r = x - 1.0;\n // #if __FP_FAST_FMA\n // hi = r * InvLn2hi;\n // lo = r * InvLn2lo + __builtin_fma(r, InvLn2hi, -hi);\n // #else\n let rhi = reinterpret(reinterpret(r) & 0xFFFFFFFF00000000);\n let rlo = r - rhi;\n let hi = rhi * InvLn2hi;\n let lo = rlo * InvLn2hi + r * InvLn2lo;\n // #endif\n let r2 = r * r; // rounding error: 0x1p-62\n let r4 = r2 * r2;\n // Worst-case error is less than 0.54 ULP (0.55 ULP without fma)\n let p = r2 * (B0 + r * B1);\n let y = hi + p;\n lo += hi - y + p;\n lo += r4 * (B2 + r * B3 + r2 * (B4 + r * B5) +\n r4 * (B6 + r * B7 + r2 * (B8 + r * B9)));\n return y + lo;\n }\n var top = (ix >> 48);\n if (top - 0x0010 >= 0x7ff0 - 0x0010) {\n // x < 0x1p-1022 or inf or nan.\n if ((ix << 1) == 0) return -1.0 / (x * x);\n if (ix == 0x7FF0000000000000) return x; // log(inf) == inf\n if ((top & 0x8000) || (top & 0x7FF0) == 0x7FF0) return (x - x) / (x - x);\n // x is subnormal, normalize it.\n ix = reinterpret(x * Ox1p52);\n ix -= u64(52) << 52;\n }\n\n // x = 2^k z; where z is in range [OFF,2*OFF) and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ix - 0x3FE6000000000000;\n var i = ((tmp >> (52 - LOG2_TABLE_BITS)) & N_MASK);\n var k = tmp >> 52;\n var iz = ix - (tmp & 0xFFF0000000000000);\n\n var invc = load(LOG2_DATA_TAB1 + (i << (1 + alignof())), 0 << alignof()); // T[i].invc;\n var logc = load(LOG2_DATA_TAB1 + (i << (1 + alignof())), 1 << alignof()); // T[i].logc;\n var z = reinterpret(iz);\n var kd = k;\n\n // log2(x) = log2(z/c) + log2(c) + k.\n // r ~= z/c - 1, |r| < 1/(2*N).\n // #if __FP_FAST_FMA\n // \t// rounding error: 0x1p-55/N.\n // \tr = __builtin_fma(z, invc, -1.0);\n // \tt1 = r * InvLn2hi;\n // \tt2 = r * InvLn2lo + __builtin_fma(r, InvLn2hi, -t1);\n // #else\n // rounding error: 0x1p-55/N + 0x1p-65.\n var chi = load(LOG2_DATA_TAB2 + (i << (1 + alignof())), 0 << alignof()); // T[i].chi;\n var clo = load(LOG2_DATA_TAB2 + (i << (1 + alignof())), 1 << alignof()); // T[i].clo;\n\n var r = (z - chi - clo) * invc;\n var rhi = reinterpret(reinterpret(r) & 0xFFFFFFFF00000000);\n var rlo = r - rhi;\n var t1 = rhi * InvLn2hi;\n var t2 = rlo * InvLn2hi + r * InvLn2lo;\n // #endif\n\n // hi + lo = r/ln2 + log2(c) + k\n var t3 = kd + logc;\n var hi = t3 + t1;\n var lo = t3 - hi + t1 + t2;\n\n // log2(r+1) = r/ln2 + r^2*poly(r)\n // Evaluation is optimized assuming superscalar pipelined execution\n var r2 = r * r; // rounding error: 0x1p-54/N^2\n // Worst-case error if |y| > 0x1p-4: 0.547 ULP (0.550 ULP without fma).\n // ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma).\n var p = A0 + r * A1 + r2 * (A2 + r * A3) + (r2 * r2) * (A4 + r * A5);\n return lo + r2 * p + hi;\n}\n\n//\n// Lookup data for log. See: https://git.musl-libc.org/cgit/musl/tree/src/math/log.c\n//\n\n// @ts-ignore: decorator\n@inline const LOG_TABLE_BITS = 7;\n\n/* Algorithm:\n\n x = 2^k z\n log(x) = k ln2 + log(c) + log(z/c)\n log(z/c) = poly(z/c - 1)\n\nwhere z is in [1.6p-1; 1.6p0] which is split into N subintervals and z falls\ninto the ith one, then table entries are computed as\n\n tab[i].invc = 1/c\n tab[i].logc = (double)log(c)\n tab2[i].chi = (double)c\n tab2[i].clo = (double)(c - (double)c)\n\nwhere c is near the center of the subinterval and is chosen by trying +-2^29\nfloating point invc candidates around 1/center and selecting one for which\n\n 1) the rounding error in 0x1.8p9 + logc is 0,\n 2) the rounding error in z - chi - clo is < 0x1p-66 and\n 3) the rounding error in (double)log(c) is minimized (< 0x1p-66).\n\nNote: 1) ensures that k*ln2hi + logc can be computed without rounding error,\n2) ensures that z/c - 1 can be computed as (z - chi - clo)*invc with close to\na single rounding error when there is no fast fma for z*invc - 1, 3) ensures\nthat logc + poly(z/c - 1) has small error, however near x == 1 when\n|log(x)| < 0x1p-4, this is not enough so that is special cased.*/\n\n// @ts-ignore: decorator\n@lazy @inline const LOG_DATA_TAB1 = memory.data([\n // invc , logc\n reinterpret(0x3FF734F0C3E0DE9F), reinterpret(0xBFD7CC7F79E69000),\n reinterpret(0x3FF713786A2CE91F), reinterpret(0xBFD76FEEC20D0000),\n reinterpret(0x3FF6F26008FAB5A0), reinterpret(0xBFD713E31351E000),\n reinterpret(0x3FF6D1A61F138C7D), reinterpret(0xBFD6B85B38287800),\n reinterpret(0x3FF6B1490BC5B4D1), reinterpret(0xBFD65D5590807800),\n reinterpret(0x3FF69147332F0CBA), reinterpret(0xBFD602D076180000),\n reinterpret(0x3FF6719F18224223), reinterpret(0xBFD5A8CA86909000),\n reinterpret(0x3FF6524F99A51ED9), reinterpret(0xBFD54F4356035000),\n reinterpret(0x3FF63356AA8F24C4), reinterpret(0xBFD4F637C36B4000),\n reinterpret(0x3FF614B36B9DDC14), reinterpret(0xBFD49DA7FDA85000),\n reinterpret(0x3FF5F66452C65C4C), reinterpret(0xBFD445923989A800),\n reinterpret(0x3FF5D867B5912C4F), reinterpret(0xBFD3EDF439B0B800),\n reinterpret(0x3FF5BABCCB5B90DE), reinterpret(0xBFD396CE448F7000),\n reinterpret(0x3FF59D61F2D91A78), reinterpret(0xBFD3401E17BDA000),\n reinterpret(0x3FF5805612465687), reinterpret(0xBFD2E9E2EF468000),\n reinterpret(0x3FF56397CEE76BD3), reinterpret(0xBFD2941B3830E000),\n reinterpret(0x3FF54725E2A77F93), reinterpret(0xBFD23EC58CDA8800),\n reinterpret(0x3FF52AFF42064583), reinterpret(0xBFD1E9E129279000),\n reinterpret(0x3FF50F22DBB2BDDF), reinterpret(0xBFD1956D2B48F800),\n reinterpret(0x3FF4F38F4734DED7), reinterpret(0xBFD141679AB9F800),\n reinterpret(0x3FF4D843CFDE2840), reinterpret(0xBFD0EDD094EF9800),\n reinterpret(0x3FF4BD3EC078A3C8), reinterpret(0xBFD09AA518DB1000),\n reinterpret(0x3FF4A27FC3E0258A), reinterpret(0xBFD047E65263B800),\n reinterpret(0x3FF4880524D48434), reinterpret(0xBFCFEB224586F000),\n reinterpret(0x3FF46DCE1B192D0B), reinterpret(0xBFCF474A7517B000),\n reinterpret(0x3FF453D9D3391854), reinterpret(0xBFCEA4443D103000),\n reinterpret(0x3FF43A2744B4845A), reinterpret(0xBFCE020D44E9B000),\n reinterpret(0x3FF420B54115F8FB), reinterpret(0xBFCD60A22977F000),\n reinterpret(0x3FF40782DA3EF4B1), reinterpret(0xBFCCC00104959000),\n reinterpret(0x3FF3EE8F5D57FE8F), reinterpret(0xBFCC202956891000),\n reinterpret(0x3FF3D5D9A00B4CE9), reinterpret(0xBFCB81178D811000),\n reinterpret(0x3FF3BD60C010C12B), reinterpret(0xBFCAE2C9CCD3D000),\n reinterpret(0x3FF3A5242B75DAB8), reinterpret(0xBFCA45402E129000),\n reinterpret(0x3FF38D22CD9FD002), reinterpret(0xBFC9A877681DF000),\n reinterpret(0x3FF3755BC5847A1C), reinterpret(0xBFC90C6D69483000),\n reinterpret(0x3FF35DCE49AD36E2), reinterpret(0xBFC87120A645C000),\n reinterpret(0x3FF34679984DD440), reinterpret(0xBFC7D68FB4143000),\n reinterpret(0x3FF32F5CCEFFCB24), reinterpret(0xBFC73CB83C627000),\n reinterpret(0x3FF3187775A10D49), reinterpret(0xBFC6A39A9B376000),\n reinterpret(0x3FF301C8373E3990), reinterpret(0xBFC60B3154B7A000),\n reinterpret(0x3FF2EB4EBB95F841), reinterpret(0xBFC5737D76243000),\n reinterpret(0x3FF2D50A0219A9D1), reinterpret(0xBFC4DC7B8FC23000),\n reinterpret(0x3FF2BEF9A8B7FD2A), reinterpret(0xBFC4462C51D20000),\n reinterpret(0x3FF2A91C7A0C1BAB), reinterpret(0xBFC3B08ABC830000),\n reinterpret(0x3FF293726014B530), reinterpret(0xBFC31B996B490000),\n reinterpret(0x3FF27DFA5757A1F5), reinterpret(0xBFC2875490A44000),\n reinterpret(0x3FF268B39B1D3BBF), reinterpret(0xBFC1F3B9F879A000),\n reinterpret(0x3FF2539D838FF5BD), reinterpret(0xBFC160C8252CA000),\n reinterpret(0x3FF23EB7AAC9083B), reinterpret(0xBFC0CE7F57F72000),\n reinterpret(0x3FF22A012BA940B6), reinterpret(0xBFC03CDC49FEA000),\n reinterpret(0x3FF2157996CC4132), reinterpret(0xBFBF57BDBC4B8000),\n reinterpret(0x3FF201201DD2FC9B), reinterpret(0xBFBE370896404000),\n reinterpret(0x3FF1ECF4494D480B), reinterpret(0xBFBD17983EF94000),\n reinterpret(0x3FF1D8F5528F6569), reinterpret(0xBFBBF9674ED8A000),\n reinterpret(0x3FF1C52311577E7C), reinterpret(0xBFBADC79202F6000),\n reinterpret(0x3FF1B17C74CB26E9), reinterpret(0xBFB9C0C3E7288000),\n reinterpret(0x3FF19E010C2C1AB6), reinterpret(0xBFB8A646B372C000),\n reinterpret(0x3FF18AB07BB670BD), reinterpret(0xBFB78D01B3AC0000),\n reinterpret(0x3FF1778A25EFBCB6), reinterpret(0xBFB674F145380000),\n reinterpret(0x3FF1648D354C31DA), reinterpret(0xBFB55E0E6D878000),\n reinterpret(0x3FF151B990275FDD), reinterpret(0xBFB4485CDEA1E000),\n reinterpret(0x3FF13F0EA432D24C), reinterpret(0xBFB333D94D6AA000),\n reinterpret(0x3FF12C8B7210F9DA), reinterpret(0xBFB22079F8C56000),\n reinterpret(0x3FF11A3028ECB531), reinterpret(0xBFB10E4698622000),\n reinterpret(0x3FF107FBDA8434AF), reinterpret(0xBFAFFA6C6AD20000),\n reinterpret(0x3FF0F5EE0F4E6BB3), reinterpret(0xBFADDA8D4A774000),\n reinterpret(0x3FF0E4065D2A9FCE), reinterpret(0xBFABBCECE4850000),\n reinterpret(0x3FF0D244632CA521), reinterpret(0xBFA9A1894012C000),\n reinterpret(0x3FF0C0A77CE2981A), reinterpret(0xBFA788583302C000),\n reinterpret(0x3FF0AF2F83C636D1), reinterpret(0xBFA5715E67D68000),\n reinterpret(0x3FF09DDB98A01339), reinterpret(0xBFA35C8A49658000),\n reinterpret(0x3FF08CABAF52E7DF), reinterpret(0xBFA149E364154000),\n reinterpret(0x3FF07B9F2F4E28FB), reinterpret(0xBF9E72C082EB8000),\n reinterpret(0x3FF06AB58C358F19), reinterpret(0xBF9A55F152528000),\n reinterpret(0x3FF059EEA5ECF92C), reinterpret(0xBF963D62CF818000),\n reinterpret(0x3FF04949CDD12C90), reinterpret(0xBF9228FB8CAA0000),\n reinterpret(0x3FF038C6C6F0ADA9), reinterpret(0xBF8C317B20F90000),\n reinterpret(0x3FF02865137932A9), reinterpret(0xBF8419355DAA0000),\n reinterpret(0x3FF0182427EA7348), reinterpret(0xBF781203C2EC0000),\n reinterpret(0x3FF008040614B195), reinterpret(0xBF60040979240000),\n reinterpret(0x3FEFE01FF726FA1A), reinterpret(0x3F6FEFF384900000),\n reinterpret(0x3FEFA11CC261EA74), reinterpret(0x3F87DC41353D0000),\n reinterpret(0x3FEF6310B081992E), reinterpret(0x3F93CEA3C4C28000),\n reinterpret(0x3FEF25F63CEEADCD), reinterpret(0x3F9B9FC114890000),\n reinterpret(0x3FEEE9C8039113E7), reinterpret(0x3FA1B0D8CE110000),\n reinterpret(0x3FEEAE8078CBB1AB), reinterpret(0x3FA58A5BD001C000),\n reinterpret(0x3FEE741AA29D0C9B), reinterpret(0x3FA95C8340D88000),\n reinterpret(0x3FEE3A91830A99B5), reinterpret(0x3FAD276AEF578000),\n reinterpret(0x3FEE01E009609A56), reinterpret(0x3FB07598E598C000),\n reinterpret(0x3FEDCA01E577BB98), reinterpret(0x3FB253F5E30D2000),\n reinterpret(0x3FED92F20B7C9103), reinterpret(0x3FB42EDD8B380000),\n reinterpret(0x3FED5CAC66FB5CCE), reinterpret(0x3FB606598757C000),\n reinterpret(0x3FED272CAA5EDE9D), reinterpret(0x3FB7DA76356A0000),\n reinterpret(0x3FECF26E3E6B2CCD), reinterpret(0x3FB9AB434E1C6000),\n reinterpret(0x3FECBE6DA2A77902), reinterpret(0x3FBB78C7BB0D6000),\n reinterpret(0x3FEC8B266D37086D), reinterpret(0x3FBD431332E72000),\n reinterpret(0x3FEC5894BD5D5804), reinterpret(0x3FBF0A3171DE6000),\n reinterpret(0x3FEC26B533BB9F8C), reinterpret(0x3FC067152B914000),\n reinterpret(0x3FEBF583EEECE73F), reinterpret(0x3FC147858292B000),\n reinterpret(0x3FEBC4FD75DB96C1), reinterpret(0x3FC2266ECDCA3000),\n reinterpret(0x3FEB951E0C864A28), reinterpret(0x3FC303D7A6C55000),\n reinterpret(0x3FEB65E2C5EF3E2C), reinterpret(0x3FC3DFC33C331000),\n reinterpret(0x3FEB374867C9888B), reinterpret(0x3FC4BA366B7A8000),\n reinterpret(0x3FEB094B211D304A), reinterpret(0x3FC5933928D1F000),\n reinterpret(0x3FEADBE885F2EF7E), reinterpret(0x3FC66ACD2418F000),\n reinterpret(0x3FEAAF1D31603DA2), reinterpret(0x3FC740F8EC669000),\n reinterpret(0x3FEA82E63FD358A7), reinterpret(0x3FC815C0F51AF000),\n reinterpret(0x3FEA5740EF09738B), reinterpret(0x3FC8E92954F68000),\n reinterpret(0x3FEA2C2A90AB4B27), reinterpret(0x3FC9BB3602F84000),\n reinterpret(0x3FEA01A01393F2D1), reinterpret(0x3FCA8BED1C2C0000),\n reinterpret(0x3FE9D79F24DB3C1B), reinterpret(0x3FCB5B515C01D000),\n reinterpret(0x3FE9AE2505C7B190), reinterpret(0x3FCC2967CCBCC000),\n reinterpret(0x3FE9852EF297CE2F), reinterpret(0x3FCCF635D5486000),\n reinterpret(0x3FE95CBAEEA44B75), reinterpret(0x3FCDC1BD3446C000),\n reinterpret(0x3FE934C69DE74838), reinterpret(0x3FCE8C01B8CFE000),\n reinterpret(0x3FE90D4F2F6752E6), reinterpret(0x3FCF5509C0179000),\n reinterpret(0x3FE8E6528EFFD79D), reinterpret(0x3FD00E6C121FB800),\n reinterpret(0x3FE8BFCE9FCC007C), reinterpret(0x3FD071B80E93D000),\n reinterpret(0x3FE899C0DABEC30E), reinterpret(0x3FD0D46B9E867000),\n reinterpret(0x3FE87427AA2317FB), reinterpret(0x3FD13687334BD000),\n reinterpret(0x3FE84F00ACB39A08), reinterpret(0x3FD1980D67234800),\n reinterpret(0x3FE82A49E8653E55), reinterpret(0x3FD1F8FFE0CC8000),\n reinterpret(0x3FE8060195F40260), reinterpret(0x3FD2595FD7636800),\n reinterpret(0x3FE7E22563E0A329), reinterpret(0x3FD2B9300914A800),\n reinterpret(0x3FE7BEB377DCB5AD), reinterpret(0x3FD3187210436000),\n reinterpret(0x3FE79BAA679725C2), reinterpret(0x3FD377266DEC1800),\n reinterpret(0x3FE77907F2170657), reinterpret(0x3FD3D54FFBAF3000),\n reinterpret(0x3FE756CADBD6130C), reinterpret(0x3FD432EEE32FE000)\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const LOG_DATA_TAB2 = memory.data([\n // chi , clo\n reinterpret(0x3FE61000014FB66B), reinterpret(0x3C7E026C91425B3C),\n reinterpret(0x3FE63000034DB495), reinterpret(0x3C8DBFEA48005D41),\n reinterpret(0x3FE650000D94D478), reinterpret(0x3C8E7FA786D6A5B7),\n reinterpret(0x3FE67000074E6FAD), reinterpret(0x3C61FCEA6B54254C),\n reinterpret(0x3FE68FFFFEDF0FAE), reinterpret(0xBC7C7E274C590EFD),\n reinterpret(0x3FE6B0000763C5BC), reinterpret(0xBC8AC16848DCDA01),\n reinterpret(0x3FE6D0001E5CC1F6), reinterpret(0x3C833F1C9D499311),\n reinterpret(0x3FE6EFFFEB05F63E), reinterpret(0xBC7E80041AE22D53),\n reinterpret(0x3FE710000E869780), reinterpret(0x3C7BFF6671097952),\n reinterpret(0x3FE72FFFFC67E912), reinterpret(0x3C8C00E226BD8724),\n reinterpret(0x3FE74FFFDF81116A), reinterpret(0xBC6E02916EF101D2),\n reinterpret(0x3FE770000F679C90), reinterpret(0xBC67FC71CD549C74),\n reinterpret(0x3FE78FFFFA7EC835), reinterpret(0x3C81BEC19EF50483),\n reinterpret(0x3FE7AFFFFE20C2E6), reinterpret(0xBC707E1729CC6465),\n reinterpret(0x3FE7CFFFED3FC900), reinterpret(0xBC808072087B8B1C),\n reinterpret(0x3FE7EFFFE9261A76), reinterpret(0x3C8DC0286D9DF9AE),\n reinterpret(0x3FE81000049CA3E8), reinterpret(0x3C897FD251E54C33),\n reinterpret(0x3FE8300017932C8F), reinterpret(0xBC8AFEE9B630F381),\n reinterpret(0x3FE850000633739C), reinterpret(0x3C89BFBF6B6535BC),\n reinterpret(0x3FE87000204289C6), reinterpret(0xBC8BBF65F3117B75),\n reinterpret(0x3FE88FFFEBF57904), reinterpret(0xBC89006EA23DCB57),\n reinterpret(0x3FE8B00022BC04DF), reinterpret(0xBC7D00DF38E04B0A),\n reinterpret(0x3FE8CFFFE50C1B8A), reinterpret(0xBC88007146FF9F05),\n reinterpret(0x3FE8EFFFFC918E43), reinterpret(0x3C83817BD07A7038),\n reinterpret(0x3FE910001EFA5FC7), reinterpret(0x3C893E9176DFB403),\n reinterpret(0x3FE9300013467BB9), reinterpret(0x3C7F804E4B980276),\n reinterpret(0x3FE94FFFE6EE076F), reinterpret(0xBC8F7EF0D9FF622E),\n reinterpret(0x3FE96FFFDE3C12D1), reinterpret(0xBC7082AA962638BA),\n reinterpret(0x3FE98FFFF4458A0D), reinterpret(0xBC87801B9164A8EF),\n reinterpret(0x3FE9AFFFDD982E3E), reinterpret(0xBC8740E08A5A9337),\n reinterpret(0x3FE9CFFFED49FB66), reinterpret(0x3C3FCE08C19BE000),\n reinterpret(0x3FE9F00020F19C51), reinterpret(0xBC8A3FAA27885B0A),\n reinterpret(0x3FEA10001145B006), reinterpret(0x3C74FF489958DA56),\n reinterpret(0x3FEA300007BBF6FA), reinterpret(0x3C8CBEAB8A2B6D18),\n reinterpret(0x3FEA500010971D79), reinterpret(0x3C88FECADD787930),\n reinterpret(0x3FEA70001DF52E48), reinterpret(0xBC8F41763DD8ABDB),\n reinterpret(0x3FEA90001C593352), reinterpret(0xBC8EBF0284C27612),\n reinterpret(0x3FEAB0002A4F3E4B), reinterpret(0xBC69FD043CFF3F5F),\n reinterpret(0x3FEACFFFD7AE1ED1), reinterpret(0xBC823EE7129070B4),\n reinterpret(0x3FEAEFFFEE510478), reinterpret(0x3C6A063EE00EDEA3),\n reinterpret(0x3FEB0FFFDB650D5B), reinterpret(0x3C5A06C8381F0AB9),\n reinterpret(0x3FEB2FFFFEAACA57), reinterpret(0xBC79011E74233C1D),\n reinterpret(0x3FEB4FFFD995BADC), reinterpret(0xBC79FF1068862A9F),\n reinterpret(0x3FEB7000249E659C), reinterpret(0x3C8AFF45D0864F3E),\n reinterpret(0x3FEB8FFFF9871640), reinterpret(0x3C7CFE7796C2C3F9),\n reinterpret(0x3FEBAFFFD204CB4F), reinterpret(0xBC63FF27EEF22BC4),\n reinterpret(0x3FEBCFFFD2415C45), reinterpret(0xBC6CFFB7EE3BEA21),\n reinterpret(0x3FEBEFFFF86309DF), reinterpret(0xBC814103972E0B5C),\n reinterpret(0x3FEC0FFFE1B57653), reinterpret(0x3C8BC16494B76A19),\n reinterpret(0x3FEC2FFFF1FA57E3), reinterpret(0xBC64FEEF8D30C6ED),\n reinterpret(0x3FEC4FFFDCBFE424), reinterpret(0xBC843F68BCEC4775),\n reinterpret(0x3FEC6FFFED54B9F7), reinterpret(0x3C847EA3F053E0EC),\n reinterpret(0x3FEC8FFFEB998FD5), reinterpret(0x3C7383068DF992F1),\n reinterpret(0x3FECB0002125219A), reinterpret(0xBC68FD8E64180E04),\n reinterpret(0x3FECCFFFDD94469C), reinterpret(0x3C8E7EBE1CC7EA72),\n reinterpret(0x3FECEFFFEAFDC476), reinterpret(0x3C8EBE39AD9F88FE),\n reinterpret(0x3FED1000169AF82B), reinterpret(0x3C757D91A8B95A71),\n reinterpret(0x3FED30000D0FF71D), reinterpret(0x3C89C1906970C7DA),\n reinterpret(0x3FED4FFFEA790FC4), reinterpret(0xBC580E37C558FE0C),\n reinterpret(0x3FED70002EDC87E5), reinterpret(0xBC7F80D64DC10F44),\n reinterpret(0x3FED900021DC82AA), reinterpret(0xBC747C8F94FD5C5C),\n reinterpret(0x3FEDAFFFD86B0283), reinterpret(0x3C8C7F1DC521617E),\n reinterpret(0x3FEDD000296C4739), reinterpret(0x3C88019EB2FFB153),\n reinterpret(0x3FEDEFFFE54490F5), reinterpret(0x3C6E00D2C652CC89),\n reinterpret(0x3FEE0FFFCDABF694), reinterpret(0xBC7F8340202D69D2),\n reinterpret(0x3FEE2FFFDB52C8DD), reinterpret(0x3C7B00C1CA1B0864),\n reinterpret(0x3FEE4FFFF24216EF), reinterpret(0x3C72FFA8B094AB51),\n reinterpret(0x3FEE6FFFE88A5E11), reinterpret(0xBC57F673B1EFBE59),\n reinterpret(0x3FEE9000119EFF0D), reinterpret(0xBC84808D5E0BC801),\n reinterpret(0x3FEEAFFFDFA51744), reinterpret(0x3C780006D54320B5),\n reinterpret(0x3FEED0001A127FA1), reinterpret(0xBC5002F860565C92),\n reinterpret(0x3FEEF00007BABCC4), reinterpret(0xBC8540445D35E611),\n reinterpret(0x3FEF0FFFF57A8D02), reinterpret(0xBC4FFB3139EF9105),\n reinterpret(0x3FEF30001EE58AC7), reinterpret(0x3C8A81ACF2731155),\n reinterpret(0x3FEF4FFFF5823494), reinterpret(0x3C8A3F41D4D7C743),\n reinterpret(0x3FEF6FFFFCA94C6B), reinterpret(0xBC6202F41C987875),\n reinterpret(0x3FEF8FFFE1F9C441), reinterpret(0x3C777DD1F477E74B),\n reinterpret(0x3FEFAFFFD2E0E37E), reinterpret(0xBC6F01199A7CA331),\n reinterpret(0x3FEFD0001C77E49E), reinterpret(0x3C7181EE4BCEACB1),\n reinterpret(0x3FEFEFFFF7E0C331), reinterpret(0xBC6E05370170875A),\n reinterpret(0x3FF00FFFF465606E), reinterpret(0xBC8A7EAD491C0ADA),\n reinterpret(0x3FF02FFFF3867A58), reinterpret(0xBC977F69C3FCB2E0),\n reinterpret(0x3FF04FFFFDFC0D17), reinterpret(0x3C97BFFE34CB945B),\n reinterpret(0x3FF0700003CD4D82), reinterpret(0x3C820083C0E456CB),\n reinterpret(0x3FF08FFFF9F2CBE8), reinterpret(0xBC6DFFDFBE37751A),\n reinterpret(0x3FF0B000010CDA65), reinterpret(0xBC913F7FAEE626EB),\n reinterpret(0x3FF0D00001A4D338), reinterpret(0x3C807DFA79489FF7),\n reinterpret(0x3FF0EFFFFADAFDFD), reinterpret(0xBC77040570D66BC0),\n reinterpret(0x3FF110000BBAFD96), reinterpret(0x3C8E80D4846D0B62),\n reinterpret(0x3FF12FFFFAE5F45D), reinterpret(0x3C9DBFFA64FD36EF),\n reinterpret(0x3FF150000DD59AD9), reinterpret(0x3C9A0077701250AE),\n reinterpret(0x3FF170000F21559A), reinterpret(0x3C8DFDF9E2E3DEEE),\n reinterpret(0x3FF18FFFFC275426), reinterpret(0x3C910030DC3B7273),\n reinterpret(0x3FF1B000123D3C59), reinterpret(0x3C997F7980030188),\n reinterpret(0x3FF1CFFFF8299EB7), reinterpret(0xBC65F932AB9F8C67),\n reinterpret(0x3FF1EFFFF48AD400), reinterpret(0x3C937FBF9DA75BEB),\n reinterpret(0x3FF210000C8B86A4), reinterpret(0x3C9F806B91FD5B22),\n reinterpret(0x3FF2300003854303), reinterpret(0x3C93FFC2EB9FBF33),\n reinterpret(0x3FF24FFFFFBCF684), reinterpret(0x3C7601E77E2E2E72),\n reinterpret(0x3FF26FFFF52921D9), reinterpret(0x3C7FFCBB767F0C61),\n reinterpret(0x3FF2900014933A3C), reinterpret(0xBC7202CA3C02412B),\n reinterpret(0x3FF2B00014556313), reinterpret(0xBC92808233F21F02),\n reinterpret(0x3FF2CFFFEBFE523B), reinterpret(0xBC88FF7E384FDCF2),\n reinterpret(0x3FF2F0000BB8AD96), reinterpret(0xBC85FF51503041C5),\n reinterpret(0x3FF30FFFFB7AE2AF), reinterpret(0xBC810071885E289D),\n reinterpret(0x3FF32FFFFEAC5F7F), reinterpret(0xBC91FF5D3FB7B715),\n reinterpret(0x3FF350000CA66756), reinterpret(0x3C957F82228B82BD),\n reinterpret(0x3FF3700011FBF721), reinterpret(0x3C8000BAC40DD5CC),\n reinterpret(0x3FF38FFFF9592FB9), reinterpret(0xBC943F9D2DB2A751),\n reinterpret(0x3FF3B00004DDD242), reinterpret(0x3C857F6B707638E1),\n reinterpret(0x3FF3CFFFF5B2C957), reinterpret(0x3C7A023A10BF1231),\n reinterpret(0x3FF3EFFFEAB0B418), reinterpret(0x3C987F6D66B152B0),\n reinterpret(0x3FF410001532AFF4), reinterpret(0x3C67F8375F198524),\n reinterpret(0x3FF4300017478B29), reinterpret(0x3C8301E672DC5143),\n reinterpret(0x3FF44FFFE795B463), reinterpret(0x3C89FF69B8B2895A),\n reinterpret(0x3FF46FFFE80475E0), reinterpret(0xBC95C0B19BC2F254),\n reinterpret(0x3FF48FFFEF6FC1E7), reinterpret(0x3C9B4009F23A2A72),\n reinterpret(0x3FF4AFFFE5BEA704), reinterpret(0xBC94FFB7BF0D7D45),\n reinterpret(0x3FF4D000171027DE), reinterpret(0xBC99C06471DC6A3D),\n reinterpret(0x3FF4F0000FF03EE2), reinterpret(0x3C977F890B85531C),\n reinterpret(0x3FF5100012DC4BD1), reinterpret(0x3C6004657166A436),\n reinterpret(0x3FF530001605277A), reinterpret(0xBC96BFCECE233209),\n reinterpret(0x3FF54FFFECDB704C), reinterpret(0xBC8902720505A1D7),\n reinterpret(0x3FF56FFFEF5F54A9), reinterpret(0x3C9BBFE60EC96412),\n reinterpret(0x3FF5900017E61012), reinterpret(0x3C887EC581AFEF90),\n reinterpret(0x3FF5B00003C93E92), reinterpret(0xBC9F41080ABF0CC0),\n reinterpret(0x3FF5D0001D4919BC), reinterpret(0xBC98812AFB254729),\n reinterpret(0x3FF5EFFFE7B87A89), reinterpret(0xBC947EB780ED6904)\n]);\n\n// @ts-ignore: decorator\n@inline\nexport function log_lut(x: f64): f64 {\n const N_MASK = (1 << LOG_TABLE_BITS) - 1;\n\n const\n B0 = reinterpret(0xBFE0000000000000), // -0x1p-1\n B1 = reinterpret(0x3FD5555555555577), // 0x1.5555555555577p-2\n B2 = reinterpret(0xBFCFFFFFFFFFFDCB), // -0x1.ffffffffffdcbp-3\n B3 = reinterpret(0x3FC999999995DD0C), // 0x1.999999995dd0cp-3\n B4 = reinterpret(0xBFC55555556745A7), // -0x1.55555556745a7p-3\n B5 = reinterpret(0x3FC24924A344DE30), // 0x1.24924a344de3p-3\n B6 = reinterpret(0xBFBFFFFFA4423D65), // -0x1.fffffa4423d65p-4\n B7 = reinterpret(0x3FBC7184282AD6CA), // 0x1.c7184282ad6cap-4\n B8 = reinterpret(0xBFB999EB43B068FF), // -0x1.999eb43b068ffp-4\n B9 = reinterpret(0x3FB78182F7AFD085), // 0x1.78182f7afd085p-4\n B10 = reinterpret(0xBFB5521375D145CD); // -0x1.5521375d145cdp-4\n\n const\n A0 = reinterpret(0xBFE0000000000001), // -0x1.0000000000001p-1\n A1 = reinterpret(0x3FD555555551305B), // 0x1.555555551305bp-2\n A2 = reinterpret(0xBFCFFFFFFFEB4590), // -0x1.fffffffeb459p-3\n A3 = reinterpret(0x3FC999B324F10111), // 0x1.999b324f10111p-3\n A4 = reinterpret(0xBFC55575E506C89F); // -0x1.55575e506c89fp-3\n\n const\n LO: u64 = 0x3FEE000000000000,\n HI: u64 = 0x3FF1090000000000;\n\n const\n Ln2hi = reinterpret(0x3FE62E42FEFA3800), // 0x1.62e42fefa3800p-1\n Ln2lo = reinterpret(0x3D2EF35793C76730), // 0x1.ef35793c76730p-45\n Ox1p27 = reinterpret(0x41A0000000000000), // 0x1p27\n Ox1p52 = reinterpret(0x4330000000000000); // 0x1p52\n\n var ix = reinterpret(x);\n if (ix - LO < HI - LO) {\n let r = x - 1.0;\n let r2 = r * r;\n let r3 = r2 * r;\n let y =\n r3 * (B1 + r * B2 + r2 * B3 +\n r3 * (B4 + r * B5 + r2 * B6 +\n r3 * (B7 + r * B8 + r2 * B9 + r3 * B10)));\n // Worst-case error is around 0.507 ULP\n let w = r * Ox1p27;\n let rhi = r + w - w;\n let rlo = r - rhi;\n w = rhi * rhi * B0; // B[0] == -0.5\n let hi = r + w;\n let lo = r - hi + w;\n lo += B0 * rlo * (rhi + r);\n return y + lo + hi;\n }\n var top = u32(ix >> 48);\n if (top - 0x0010 >= 0x7FF0 - 0x0010) {\n // x < 0x1p-1022 or inf or nan\n if ((ix << 1) == 0) return -1.0 / (x * x);\n if (ix == reinterpret(Infinity)) return x; // log(inf) == inf\n if ((top & 0x8000) || (top & 0x7FF0) == 0x7FF0) return (x - x) / (x - x);\n // x is subnormal, normalize it\n ix = reinterpret(x * Ox1p52);\n ix -= u64(52) << 52;\n }\n\n // x = 2^k z; where z is in range [OFF,2*OFF) and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ix - 0x3FE6000000000000;\n var i = ((tmp >> (52 - LOG_TABLE_BITS)) & N_MASK);\n var k = tmp >> 52;\n var iz = ix - (tmp & (u64(0xFFF) << 52));\n\n var invc = load(LOG_DATA_TAB1 + (i << (1 + alignof())), 0 << alignof()); // T[i].invc;\n var logc = load(LOG_DATA_TAB1 + (i << (1 + alignof())), 1 << alignof()); // T[i].logc;\n var z = reinterpret(iz);\n\n // log(x) = log1p(z/c-1) + log(c) + k*Ln2.\n // r ~= z/c - 1, |r| < 1/(2*N)\n // #if __FP_FAST_FMA\n // \t// rounding error: 0x1p-55/N\n // \tr = __builtin_fma(z, invc, -1.0);\n // #else\n // rounding error: 0x1p-55/N + 0x1p-66\n const chi = load(LOG_DATA_TAB2 + (i << (1 + alignof())), 0 << alignof()); // T2[i].chi\n const clo = load(LOG_DATA_TAB2 + (i << (1 + alignof())), 1 << alignof()); // T2[i].clo\n var r = (z - chi - clo) * invc;\n // #endif\n var kd = k;\n\n // hi + lo = r + log(c) + k*Ln2\n var w = kd * Ln2hi + logc;\n var hi = w + r;\n var lo = w - hi + r + kd * Ln2lo;\n\n // log(x) = lo + (log1p(r) - r) + hi\n var r2 = r * r; // rounding error: 0x1p-54/N^2\n // Worst case error if |y| > 0x1p-5:\n // 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma)\n // Worst case error if |y| > 0x1p-4:\n // 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma).\n return lo + r2 * A0 + r * r2 * (A1 + r * A2 + r2 * (A3 + r * A4)) + hi;\n}\n\n//\n// Lookup data for pow. See: https://git.musl-libc.org/cgit/musl/tree/src/math/pow.c\n//\n\n// @ts-ignore: decorator\n@inline const POW_LOG_TABLE_BITS = 7;\n\n/* Algorithm:\n\n x = 2^k z\n log(x) = k ln2 + log(c) + log(z/c)\n log(z/c) = poly(z/c - 1)\n\nwhere z is in [0x1.69555p-1; 0x1.69555p0] which is split into N subintervals\nand z falls into the ith one, then table entries are computed as\n\n tab[i].invc = 1/c\n tab[i].logc = round(0x1p43*log(c))/0x1p43\n tab[i].logctail = (double)(log(c) - logc)\n\nwhere c is chosen near the center of the subinterval such that 1/c has only a\nfew precision bits so z/c - 1 is exactly representible as double:\n\n 1/c = center < 1 ? round(N/center)/N : round(2*N/center)/N/2\n\nNote: |z/c - 1| < 1/N for the chosen c, |log(c) - logc - logctail| < 0x1p-97,\nthe last few bits of logc are rounded away so k*ln2hi + logc has no rounding\nerror and the interval for z is selected such that near x == 1, where log(x)\nis tiny, large cancellation error is avoided in logc + poly(z/c - 1). */\n\n// @ts-ignore: decorator\n@lazy @inline const POW_LOG_DATA_TAB = memory.data([\n // invc ,pad, logc , logctail\n reinterpret(0x3FF6A00000000000), 0, reinterpret(0xBFD62C82F2B9C800), reinterpret(0x3CFAB42428375680),\n reinterpret(0x3FF6800000000000), 0, reinterpret(0xBFD5D1BDBF580800), reinterpret(0xBD1CA508D8E0F720),\n reinterpret(0x3FF6600000000000), 0, reinterpret(0xBFD5767717455800), reinterpret(0xBD2362A4D5B6506D),\n reinterpret(0x3FF6400000000000), 0, reinterpret(0xBFD51AAD872DF800), reinterpret(0xBCE684E49EB067D5),\n reinterpret(0x3FF6200000000000), 0, reinterpret(0xBFD4BE5F95777800), reinterpret(0xBD041B6993293EE0),\n reinterpret(0x3FF6000000000000), 0, reinterpret(0xBFD4618BC21C6000), reinterpret(0x3D13D82F484C84CC),\n reinterpret(0x3FF5E00000000000), 0, reinterpret(0xBFD404308686A800), reinterpret(0x3CDC42F3ED820B3A),\n reinterpret(0x3FF5C00000000000), 0, reinterpret(0xBFD3A64C55694800), reinterpret(0x3D20B1C686519460),\n reinterpret(0x3FF5A00000000000), 0, reinterpret(0xBFD347DD9A988000), reinterpret(0x3D25594DD4C58092),\n reinterpret(0x3FF5800000000000), 0, reinterpret(0xBFD2E8E2BAE12000), reinterpret(0x3D267B1E99B72BD8),\n reinterpret(0x3FF5600000000000), 0, reinterpret(0xBFD2895A13DE8800), reinterpret(0x3D15CA14B6CFB03F),\n reinterpret(0x3FF5600000000000), 0, reinterpret(0xBFD2895A13DE8800), reinterpret(0x3D15CA14B6CFB03F),\n reinterpret(0x3FF5400000000000), 0, reinterpret(0xBFD22941FBCF7800), reinterpret(0xBD165A242853DA76),\n reinterpret(0x3FF5200000000000), 0, reinterpret(0xBFD1C898C1699800), reinterpret(0xBD1FAFBC68E75404),\n reinterpret(0x3FF5000000000000), 0, reinterpret(0xBFD1675CABABA800), reinterpret(0x3D1F1FC63382A8F0),\n reinterpret(0x3FF4E00000000000), 0, reinterpret(0xBFD1058BF9AE4800), reinterpret(0xBD26A8C4FD055A66),\n reinterpret(0x3FF4C00000000000), 0, reinterpret(0xBFD0A324E2739000), reinterpret(0xBD0C6BEE7EF4030E),\n reinterpret(0x3FF4A00000000000), 0, reinterpret(0xBFD0402594B4D000), reinterpret(0xBCF036B89EF42D7F),\n reinterpret(0x3FF4A00000000000), 0, reinterpret(0xBFD0402594B4D000), reinterpret(0xBCF036B89EF42D7F),\n reinterpret(0x3FF4800000000000), 0, reinterpret(0xBFCFB9186D5E4000), reinterpret(0x3D0D572AAB993C87),\n reinterpret(0x3FF4600000000000), 0, reinterpret(0xBFCEF0ADCBDC6000), reinterpret(0x3D2B26B79C86AF24),\n reinterpret(0x3FF4400000000000), 0, reinterpret(0xBFCE27076E2AF000), reinterpret(0xBD172F4F543FFF10),\n reinterpret(0x3FF4200000000000), 0, reinterpret(0xBFCD5C216B4FC000), reinterpret(0x3D21BA91BBCA681B),\n reinterpret(0x3FF4000000000000), 0, reinterpret(0xBFCC8FF7C79AA000), reinterpret(0x3D27794F689F8434),\n reinterpret(0x3FF4000000000000), 0, reinterpret(0xBFCC8FF7C79AA000), reinterpret(0x3D27794F689F8434),\n reinterpret(0x3FF3E00000000000), 0, reinterpret(0xBFCBC286742D9000), reinterpret(0x3D194EB0318BB78F),\n reinterpret(0x3FF3C00000000000), 0, reinterpret(0xBFCAF3C94E80C000), reinterpret(0x3CBA4E633FCD9066),\n reinterpret(0x3FF3A00000000000), 0, reinterpret(0xBFCA23BC1FE2B000), reinterpret(0xBD258C64DC46C1EA),\n reinterpret(0x3FF3A00000000000), 0, reinterpret(0xBFCA23BC1FE2B000), reinterpret(0xBD258C64DC46C1EA),\n reinterpret(0x3FF3800000000000), 0, reinterpret(0xBFC9525A9CF45000), reinterpret(0xBD2AD1D904C1D4E3),\n reinterpret(0x3FF3600000000000), 0, reinterpret(0xBFC87FA06520D000), reinterpret(0x3D2BBDBF7FDBFA09),\n reinterpret(0x3FF3400000000000), 0, reinterpret(0xBFC7AB890210E000), reinterpret(0x3D2BDB9072534A58),\n reinterpret(0x3FF3400000000000), 0, reinterpret(0xBFC7AB890210E000), reinterpret(0x3D2BDB9072534A58),\n reinterpret(0x3FF3200000000000), 0, reinterpret(0xBFC6D60FE719D000), reinterpret(0xBD10E46AA3B2E266),\n reinterpret(0x3FF3000000000000), 0, reinterpret(0xBFC5FF3070A79000), reinterpret(0xBD1E9E439F105039),\n reinterpret(0x3FF3000000000000), 0, reinterpret(0xBFC5FF3070A79000), reinterpret(0xBD1E9E439F105039),\n reinterpret(0x3FF2E00000000000), 0, reinterpret(0xBFC526E5E3A1B000), reinterpret(0xBD20DE8B90075B8F),\n reinterpret(0x3FF2C00000000000), 0, reinterpret(0xBFC44D2B6CCB8000), reinterpret(0x3D170CC16135783C),\n reinterpret(0x3FF2C00000000000), 0, reinterpret(0xBFC44D2B6CCB8000), reinterpret(0x3D170CC16135783C),\n reinterpret(0x3FF2A00000000000), 0, reinterpret(0xBFC371FC201E9000), reinterpret(0x3CF178864D27543A),\n reinterpret(0x3FF2800000000000), 0, reinterpret(0xBFC29552F81FF000), reinterpret(0xBD248D301771C408),\n reinterpret(0x3FF2600000000000), 0, reinterpret(0xBFC1B72AD52F6000), reinterpret(0xBD2E80A41811A396),\n reinterpret(0x3FF2600000000000), 0, reinterpret(0xBFC1B72AD52F6000), reinterpret(0xBD2E80A41811A396),\n reinterpret(0x3FF2400000000000), 0, reinterpret(0xBFC0D77E7CD09000), reinterpret(0x3D0A699688E85BF4),\n reinterpret(0x3FF2400000000000), 0, reinterpret(0xBFC0D77E7CD09000), reinterpret(0x3D0A699688E85BF4),\n reinterpret(0x3FF2200000000000), 0, reinterpret(0xBFBFEC9131DBE000), reinterpret(0xBD2575545CA333F2),\n reinterpret(0x3FF2000000000000), 0, reinterpret(0xBFBE27076E2B0000), reinterpret(0x3D2A342C2AF0003C),\n reinterpret(0x3FF2000000000000), 0, reinterpret(0xBFBE27076E2B0000), reinterpret(0x3D2A342C2AF0003C),\n reinterpret(0x3FF1E00000000000), 0, reinterpret(0xBFBC5E548F5BC000), reinterpret(0xBD1D0C57585FBE06),\n reinterpret(0x3FF1C00000000000), 0, reinterpret(0xBFBA926D3A4AE000), reinterpret(0x3D253935E85BAAC8),\n reinterpret(0x3FF1C00000000000), 0, reinterpret(0xBFBA926D3A4AE000), reinterpret(0x3D253935E85BAAC8),\n reinterpret(0x3FF1A00000000000), 0, reinterpret(0xBFB8C345D631A000), reinterpret(0x3D137C294D2F5668),\n reinterpret(0x3FF1A00000000000), 0, reinterpret(0xBFB8C345D631A000), reinterpret(0x3D137C294D2F5668),\n reinterpret(0x3FF1800000000000), 0, reinterpret(0xBFB6F0D28AE56000), reinterpret(0xBD269737C93373DA),\n reinterpret(0x3FF1600000000000), 0, reinterpret(0xBFB51B073F062000), reinterpret(0x3D1F025B61C65E57),\n reinterpret(0x3FF1600000000000), 0, reinterpret(0xBFB51B073F062000), reinterpret(0x3D1F025B61C65E57),\n reinterpret(0x3FF1400000000000), 0, reinterpret(0xBFB341D7961BE000), reinterpret(0x3D2C5EDACCF913DF),\n reinterpret(0x3FF1400000000000), 0, reinterpret(0xBFB341D7961BE000), reinterpret(0x3D2C5EDACCF913DF),\n reinterpret(0x3FF1200000000000), 0, reinterpret(0xBFB16536EEA38000), reinterpret(0x3D147C5E768FA309),\n reinterpret(0x3FF1000000000000), 0, reinterpret(0xBFAF0A30C0118000), reinterpret(0x3D2D599E83368E91),\n reinterpret(0x3FF1000000000000), 0, reinterpret(0xBFAF0A30C0118000), reinterpret(0x3D2D599E83368E91),\n reinterpret(0x3FF0E00000000000), 0, reinterpret(0xBFAB42DD71198000), reinterpret(0x3D1C827AE5D6704C),\n reinterpret(0x3FF0E00000000000), 0, reinterpret(0xBFAB42DD71198000), reinterpret(0x3D1C827AE5D6704C),\n reinterpret(0x3FF0C00000000000), 0, reinterpret(0xBFA77458F632C000), reinterpret(0xBD2CFC4634F2A1EE),\n reinterpret(0x3FF0C00000000000), 0, reinterpret(0xBFA77458F632C000), reinterpret(0xBD2CFC4634F2A1EE),\n reinterpret(0x3FF0A00000000000), 0, reinterpret(0xBFA39E87B9FEC000), reinterpret(0x3CF502B7F526FEAA),\n reinterpret(0x3FF0A00000000000), 0, reinterpret(0xBFA39E87B9FEC000), reinterpret(0x3CF502B7F526FEAA),\n reinterpret(0x3FF0800000000000), 0, reinterpret(0xBF9F829B0E780000), reinterpret(0xBD2980267C7E09E4),\n reinterpret(0x3FF0800000000000), 0, reinterpret(0xBF9F829B0E780000), reinterpret(0xBD2980267C7E09E4),\n reinterpret(0x3FF0600000000000), 0, reinterpret(0xBF97B91B07D58000), reinterpret(0xBD288D5493FAA639),\n reinterpret(0x3FF0400000000000), 0, reinterpret(0xBF8FC0A8B0FC0000), reinterpret(0xBCDF1E7CF6D3A69C),\n reinterpret(0x3FF0400000000000), 0, reinterpret(0xBF8FC0A8B0FC0000), reinterpret(0xBCDF1E7CF6D3A69C),\n reinterpret(0x3FF0200000000000), 0, reinterpret(0xBF7FE02A6B100000), reinterpret(0xBD19E23F0DDA40E4),\n reinterpret(0x3FF0200000000000), 0, reinterpret(0xBF7FE02A6B100000), reinterpret(0xBD19E23F0DDA40E4),\n reinterpret(0x3FF0000000000000), 0, 0, 0,\n reinterpret(0x3FF0000000000000), 0, 0, 0,\n reinterpret(0x3FEFC00000000000), 0, reinterpret(0x3F80101575890000), reinterpret(0xBD10C76B999D2BE8),\n reinterpret(0x3FEF800000000000), 0, reinterpret(0x3F90205658938000), reinterpret(0xBD23DC5B06E2F7D2),\n reinterpret(0x3FEF400000000000), 0, reinterpret(0x3F98492528C90000), reinterpret(0xBD2AA0BA325A0C34),\n reinterpret(0x3FEF000000000000), 0, reinterpret(0x3FA0415D89E74000), reinterpret(0x3D0111C05CF1D753),\n reinterpret(0x3FEEC00000000000), 0, reinterpret(0x3FA466AED42E0000), reinterpret(0xBD2C167375BDFD28),\n reinterpret(0x3FEE800000000000), 0, reinterpret(0x3FA894AA149FC000), reinterpret(0xBD197995D05A267D),\n reinterpret(0x3FEE400000000000), 0, reinterpret(0x3FACCB73CDDDC000), reinterpret(0xBD1A68F247D82807),\n reinterpret(0x3FEE200000000000), 0, reinterpret(0x3FAEEA31C006C000), reinterpret(0xBD0E113E4FC93B7B),\n reinterpret(0x3FEDE00000000000), 0, reinterpret(0x3FB1973BD1466000), reinterpret(0xBD25325D560D9E9B),\n reinterpret(0x3FEDA00000000000), 0, reinterpret(0x3FB3BDF5A7D1E000), reinterpret(0x3D2CC85EA5DB4ED7),\n reinterpret(0x3FED600000000000), 0, reinterpret(0x3FB5E95A4D97A000), reinterpret(0xBD2C69063C5D1D1E),\n reinterpret(0x3FED400000000000), 0, reinterpret(0x3FB700D30AEAC000), reinterpret(0x3CEC1E8DA99DED32),\n reinterpret(0x3FED000000000000), 0, reinterpret(0x3FB9335E5D594000), reinterpret(0x3D23115C3ABD47DA),\n reinterpret(0x3FECC00000000000), 0, reinterpret(0x3FBB6AC88DAD6000), reinterpret(0xBD1390802BF768E5),\n reinterpret(0x3FECA00000000000), 0, reinterpret(0x3FBC885801BC4000), reinterpret(0x3D2646D1C65AACD3),\n reinterpret(0x3FEC600000000000), 0, reinterpret(0x3FBEC739830A2000), reinterpret(0xBD2DC068AFE645E0),\n reinterpret(0x3FEC400000000000), 0, reinterpret(0x3FBFE89139DBE000), reinterpret(0xBD2534D64FA10AFD),\n reinterpret(0x3FEC000000000000), 0, reinterpret(0x3FC1178E8227E000), reinterpret(0x3D21EF78CE2D07F2),\n reinterpret(0x3FEBE00000000000), 0, reinterpret(0x3FC1AA2B7E23F000), reinterpret(0x3D2CA78E44389934),\n reinterpret(0x3FEBA00000000000), 0, reinterpret(0x3FC2D1610C868000), reinterpret(0x3D039D6CCB81B4A1),\n reinterpret(0x3FEB800000000000), 0, reinterpret(0x3FC365FCB0159000), reinterpret(0x3CC62FA8234B7289),\n reinterpret(0x3FEB400000000000), 0, reinterpret(0x3FC4913D8333B000), reinterpret(0x3D25837954FDB678),\n reinterpret(0x3FEB200000000000), 0, reinterpret(0x3FC527E5E4A1B000), reinterpret(0x3D2633E8E5697DC7),\n reinterpret(0x3FEAE00000000000), 0, reinterpret(0x3FC6574EBE8C1000), reinterpret(0x3D19CF8B2C3C2E78),\n reinterpret(0x3FEAC00000000000), 0, reinterpret(0x3FC6F0128B757000), reinterpret(0xBD25118DE59C21E1),\n reinterpret(0x3FEAA00000000000), 0, reinterpret(0x3FC7898D85445000), reinterpret(0xBD1C661070914305),\n reinterpret(0x3FEA600000000000), 0, reinterpret(0x3FC8BEAFEB390000), reinterpret(0xBD073D54AAE92CD1),\n reinterpret(0x3FEA400000000000), 0, reinterpret(0x3FC95A5ADCF70000), reinterpret(0x3D07F22858A0FF6F),\n reinterpret(0x3FEA000000000000), 0, reinterpret(0x3FCA93ED3C8AE000), reinterpret(0xBD28724350562169),\n reinterpret(0x3FE9E00000000000), 0, reinterpret(0x3FCB31D8575BD000), reinterpret(0xBD0C358D4EACE1AA),\n reinterpret(0x3FE9C00000000000), 0, reinterpret(0x3FCBD087383BE000), reinterpret(0xBD2D4BC4595412B6),\n reinterpret(0x3FE9A00000000000), 0, reinterpret(0x3FCC6FFBC6F01000), reinterpret(0xBCF1EC72C5962BD2),\n reinterpret(0x3FE9600000000000), 0, reinterpret(0x3FCDB13DB0D49000), reinterpret(0xBD2AFF2AF715B035),\n reinterpret(0x3FE9400000000000), 0, reinterpret(0x3FCE530EFFE71000), reinterpret(0x3CC212276041F430),\n reinterpret(0x3FE9200000000000), 0, reinterpret(0x3FCEF5ADE4DD0000), reinterpret(0xBCCA211565BB8E11),\n reinterpret(0x3FE9000000000000), 0, reinterpret(0x3FCF991C6CB3B000), reinterpret(0x3D1BCBECCA0CDF30),\n reinterpret(0x3FE8C00000000000), 0, reinterpret(0x3FD07138604D5800), reinterpret(0x3CF89CDB16ED4E91),\n reinterpret(0x3FE8A00000000000), 0, reinterpret(0x3FD0C42D67616000), reinterpret(0x3D27188B163CEAE9),\n reinterpret(0x3FE8800000000000), 0, reinterpret(0x3FD1178E8227E800), reinterpret(0xBD2C210E63A5F01C),\n reinterpret(0x3FE8600000000000), 0, reinterpret(0x3FD16B5CCBACF800), reinterpret(0x3D2B9ACDF7A51681),\n reinterpret(0x3FE8400000000000), 0, reinterpret(0x3FD1BF99635A6800), reinterpret(0x3D2CA6ED5147BDB7),\n reinterpret(0x3FE8200000000000), 0, reinterpret(0x3FD214456D0EB800), reinterpret(0x3D0A87DEBA46BAEA),\n reinterpret(0x3FE7E00000000000), 0, reinterpret(0x3FD2BEF07CDC9000), reinterpret(0x3D2A9CFA4A5004F4),\n reinterpret(0x3FE7C00000000000), 0, reinterpret(0x3FD314F1E1D36000), reinterpret(0xBD28E27AD3213CB8),\n reinterpret(0x3FE7A00000000000), 0, reinterpret(0x3FD36B6776BE1000), reinterpret(0x3D116ECDB0F177C8),\n reinterpret(0x3FE7800000000000), 0, reinterpret(0x3FD3C25277333000), reinterpret(0x3D183B54B606BD5C),\n reinterpret(0x3FE7600000000000), 0, reinterpret(0x3FD419B423D5E800), reinterpret(0x3D08E436EC90E09D),\n reinterpret(0x3FE7400000000000), 0, reinterpret(0x3FD4718DC271C800), reinterpret(0xBD2F27CE0967D675),\n reinterpret(0x3FE7200000000000), 0, reinterpret(0x3FD4C9E09E173000), reinterpret(0xBD2E20891B0AD8A4),\n reinterpret(0x3FE7000000000000), 0, reinterpret(0x3FD522AE0738A000), reinterpret(0x3D2EBE708164C759),\n reinterpret(0x3FE6E00000000000), 0, reinterpret(0x3FD57BF753C8D000), reinterpret(0x3D1FADEDEE5D40EF),\n reinterpret(0x3FE6C00000000000), 0, reinterpret(0x3FD5D5BDDF596000), reinterpret(0xBD0A0B2A08A465DC)\n]);\n\n// Returns 0 if not int, 1 if odd int, 2 if even int. The argument is\n// the bit representation of a non-zero finite floating-point value.\n// @ts-ignore: decorator\n@inline\nfunction checkint(iy: u64): i32 {\n var e = iy >> 52 & 0x7FF;\n if (e < 0x3FF ) return 0;\n if (e > 0x3FF + 52) return 2;\n e = u64(1) << (0x3FF + 52 - e);\n if (iy & (e - 1)) return 0;\n if (iy & e ) return 1;\n return 2;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction xflow(sign: u32, y: f64): f64 {\n return select(-y, y, sign) * y;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction uflow(sign: u32): f64 {\n return xflow(sign, reinterpret(0x1000000000000000)); // 0x1p-767\n}\n\n// @ts-ignore: decorator\n@inline\nfunction oflow(sign: u32): f64 {\n return xflow(sign, reinterpret(0x7000000000000000)); // 0x1p769\n}\n\n// Returns 1 if input is the bit representation of 0, infinity or nan.\n// @ts-ignore: decorator\n@inline\nfunction zeroinfnan(u: u64): bool {\n return (u << 1) - 1 >= 0xFFE0000000000000 - 1;\n}\n\n// @ts-ignore: decorator\n@lazy var log_tail: f64 = 0;\n\n// Compute y+TAIL = log(x) where the rounded result is y and TAIL has about\n// additional 15 bits precision. IX is the bit representation of x, but\n// normalized in the subnormal range using the sign bit for the exponent.\n// @ts-ignore: decorator\n@inline\nfunction log_inline(ix: u64): f64 {\n const N = 1 << POW_LOG_TABLE_BITS;\n const N_MASK = N - 1;\n\n const\n Ln2hi = reinterpret(0x3FE62E42FEFA3800),\n Ln2lo = reinterpret(0x3D2EF35793C76730);\n\n const\n A0 = reinterpret(0xBFE0000000000000),\n A1 = reinterpret(0xBFE5555555555560),\n A2 = reinterpret(0x3FE0000000000006),\n A3 = reinterpret(0x3FE999999959554E),\n A4 = reinterpret(0xBFE555555529A47A),\n A5 = reinterpret(0xBFF2495B9B4845E9),\n A6 = reinterpret(0x3FF0002B8B263FC3);\n\n // x = 2^k z; where z is in range [OFF,2*OFF) and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ix - 0x3fE6955500000000;\n var i = ((tmp >> (52 - POW_LOG_TABLE_BITS)) & N_MASK);\n var k = tmp >> 52;\n var iz = ix - (tmp & u64(0xFFF) << 52);\n var z = reinterpret(iz);\n var kd = k;\n\n // log(x) = k*Ln2 + log(c) + log1p(z/c-1).\n var invc = load(POW_LOG_DATA_TAB + (i << (2 + alignof())), 0 << alignof()); // tab[i].invc\n var logc = load(POW_LOG_DATA_TAB + (i << (2 + alignof())), 2 << alignof()); // tab[i].logc\n var logctail = load(POW_LOG_DATA_TAB + (i << (2 + alignof())), 3 << alignof()); // tab[i].logctail\n\n // Note: 1/c is j/N or j/N/2 where j is an integer in [N,2N) and\n // |z/c - 1| < 1/N, so r = z/c - 1 is exactly representible.\n // Split z such that rhi, rlo and rhi*rhi are exact and |rlo| <= |r|.\n var zhi = reinterpret((iz + u64(0x80000000)) & 0xFFFFFFFF00000000);\n var zlo = z - zhi;\n var rhi = zhi * invc - 1.0;\n var rlo = zlo * invc;\n var r = rhi + rlo;\n\n // k * Ln2 + log(c) + r.\n var t1 = kd * Ln2hi + logc;\n var t2 = t1 + r;\n var lo1 = kd * Ln2lo + logctail;\n var lo2 = t1 - t2 + r;\n\n // Evaluation is optimized assuming superscalar pipelined execution.\n var ar = A0 * r; // A[0] = -0.5\n var ar2 = r * ar;\n var ar3 = r * ar2;\n // k * Ln2 + log(c) + r + A[0] * r * r.\n var arhi = A0 * rhi;\n var arhi2 = rhi * arhi;\n var hi = t2 + arhi2;\n var lo3 = rlo * (ar + arhi);\n var lo4 = t2 - hi + arhi2;\n\n // p = log1p(r) - r - A[0] * r * r.\n var p = ar3 * (A1 + r * A2 + ar2 * (A3 + r * A4 + ar2 * (A5 + r * A6)));\n var lo = lo1 + lo2 + lo3 + lo4 + p;\n var y = hi + lo;\n log_tail = hi - y + lo;\n\n return y;\n}\n\n// @ts-ignore: decorator\n@inline const SIGN_BIAS = 0x800 << EXP_TABLE_BITS;\n\n// Computes sign*exp(x+xtail) where |xtail| < 2^-8/N and |xtail| <= |x|.\n// The sign_bias argument is SIGN_BIAS or 0 and sets the sign to -1 or 1.\n// @ts-ignore: decorator\n@inline\nfunction exp_inline(x: f64, xtail: f64, sign_bias: u32): f64 {\n const N = 1 << EXP_TABLE_BITS;\n const N_MASK = N - 1;\n\n const\n InvLn2N = reinterpret(0x3FF71547652B82FE) * N, // 0x1.71547652b82fep0\n NegLn2hiN = reinterpret(0xBF762E42FEFA0000), // -0x1.62e42fefa0000p-8\n NegLn2loN = reinterpret(0xBD0CF79ABC9E3B3A), // -0x1.cf79abc9e3b3ap-47\n shift = reinterpret(0x4338000000000000); // 0x1.8p52\n\n const\n C2 = reinterpret(0x3FDFFFFFFFFFFDBD), // __exp_data.poly[0] (0x1.ffffffffffdbdp-2)\n C3 = reinterpret(0x3FC555555555543C), // __exp_data.poly[1] (0x1.555555555543cp-3)\n C4 = reinterpret(0x3FA55555CF172B91), // __exp_data.poly[2] (0x1.55555cf172b91p-5)\n C5 = reinterpret(0x3F81111167A4D017); // __exp_data.poly[3] (0x1.1111167a4d017p-7)\n\n var abstop: u32;\n var ki: u64, top: u64, sbits: u64;\n var idx: usize;\n // double_t for better performance on targets with FLT_EVAL_METHOD==2.\n var kd: f64, z: f64, r: f64, r2: f64, scale: f64, tail: f64, tmp: f64;\n\n var ux = reinterpret(x);\n abstop = (ux >> 52) & 0x7FF;\n if (abstop - 0x3C9 >= 0x03F) {\n if (abstop - 0x3C9 >= 0x80000000) {\n // Avoid spurious underflow for tiny x.\n // Note: 0 is common input.\n return select(-1.0, 1.0, sign_bias);\n }\n if (abstop >= 0x409) { // top12(1024.0)\n // Note: inf and nan are already handled.\n return ux >> 63 ? uflow(sign_bias) : oflow(sign_bias);\n }\n // Large x is special cased below.\n abstop = 0;\n }\n\n // exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)].\n // x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N].\n z = InvLn2N * x;\n\n // #if TOINT_INTRINSICS\n // kd = roundtoint(z);\n // ki = converttoint(z);\n // #elif EXP_USE_TOINT_NARROW\n // // z - kd is in [-0.5-2^-16, 0.5] in all rounding modes.\n // kd = eval_as_double(z + shift);\n // ki = asuint64(kd) >> 16;\n // kd = (double_t)(int32_t)ki;\n // #else\n // z - kd is in [-1, 1] in non-nearest rounding modes\n kd = z + shift;\n ki = reinterpret(kd);\n kd -= shift;\n // #endif\n r = x + kd * NegLn2hiN + kd * NegLn2loN;\n // The code assumes 2^-200 < |xtail| < 2^-8/N\n r += xtail;\n // 2^(k/N) ~= scale * (1 + tail)\n idx = ((ki & N_MASK) << 1);\n top = (ki + sign_bias) << (52 - EXP_TABLE_BITS);\n\n tail = reinterpret(load(EXP_DATA_TAB + (idx << alignof())));\n // This is only a valid scale when -1023*N < k < 1024*N\n sbits = load(EXP_DATA_TAB + (idx << alignof()), 1 << alignof()) + top;\n // exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1).\n // Evaluation is optimized assuming superscalar pipelined execution.\n r2 = r * r;\n // Without fma the worst case error is 0.25/N ulp larger.\n // Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp\n tmp = tail + r + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5);\n if (abstop == 0) return specialcase(tmp, sbits, ki);\n scale = reinterpret(sbits);\n // Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there\n // is no spurious underflow here even without fma.\n return scale + scale * tmp;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function pow_lut(x: f64, y: f64): f64 {\n const Ox1p52 = reinterpret(0x4330000000000000); // 0x1p52\n\n var sign_bias: u32 = 0;\n var ix = reinterpret(x);\n var iy = reinterpret(y);\n var topx = ix >> 52;\n var topy = iy >> 52;\n\n if (topx - 0x001 >= 0x7FF - 0x001 || (topy & 0x7FF) - 0x3BE >= 0x43e - 0x3BE) {\n // Note: if |y| > 1075 * ln2 * 2^53 ~= 0x1.749p62 then pow(x,y) = inf/0\n // and if |y| < 2^-54 / 1075 ~= 0x1.e7b6p-65 then pow(x,y) = +-1.\n // Special cases: (x < 0x1p-126 or inf or nan) or\n // (|y| < 0x1p-65 or |y| >= 0x1p63 or nan).\n if (zeroinfnan(iy)) {\n if ((iy << 1) == 0) return 1.0;\n if (ix == 0x3FF0000000000000) return NaN; // original: 1.0\n if ((ix << 1) > 0xFFE0000000000000 || (iy << 1) > 0xFFE0000000000000) return x + y;\n if ((ix << 1) == 0x7FE0000000000000) return NaN; // original: 1.0\n if (((ix << 1) < 0x7FE0000000000000) == !(iy >> 63)) return 0; // |x|<1 && y==inf or |x|>1 && y==-inf.\n return y * y;\n }\n if (zeroinfnan(ix)) {\n let x2 = x * x;\n if (i32(ix >> 63) && checkint(iy) == 1) x2 = -x2;\n return iy >> 63 ? 1 / x2 : x2;\n }\n // Here x and y are non-zero finite\n if (ix >> 63) {\n // Finite x < 0\n let yint = checkint(iy);\n if (yint == 0) return (x - x) / (x - x);\n if (yint == 1) sign_bias = SIGN_BIAS;\n ix &= 0x7FFFFFFFFFFFFFFF;\n topx &= 0x7FF;\n }\n if ((topy & 0x7FF) - 0x3BE >= 0x43E - 0x3BE) {\n // Note: sign_bias == 0 here because y is not odd.\n if (ix == 0x3FF0000000000000) return 1;\n if ((topy & 0x7FF) < 0x3BE) return 1; // |y| < 2^-65, x^y ~= 1 + y*log(x).\n return (ix > 0x3FF0000000000000) == (topy < 0x800) ? Infinity : 0;\n }\n if (topx == 0) {\n // Normalize subnormal x so exponent becomes negative.\n ix = reinterpret(x * Ox1p52);\n ix &= 0x7FFFFFFFFFFFFFFF;\n ix -= u64(52) << 52;\n }\n }\n\n var hi = log_inline(ix);\n var lo = log_tail;\n var ehi: f64, elo: f64;\n // #if __FP_FAST_FMA\n // ehi = y * hi;\n // elo = y * lo + __builtin_fma(y, hi, -ehi);\n // #else\n var yhi = reinterpret(iy & 0xFFFFFFFFF8000000);\n var ylo = y - yhi;\n var lhi = reinterpret(reinterpret(hi) & 0xFFFFFFFFF8000000);\n var llo = hi - lhi + lo;\n ehi = yhi * lhi;\n elo = ylo * lhi + y * llo; // |elo| < |ehi| * 2^-25.\n // #endif\n return exp_inline(ehi, elo, sign_bias);\n}\n","import { itoa32, utoa32, itoa64, utoa64, dtoa, itoa_buffered, dtoa_buffered, MAX_DOUBLE_LENGTH } from \"./number\";\nimport { ipow32 } from \"../math\";\n\n// All tables are stored as two staged lookup tables (static tries)\n// because the full range of Unicode symbols can't be efficiently\n// represented as-is in memory (see Unicode spec ch 5, p.196):\n// https://www.unicode.org/versions/Unicode12.0.0/ch05.pdf\n// Tables have been generated using these forked musl tools:\n// https://github.com/MaxGraey/musl-chartable-tools/tree/case-ignorable\n\n// Lookup table to check if a character is alphanumeric or not\n// See: https://git.musl-libc.org/cgit/musl/tree/src/ctype/alpha.h\n// size: 3904 bytes\n// @ts-ignore\n@inline @lazy const ALPHA_TABLE = memory.data([\n 18,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,17,34,35,36,17,37,38,39,40,\n 41,42,43,44,17,45,46,47,16,16,48,16,16,16,16,16,16,16,49,50,51,16,52,53,16,16,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,54,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,55,17,17,17,17,56,17,57,58,59,60,61,62,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,\n 68,69,70,71,72,73,74,17,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,\n 93,94,16,95,96,97,98,17,17,17,99,100,101,16,16,16,16,16,16,16,16,16,16,17,17,\n 17,17,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,103,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,17,17,104,105,16,16,106,107,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,108,17,17,17,17,109,110,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 17,111,112,16,16,16,16,16,16,16,16,16,113,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,114,115,116,117,16,16,16,16,16,16,16,16,118,\n 119,120,16,16,16,16,16,121,122,16,16,16,16,123,16,16,124,16,16,16,16,16,16,16,\n 16,16,125,16,16,16,\n 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,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,\n 255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,188,64,215,255,255,\n 251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,255,255,255,\n 255,255,1,0,0,0,0,255,191,182,0,255,255,255,135,7,0,0,0,255,7,255,255,255,255,\n 255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239,\n 31,254,225,255,\n 159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,\n 255,255,3,0,255,255,255,255,255,7,48,4,255,255,255,252,255,31,0,0,255,255,255,\n 1,255,7,0,0,0,0,0,0,255,255,223,255,255,0,240,255,248,3,255,255,255,255,255,\n 255,255,255,255,239,255,223,225,255,207,255,254,255,239,159,249,255,255,253,\n 197,227,159,89,128,176,207,255,3,16,238,135,249,255,255,253,109,195,135,25,2,\n 94,192,255,63,0,238,191,251,255,255,253,237,227,191,27,1,0,207,255,0,30,238,\n 159,249,255,255,253,237,227,159,25,192,176,207,255,2,0,236,199,61,214,24,199,\n 255,195,199,29,129,0,192,255,0,0,239,223,253,255,255,253,255,227,223,29,96,7,\n 207,255,0,0,239,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,255,223,\n 253,255,255,255,255,231,223,93,240,128,207,255,0,252,238,255,127,252,255,255,\n 251,47,127,128,95,255,192,255,12,0,254,255,255,255,255,127,255,7,63,32,255,3,\n 0,0,0,0,214,247,255,255,175,255,255,59,95,32,255,243,0,0,0,\n 0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255,\n 31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,255,255,255,\n 255,255,255,255,63,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,\n 255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61,\n 127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255,\n 7,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255,\n 255,199,255,1,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255,\n 255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255,\n 255,255,255,255,255,1,255,255,255,255,255,7,255,255,255,255,255,255,255,255,\n 63,\n 0,255,255,255,127,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255,\n 255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255,\n 127,254,255,31,0,255,3,255,3,128,0,0,128,1,0,0,0,0,0,0,0,255,255,255,255,255,\n 255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255,\n 255,191,255,3,0,255,255,255,255,255,255,127,0,255,227,255,255,255,255,255,63,\n 255,1,255,255,255,255,255,231,0,0,0,0,0,222,111,4,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,\n 128,255,31,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,\n 255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,\n 224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,\n 0,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,\n 255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,\n 255,255,255,255,0,0,0,0,0,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,\n 0,0,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,\n 255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,255,254,255,\n 255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,255,0,0,0,0,0,0,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,\n 31,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,\n 0,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,\n 255,127,240,143,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,\n 0,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,249,255,255,255,\n 255,255,255,252,7,0,0,0,0,224,255,191,255,255,255,255,0,0,0,255,255,255,255,\n 255,255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,232,255,255,\n 255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,\n 255,0,128,255,3,255,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3,\n 255,255,127,252,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,\n 126,0,127,127,255,255,255,255,255,247,255,3,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,\n 255,\n 15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255,\n 255,255,255,255,255,255,255,255,255,63,0,0,255,255,255,255,255,255,255,255,\n 252,255,255,255,255,255,255,0,0,0,0,0,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,255,3,\n 254,255,255,7,254,255,255,7,192,255,255,255,255,255,255,255,255,255,255,127,\n 252,252,252,28,0,0,0,0,255,239,255,255,127,255,255,183,255,63,255,63,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,31,255,255,255,255,255,255,1,0,0,0,0,\n 0,255,255,255,255,0,224,255,255,255,7,255,255,255,255,255,7,255,255,255,63,\n 255,255,255,255,15,255,62,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,63,255,3,255,255,255,255,15,255,255,255,\n 255,15,255,255,255,255,255,0,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,255,255,63,0,255,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,255,255,\n 127,0,255,255,255,127,0,0,0,0,0,0,0,0,255,255,55,0,255,255,63,0,255,255,255,3,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239,\n 254,255,255,63,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255,\n 255,31,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,255,255,3,\n 0,0,0,0,0,0,0,0,0,0,0,0,\n 0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,255,255,255,255,255,255,7,\n 0,255,255,255,255,255,255,7,0,255,255,255,255,255,0,255,3,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,\n 255,27,3,0,0,0,0,0,0,0,0,0,255,255,255,31,128,0,255,255,63,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,255,255,31,0,0,0,255,255,127,0,255,255,255,255,255,255,255,255,63,0,0,\n 0,192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,\n 255,255,255,255,199,255,240,0,255,255,255,255,71,0,255,255,255,255,255,255,\n 255,255,30,192,255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,\n 127,189,255,191,255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,\n 253,237,227,159,25,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,255,255,255,255,255,255,255,255,187,7,255,131,3,0,0,0,255,255,255,255,255,\n 255,255,255,179,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,\n 255,255,255,63,127,0,0,0,63,0,0,0,0,255,255,255,255,255,255,255,127,17,0,255,\n 3,0,0,0,0,255,255,255,255,255,255,63,1,255,3,0,0,0,0,0,0,255,255,255,231,255,\n 7,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,\n 255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,3,0,128,\n 127,242,111,255,255,255,191,153,7,0,255,3,0,0,0,0,0,0,0,0,255,252,255,255,255,\n 255,255,252,26,0,0,0,255,255,255,255,255,255,231,127,0,0,255,255,255,255,255,\n 255,255,255,255,32,0,0,0,0,255,255,255,255,255,255,255,1,255,253,255,255,255,\n 255,127,127,1,0,255,3,0,0,252,255,255,255,252,255,255,254,127,0,0,0,0,0,0,0,0,\n 0,127,251,255,255,255,255,127,180,203,0,255,3,191,253,255,255,255,127,123,1,\n 255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,\n 0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,3,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,127,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,\n 0,255,255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,63,0,0,255,255,255,255,255,255,0,0,15,0,255,3,248,255,255,224,255,\n 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,\n 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,135,\n 255,255,255,255,255,255,255,128,255,255,0,0,0,0,0,0,0,0,11,0,3,0,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,\n 255,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,255,255,255,\n 127,0,0,0,0,0,0,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255,\n 223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,\n 255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255,\n 247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253,\n 255,255,255,253,255,255,247,207,255,255,255,255,255,255,127,255,255,249,219,7,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,31,\n 128,63,255,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,15,255,\n 3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,31,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,143,8,\n 255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239,255,255,255,150,254,247,10,\n 132,234,150,170,150,247,247,94,255,251,255,15,238,251,255,15,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,255,255,255,3,255,255,255,3,255,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,3\n]);\n\n// size: 1568 bytes (compressed to ~1380 bytes after binaryen)\n// @ts-ignore: decorator\n@lazy @inline const CASED = memory.data([\n 18,19,20,21,22,23,16,16,16,16,16,16,16,16,16,16,\n 24,16,16,25,16,16,16,16,16,16,16,16,26,27,17,28,\n 29,30,16,16,31,16,16,16,16,16,16,16,32,33,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,34,35,16,16,16,36,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,37,16,16,16,38,\n 16,16,16,16,39,16,16,16,16,16,16,16,40,16,16,16,\n 16,16,16,16,16,16,16,16,41,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,42,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,43,44,45,46,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,47,16,16,16,16,16,16,\n 16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,0,0,0,0,254,255,255,7,254,255,255,7,0,0,0,0,0,4,32,4,\n 255,255,127,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,247,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,239,255,255,255,255,1,3,0,0,0,31,0,0,0,\n 0,0,0,0,0,0,0,0,32,0,0,0,0,0,207,188,64,215,255,255,251,255,255,255,\n 255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 3,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,\n 255,255,127,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,\n 191,32,255,255,255,255,255,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,255,255,255,255,255,255,255,255,255,255,63,63,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,1,255,255,255,255,255,231,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,0,0,0,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,\n 255,255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,\n 132,252,47,62,80,189,31,242,224,67,0,0,255,255,255,255,24,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,0,255,255,255,255,255,127,255,255,\n 255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,120,12,0,\n 255,255,255,255,191,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,63,0,0,\n 255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,255,255,255,\n 255,255,255,255,255,255,255,255,255,120,255,255,255,255,255,255,252,7,0,0,0,0,96,7,\n 0,0,0,0,0,0,255,255,255,255,255,247,255,1,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,0,0,0,0,127,0,248,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,7,\n 254,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,\n 255,255,15,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,7,0,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,\n 255,255,255,223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,255,123,\n 95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,\n 253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,\n 255,253,255,255,255,253,255,255,247,15,0,0,0,0,0,0,255,255,255,255,255,255,255,255,\n 15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,255,255,255,3,255,255,255,3,255,255,255,3,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0\n]);\n\n// size: 2976 bytes (compressed to ~2050 bytes after binaryen)\n// @ts-ignore: decorator\n@lazy @inline const CASE_IGNORABLES = memory.data([\n 18,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,16,16,34,16,16,16,35,36,37,38,39,40,41,16,42,\n 43,16,16,16,16,16,16,16,16,16,16,16,44,45,46,16,\n 47,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 48,16,16,16,49,16,50,51,52,53,54,55,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,56,16,16,57,58,\n 16,59,60,61,16,16,16,16,16,16,62,16,16,63,64,65,\n 66,67,68,69,70,71,72,73,74,75,76,16,77,78,79,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,80,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,81,82,16,16,16,83,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,84,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,85,86,16,16,16,16,16,16,16,87,16,16,16,16,16,\n 88,89,90,16,16,16,16,16,91,92,16,16,16,16,16,16,\n 16,16,16,93,16,16,16,16,16,16,16,16,16,16,16,16,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,128,64,0,4,0,0,0,64,1,0,0,0,0,0,0,0,0,161,144,1,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,48,4,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,3,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130,0,0,0,0,\n 0,0,254,255,255,255,255,191,182,0,0,0,0,0,16,0,63,0,255,23,0,0,0,0,\n 1,248,255,255,0,0,1,0,0,0,0,0,0,0,0,0,0,0,192,191,255,61,0,0,\n 0,128,2,0,0,0,255,255,255,7,0,0,0,0,0,0,0,0,0,0,192,255,1,0,\n 0,0,0,0,0,248,63,36,0,0,192,255,255,63,0,0,0,0,0,14,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,255,7,0,0,0,0,0,0,20,\n 254,33,254,0,12,0,2,0,2,0,0,0,0,0,0,16,30,32,0,0,12,0,0,64,\n 6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,\n 190,33,0,0,12,0,0,252,2,0,0,0,0,0,0,144,30,32,96,0,12,0,0,0,\n 4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,17,0,0,0,0,0,0,192,\n 193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,\n 3,0,0,0,0,0,0,24,30,32,0,0,12,0,0,0,2,0,0,0,0,0,0,0,\n 0,4,92,0,0,0,0,0,0,0,0,0,0,0,242,7,192,127,0,0,0,0,0,0,\n 0,0,0,0,0,0,242,31,64,63,0,0,0,0,0,0,0,0,0,3,0,0,160,2,\n 0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,\n 0,0,0,0,0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,\n 0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,28,0,\n 0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,143,32,0,0,0,0,\n 0,120,0,0,0,0,0,0,8,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,9,0,0,0,0,\n 0,0,64,127,229,31,248,159,0,0,0,0,128,0,255,255,1,0,0,0,0,0,0,0,\n 15,0,0,0,0,0,208,23,4,0,0,0,0,248,15,0,3,0,0,0,60,59,0,0,\n 0,0,0,0,64,163,3,0,0,0,0,0,0,240,207,0,0,0,0,0,0,0,0,63,\n 0,0,0,0,0,0,0,0,0,0,247,255,253,33,16,3,0,0,0,0,0,240,255,255,\n 255,255,255,255,255,7,0,1,0,0,0,248,255,255,255,255,255,255,255,255,255,255,255,251,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,\n 3,224,0,224,0,224,0,96,0,248,0,3,144,124,0,0,0,0,0,0,223,255,2,128,\n 0,0,255,31,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,128,0,0,0,0,0,0,0,0,\n 0,0,0,0,255,255,255,255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,60,62,8,\n 0,0,0,0,0,0,0,0,0,0,0,126,0,0,0,0,0,0,0,0,0,0,0,112,\n 0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,16,0,0,0,0,0,0,\n 0,0,0,0,0,128,247,191,0,0,0,240,0,0,0,0,0,0,0,0,0,0,3,0,\n 255,255,255,255,3,0,0,0,0,0,0,0,0,0,1,0,0,7,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,3,68,8,0,0,96,16,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,\n 128,255,3,0,0,0,0,0,7,0,0,0,0,0,200,51,0,128,0,0,96,0,0,0,\n 0,0,0,0,0,126,102,0,8,16,0,0,0,0,1,16,0,0,0,0,0,0,157,193,\n 2,0,0,32,0,48,88,0,0,0,0,0,0,0,0,0,0,0,0,248,0,14,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,64,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,255,3,0,0,0,0,0,0,0,\n 255,255,8,0,255,255,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,128,128,64,0,4,0,0,0,64,1,0,0,0,0,0,1,0,\n 0,0,0,192,0,0,0,0,0,0,0,0,8,0,0,14,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,240,0,0,0,0,0,135,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,\n 0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 192,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,\n 0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0,0,0,0,0,0,0,8,0,\n 3,0,0,0,0,0,192,127,0,158,0,0,0,0,0,0,0,0,0,0,0,128,211,64,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,\n 3,0,0,0,0,0,0,24,1,0,0,0,192,31,31,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,\n 0,0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,176,1,0,0,48,0,0,0,0,\n 0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,\n 0,0,0,0,0,0,0,0,0,0,0,224,188,15,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,6,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,88,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0,126,14,0,0,0,0,\n 0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,\n 0,0,0,0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,163,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,255,1,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,15,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,128,0,0,0,0,0,0,0,128,255,255,0,0,0,0,0,0,0,0,27,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,\n 231,15,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,\n 0,0,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,63,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 240,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,248\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const LOWER127 = memory.data([\n 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,\n 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,\n 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,\n 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,\n 64,\n 97,98,99,100,101,102,103,104,105,106,107,108,109,\n 110,111,112,113,114,115,116,117,118,119,120,121,122,\n 91,92,93,94,95,96,\n 97,98,99,100,101,102,103,104,105,106,107,108,109,\n 110,111,112,113,114,115,116,117,118,119,120,121,122,\n 123,124,125,126,127\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const UPPER127 = memory.data([\n 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,\n 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,\n 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,\n 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,\n 64,\n 65,66,67,68,69,70,71,72,73,74,75,76,77,\n 78,79,80,81,82,83,84,85,86,87,88,89,90,\n 91,92,93,94,95,96,\n 65,66,67,68,69,70,71,72,73,74,75,76,77,\n 78,79,80,81,82,83,84,85,86,87,88,89,90,\n 123,124,125,126,127\n]);\n\n// 23 * 8 = 184 bytes\n// @ts-ignore: decorator\n@lazy @inline const POWERS10 = memory.data([\n 1e00, 1e01, 1e02, 1e03, 1e04, 1e05, 1e06, 1e07, 1e08, 1e09,\n 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,\n 1e20, 1e21, 1e22\n]);\n\n// @ts-ignore: decorator\n@inline\nexport const enum CharCode {\n PERCENT = 0x25,\n PLUS = 0x2B,\n MINUS = 0x2D,\n DOT = 0x2E,\n _0 = 0x30,\n _1 = 0x31,\n _2 = 0x32,\n _3 = 0x33,\n _4 = 0x34,\n _5 = 0x35,\n _6 = 0x36,\n _7 = 0x37,\n _8 = 0x38,\n _9 = 0x39,\n A = 0x41,\n B = 0x42,\n E = 0x45,\n I = 0x49,\n N = 0x4E,\n O = 0x4F,\n X = 0x58,\n Z = 0x5A,\n a = 0x61,\n b = 0x62,\n e = 0x65,\n n = 0x6E,\n o = 0x6F,\n u = 0x75,\n x = 0x78,\n z = 0x7A\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isAscii(c: u32): bool {\n return !(c >> 7);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isLower8(c: u32): bool {\n return c - CharCode.a < 26;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isUpper8(c: u32): bool {\n return c - CharCode.A < 26;\n}\n\nexport function isSpace(c: u32): bool {\n if (c < 0x1680) { // < (1)\n // , , , , , and \n // (c == 0x20 || c == 0xA0) was optimized to (c | 0x80) == 0xA0\n // @ts-ignore: cast\n return ((c | 0x80) == 0xA0) | (c - 0x09 <= 0x0D - 0x09);\n }\n if (c - 0x2000 <= 0x200A - 0x2000) return true;\n switch (c) {\n case 0x1680: // (1)\n case 0x2028: // (2)\n case 0x2029: // \n case 0x202F: // \n case 0x205F: // \n case 0x3000: // \n case 0xFEFF: return true; // \n }\n return false;\n}\n\nexport function isAlpha(c: u32): bool {\n if (isAscii(c)) return (c | 32) - CharCode.a < 26;\n if (c < 0x20000) {\n // @ts-ignore: cast\n return stagedBinaryLookup(ALPHA_TABLE, c);\n }\n return c < 0x2FFFE;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isCased(c: u32): bool {\n // @ts-ignore: cast\n return c < 0x1F18A && stagedBinaryLookup(CASED, c);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isCaseIgnorable(c: u32): bool {\n // @ts-ignore: cast\n return c < 0xE01F0 && stagedBinaryLookup(CASE_IGNORABLES, c);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isFinalSigma(buffer: usize, index: isize, len: isize): bool {\n const lookaheadLimit = 30; // max lookahead limit\n var found = false;\n var pos = index;\n var minPos = max(0, pos - lookaheadLimit);\n while (pos > minPos) {\n let c = codePointBefore(buffer, pos);\n if (!isCaseIgnorable(c)) {\n if (isCased(c)) {\n found = true;\n } else {\n return false;\n }\n }\n pos -= isize(c >= 0x10000) + 1;\n }\n if (!found) return false;\n pos = index + 1;\n var maxPos = min(pos + lookaheadLimit, len);\n while (pos < maxPos) {\n let c = load(buffer + (pos << 1));\n if (u32((c & 0xFC00) == 0xD800) & u32(pos + 1 != len)) {\n let c1 = load(buffer + (pos << 1), 2);\n if ((c1 & 0xFC00) == 0xDC00) {\n c = (c - 0xD800 << 10) + (c1 - 0xDC00) + 0x10000;\n }\n }\n if (!isCaseIgnorable(c)) {\n return !isCased(c);\n }\n pos += isize(c >= 0x10000) + 1;\n }\n return true;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction codePointBefore(buffer: usize, index: isize): i32 {\n if (index <= 0) return -1;\n var c = load(buffer + (index - 1 << 1));\n if (u32((c & 0xFC00) == 0xDC00) & u32(index - 2 >= 0)) {\n let c1 = load(buffer + (index - 2 << 1));\n if ((c1 & 0xFC00) == 0xD800) {\n return ((c1 & 0x3FF) << 10) + (c & 0x3FF) + 0x10000;\n }\n }\n return (c & 0xF800) == 0xD800 ? 0xFFFD : c;\n}\n\n// Search routine for two-staged lookup tables\nfunction stagedBinaryLookup(table: usize, c: u32): bool {\n return ((load(table + (load(table + (c >>> 8)) << 5) + ((c & 255) >> 3)) >>> (c & 7)) & 1);\n}\n\nexport function compareImpl(str1: string, index1: usize, str2: string, index2: usize, len: usize): i32 {\n var ptr1 = changetype(str1) + (index1 << 1);\n var ptr2 = changetype(str2) + (index2 << 1);\n if (ASC_SHRINK_LEVEL < 2) {\n if (len >= 4 && !((ptr1 & 7) | (ptr2 & 7))) {\n do {\n if (load(ptr1) != load(ptr2)) break;\n ptr1 += 8;\n ptr2 += 8;\n len -= 4;\n } while (len >= 4);\n }\n }\n while (len--) {\n let a = load(ptr1);\n let b = load(ptr2);\n if (a != b) return a - b;\n ptr1 += 2;\n ptr2 += 2;\n }\n return 0;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function toLower8(c: u32): u32 {\n if (ASC_SHRINK_LEVEL > 0) {\n return c | u32(isUpper8(c)) << 5;\n } else {\n return load(LOWER127 + c);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function toUpper8(c: u32): u32 {\n if (ASC_SHRINK_LEVEL > 0) {\n return c & ~(u32(isLower8(c)) << 5);\n } else {\n return load(UPPER127 + c);\n }\n}\n\n/** Parses a string to an integer (usually), using the specified radix. */\nexport function strtol(str: string, radix: i32 = 0): T {\n var len = str.length;\n if (!len) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n\n var ptr = changetype(str) /* + HEAD -> offset */;\n var code = load(ptr);\n\n // trim white spaces\n while (isSpace(code)) {\n code = load(ptr += 2);\n --len;\n }\n // determine sign\n // @ts-ignore\n var sign: T = 1;\n if (code == CharCode.MINUS || code == CharCode.PLUS) {\n if (!--len) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n if (code == CharCode.MINUS) {\n // @ts-ignore: type\n sign = -1;\n }\n code = load(ptr += 2);\n }\n\n // See https://tc39.es/ecma262/#sec-parseint-string-radix\n if (radix) {\n if (radix < 2 || radix > 36) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n // handle case as parseInt(\"0xFF\", 16) by spec\n if (radix == 16) {\n if (\n len > 2 &&\n code == CharCode._0 &&\n (load(ptr, 2) | 32) == CharCode.x\n ) {\n ptr += 4; len -= 2;\n }\n }\n } else {\n // determine radix by literal prefix\n if (code == CharCode._0 && len > 2) {\n switch (load(ptr, 2) | 32) {\n case CharCode.b: {\n ptr += 4; len -= 2;\n radix = 2;\n break;\n }\n case CharCode.o: {\n ptr += 4; len -= 2;\n radix = 8;\n break;\n }\n case CharCode.x: {\n ptr += 4; len -= 2;\n radix = 16;\n break;\n }\n }\n }\n if (!radix) radix = 10;\n }\n\n // calculate value\n // @ts-ignore: type\n var num: T = 0;\n while (len--) {\n code = load(ptr);\n if (code - CharCode._0 < 10) {\n code -= CharCode._0;\n } else if (code - CharCode.A <= (CharCode.Z - CharCode.A)) {\n code -= CharCode.A - 10;\n } else if (code - CharCode.a <= (CharCode.z - CharCode.a)) {\n code -= CharCode.a - 10;\n }\n if (code >= radix) {\n if (!num) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n break;\n }\n // @ts-ignore: type\n num = num * radix + code;\n ptr += 2;\n }\n // @ts-ignore: type\n return sign * num;\n}\n\nexport function strtod(str: string): f64 {\n var len = str.length;\n if (!len) return NaN;\n\n var ptr = changetype(str);\n var code = load(ptr);\n\n var sign = 1.0;\n // skip white spaces\n while (len && isSpace(code)) {\n code = load(ptr += 2);\n --len;\n }\n if (!len) return NaN;\n\n // try parse '-' or '+'\n if (code == CharCode.MINUS) {\n if (!--len) return NaN;\n code = load(ptr += 2);\n sign = -1;\n } else if (code == CharCode.PLUS) {\n if (!--len) return NaN;\n code = load(ptr += 2);\n }\n\n // try parse Infinity\n if (len >= 8 && code == CharCode.I) {\n if (\n load(ptr, 0) == 0x690066006E0049 && // ifnI\n load(ptr, 8) == 0x7900740069006E // ytin\n ) {\n return Infinity * sign;\n }\n return NaN;\n }\n // validate next symbol\n if (code != CharCode.DOT && (code - CharCode._0) >= 10) {\n return NaN;\n }\n var savedPtr = ptr;\n // skip zeros\n while (code == CharCode._0) {\n code = load(ptr += 2);\n --len;\n }\n if (len <= 0) return 0;\n const capacity = 19; // int(64 * 0.3010)\n var pointed = false;\n var consumed = 0;\n var position = 0;\n var x: u64 = 0;\n if (code == CharCode.DOT) {\n let noDigits = !(savedPtr - ptr);\n ptr += 2; --len;\n if (!len && noDigits) return NaN;\n for (pointed = true; (code = load(ptr)) == CharCode._0; --position, ptr += 2) --len;\n if (len <= 0) return 0;\n if (!position && noDigits && code - CharCode._0 >= 10) return NaN;\n }\n for (let digit = code - CharCode._0; digit < 10 || (code == CharCode.DOT && !pointed); digit = code - CharCode._0) {\n if (digit < 10) {\n x = consumed < capacity ? 10 * x + digit : x | u64(!!digit);\n ++consumed;\n } else {\n position = consumed;\n pointed = true;\n }\n if (!--len) break;\n code = load(ptr += 2);\n }\n\n if (!pointed) position = consumed;\n return copysign(scientific(x, position - min(capacity, consumed) + parseExp(ptr, len)), sign);\n}\n\nexport function joinBooleanArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) return select(\"true\", \"false\", load(dataStart));\n\n var sepLen = separator.length;\n var valueLen = 5; // max possible length of element len(\"false\")\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__new(estLen << 1, idof()));\n var offset = 0;\n var value: bool;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + i);\n valueLen = 4 + i32(!value);\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(select(\"true\", \"false\", value)),\n valueLen << 1\n );\n offset += valueLen;\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + lastIndex);\n valueLen = 4 + i32(!value);\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(select(\"true\", \"false\", value)),\n valueLen << 1\n );\n offset += valueLen;\n\n if (estLen > offset) return result.substring(0, offset);\n return result;\n}\n\nexport function joinIntegerArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) {\n let value = load(dataStart);\n if (isSigned()) {\n if (sizeof() <= 4) {\n // @ts-ignore: type\n return changetype(itoa32(value, 10));\n } else {\n // @ts-ignore: type\n return changetype(itoa64(value, 10));\n }\n } else {\n if (sizeof() <= 4) {\n // @ts-ignore: type\n return changetype(utoa32(value, 10));\n } else {\n // @ts-ignore: type\n return changetype(utoa64(value, 10));\n }\n }\n }\n\n var sepLen = separator.length;\n const valueLen = (sizeof() <= 4 ? 10 : 20) + i32(isSigned());\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__new(estLen << 1, idof()));\n var offset = 0;\n var value: T;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n offset += itoa_buffered(changetype(result) + (offset << 1), value);\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n // @ts-ignore: type\n offset += itoa_buffered(changetype(result) + (offset << 1), value);\n if (estLen > offset) return result.substring(0, offset);\n return result;\n}\n\nexport function joinFloatArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) {\n return changetype(dtoa(\n // @ts-ignore: type\n load(dataStart))\n );\n }\n\n const valueLen = MAX_DOUBLE_LENGTH;\n var sepLen = separator.length;\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__new(estLen << 1, idof()));\n var offset = 0;\n var value: T;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n offset += dtoa_buffered(changetype(result) + (offset << 1), value);\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n // @ts-ignore: type\n offset += dtoa_buffered(changetype(result) + (offset << 1), value);\n if (estLen > offset) return result.substring(0, offset);\n return result;\n}\n\nexport function joinStringArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) {\n // @ts-ignore: type\n return load(dataStart) || \"\";\n }\n var estLen = 0;\n var value: string;\n for (let i = 0; i < length; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n if (value !== null) estLen += value.length;\n }\n var offset = 0;\n var sepLen = separator.length;\n var result = changetype(__new((estLen + sepLen * lastIndex) << 1, idof()));\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n if (value !== null) {\n let valueLen = value.length;\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(value),\n valueLen << 1\n );\n offset += valueLen;\n }\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n if (value !== null) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(value),\n value.length << 1\n );\n }\n return result;\n}\n\nexport function joinReferenceArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n var value: T;\n if (!lastIndex) {\n value = load(dataStart);\n // @ts-ignore: type\n return value !== null ? value.toString() : \"\";\n }\n var result = \"\";\n var sepLen = separator.length;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n if (value !== null) result += value.toString();\n if (sepLen) result += separator;\n }\n value = load(dataStart + (lastIndex << alignof()));\n // @ts-ignore: type\n if (value !== null) result += value.toString();\n return result;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction scientific(significand: u64, exp: i32): f64 {\n if (!significand || exp < -342) return 0;\n if (exp > 308) return Infinity;\n // Try use fast path\n // Use fast path for string-to-double conversion if possible\n // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion\n // Simple integer\n var significandf = significand;\n if (!exp) return significandf;\n if (exp > 22 && exp <= 22 + 15) {\n significandf *= pow10(exp - 22);\n exp = 22;\n }\n if (significand <= 9007199254740991 && abs(exp) <= 22) {\n if (exp > 0) return significandf * pow10(exp);\n return significandf / pow10(-exp);\n } else if (exp < 0) {\n return scaledown(significand, exp);\n } else {\n return scaleup(significand, exp);\n }\n}\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction scaledown(significand: u64, exp: i32): f64 {\n const denom: u64 = 6103515625; // 1e14 * 0x1p-14\n const scale = reinterpret(0x3F06849B86A12B9B); // 1e-14 * 0x1p32\n\n var shift = clz(significand);\n significand <<= shift;\n shift = exp - shift;\n\n for (; exp <= -14; exp += 14) {\n let q = significand / denom;\n let r = significand % denom;\n let s = clz(q);\n significand = (q << s) + nearest(scale * (r << (s - 18)));\n shift -= s;\n }\n var b = ipow32(5, -exp);\n var q = significand / b;\n var r = significand % b;\n var s = clz(q);\n significand = (q << s) + (reinterpret(reinterpret(r) + (s << 52)) / b);\n shift -= s;\n\n return NativeMath.scalbn(significand, shift);\n}\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction scaleup(significand: u64, exp: i32): f64 {\n const coeff: u32 = 1220703125; // 1e13 * 0x1p-13;\n var shift = ctz(significand);\n significand >>= shift;\n shift += exp;\n\n __fixmulShift = shift;\n for (; exp >= 13; exp -= 13) {\n significand = fixmul(significand, coeff);\n }\n significand = fixmul(significand, ipow32(5, exp));\n shift = __fixmulShift;\n return NativeMath.scalbn(significand, shift);\n}\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction parseExp(ptr: usize, len: i32): i32 {\n var sign = 1, magnitude = 0;\n var code = load(ptr);\n // check code is 'e' or 'E'\n if ((code | 32) != CharCode.e) return 0;\n\n if (!--len) return 0;\n code = load(ptr += 2);\n if (code == CharCode.MINUS) {\n if (!--len) return 0;\n code = load(ptr += 2);\n sign = -1;\n } else if (code == CharCode.PLUS) {\n if (!--len) return 0;\n code = load(ptr += 2);\n }\n // skip zeros\n while (code == CharCode._0) {\n if (!--len) return 0;\n code = load(ptr += 2);\n }\n for (let digit: u32 = code - CharCode._0; len && digit < 10; digit = code - CharCode._0) {\n if (magnitude >= 3200) return sign * 3200;\n magnitude = 10 * magnitude + digit;\n code = load(ptr += 2);\n --len;\n }\n return sign * magnitude;\n}\n\n// @ts-ignore: decorator\n@lazy var __fixmulShift: u64 = 0;\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction fixmul(a: u64, b: u32): u64 {\n var low = (a & 0xFFFFFFFF) * b;\n var high = (a >> 32) * b + (low >> 32);\n var overflow = (high >> 32);\n var space = clz(overflow);\n var revspace: u64 = 32 - space;\n __fixmulShift += revspace;\n return (high << space | (low & 0xFFFFFFFF) >> revspace) + (low << space >> 31 & 1);\n}\n\n// @ts-ignore: decorator\n@inline\nfunction pow10(n: i32): f64 {\n // argument `n` should bounds in [0, 22] range\n return load(POWERS10 + (n << alignof()));\n}\n","import { compareImpl } from \"./string\";\n\ntype Comparator = (a: T, b: T) => i32;\n\n// @ts-ignore: decorator\n@lazy @inline const EMPTY = u32.MAX_VALUE;\n// @ts-ignore: decorator\n@inline const INSERTION_SORT_THRESHOLD = 48;\n// @ts-ignore: decorator\n@inline const MIN_RUN_LENGTH = 32;\n\n// @ts-ignore: decorator\n@inline\nfunction log2u(n: u32): u32 {\n return 31 - clz(n);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function COMPARATOR(): Comparator {\n if (isInteger()) {\n if (isSigned() && sizeof() <= 4) {\n return (a, b) => i32(a) - i32(b);\n } else {\n return (a, b) => i32(a > b) - i32(a < b);\n }\n } else if (isFloat()) {\n if (sizeof() == 4) {\n return (a, b) => {\n var ia = reinterpret(f32(a));\n var ib = reinterpret(f32(b));\n ia ^= ia >> 31 >>> 1;\n ib ^= ib >> 31 >>> 1;\n return i32(ia > ib) - i32(ia < ib);\n };\n } else {\n return (a, b) => {\n var ia = reinterpret(f64(a));\n var ib = reinterpret(f64(b));\n ia ^= ia >> 63 >>> 1;\n ib ^= ib >> 63 >>> 1;\n return i32(ia > ib) - i32(ia < ib);\n };\n }\n } else if (isString()) {\n return (a, b) => {\n if (a === b || a === null || b === null) return 0;\n var alen = changetype(a).length;\n var blen = changetype(b).length;\n if (!(alen | blen)) return 0;\n if (!alen) return -1;\n if (!blen) return 1;\n let res = compareImpl(\n changetype(a), 0,\n changetype(b), 0,\n min(alen, blen)\n );\n return res ? res : alen - blen;\n };\n } else {\n return (a, b) => i32(a > b) - i32(a < b);\n }\n}\n\n// Power Sort implementation (stable) from paper \"Nearly-Optimal Mergesorts\"\n// https://arxiv.org/pdf/1805.04154.pdf\n// This method usually outperform TimSort.\n// TODO: refactor c >>> 31 to c < 0 when binaryen will support this opt\nexport function SORT(\n ptr: usize,\n len: i32,\n comparator: Comparator\n): void {\n if (len <= INSERTION_SORT_THRESHOLD) {\n if (len <= 1) return;\n if (ASC_SHRINK_LEVEL < 1) {\n switch (len) {\n case 3: {\n let a = load(ptr, 0);\n let b = load(ptr, 1 << alignof());\n let c = comparator(a, b) > 0;\n store(ptr, select(b, a, c), 0);\n a = select(a, b, c);\n b = load(ptr, 2 << alignof());\n c = comparator(a, b) > 0;\n store(ptr, select(b, a, c), 1 << alignof());\n store(ptr, select(a, b, c), 2 << alignof());\n }\n case 2: {\n let a = load(ptr, 0);\n let b = load(ptr, 1 << alignof());\n let c = comparator(a, b) > 0;\n store(ptr, select(b, a, c), 0);\n store(ptr, select(a, b, c), 1 << alignof());\n return;\n }\n }\n }\n insertionSort(ptr, 0, len - 1, 0, comparator);\n return;\n }\n\n var lgPlus2 = log2u(len) + 2;\n var lgPlus2Size = lgPlus2 << alignof();\n var leftRunStartBuf = __alloc(lgPlus2Size << 1);\n var leftRunEndBuf = leftRunStartBuf + lgPlus2Size;\n\n for (let i: u32 = 0; i < lgPlus2; ++i) {\n store(leftRunStartBuf + (i << alignof()), EMPTY);\n }\n\n var buffer = __alloc(len << alignof());\n\n var hi = len - 1;\n var endA = extendRunRight(ptr, 0, hi, comparator);\n var lenA = endA + 1;\n\n if (lenA < MIN_RUN_LENGTH) {\n endA = min(hi, MIN_RUN_LENGTH - 1);\n insertionSort(ptr, 0, endA, lenA, comparator);\n }\n\n var top: u32 = 0, startA = 0;\n while (endA < hi) {\n let startB = endA + 1;\n let endB = extendRunRight(ptr, startB, hi, comparator);\n let lenB = endB - startB + 1;\n\n if (lenB < MIN_RUN_LENGTH) {\n endB = min(hi, startB + MIN_RUN_LENGTH - 1);\n insertionSort(ptr, startB, endB, lenB, comparator);\n }\n\n let k = nodePower(0, hi, startA, startB, endB);\n\n for (let i = top; i > k; --i) {\n let start = load(leftRunStartBuf + (i << alignof()));\n if (start != EMPTY) {\n mergeRuns(\n ptr,\n start,\n load(leftRunEndBuf + (i << alignof())) + 1,\n endA,\n buffer,\n comparator\n );\n startA = start;\n store(leftRunStartBuf + (i << alignof()), EMPTY);\n }\n }\n\n store(leftRunStartBuf + (k << alignof()), startA);\n store(leftRunEndBuf + (k << alignof()), endA);\n startA = startB;\n endA = endB;\n top = k;\n }\n\n for (let i = top; i != 0; --i) {\n let start = load(leftRunStartBuf + (i << alignof()));\n if (start != EMPTY) {\n mergeRuns(\n ptr,\n start,\n load(leftRunEndBuf + (i << alignof())) + 1,\n hi,\n buffer,\n comparator\n );\n }\n }\n // dealloc aux buffers\n __free(buffer);\n __free(leftRunStartBuf);\n}\n\nfunction insertionSort(\n ptr: usize,\n left: i32,\n right: i32,\n presorted: i32,\n comparator: Comparator\n): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n // slightly improved original insertion sort\n for (let i = left + presorted; i <= right; ++i) {\n let j = i - 1;\n let a = load(ptr + (i << alignof()));\n while (j >= left) {\n let b = load(ptr + (j << alignof()));\n if (comparator(a, b) < 0) {\n store(ptr + (j << alignof()), b, 1 << alignof()); --j;\n } else break;\n }\n store(ptr + (j << alignof()), a, 1 << alignof());\n }\n } else {\n // even-odd two-way insertion sort which allow increase minRunLen\n let range = right - left + 1;\n let i = left + select(range & 1, presorted - ((range - presorted) & 1), presorted == 0);\n for (; i <= right; i += 2) {\n let a = load(ptr + (i << alignof()), 0);\n let b = load(ptr + (i << alignof()), 1 << alignof());\n let min = b, max = a;\n if (comparator(a, b) <= 0) {\n min = a, max = b;\n }\n let j = i - 1;\n while (j >= left) {\n a = load(ptr + (j << alignof()));\n if (comparator(a, max) > 0) {\n store(ptr + (j << alignof()), a, 2 << alignof()); --j;\n } else break;\n }\n store(ptr + (j << alignof()), max, 2 << alignof());\n while (j >= left) {\n a = load(ptr + (j << alignof()));\n if (comparator(a, min) > 0) {\n store(ptr + (j << alignof()), a, 1 << alignof()); --j;\n } else break;\n }\n store(ptr + (j << alignof()), min, 1 << alignof());\n }\n }\n}\n\nfunction nodePower(left: u32, right: u32, startA: u32, startB: u32, endB: u32): u32 {\n var n: u64 = right - left + 1;\n var s = startB - (left << 1);\n var l = startA + s;\n var r = endB + s + 1;\n var a = (l << 30) / n;\n var b = (r << 30) / n;\n return clz((a ^ b));\n}\n\nfunction extendRunRight(\n ptr: usize,\n i: i32,\n right: i32,\n comparator: Comparator\n): i32 {\n if (i == right) return i;\n var j = i;\n if (comparator(\n load(ptr + ( j << alignof())),\n load(ptr + (++j << alignof()))\n ) > 0) {\n while (\n j < right &&\n (comparator(\n load(ptr + (j << alignof()), 1 << alignof()),\n load(ptr + (j << alignof()))\n ) >>> 31) // < 0\n ) ++j;\n // reverse\n let k = j;\n while (i < k) {\n let tmp = load(ptr + (i << alignof()));\n store(ptr + (i << alignof()), load(ptr + (k << alignof()))); ++i;\n store(ptr + (k << alignof()), tmp); --k;\n }\n } else {\n while (\n j < right &&\n comparator(\n load(ptr + (j << alignof()), 1 << alignof()),\n load(ptr + (j << alignof()))\n ) >= 0\n ) ++j;\n }\n return j;\n}\n\n// Merges arr[l..m - 1] and arr[m..r]\nfunction mergeRuns(\n ptr: usize,\n l: i32,\n m: i32,\n r: i32,\n buffer: usize,\n comparator: Comparator\n): void {\n --m;\n var i: i32, j: i32, t = r + m;\n for (i = m + 1; i > l; --i) {\n store(\n buffer + ((i - 1) << alignof()),\n load(ptr + ((i - 1) << alignof()))\n );\n }\n for (j = m; j < r; ++j) {\n store(\n buffer + ((t - j) << alignof()),\n load(ptr + (j << alignof()), 1 << alignof())\n );\n }\n for (let k = l; k <= r; ++k) {\n let a = load(buffer + (j << alignof()));\n let b = load(buffer + (i << alignof()));\n if (comparator(a, b) < 0) {\n store(ptr + (k << alignof()), a);\n --j;\n } else {\n store(ptr + (k << alignof()), b);\n ++i;\n }\n }\n}\n","/// \n\nimport { BLOCK_MAXSIZE } from \"./rt/common\";\nimport { COMPARATOR, SORT } from \"./util/sort\";\nimport { REVERSE } from \"./util/bytes\";\nimport { joinBooleanArray, joinIntegerArray, joinFloatArray, joinStringArray, joinReferenceArray } from \"./util/string\";\nimport { idof, isArray as builtin_isArray } from \"./builtins\";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_ILLEGALGENTYPE, E_EMPTYARRAY, E_HOLEYARRAY } from \"./util/error\";\n\n// @ts-ignore: decorator\n@inline @lazy const MIN_SIZE: usize = 8;\n\n/** Ensures that the given array has _at least_ the specified backing size. */\nfunction ensureCapacity(array: usize, newSize: usize, alignLog2: u32, canGrow: bool = true): void {\n // Depends on the fact that Arrays mimic ArrayBufferView\n var oldCapacity = changetype(array).byteLength;\n if (newSize > oldCapacity >>> alignLog2) {\n if (newSize > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH);\n let oldData = changetype(changetype(array).buffer);\n // Grows old capacity by factor of two.\n // Make sure we don't reach BLOCK_MAXSIZE for new growed capacity.\n let newCapacity = max(newSize, MIN_SIZE) << alignLog2;\n if (canGrow) newCapacity = max(min(oldCapacity << 1, BLOCK_MAXSIZE), newCapacity);\n let newData = __renew(oldData, newCapacity);\n memory.fill(newData + oldCapacity, 0, newCapacity - oldCapacity);\n if (newData !== oldData) { // oldData has been free'd\n store(array, newData, offsetof(\"buffer\"));\n store(array, newData, offsetof(\"dataStart\"));\n __link(array, changetype(newData), false);\n }\n store(array, newCapacity, offsetof(\"byteLength\"));\n }\n}\n\nexport class Array {\n [key: number]: T;\n\n // Mimicking ArrayBufferView isn't strictly necessary here but is done to allow glue code\n // to work with typed and normal arrays interchangeably. Technically, normal arrays do not need\n // `dataStart` (equals `buffer`) and `byteLength` (equals computed `buffer.byteLength`), but the\n // block is 16 bytes anyway so it's fine to have a couple extra fields in there.\n\n private buffer: ArrayBuffer;\n @unsafe readonly dataStart: usize;\n private byteLength: i32; // Uses here as capacity\n\n // Also note that Array with non-nullable T must guard against uninitialized null values\n // whenever an element is accessed. Otherwise, the compiler wouldn't be able to guarantee\n // type-safety anymore. For lack of a better word, such an array is \"holey\".\n\n private length_: i32;\n\n static isArray(value: U): bool {\n return isReference() ? builtin_isArray(value) && value !== null : false;\n }\n\n static create(capacity: i32 = 0): Array {\n WARNING(\"'Array.create' is deprecated. Use 'new Array' instead, making sure initial elements are initialized.\");\n var array = new Array(capacity);\n array.length = 0;\n return array;\n }\n\n constructor(length: i32 = 0) {\n if (length > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH);\n // reserve capacity for at least MIN_SIZE elements\n var bufferSize = max(length, MIN_SIZE) << alignof();\n var buffer = changetype(__new(bufferSize, idof()));\n memory.fill(changetype(buffer), 0, bufferSize);\n this.buffer = buffer; // links\n this.dataStart = changetype(buffer);\n this.byteLength = bufferSize;\n this.length_ = length;\n }\n\n get length(): i32 {\n return this.length_;\n }\n\n set length(newLength: i32) {\n ensureCapacity(changetype(this), newLength, alignof(), false);\n this.length_ = newLength;\n }\n\n every(fn: (value: T, index: i32, array: Array) => bool): bool {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n if (!fn(load(this.dataStart + (i << alignof())), i, this)) return false;\n }\n return true;\n }\n\n findIndex(fn: (value: T, index: i32, array: Array) => bool): i32 {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n if (fn(load(this.dataStart + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n findLastIndex(fn: (value: T, index: i32, array: Array) => bool): i32 {\n for (let i = this.length_ - 1; i >= 0; --i) {\n if (fn(load(this.dataStart + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n @operator(\"[]\") private __get(index: i32): T {\n if (index >= this.length_) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(this.dataStart + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n @unsafe @operator(\"{}\") private __uget(index: i32): T {\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator(\"[]=\") private __set(index: i32, value: T): void {\n if (index >= this.length_) {\n if (index < 0) throw new RangeError(E_INDEXOUTOFRANGE);\n ensureCapacity(changetype(this), index + 1, alignof());\n this.length_ = index + 1;\n }\n this.__uset(index, value);\n }\n\n @unsafe @operator(\"{}=\") private __uset(index: i32, value: T): void {\n store(this.dataStart + (index << alignof()), value);\n if (isManaged()) {\n __link(changetype(this), changetype(value), true);\n }\n }\n\n at(index: i32): T {\n var len = this.length_;\n index += select(0, len, index >= 0);\n if (index >= len) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(this.dataStart + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this {\n var ptr = this.dataStart;\n var len = this.length_;\n start = start < 0 ? max(len + start, 0) : min(start, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n if (isManaged()) {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), changetype(value));\n __link(changetype(this), changetype(value), true);\n }\n } else if (sizeof() == 1) {\n if (start < end) {\n memory.fill(\n ptr + start,\n u8(value),\n (end - start)\n );\n }\n } else {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), value);\n }\n }\n return this;\n }\n\n includes(value: T, fromIndex: i32 = 0): bool {\n if (isFloat()) {\n let len = this.length_;\n if (len == 0 || fromIndex >= len) return false;\n if (fromIndex < 0) fromIndex = max(len + fromIndex, 0);\n let ptr = this.dataStart;\n while (fromIndex < len) {\n let elem = load(ptr + (fromIndex << alignof()));\n // @ts-ignore\n if (elem == value || isNaN(elem) & isNaN(value)) return true;\n ++fromIndex;\n }\n return false;\n } else {\n return this.indexOf(value, fromIndex) >= 0;\n }\n }\n\n indexOf(value: T, fromIndex: i32 = 0): i32 {\n var len = this.length_;\n if (len == 0 || fromIndex >= len) return -1;\n if (fromIndex < 0) fromIndex = max(len + fromIndex, 0);\n var ptr = this.dataStart;\n while (fromIndex < len) {\n if (load(ptr + (fromIndex << alignof())) == value) return fromIndex;\n ++fromIndex;\n }\n return -1;\n }\n\n lastIndexOf(value: T, fromIndex: i32 = this.length_): i32 {\n var len = this.length_;\n if (len == 0) return -1;\n if (fromIndex < 0) fromIndex = len + fromIndex;\n else if (fromIndex >= len) fromIndex = len - 1;\n var ptr = this.dataStart;\n while (fromIndex >= 0) {\n if (load(ptr + (fromIndex << alignof())) == value) return fromIndex;\n --fromIndex;\n }\n return -1;\n }\n\n push(value: T): i32 {\n var oldLen = this.length_;\n var len = oldLen + 1;\n ensureCapacity(changetype(this), len, alignof());\n if (isManaged()) {\n store(this.dataStart + (oldLen << alignof()), changetype(value));\n __link(changetype(this), changetype(value), true);\n } else {\n store(this.dataStart + (oldLen << alignof()), value);\n }\n this.length_ = len;\n return len;\n }\n\n concat(other: Array): Array {\n var thisLen = this.length_;\n var otherLen = select(0, other.length_, other === null);\n var outLen = thisLen + otherLen;\n if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH);\n var out = changetype>(__newArray(outLen, alignof(), idof>()));\n var outStart = out.dataStart;\n var thisSize = thisLen << alignof();\n if (isManaged()) {\n let thisStart = this.dataStart;\n for (let offset: usize = 0; offset < thisSize; offset += sizeof()) {\n let ref = load(thisStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n outStart += thisSize;\n let otherStart = other.dataStart;\n let otherSize = otherLen << alignof();\n for (let offset: usize = 0; offset < otherSize; offset += sizeof()) {\n let ref = load(otherStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(outStart, this.dataStart, thisSize);\n memory.copy(outStart + thisSize, other.dataStart, otherLen << alignof());\n }\n return out;\n }\n\n copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this {\n var ptr = this.dataStart;\n var len = this.length_;\n\n end = min(end, len);\n\n var to = target < 0 ? max(len + target, 0) : min(target, len);\n var from = start < 0 ? max(len + start, 0) : min(start, len);\n var last = end < 0 ? max(len + end, 0) : min(end, len);\n var count = min(last - from, len - to);\n\n memory.copy( // is memmove\n ptr + (to << alignof()),\n ptr + (from << alignof()),\n count << alignof()\n );\n return this;\n }\n\n pop(): T {\n var len = this.length_;\n if (len < 1) throw new RangeError(E_EMPTYARRAY);\n var val = load(this.dataStart + ((--len) << alignof()));\n this.length_ = len;\n return val;\n }\n\n forEach(fn: (value: T, index: i32, array: Array) => void): void {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n fn(load(this.dataStart + (i << alignof())), i, this);\n }\n }\n\n map(fn: (value: T, index: i32, array: Array) => U): Array {\n var len = this.length_;\n var out = changetype>(__newArray(len, alignof(), idof>()));\n var outStart = out.dataStart;\n for (let i = 0; i < min(len, this.length_); ++i) {\n let result = fn(load(this.dataStart + (i << alignof())), i, this);\n store(outStart + (i << alignof()), result);\n if (isManaged()) {\n __link(changetype(out), changetype(result), true);\n }\n }\n return out;\n }\n\n filter(fn: (value: T, index: i32, array: Array) => bool): Array {\n var result = changetype>(__newArray(0, alignof(), idof>()));\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n let value = load(this.dataStart + (i << alignof()));\n if (fn(value, i, this)) result.push(value);\n }\n return result;\n }\n\n reduce(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n acc = fn(acc, load(this.dataStart + (i << alignof())), i, this);\n }\n return acc;\n }\n\n reduceRight(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = this.length_ - 1; i >= 0; --i) {\n acc = fn(acc, load(this.dataStart + (i << alignof())), i, this);\n }\n return acc;\n }\n\n shift(): T {\n var len = this.length_;\n if (len < 1) throw new RangeError(E_EMPTYARRAY);\n var base = this.dataStart;\n var element = load(base);\n var lastIndex = len - 1;\n memory.copy(\n base,\n base + sizeof(),\n lastIndex << alignof()\n );\n if (isReference()) {\n store(base + (lastIndex << alignof()), 0);\n } else {\n // @ts-ignore\n store(base + (lastIndex << alignof()), 0);\n }\n this.length_ = lastIndex;\n return element;\n }\n\n some(fn: (value: T, index: i32, array: Array) => bool): bool {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n if (fn(load(this.dataStart + (i << alignof())), i, this)) return true;\n }\n return false;\n }\n\n unshift(value: T): i32 {\n var len = this.length_ + 1;\n ensureCapacity(changetype(this), len, alignof());\n var ptr = this.dataStart;\n memory.copy(\n ptr + sizeof(),\n ptr,\n (len - 1) << alignof()\n );\n store(ptr, value);\n if (isManaged()) {\n __link(changetype(this), changetype(value), true);\n }\n this.length_ = len;\n return len;\n }\n\n slice(start: i32 = 0, end: i32 = i32.MAX_VALUE): Array {\n var len = this.length_;\n start = start < 0 ? max(start + len, 0) : min(start, len);\n end = end < 0 ? max(end + len, 0) : min(end , len);\n len = max(end - start, 0);\n var slice = changetype>(__newArray(len, alignof(), idof>()));\n var sliceBase = slice.dataStart;\n var thisBase = this.dataStart + (start << alignof());\n if (isManaged()) {\n let off = 0;\n let end = len << alignof();\n while (off < end) {\n let ref = load(thisBase + off);\n store(sliceBase + off, ref);\n __link(changetype(slice), ref, true);\n off += sizeof();\n }\n } else {\n memory.copy(sliceBase, thisBase, len << alignof());\n }\n return slice;\n }\n\n splice(start: i32, deleteCount: i32 = i32.MAX_VALUE): Array {\n var len = this.length_;\n start = start < 0 ? max(len + start, 0) : min(start, len);\n deleteCount = max(min(deleteCount, len - start), 0);\n var result = changetype>(__newArray(deleteCount, alignof(), idof>()));\n var resultStart = result.dataStart;\n var thisStart = this.dataStart;\n var thisBase = thisStart + (start << alignof());\n memory.copy(\n resultStart,\n thisBase,\n deleteCount << alignof()\n );\n var offset = start + deleteCount;\n if (len != offset) {\n memory.copy(\n thisBase,\n thisStart + (offset << alignof()),\n (len - offset) << alignof()\n );\n }\n this.length_ = len - deleteCount;\n return result;\n }\n\n reverse(): this {\n REVERSE(this.dataStart, this.length_);\n return this;\n }\n\n sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this {\n SORT(this.dataStart, this.length_, comparator);\n return this;\n }\n\n join(separator: string = \",\"): string {\n var ptr = this.dataStart;\n var len = this.length_;\n if (isBoolean()) return joinBooleanArray(ptr, len, separator);\n if (isInteger()) return joinIntegerArray(ptr, len, separator);\n if (isFloat()) return joinFloatArray(ptr, len, separator);\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (isString()) return joinStringArray(ptr, len, separator);\n }\n // For rest objects and arrays use general join routine\n if (isReference()) return joinReferenceArray(ptr, len, separator);\n ERROR(\"unspported element type\");\n return unreachable();\n }\n\n flat(): T {\n if (!isArray()) {\n throw new TypeError(E_ILLEGALGENTYPE);\n }\n // Get the length and data start values\n var ptr = this.dataStart;\n var len = this.length_;\n\n // calculate the end size with an initial pass\n var size = 0;\n for (let i = 0; i < len; ++i) {\n let child = load(ptr + (i << alignof()));\n size += child == 0 ? 0 : load(child, offsetof(\"length_\"));\n }\n\n // calculate the byteLength of the resulting backing ArrayBuffer\n const align = alignof>();\n var byteLength = size << align;\n var outBuffer = changetype(__new(byteLength, idof()));\n\n // create the return value and initialize it\n var outArray = changetype(__new(offsetof(), idof()));\n store(changetype(outArray), size, offsetof(\"length_\"));\n\n // byteLength, dataStart, and buffer are all readonly\n store(changetype(outArray), byteLength, offsetof(\"byteLength\"));\n store(changetype(outArray), changetype(outBuffer), offsetof(\"dataStart\"));\n store(changetype(outArray), changetype(outBuffer), offsetof(\"buffer\"));\n __link(changetype(outArray), changetype(outBuffer), false);\n\n // set the elements\n var resultOffset: usize = 0;\n for (let i = 0; i < len; ++i) { // for each child\n let child = load(ptr + (i << alignof()));\n\n // ignore null arrays\n if (!child) continue;\n\n // copy the underlying buffer data to the result buffer\n let childDataLength = load(child, offsetof(\"length_\")) << align;\n memory.copy(\n changetype(outBuffer) + resultOffset,\n load(child, offsetof(\"dataStart\")),\n childDataLength\n );\n\n // advance the result length\n resultOffset += childDataLength;\n }\n\n // if the `valueof` type is managed, we must link each reference\n if (isManaged>()) {\n for (let i = 0; i < size; ++i) {\n let ref = load(changetype(outBuffer) + (i << usize(alignof>())));\n __link(changetype(outBuffer), ref, true);\n }\n }\n\n return outArray;\n }\n\n toString(): string {\n return this.join();\n }\n\n // RT integration\n\n @unsafe private __visit(cookie: u32): void {\n if (isManaged()) {\n let cur = this.dataStart;\n let end = cur + (this.length_ << alignof());\n while (cur < end) {\n let val = load(cur);\n if (val) __visit(val, cookie);\n cur += sizeof();\n }\n }\n __visit(changetype(this.buffer), cookie);\n }\n}\n","/// \n\nimport { OBJECT, BLOCK_MAXSIZE, TOTAL_OVERHEAD } from \"./rt/common\";\nimport { compareImpl, strtol, strtod, isSpace, isAscii, isFinalSigma, toLower8, toUpper8 } from \"./util/string\";\nimport { SPECIALS_UPPER, casemap, bsearch } from \"./util/casemap\";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_UNPAIRED_SURROGATE } from \"./util/error\";\nimport { idof } from \"./builtins\";\nimport { Array } from \"./array\";\n\n@final export abstract class String {\n\n @lazy static readonly MAX_LENGTH: i32 = (BLOCK_MAXSIZE >>> alignof());\n\n static fromCharCode(unit: i32, surr: i32 = -1): String {\n var hasSur = surr > 0;\n var out = changetype(__new(2 << i32(hasSur), idof()));\n store(changetype(out), unit);\n if (hasSur) store(changetype(out), surr, 2);\n return out;\n }\n\n static fromCharCodes(units: Array): String {\n var length = units.length;\n var out = changetype(__new(length << 1, idof()));\n var ptr = units.dataStart;\n for (let i = 0; i < length; ++i) {\n store(changetype(out) + (i << 1), load(ptr + (i << 2)));\n }\n return out;\n }\n\n static fromCodePoint(code: i32): String {\n var hasSur = code > 0xFFFF;\n var out = changetype(__new(2 << i32(hasSur), idof()));\n if (!hasSur) {\n store(changetype(out), code);\n } else {\n // Checks valid code point range\n assert(code <= 0x10FFFF);\n code -= 0x10000;\n let hi = (code & 0x03FF) | 0xDC00;\n let lo = code >>> 10 | 0xD800;\n store(changetype(out), lo | hi << 16);\n }\n return out;\n }\n\n @builtin static raw(parts: TemplateStringsArray, ...args: unknown[]): string { return unreachable(); }\n\n get length(): i32 {\n return changetype(changetype(this) - TOTAL_OVERHEAD).rtSize >> 1;\n }\n\n at(pos: i32): String {\n var len = this.length;\n pos += select(0, len, pos >= 0);\n if (pos >= len) throw new RangeError(E_INDEXOUTOFRANGE);\n var out = __new(2, idof());\n store(out, load(changetype(this) + (pos << 1)));\n return changetype(out); // retains\n }\n\n @operator(\"[]\") charAt(pos: i32): String {\n if (pos >= this.length) return changetype(\"\");\n var out = changetype(__new(2, idof()));\n store(changetype(out), load(changetype(this) + (pos << 1)));\n return out;\n }\n\n charCodeAt(pos: i32): i32 {\n if (pos >= this.length) return -1; // (NaN)\n return load(changetype(this) + (pos << 1));\n }\n\n codePointAt(pos: i32): i32 {\n var len = this.length;\n if (pos >= len) return -1; // (undefined)\n var first = load(changetype(this) + (pos << 1));\n if ((first & 0xFC00) != 0xD800 || pos + 1 == len) return first;\n var second = load(changetype(this) + (pos << 1), 2);\n if ((second & 0xFC00) != 0xDC00) return first;\n return (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n }\n\n @operator(\"+\") private static __concat(left: String, right: String): String {\n return left.concat(right);\n }\n\n concat(other: String): String {\n var thisSize: isize = this.length << 1;\n var otherSize: isize = other.length << 1;\n var outSize: usize = thisSize + otherSize;\n if (outSize == 0) return changetype(\"\");\n var out = changetype(__new(outSize, idof()));\n memory.copy(changetype(out), changetype(this), thisSize);\n memory.copy(changetype(out) + thisSize, changetype(other), otherSize);\n return out;\n }\n\n endsWith(search: String, end: i32 = String.MAX_LENGTH): bool {\n end = min(max(end, 0), this.length);\n var searchLength = search.length;\n var searchStart = end - searchLength;\n if (searchStart < 0) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(this, searchStart, search, 0, searchLength);\n }\n\n @operator(\"==\") private static __eq(left: String | null, right: String | null): bool {\n if (left === right) return true;\n if (left === null || right === null) return false;\n var leftLength = left.length;\n if (leftLength != right.length) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(left, 0, right, 0, leftLength);\n }\n\n @operator.prefix(\"!\")\n private static __not(str: String | null): bool {\n return str === null || !str.length;\n }\n\n @operator(\"!=\")\n private static __ne(left: String | null, right: String | null): bool {\n return !this.__eq(left, right);\n }\n\n @operator(\">\") private static __gt(left: String, right: String): bool {\n if (left === right) return false;\n var leftLength = left.length;\n if (!leftLength) return false;\n var rightLength = right.length;\n if (!rightLength) return true;\n // @ts-ignore: string <-> String\n var res = compareImpl(left, 0, right, 0, min(leftLength, rightLength));\n return res ? res > 0 : leftLength > rightLength;\n }\n\n @operator(\">=\") private static __gte(left: String, right: String): bool {\n return !this.__lt(left, right);\n }\n\n @operator(\"<\") private static __lt(left: String, right: String): bool {\n if (left === right) return false;\n var rightLength = right.length;\n if (!rightLength) return false;\n var leftLength = left.length;\n if (!leftLength) return true;\n // @ts-ignore: string <-> String\n var res = compareImpl(left, 0, right, 0, min(leftLength, rightLength));\n return res ? res < 0 : leftLength < rightLength;\n }\n\n @operator(\"<=\") private static __lte(left: String, right: String): bool {\n return !this.__gt(left, right);\n }\n\n includes(search: String, start: i32 = 0): bool {\n return this.indexOf(search, start) != -1;\n }\n\n indexOf(search: String, start: i32 = 0): i32 {\n var searchLen = search.length;\n if (!searchLen) return 0;\n var len = this.length;\n if (!len) return -1;\n var searchStart = min(max(start, 0), len);\n for (len -= searchLen; searchStart <= len; ++searchStart) {\n // @ts-ignore: string <-> String\n if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart;\n }\n return -1;\n }\n\n lastIndexOf(search: String, start: i32 = i32.MAX_VALUE): i32 {\n var searchLen = search.length;\n if (!searchLen) return this.length;\n var len = this.length;\n if (!len) return -1;\n var searchStart = min(max(start, 0), len - searchLen);\n for (; searchStart >= 0; --searchStart) {\n // @ts-ignore: string <-> String\n if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart;\n }\n return -1;\n }\n\n // TODO: implement full locale comparison with locales and Collator options\n localeCompare(other: String): i32 {\n if (other === this) return 0; // compare pointers\n var len: isize = this.length;\n var otherLen: isize = other.length;\n if (otherLen != len) return select(1, -1, len > otherLen);\n if (!otherLen) return 0; // \"\" == \"\"\n // @ts-ignore: string <-> String\n return compareImpl(this, 0, other, 0, otherLen);\n }\n\n startsWith(search: String, start: i32 = 0): bool {\n var len = this.length;\n var searchStart = min(max(start, 0), len);\n var searchLength = search.length;\n if (searchLength + searchStart > len) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(this, searchStart, search, 0, searchLength);\n }\n\n substr(start: i32, length: i32 = i32.MAX_VALUE): String { // legacy\n var intStart: isize = start;\n var end: isize = length;\n var len: isize = this.length;\n if (intStart < 0) intStart = max(len + intStart, 0);\n var size = min(max(end, 0), len - intStart) << 1;\n if (size <= 0) return changetype(\"\");\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + (intStart << 1), size);\n return out;\n }\n\n substring(start: i32, end: i32 = i32.MAX_VALUE): String {\n var len: isize = this.length;\n var finalStart = min(max(start, 0), len);\n var finalEnd = min(max(end, 0), len);\n var fromPos = min(finalStart, finalEnd) << 1;\n var toPos = max(finalStart, finalEnd) << 1;\n var size = toPos - fromPos;\n if (!size) return changetype(\"\");\n if (!fromPos && toPos == len << 1) return this;\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + fromPos, size);\n return out;\n }\n\n trim(): String {\n var len = this.length;\n var size: usize = len << 1;\n while (size && isSpace(load(changetype(this) + size - 2))) {\n size -= 2;\n }\n var offset: usize = 0;\n while (offset < size && isSpace(load(changetype(this) + offset))) {\n offset += 2; size -= 2;\n }\n if (!size) return changetype(\"\");\n if (!offset && size == len << 1) return this;\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + offset, size);\n return out;\n }\n\n @inline\n trimLeft(): String {\n return this.trimStart();\n }\n\n @inline\n trimRight(): String {\n return this.trimEnd();\n }\n\n trimStart(): String {\n var size = this.length << 1;\n var offset: usize = 0;\n while (offset < size && isSpace(load(changetype(this) + offset))) {\n offset += 2;\n }\n if (!offset) return this;\n size -= offset;\n if (!size) return changetype(\"\");\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + offset, size);\n return out;\n }\n\n trimEnd(): String {\n var originalSize = this.length << 1;\n var size = originalSize;\n while (size && isSpace(load(changetype(this) + size - 2))) {\n size -= 2;\n }\n if (!size) return changetype(\"\");\n if (size == originalSize) return this;\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this), size);\n return out;\n }\n\n padStart(length: i32, pad: string = \" \"): String {\n var thisSize = this.length << 1;\n var targetSize = length << 1;\n var padSize = pad.length << 1;\n if (targetSize < thisSize || !padSize) return this;\n var prependSize = targetSize - thisSize;\n var out = changetype(__new(targetSize, idof()));\n if (prependSize > padSize) {\n let repeatCount = (prependSize - 2) / padSize;\n let restBase = repeatCount * padSize;\n let restSize = prependSize - restBase;\n memory.repeat(changetype(out), changetype(pad), padSize, repeatCount);\n memory.copy(changetype(out) + restBase, changetype(pad), restSize);\n } else {\n memory.copy(changetype(out), changetype(pad), prependSize);\n }\n memory.copy(changetype(out) + prependSize, changetype(this), thisSize);\n return out;\n }\n\n padEnd(length: i32, pad: string = \" \"): String {\n var thisSize = this.length << 1;\n var targetSize = length << 1;\n var padSize = pad.length << 1;\n if (targetSize < thisSize || !padSize) return this;\n var appendSize = targetSize - thisSize;\n var out = changetype(__new(targetSize, idof()));\n memory.copy(changetype(out), changetype(this), thisSize);\n if (appendSize > padSize) {\n let repeatCount = (appendSize - 2) / padSize;\n let restBase = repeatCount * padSize;\n let restSize = appendSize - restBase;\n memory.repeat(changetype(out) + thisSize, changetype(pad), padSize, repeatCount);\n memory.copy(changetype(out) + thisSize + restBase, changetype(pad), restSize);\n } else {\n memory.copy(changetype(out) + thisSize, changetype(pad), appendSize);\n }\n return out;\n }\n\n repeat(count: i32 = 0): String {\n var length = this.length;\n\n // Most browsers can't handle strings 1 << 28 chars or longer\n if (count < 0 || length * count > (1 << 28)) {\n throw new RangeError(E_INVALIDLENGTH);\n }\n\n if (count == 0 || !length) return changetype(\"\");\n if (count == 1) return this;\n var out = changetype(__new((length * count) << 1, idof()));\n memory.repeat(changetype(out), changetype(this), length << 1, count);\n return out;\n }\n\n replace(search: String, replacement: String): String {\n var len: usize = this.length;\n var slen: usize = search.length;\n if (len <= slen) {\n return len < slen ? this : select(replacement, this, search == this);\n }\n var index: isize = this.indexOf(search);\n if (~index) {\n let rlen: usize = replacement.length;\n len -= slen;\n let olen = len + rlen;\n if (olen) {\n let out = changetype(__new(olen << 1, idof()));\n memory.copy(changetype(out), changetype(this), index << 1);\n memory.copy(\n changetype(out) + (index << 1),\n changetype(replacement),\n rlen << 1\n );\n memory.copy(\n changetype(out) + ((index + rlen) << 1),\n changetype(this) + ((index + slen) << 1),\n (len - index) << 1\n );\n return out;\n }\n }\n return this;\n }\n\n replaceAll(search: String, replacement: String): String {\n var thisLen: usize = this.length;\n var searchLen: usize = search.length;\n if (thisLen <= searchLen) {\n return thisLen < searchLen\n ? this\n : select(replacement, this, search == this);\n }\n var replaceLen: usize = replacement.length;\n if (!searchLen) {\n if (!replaceLen) return this;\n // Special case: 'abc'.replaceAll('', '-') -> '-a-b-c-'\n let out = changetype(__new((thisLen + (thisLen + 1) * replaceLen) << 1, idof()));\n memory.copy(changetype(out), changetype(replacement), replaceLen << 1);\n let offset = replaceLen;\n for (let i: usize = 0; i < thisLen; ++i) {\n store(\n changetype(out) + (offset++ << 1),\n load(changetype(this) + (i << 1))\n );\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(replacement),\n replaceLen << 1\n );\n offset += replaceLen;\n }\n return out;\n }\n var prev: isize = 0, next: isize = 0;\n if (searchLen == replaceLen) {\n // Fast path when search and replacement have same length\n let outSize = thisLen << 1;\n let out = changetype(__new(outSize, idof()));\n memory.copy(changetype(out), changetype(this), outSize);\n while (~(next = this.indexOf(search, prev))) {\n memory.copy(changetype(out) + (next << 1), changetype(replacement), replaceLen << 1);\n prev = next + searchLen;\n }\n return out;\n }\n var out: String | null = null, offset: usize = 0, outSize = thisLen;\n while (~(next = this.indexOf(search, prev))) {\n if (!out) out = changetype(__new(thisLen << 1, idof()));\n let chunk = next - prev;\n if (offset + chunk + replaceLen > outSize) {\n outSize <<= 1;\n out = changetype(__renew(changetype(out), outSize << 1));\n }\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(this) + (prev << 1),\n chunk << 1\n );\n offset += chunk;\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(replacement),\n replaceLen << 1\n );\n offset += replaceLen;\n prev = next + searchLen;\n }\n if (out) {\n let rest = thisLen - prev;\n if (offset + rest > outSize) {\n outSize <<= 1;\n out = changetype(__renew(changetype(out), outSize << 1));\n }\n if (rest) {\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(this) + (prev << 1),\n rest << 1\n );\n }\n rest += offset;\n if (outSize > rest) {\n out = changetype(__renew(changetype(out), rest << 1));\n }\n return out;\n }\n return this;\n }\n\n slice(start: i32, end: i32 = i32.MAX_VALUE): String {\n var len = this.length;\n start = start < 0 ? max(start + len, 0) : min(start, len);\n end = end < 0 ? max(end + len, 0) : min(end, len);\n len = end - start;\n if (len <= 0) return changetype(\"\");\n var out = changetype(__new(len << 1, idof()));\n memory.copy(changetype(out), changetype(this) + (start << 1), len << 1);\n return out;\n }\n\n split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] {\n if (!limit) return changetype(__newArray(0, alignof(), idof>()));\n if (separator === null) return [this];\n var length: isize = this.length;\n var sepLen = separator.length;\n if (limit < 0) limit = i32.MAX_VALUE;\n if (!sepLen) {\n if (!length) return changetype(__newArray(0, alignof(), idof>()));\n // split by chars\n length = min(length, limit);\n let result = changetype(__newArray(length, alignof(), idof>()));\n // @ts-ignore: cast\n let resultStart = result.dataStart as usize;\n for (let i: isize = 0; i < length; ++i) {\n let charStr = changetype(__new(2, idof()));\n store(changetype(charStr), load(changetype(this) + (i << 1)));\n store(resultStart + (i << alignof()), changetype(charStr)); // result[i] = charStr\n __link(changetype(result), changetype(charStr), true);\n }\n return result;\n } else if (!length) {\n let result = changetype(__newArray(1, alignof(), idof>()));\n // @ts-ignore: cast\n store(result.dataStart as usize, changetype(\"\")); // static \"\"\n return result;\n }\n var result = changetype(__newArray(0, alignof(), idof>()));\n var end = 0, start = 0, i = 0;\n while (~(end = this.indexOf(separator, start))) {\n let len = end - start;\n if (len > 0) {\n let out = changetype(__new(len << 1, idof()));\n memory.copy(changetype(out), changetype(this) + (start << 1), len << 1);\n result.push(out);\n } else {\n result.push(changetype(\"\"));\n }\n if (++i == limit) return result;\n start = end + sepLen;\n }\n if (!start) { // also means: loop above didn't do anything\n result.push(this);\n return result;\n }\n var len = length - start;\n if (len > 0) {\n let out = changetype(__new(len << 1, idof()));\n memory.copy(changetype(out), changetype(this) + (start << 1), len << 1);\n result.push(out);\n } else {\n result.push(changetype(\"\")); // static \"\"\n }\n return result;\n }\n\n toUpperCase(): String {\n var len = this.length;\n if (!len) return this;\n var codes = changetype(__new(len * 2 * 2, idof()));\n var j: usize = 0;\n for (let i: usize = 0; i < len; ++i, ++j) {\n let c = load(changetype(this) + (i << 1));\n if (isAscii(c)) {\n store(changetype(codes) + (j << 1), toLower8(c));\n } else {\n // check and read surrogate pair\n if ((c - 0xD7FF < 0xDC00 - 0xD7FF) && i < len - 1) {\n let c1 = load(changetype(this) + (i << 1), 2);\n if (c1 - 0xDBFF < 0xE000 - 0xDBFF) {\n let c0 = c;\n c = (((c & 0x03FF) << 10) | (c1 & 0x03FF)) + 0x10000;\n ++i;\n if (c >= 0x20000) {\n store(changetype(codes) + (j << 1), c0 | (c1 << 16));\n ++j;\n continue;\n }\n }\n }\n // check special casing for lower table. It has one ently so instead lookup we just inline this.\n if (c == 0x0130) {\n // 0x0130 -> [0x0069, 0x0307]\n store(changetype(codes) + (j << 1), (0x0307 << 16) | 0x0069);\n ++j;\n } else if (c == 0x03A3) { // 'Σ'\n // Σ maps to σ but except at the end of a word where it maps to ς\n let sigma = 0x03C3; // σ\n if (len > 1 && isFinalSigma(changetype(this), i, len)) {\n sigma = 0x03C2; // ς\n }\n store(changetype(codes) + (j << 1), sigma);\n } else if (c - 0x24B6 <= 0x24CF - 0x24B6) {\n // Range 0x24B6 <= c <= 0x24CF not covered by casemap and require special early handling\n store(changetype(codes) + (j << 1), c + 26);\n } else {\n let code = casemap(c, 0) & 0x1FFFFF;\n if (code < 0x10000) {\n store(changetype(codes) + (j << 1), code);\n } else {\n // store as surrogare pair\n code -= 0x10000;\n let lo = (code >>> 10) | 0xD800;\n let hi = (code & 0x03FF) | 0xDC00;\n store(changetype(codes) + (j << 1), lo | (hi << 16));\n ++j;\n }\n }\n }\n }\n return changetype(__renew(changetype(codes), j << 1));\n }\n\n toUpperCase(): String {\n var len = this.length;\n if (!len) return this;\n var codes = changetype(__new(len * 3 * 2, idof()));\n var specialsPtr = changetype(SPECIALS_UPPER);\n var specialsLen = SPECIALS_UPPER.length;\n var j: usize = 0;\n for (let i: usize = 0; i < len; ++i, ++j) {\n let c = load(changetype(this) + (i << 1));\n if (isAscii(c)) {\n store(changetype(codes) + (j << 1), toUpper8(c));\n } else {\n // check and read surrogate pair\n if ((c - 0xD7FF < 0xDC00 - 0xD7FF) && i < len - 1) {\n let c1 = load(changetype(this) + (i << 1), 2);\n if (c1 - 0xDBFF < 0xE000 - 0xDBFF) {\n let c0 = c;\n c = (((c & 0x03FF) << 10) | (c1 & 0x03FF)) + 0x10000;\n ++i;\n if (c >= 0x20000) {\n store(changetype(codes) + (j << 1), c0 | (c1 << 16));\n ++j;\n continue;\n }\n }\n }\n // Range 0x24D0 <= c <= 0x24E9 not covered by casemap and require special early handling\n if (c - 0x24D0 <= 0x24E9 - 0x24D0) {\n // monkey patch\n store(changetype(codes) + (j << 1), c - 26);\n } else {\n let index: usize = -1;\n // Fast range check. See first and last rows in specialsUpper table\n if (c - 0x00DF <= 0xFB17 - 0x00DF) {\n index = bsearch(c, specialsPtr, specialsLen);\n }\n if (~index) {\n // load next 3 code points from row with `index` offset for specialsUpper table\n let ab = load(specialsPtr + (index << 1), 2);\n let cc = load(specialsPtr + (index << 1), 6);\n store(changetype(codes) + (j << 1), ab, 0);\n store(changetype(codes) + (j << 1), cc, 4);\n j += 1 + usize(cc != 0);\n } else {\n let code = casemap(c, 1) & 0x1FFFFF;\n if (code < 0x10000) {\n store(changetype(codes) + (j << 1), code);\n } else {\n // store as surrogare pair\n code -= 0x10000;\n let lo = (code >>> 10) | 0xD800;\n let hi = (code & 0x03FF) | 0xDC00;\n store(changetype(codes) + (j << 1), lo | (hi << 16));\n ++j;\n }\n }\n }\n }\n }\n return changetype(__renew(changetype(codes), j << 1));\n }\n\n toString(): String {\n return this;\n }\n}\n\n// @ts-ignore: nolib\nexport type string = String;\n\nexport function parseInt(str: string, radix: i32 = 0): f64 {\n return strtol(str, radix);\n}\n\nexport function parseFloat(str: string): f64 {\n return strtod(str);\n}\n\n// Encoding helpers\nexport namespace String {\n\n export namespace UTF8 {\n\n export const enum ErrorMode {\n WTF8,\n REPLACE,\n ERROR\n }\n\n export function byteLength(str: string, nullTerminated: bool = false): i32 {\n var strOff = changetype(str);\n var strEnd = strOff + changetype(changetype(str) - TOTAL_OVERHEAD).rtSize;\n var bufLen = i32(nullTerminated);\n while (strOff < strEnd) {\n let c1 = load(strOff);\n if (c1 < 128) {\n // @ts-ignore: cast\n if (nullTerminated & !c1) break;\n bufLen += 1;\n } else if (c1 < 2048) {\n bufLen += 2;\n } else {\n if ((c1 & 0xFC00) == 0xD800 && strOff + 2 < strEnd) {\n if ((load(strOff, 2) & 0xFC00) == 0xDC00) {\n bufLen += 4; strOff += 4;\n continue;\n }\n }\n bufLen += 3;\n }\n strOff += 2;\n }\n return bufLen;\n }\n\n export function encode(str: string, nullTerminated: bool = false, errorMode: ErrorMode = ErrorMode.WTF8): ArrayBuffer {\n var buf = changetype(__new(byteLength(str, nullTerminated), idof()));\n encodeUnsafe(changetype(str), str.length, changetype(buf), nullTerminated, errorMode);\n return buf;\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function encodeUnsafe(str: usize, len: i32, buf: usize, nullTerminated: bool = false, errorMode: ErrorMode = ErrorMode.WTF8): usize {\n var strEnd = str + (len << 1);\n var bufOff = buf;\n while (str < strEnd) {\n let c1 = load(str);\n if (c1 < 128) {\n store(bufOff, c1);\n bufOff++;\n } else if (c1 < 2048) {\n let b0 = c1 >> 6 | 192;\n let b1 = c1 & 63 | 128;\n store(bufOff, b1 << 8 | b0);\n bufOff += 2;\n } else {\n // D800: 11011 0 0000000000 Lead\n // DBFF: 11011 0 1111111111\n // DC00: 11011 1 0000000000 Trail\n // DFFF: 11011 1 1111111111\n // F800: 11111 0 0000000000 Mask\n // FC00: 11111 1 0000000000\n if ((c1 & 0xF800) == 0xD800) {\n if (c1 < 0xDC00 && str + 2 < strEnd) {\n let c2 = load(str, 2);\n if ((c2 & 0xFC00) == 0xDC00) {\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) | (c2 & 0x03FF);\n let b0 = c1 >> 18 | 240;\n let b1 = c1 >> 12 & 63 | 128;\n let b2 = c1 >> 6 & 63 | 128;\n let b3 = c1 & 63 | 128;\n store(bufOff, b3 << 24 | b2 << 16 | b1 << 8 | b0);\n bufOff += 4; str += 4;\n continue;\n }\n }\n if (errorMode != ErrorMode.WTF8) { // unlikely\n if (errorMode == ErrorMode.ERROR) throw new Error(E_UNPAIRED_SURROGATE);\n c1 = 0xFFFD;\n }\n }\n let b0 = c1 >> 12 | 224;\n let b1 = c1 >> 6 & 63 | 128;\n let b2 = c1 & 63 | 128;\n store(bufOff, b1 << 8 | b0);\n store(bufOff, b2, 2);\n bufOff += 3;\n }\n str += 2;\n }\n if (nullTerminated) {\n store(bufOff++, 0);\n }\n return bufOff - buf;\n }\n\n export function decode(buf: ArrayBuffer, nullTerminated: bool = false): String {\n return decodeUnsafe(changetype(buf), buf.byteLength, nullTerminated);\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function decodeUnsafe(buf: usize, len: usize, nullTerminated: bool = false): String {\n var bufOff = buf;\n var bufEnd = buf + len;\n assert(bufEnd >= bufOff); // guard wraparound\n var str = changetype(__new(len << 1, idof())); // max is one u16 char per u8 byte\n var strOff = changetype(str);\n while (bufOff < bufEnd) {\n let u0 = load(bufOff); ++bufOff;\n if (!(u0 & 128)) {\n // @ts-ignore: cast\n if (nullTerminated & !u0) break;\n store(strOff, u0);\n } else {\n if (bufEnd == bufOff) break;\n let u1 = load(bufOff) & 63; ++bufOff;\n if ((u0 & 224) == 192) {\n store(strOff, (u0 & 31) << 6 | u1);\n } else {\n if (bufEnd == bufOff) break;\n let u2 = load(bufOff) & 63; ++bufOff;\n if ((u0 & 240) == 224) {\n u0 = (u0 & 15) << 12 | u1 << 6 | u2;\n } else {\n if (bufEnd == bufOff) break;\n u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | load(bufOff) & 63;\n ++bufOff;\n }\n if (u0 < 0x10000) {\n store(strOff, u0);\n } else {\n u0 -= 0x10000;\n let lo = u0 >> 10 | 0xD800;\n let hi = (u0 & 0x03FF) | 0xDC00;\n store(strOff, lo | (hi << 16));\n strOff += 2;\n }\n }\n }\n strOff += 2;\n }\n return changetype(__renew(changetype(str), strOff - changetype(str)));\n }\n }\n\n export namespace UTF16 {\n\n export function byteLength(str: string): i32 {\n return changetype(changetype(str) - TOTAL_OVERHEAD).rtSize;\n }\n\n export function encode(str: string): ArrayBuffer {\n var buf = changetype(__new(byteLength(str), idof()));\n encodeUnsafe(changetype(str), str.length, changetype(buf));\n return buf;\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function encodeUnsafe(str: usize, len: i32, buf: usize): usize {\n var size = len << 1;\n memory.copy(buf, changetype(str), size);\n return size;\n }\n\n export function decode(buf: ArrayBuffer): String {\n return decodeUnsafe(changetype(buf), buf.byteLength);\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function decodeUnsafe(buf: usize, len: usize): String {\n var str = changetype(__new(len &= ~1, idof()));\n memory.copy(changetype(str), buf, len);\n return str;\n }\n }\n}\n\nexport class TemplateStringsArray extends Array {\n readonly raw: string[];\n}\n","import { E_INVALIDDATE } from \"util/error\";\nimport { now as Date_now } from \"./bindings/Date\";\n\n// @ts-ignore: decorator\n@inline const\n MILLIS_PER_DAY = 1000 * 60 * 60 * 24,\n MILLIS_PER_HOUR = 1000 * 60 * 60,\n MILLIS_PER_MINUTE = 1000 * 60,\n MILLIS_PER_SECOND = 1000;\n\n// ymdFromEpochDays returns values via globals to avoid allocations\n// @ts-ignore: decorator\n@lazy let _month: i32, _day: i32;\n\nexport class Date {\n private year: i32 = 0;\n private month: i32 = 0;\n private day: i32 = 0;\n\n @inline static UTC(\n year: i32,\n month: i32 = 0,\n day: i32 = 1,\n hour: i32 = 0,\n minute: i32 = 0,\n second: i32 = 0,\n millisecond: i32 = 0\n ): i64 {\n if (year >= 0 && year <= 99) year += 1900;\n var ms = epochMillis(year, month + 1, day, hour, minute, second, millisecond);\n if (invalidDate(ms)) throw new RangeError(E_INVALIDDATE);\n return ms;\n }\n\n @inline static now(): i64 {\n return Date_now();\n }\n\n // It can parse only ISO 8601 inputs like YYYY-MM-DDTHH:MM:SS.000Z\n @inline static parse(dateString: string): Date {\n return this.fromString(dateString);\n }\n\n static fromString(dateTimeString: string): Date {\n if (!dateTimeString.length) throw new RangeError(E_INVALIDDATE);\n var\n hour: i32 = 0,\n min: i32 = 0,\n sec: i32 = 0,\n ms: i32 = 0;\n\n var dateString = dateTimeString;\n var posT = dateTimeString.indexOf(\"T\");\n if (~posT) {\n // includes a time component\n let timeString: string;\n dateString = dateTimeString.substring(0, posT);\n timeString = dateTimeString.substring(posT + 1);\n // parse the HH-MM-SS component\n let timeParts = timeString.split(\":\");\n let len = timeParts.length;\n if (len <= 1) throw new RangeError(E_INVALIDDATE);\n\n hour = I32.parseInt(timeParts[0]);\n min = I32.parseInt(timeParts[1]);\n if (len >= 3) {\n let secAndMs = timeParts[2];\n let posDot = secAndMs.indexOf(\".\");\n if (~posDot) {\n // includes milliseconds\n sec = I32.parseInt(secAndMs.substring(0, posDot));\n ms = I32.parseInt(secAndMs.substring(posDot + 1));\n } else {\n sec = I32.parseInt(secAndMs);\n }\n }\n }\n // parse the YYYY-MM-DD component\n var parts = dateString.split(\"-\");\n var year = I32.parseInt(parts[0]);\n var month = 1, day = 1;\n var len = parts.length;\n if (len >= 2) {\n month = I32.parseInt(parts[1]);\n if (len >= 3) {\n day = I32.parseInt(parts[2]);\n }\n }\n return new Date(epochMillis(year, month, day, hour, min, sec, ms));\n }\n\n constructor(private epochMillis: i64) {\n // this differs from JavaScript which prefer return NaN or \"Invalid Date\" string\n // instead throwing exception.\n if (invalidDate(epochMillis)) throw new RangeError(E_INVALIDDATE);\n\n this.year = ymdFromEpochDays(i32(floorDiv(epochMillis, MILLIS_PER_DAY)));\n this.month = _month;\n this.day = _day;\n }\n\n @inline getTime(): i64 {\n return this.epochMillis;\n }\n\n setTime(time: i64): i64 {\n if (invalidDate(time)) throw new RangeError(E_INVALIDDATE);\n\n this.epochMillis = time;\n this.year = ymdFromEpochDays(i32(floorDiv(time, MILLIS_PER_DAY)));\n this.month = _month;\n this.day = _day;\n\n return time;\n }\n\n @inline getUTCFullYear(): i32 {\n return this.year;\n }\n\n @inline getUTCMonth(): i32 {\n return this.month - 1;\n }\n\n @inline getUTCDate(): i32 {\n return this.day;\n }\n\n @inline getUTCDay(): i32 {\n return dayOfWeek(this.year, this.month, this.day);\n }\n\n getUTCHours(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_DAY)) / MILLIS_PER_HOUR;\n }\n\n getUTCMinutes(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_HOUR)) / MILLIS_PER_MINUTE;\n }\n\n getUTCSeconds(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_MINUTE)) / MILLIS_PER_SECOND;\n }\n\n getUTCMilliseconds(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_SECOND));\n }\n\n setUTCMilliseconds(millis: i32): void {\n this.setTime(this.epochMillis + (millis - this.getUTCMilliseconds()));\n }\n\n setUTCSeconds(seconds: i32): void {\n this.setTime(this.epochMillis + (seconds - this.getUTCSeconds()) * MILLIS_PER_SECOND);\n }\n\n setUTCMinutes(minutes: i32): void {\n this.setTime(this.epochMillis + (minutes - this.getUTCMinutes()) * MILLIS_PER_MINUTE);\n }\n\n setUTCHours(hours: i32): void {\n this.setTime(this.epochMillis + (hours - this.getUTCHours()) * MILLIS_PER_HOUR);\n }\n\n setUTCDate(day: i32): void {\n if (this.day == day) return;\n var ms = euclidRem(this.epochMillis, MILLIS_PER_DAY);\n this.setTime(i64(daysSinceEpoch(this.year, this.month, day)) * MILLIS_PER_DAY + ms);\n }\n\n setUTCMonth(month: i32): void {\n if (this.month == month) return;\n var ms = euclidRem(this.epochMillis, MILLIS_PER_DAY);\n this.setTime(i64(daysSinceEpoch(this.year, month + 1, this.day)) * MILLIS_PER_DAY + ms);\n }\n\n setUTCFullYear(year: i32): void {\n if (this.year == year) return;\n var ms = euclidRem(this.epochMillis, MILLIS_PER_DAY);\n this.setTime(i64(daysSinceEpoch(year, this.month, this.day)) * MILLIS_PER_DAY + ms);\n }\n\n toISOString(): string {\n // TODO: add more low-level helper which combine toString and padStart without extra allocation\n var yearStr: string;\n var year = this.year;\n var isNeg = year < 0;\n if (isNeg || year >= 10000) {\n yearStr = (isNeg ? \"-\" : \"+\") + abs(year).toString().padStart(6, \"0\");\n } else {\n yearStr = year.toString().padStart(4, \"0\");\n }\n\n return (\n yearStr +\n \"-\" +\n this.month.toString().padStart(2, \"0\") +\n \"-\" +\n this.day.toString().padStart(2, \"0\") +\n \"T\" +\n this.getUTCHours().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCMinutes().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCSeconds().toString().padStart(2, \"0\") +\n \".\" +\n this.getUTCMilliseconds().toString().padStart(3, \"0\") +\n \"Z\"\n );\n }\n\n toISOString(): string {\n const weeks: StaticArray = [\n \"Sun, \", \"Mon, \", \"Tue, \", \"Wed, \", \"Thu, \", \"Fri, \", \"Sat, \"\n ];\n\n const months: StaticArray = [\n \" Jan \", \" Feb \", \" Mar \", \" Apr \", \" May \", \" Jun \",\n \" Jul \", \" Aug \", \" Sep \", \" Oct \", \" Nov \", \" Dec \"\n ];\n\n var mo = this.month;\n var da = this.day;\n var yr = this.year;\n var wd = dayOfWeek(yr, mo, da);\n var year = abs(yr).toString().padStart(4, \"0\");\n if (yr < 0) year = \"-\" + year;\n\n return (\n unchecked(weeks[wd]) +\n da.toString().padStart(2, \"0\") +\n unchecked(months[mo - 1]) +\n year +\n \" \" +\n this.getUTCHours().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCMinutes().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCSeconds().toString().padStart(2, \"0\") +\n \" GMT\"\n );\n }\n\n toDateString(): string {\n // TODO: use u64 static data instead 4 chars\n // also use stream itoa variants.\n const weeks: StaticArray = [\n \"Sun \", \"Mon \", \"Tue \", \"Wed \", \"Thu \", \"Fri \", \"Sat \"\n ];\n\n const months: StaticArray = [\n \"Jan \", \"Feb \", \"Mar \", \"Apr \", \"May \", \"Jun \",\n \"Jul \", \"Aug \", \"Sep \", \"Oct \", \"Nov \", \"Dec \"\n ];\n\n var mo = this.month;\n var da = this.day;\n var yr = this.year;\n var wd = dayOfWeek(yr, mo, da);\n var year = abs(yr).toString().padStart(4, \"0\");\n if (yr < 0) year = \"-\" + year;\n\n return (\n unchecked(weeks[wd]) +\n unchecked(months[mo - 1]) +\n da.toString().padStart(2, \"0\") +\n \" \" + year\n );\n }\n\n // Note: it uses UTC time instead local time (without timezone offset)\n toTimeString(): string {\n // TODO: add timezone\n return (\n this.getUTCHours().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCMinutes().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCSeconds().toString().padStart(2, \"0\")\n );\n }\n\n // Note: it uses UTC datetime instead local datetime (without timezone offset)\n toString(): string {\n return this.toDateString() + \" \" + this.toTimeString();\n }\n}\n\nfunction epochMillis(\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n milliseconds: i32\n): i64 {\n return (\n i64(daysSinceEpoch(year, month, day)) * MILLIS_PER_DAY +\n hour * MILLIS_PER_HOUR +\n minute * MILLIS_PER_MINUTE +\n second * MILLIS_PER_SECOND +\n milliseconds\n );\n}\n\n// @ts-ignore: decorator\n@inline function floorDiv(a: T, b: T): T {\n return (a >= 0 ? a : a - b + 1) / b as T;\n}\n\n// @ts-ignore: decorator\n@inline function euclidRem(a: T, b: T): T {\n var m = a % b;\n return m + (m < 0 ? b : 0) as T;\n}\n\nfunction invalidDate(millis: i64): bool {\n // @ts-ignore\n return (millis < -8640000000000000) | (millis > 8640000000000000);\n}\n\n// see: http://howardhinnant.github.io/date_algorithms.html#civil_from_days\nfunction ymdFromEpochDays(z: i32): i32 {\n z += 719468;\n var era = floorDiv(z, 146097);\n var doe = z - era * 146097; // [0, 146096]\n var yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; // [0, 399]\n var year = yoe + era * 400;\n var doy = doe - (365 * yoe + yoe / 4 - yoe / 100); // [0, 365]\n var mo = (5 * doy + 2) / 153; // [0, 11]\n _day = doy - (153 * mo + 2) / 5 + 1; // [1, 31]\n mo += mo < 10 ? 3 : -9; // [1, 12]\n _month = mo;\n year += u32(mo <= 2);\n return year;\n}\n\n// http://howardhinnant.github.io/date_algorithms.html#days_from_civil\nfunction daysSinceEpoch(y: i32, m: i32, d: i32): i32 {\n y -= i32(m <= 2);\n var era = floorDiv(y, 400);\n var yoe = y - era * 400; // [0, 399]\n var doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1; // [0, 365]\n var doe = yoe * 365 + yoe / 4 - yoe / 100 + doy; // [0, 146096]\n return era * 146097 + doe - 719468;\n}\n\n// TomohikoSakamoto algorithm from https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week\nfunction dayOfWeek(year: i32, month: i32, day: i32): i32 {\n const tab = memory.data([0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]);\n\n year -= i32(month < 3);\n year += floorDiv(year, 4) - floorDiv(year, 100) + floorDiv(year, 400);\n month = load(tab + month - 1);\n return euclidRem(year + month + day, 7);\n}\n","import { itoa32, utoa32, itoa64, utoa64, dtoa } from \"./util/number\";\nimport { strtol } from \"./util/string\";\n\n// @ts-ignore: decorator\n@builtin @inline\nexport const NaN: f64 = 0 / 0;\n\n// @ts-ignore: decorator\n@builtin @inline\nexport const Infinity: f64 = 1 / 0;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isNaN(value: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFinite(value: T): bool;\n\n@final @unmanaged\nexport abstract class I8 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i8 = i8.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i8 = i8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i8 {\n return strtol(value, radix);\n }\n\n toString(this: i8, radix: i32 = 10): String {\n return itoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class I16 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i16 = i16.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i16 = i16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i16 {\n return strtol(value, radix);\n }\n\n toString(this: i16, radix: i32 = 10): String {\n return itoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class I32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i32 = i32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i32 = i32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i32 {\n return strtol(value, radix);\n }\n\n toString(this: i32, radix: i32 = 10): String {\n return itoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class I64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i64 = i64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i64 = i64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i64 {\n return strtol(value, radix);\n }\n\n toString(this: i64, radix: i32 = 10): String {\n return itoa64(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class Isize {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: isize = isize.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: isize = isize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): isize {\n return strtol(value, radix);\n }\n\n toString(this: isize, radix: i32 = 10): String {\n if (sizeof() == 4) {\n return itoa32(this, radix);\n } else {\n return itoa64(this, radix);\n }\n }\n}\n\n@final @unmanaged\nexport abstract class U8 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u8 = u8.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u8 = u8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u8 {\n return strtol(value, radix);\n }\n\n toString(this: u8, radix: i32 = 10): String {\n return utoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class U16 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u16 = u16.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u16 = u16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u16 {\n return strtol(value, radix);\n }\n\n toString(this: u16, radix: i32 = 10): String {\n return utoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class U32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u32 = u32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u32 = u32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u32 {\n return strtol(value, radix);\n }\n\n toString(this: u32, radix: i32 = 10): String {\n return utoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class U64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u64 = u64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u64 = u64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u64 {\n return strtol(value, radix);\n }\n\n toString(this: u64, radix: i32 = 10): String {\n return utoa64(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class Usize {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: usize = usize.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: usize = usize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): usize {\n return strtol(value, radix);\n }\n\n toString(this: usize, radix: i32 = 10): String {\n if (sizeof() == 4) {\n return utoa32(this, radix);\n } else {\n return utoa64(this, radix);\n }\n }\n}\n\n@final @unmanaged\nexport abstract class Bool {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: bool = bool.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: bool = bool.MAX_VALUE;\n\n toString(this: bool, radix: i32 = 0): String {\n return this ? \"true\" : \"false\";\n }\n}\n\nexport { Bool as Boolean };\n\n@final @unmanaged\nexport abstract class F32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly EPSILON: f32 = f32.EPSILON;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: f32 = f32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: f32 = f32.MAX_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly POSITIVE_INFINITY: f32 = f32.POSITIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NEGATIVE_INFINITY: f32 = f32.NEGATIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NaN: f32 = f32.NaN;\n\n static isNaN(value: f32): bool {\n return isNaN(value);\n }\n\n static isFinite(value: f32): bool {\n return isFinite(value);\n }\n\n static isSafeInteger(value: f32): bool {\n return abs(value) <= f32.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f32): bool {\n return isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f32 {\n return strtol(value, radix);\n }\n\n static parseFloat(value: string): f32 {\n return parseFloat(value);\n }\n\n toString(this: f32, radix: i32 = 0): String {\n return dtoa(this);\n }\n}\n\n@final @unmanaged\nexport abstract class F64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly EPSILON: f64 = f64.EPSILON;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: f64 = f64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: f64 = f64.MAX_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly POSITIVE_INFINITY: f64 = f64.POSITIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NEGATIVE_INFINITY: f64 = f64.NEGATIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NaN: f64 = f64.NaN;\n\n static isNaN(value: f64): bool {\n return isNaN(value);\n }\n\n static isFinite(value: f64): bool {\n return isFinite(value);\n }\n\n static isSafeInteger(value: f64): bool {\n return abs(value) <= f64.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f64): bool {\n return isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f64 {\n return strtol(value, radix);\n }\n\n static parseFloat(value: string): f64 {\n return parseFloat(value);\n }\n\n toString(this: f64, radix: i32 = 0): String {\n return dtoa(this);\n }\n}\n\nexport { F64 as Number };\n","type auto = i32;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isInteger(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFloat(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isBoolean(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isSigned(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isReference(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isString(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isArray(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isArrayLike(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFunction(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isNullable(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isDefined(expression: auto): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isConstant(expression: auto): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isManaged(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isVoid(): bool;\n\n// @ts-ignore\n@builtin\nexport declare function lengthof(func?: T): i32;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function clz(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function ctz(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function popcnt(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function rotl(value: T, shift: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function rotr(value: T, shift: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function abs(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function max(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function min(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function ceil(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function floor(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function copysign(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function nearest(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function reinterpret(value: number): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sqrt(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function trunc(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function add(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sub(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function mul(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function div(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function store(ptr: usize, value: auto, immOffset?: usize, immAlign?: usize): void;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sizeof(): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function alignof(): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function offsetof(fieldName?: string): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function idof(): u32;\n\n// @ts-ignore\n@builtin\nexport declare function nameof(): string;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function unreachable(): auto;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function changetype(value: auto): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function assert(isTrueish: T, message?: string): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function unchecked(expr: T): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function call_indirect(index: u32, ...args: auto[]): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function instantiate(...args: auto[]): T;\n\nexport namespace atomic {\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load(ptr: usize, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: T, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;\n\n // @ts-ignore: decorator\n @builtin\n export declare function notify(ptr: usize, count: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function fence(): void;\n}\n\n// @ts-ignore: decorator\n@lazy\nexport const enum AtomicWaitResult {\n OK = 0,\n NOT_EQUAL = 1,\n TIMED_OUT = 2\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i8(value: auto): i8;\n\nexport namespace i8 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i8 = -128;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i8 = 127;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i16(value: auto): i16;\n\nexport namespace i16 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i16 = -32768;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i16 = 32767;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i32(value: auto): i32;\n\nexport namespace i32 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i32 = -2147483648;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i32 = 2147483647;\n\n // @ts-ignore: decorator\n @builtin\n export declare function clz(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ctz(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_s(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_u(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotl(value: i32, shift: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotr(value: i32, shift: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_f32(value: f32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n export namespace atomic {\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n\n export namespace rmw16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n\n export namespace rmw {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n }\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i64(value: auto): i64;\n\nexport namespace i64 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i64 = -9223372036854775808;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i64 = 9223372036854775807;\n\n // @ts-ignore: decorator\n @builtin\n export declare function clz(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ctz(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_s(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_u(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotl(value: i64, shift: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotr(value: i64, shift: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_f64(value: f64): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store32(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n export namespace atomic {\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_u(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store32(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw32 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n }\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isize(value: auto): isize;\n\nexport namespace isize {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: isize = sizeof() == sizeof()\n ? -2147483648\n : -9223372036854775808;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: isize = sizeof() == sizeof()\n ? 2147483647\n : 9223372036854775807;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u8(value: auto): u8;\n\nexport namespace u8 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u8 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u8 = 255;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u16(value: auto): u16;\n\nexport namespace u16 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u16 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u16 = 65535;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u32(value: auto): u32;\n\nexport namespace u32 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u32 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u32 = 4294967295;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u64(value: auto): u64;\n\nexport namespace u64 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u64 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u64 = 18446744073709551615;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function usize(value: auto): usize;\n\nexport namespace usize {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: usize = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: usize = sizeof() == sizeof()\n ? 4294967295\n : 18446744073709551615;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function bool(value: auto): bool;\n\nexport namespace bool {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: bool = false;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: bool = true;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f32(value: auto): f32;\n\nexport namespace f32 {\n\n // @ts-ignore: decorator\n @lazy\n export const EPSILON = reinterpret(0x34000000); // 0x1p-23f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_SAFE_INTEGER: f32 = -16777215;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_SAFE_INTEGER: f32 = 16777215;\n\n // @ts-ignore: decorator\n @lazy\n export const POSITIVE_INFINITY: f32 = Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NEGATIVE_INFINITY: f32 = -Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NaN: f32 = 0.0 / 0.0;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function copysign(x: f32, y: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_i32(value: i32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(value: f32): f32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: f32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(left: f32, right: f32): f32;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f64(value: auto): f64;\n\nexport namespace f64 {\n\n // @ts-ignore: decorator\n @lazy\n export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_SAFE_INTEGER: f64 = -9007199254740991;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_SAFE_INTEGER: f64 = 9007199254740991;\n\n // @ts-ignore: decorator\n @lazy\n export const POSITIVE_INFINITY: f64 = Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NEGATIVE_INFINITY: f64 = -Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NaN: f64 = 0.0 / 0.0;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function copysign(x: f64, y: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_i64(value: i64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(value: f64): f64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: f64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(left: f64, right: f64): f64;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function v128(\n a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8,\n i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8\n): v128;\n\nexport namespace v128 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: T): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: T): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function swizzle(a: v128, s: v128): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_ext(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_zero(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8x8_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8x8_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16x4_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16x4_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32x2_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32x2_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load8_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load16_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load32_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load64_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load32_zero(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load64_zero(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: v128, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function andnot(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function not(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitselect(v1: v128, v2: v128, c: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function any_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmin(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmax(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function dot(a: v128, b: v128): v128; // i16 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function avgr(a: v128, b: v128): v128; // u8, u16 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_low(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function demote_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function promote_low(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function q15mulr_sat(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i8x16(\n a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8,\n i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8\n): v128;\n\nexport namespace i8x16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i8): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_s(x: v128, idx: u8): i8;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_u(x: v128, idx: u8): u8;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i8): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function avgr_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i16x8_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shuffle(\n a: v128, b: v128,\n l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8,\n l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8\n ): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function swizzle(a: v128, s: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128;\n\nexport namespace i16x8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i16): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_s(x: v128, idx: u8): i16;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_u(x: v128, idx: u8): u16;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i16): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function avgr_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i32x4_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i32x4_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i8x16_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i8x16_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i8x16_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i8x16_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i8x16_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i8x16_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function q15mulr_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i8x16_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i8x16_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i8x16_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i8x16_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;\n\nexport namespace i32x4 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function dot_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f64x2_s_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f64x2_u_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i16x8_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i16x8_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i16x8_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i16x8_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i16x8_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i16x8_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i16x8_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i16x8_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i64x2(a: i64, b: i64): v128;\n\nexport namespace i64x2 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i32x4_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i32x4_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i32x4_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i32x4_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;\n\nexport namespace f32x4 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: f32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: f32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmin(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmax(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function demote_f64x2_zero(a: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f64x2(a: f64, b: f64): v128;\n\nexport namespace f64x2 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: f64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: f64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmin(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmax(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_low_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_low_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function promote_low_f32x4(a: v128): v128;\n}\n\n@final\nexport abstract class i31 { // FIXME: usage of 'new' requires a class :(\n\n // @ts-ignore: decorator\n @builtin\n static new(value: i32): i31ref { return changetype(unreachable()); }\n\n // @ts-ignore: decorator\n @builtin\n static get(i31expr: i31ref): i32 { return unreachable(); }\n}\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n// @ts-ignore: decorator\n@external(\"env\", \"abort\")\ndeclare function abort(\n message?: string | null,\n fileName?: string | null,\n lineNumber?: u32,\n columnNumber?: u32\n): void;\n\n// @ts-ignore: decorator\n@external(\"env\", \"trace\")\ndeclare function trace(\n message: string,\n n?: i32,\n a0?: f64,\n a1?: f64,\n a2?: f64,\n a3?: f64,\n a4?: f64\n): void;\n\n// @ts-ignore: decorator\n@external(\"env\", \"seed\")\ndeclare function seed(): f64;\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n","/// \n\nimport { OBJECT, BLOCK_MAXSIZE, TOTAL_OVERHEAD } from \"./rt/common\";\nimport { COMPARATOR, SORT } from \"./util/sort\";\nimport { REVERSE } from \"./util/bytes\";\nimport { idof } from \"./builtins\";\nimport { Array } from \"./array\";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_HOLEYARRAY } from \"./util/error\";\nimport { joinBooleanArray, joinIntegerArray, joinFloatArray, joinStringArray, joinReferenceArray } from \"./util/string\";\n\n@final\nexport class StaticArray {\n [key: number]: T;\n\n // Note that the interface of StaticArray instances must be a semantically\n // compatible subset of Array in order for syntax highlighting to work\n // properly, for instance when creating static arrays from array literals.\n // The additionally provided static methods take care of dealing with static\n // arrays exclusively, without having to convert to Array first.\n\n static fromArray(source: Array): StaticArray {\n var length = source.length;\n var outSize = length << alignof();\n var out = changetype>(__new(outSize, idof>()));\n if (isManaged()) {\n let sourcePtr = source.dataStart;\n for (let i = 0; i < length; ++i) {\n let off = i << alignof();\n let ref = load(sourcePtr + off);\n store(changetype(out) + off, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(changetype(out), source.dataStart, outSize);\n }\n return out;\n }\n\n static concat(source: StaticArray, other: StaticArray): StaticArray {\n var sourceLen = source.length;\n var otherLen = select(0, other.length, other === null);\n var outLen = sourceLen + otherLen;\n if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH);\n var out = changetype>(__new(outLen << alignof(), idof>()));\n var outStart = changetype(out);\n var sourceSize = sourceLen << alignof();\n if (isManaged()) {\n for (let offset: usize = 0; offset < sourceSize; offset += sizeof()) {\n let ref = load(changetype(source) + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n outStart += sourceSize;\n let otherSize = otherLen << alignof();\n for (let offset: usize = 0; offset < otherSize; offset += sizeof()) {\n let ref = load(changetype(other) + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(outStart, changetype(source), sourceSize);\n memory.copy(outStart + sourceSize, changetype(other), otherLen << alignof());\n }\n return out;\n }\n\n static slice(source: StaticArray, start: i32 = 0, end: i32 = i32.MAX_VALUE): StaticArray {\n var length = source.length;\n start = start < 0 ? max(start + length, 0) : min(start, length);\n end = end < 0 ? max(end + length, 0) : min(end , length);\n length = max(end - start, 0);\n var sliceSize = length << alignof();\n var slice = changetype>(__new(sliceSize, idof>()));\n var sourcePtr = changetype(source) + (start << alignof());\n if (isManaged()) {\n let off: usize = 0;\n while (off < sliceSize) {\n let ref = load(sourcePtr + off);\n store(changetype(slice) + off, ref);\n __link(changetype(slice), ref, true);\n off += sizeof();\n }\n } else {\n memory.copy(changetype(slice), sourcePtr, sliceSize);\n }\n return slice;\n }\n\n constructor(length: i32) {\n if (length > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH);\n var outSize = length << alignof();\n var out = changetype>(__new(outSize, idof>()));\n memory.fill(changetype(out), 0, outSize);\n return out;\n }\n\n get length(): i32 {\n return changetype(changetype(this) - TOTAL_OVERHEAD).rtSize >>> alignof();\n }\n\n at(index: i32): T {\n var len = this.length;\n index += select(0, len, index >= 0);\n if (index >= len) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(changetype(this) + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n @operator(\"[]\") private __get(index: i32): T {\n if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(changetype(this) + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n @unsafe @operator(\"{}\") private __uget(index: i32): T {\n return load(changetype(this) + (index << alignof()));\n }\n\n @operator(\"[]=\") private __set(index: i32, value: T): void {\n if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE);\n this.__uset(index, value);\n }\n\n @unsafe @operator(\"{}=\") private __uset(index: i32, value: T): void {\n store(changetype(this) + (index << alignof()), value);\n if (isManaged()) {\n __link(changetype(this), changetype(value), true);\n }\n }\n\n fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this {\n var ptr = changetype(this);\n var len = this.length;\n start = start < 0 ? max(len + start, 0) : min(start, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n if (isManaged()) {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), changetype(value));\n __link(changetype(this), changetype(value), true);\n }\n } else if (sizeof() == 1) {\n if (start < end) {\n memory.fill(\n ptr + start,\n u8(value),\n (end - start)\n );\n }\n } else {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), value);\n }\n }\n return this;\n }\n\n copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this {\n var ptr = changetype(this);\n var len = this.length;\n\n end = min(end, len);\n\n var to = target < 0 ? max(len + target, 0) : min(target, len);\n var from = start < 0 ? max(len + start, 0) : min(start, len);\n var last = end < 0 ? max(len + end, 0) : min(end, len);\n var count = min(last - from, len - to);\n\n memory.copy( // is memmove\n ptr + (to << alignof()),\n ptr + (from << alignof()),\n count << alignof()\n );\n return this;\n }\n\n includes(value: T, fromIndex: i32 = 0): bool {\n if (isFloat()) {\n let length = this.length;\n if (length == 0 || fromIndex >= length) return false;\n if (fromIndex < 0) fromIndex = max(length + fromIndex, 0);\n while (fromIndex < length) {\n let elem = load(changetype(this) + (fromIndex << alignof()));\n // @ts-ignore\n if (elem == value || isNaN(elem) & isNaN(value)) return true;\n ++fromIndex;\n }\n return false;\n } else {\n return this.indexOf(value, fromIndex) >= 0;\n }\n }\n\n indexOf(value: T, fromIndex: i32 = 0): i32 {\n var length = this.length;\n if (length == 0 || fromIndex >= length) return -1;\n if (fromIndex < 0) fromIndex = max(length + fromIndex, 0);\n while (fromIndex < length) {\n if (load(changetype(this) + (fromIndex << alignof())) == value) return fromIndex;\n ++fromIndex;\n }\n return -1;\n }\n\n lastIndexOf(value: T, fromIndex: i32 = this.length): i32 {\n var length = this.length;\n if (length == 0) return -1;\n if (fromIndex < 0) fromIndex = length + fromIndex;\n else if (fromIndex >= length) fromIndex = length - 1;\n while (fromIndex >= 0) {\n if (load(changetype(this) + (fromIndex << alignof())) == value) return fromIndex;\n --fromIndex;\n }\n return -1;\n }\n\n concat(other: Array): Array {\n var thisLen = this.length;\n var otherLen = select(0, other.length, other === null);\n var outLen = thisLen + otherLen;\n if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH);\n var out = changetype>(__newArray(outLen, alignof(), idof>()));\n var outStart = out.dataStart;\n var thisSize = thisLen << alignof();\n if (isManaged()) {\n let thisStart = changetype(this);\n for (let offset: usize = 0; offset < thisSize; offset += sizeof()) {\n let ref = load(thisStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n outStart += thisSize;\n let otherStart = other.dataStart;\n let otherSize = otherLen << alignof();\n for (let offset: usize = 0; offset < otherSize; offset += sizeof()) {\n let ref = load(otherStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(outStart, changetype(this), thisSize);\n memory.copy(outStart + thisSize, other.dataStart, otherLen << alignof());\n }\n return out;\n }\n\n slice(start: i32 = 0, end: i32 = i32.MAX_VALUE): Array {\n var length = this.length;\n start = start < 0 ? max(start + length, 0) : min(start, length);\n end = end < 0 ? max(end + length, 0) : min(end , length);\n length = max(end - start, 0);\n var slice = changetype>(__newArray(length, alignof(), idof>()));\n var sliceBase = slice.dataStart;\n var thisBase = changetype(this) + (start << alignof());\n if (isManaged()) {\n let off = 0;\n let end = length << alignof();\n while (off < end) {\n let ref = load(thisBase + off);\n store(sliceBase + off, ref);\n __link(changetype(slice), ref, true);\n off += sizeof();\n }\n } else {\n memory.copy(sliceBase, thisBase, length << alignof());\n }\n return slice;\n }\n\n findIndex(fn: (value: T, index: i32, array: StaticArray) => bool): i32 {\n for (let i = 0, len = this.length; i < len; ++i) {\n if (fn(load(changetype(this) + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n findLastIndex(fn: (value: T, index: i32, array: StaticArray) => bool): i32 {\n for (let i = this.length - 1; i >= 0; --i) {\n if (fn(load(changetype(this) + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n forEach(fn: (value: T, index: i32, array: StaticArray) => void): void {\n for (let i = 0, len = this.length; i < len; ++i) {\n fn(load(changetype(this) + (i << alignof())), i, this);\n }\n }\n\n map(fn: (value: T, index: i32, array: StaticArray) => U): Array {\n var len = this.length;\n var out = changetype>(__newArray(len, alignof(), idof>()));\n var outStart = out.dataStart;\n for (let i = 0; i < len; ++i) {\n let result = fn(load(changetype(this) + (i << alignof())), i, this);\n store(outStart + (i << alignof()), result);\n if (isManaged()) {\n __link(changetype(out), changetype(result), true);\n }\n }\n return out;\n }\n\n filter(fn: (value: T, index: i32, array: StaticArray) => bool): Array {\n var result = changetype>(__newArray(0, alignof(), idof>()));\n for (let i = 0, len = this.length; i < len; ++i) {\n let value = load(changetype(this) + (i << alignof()));\n if (fn(value, i, this)) result.push(value);\n }\n return result;\n }\n\n reduce(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: StaticArray) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = 0, len = this.length; i < len; ++i) {\n acc = fn(acc, load(changetype(this) + (i << alignof())), i, this);\n }\n return acc;\n }\n\n reduceRight(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: StaticArray) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = this.length - 1; i >= 0; --i) {\n acc = fn(acc, load(changetype(this) + (i << alignof())), i, this);\n }\n return acc;\n }\n\n every(fn: (value: T, index: i32, array: StaticArray) => bool): bool {\n for (let i = 0, len = this.length; i < len; ++i) {\n if (!fn(load(changetype(this) + (i << alignof())), i, this)) return false;\n }\n return true;\n }\n\n some(fn: (value: T, index: i32, array: StaticArray) => bool): bool {\n for (let i = 0, len = this.length; i < len; ++i) {\n if (fn(load(changetype(this) + (i << alignof())), i, this)) return true;\n }\n return false;\n }\n\n sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this {\n SORT(changetype(this), this.length, comparator);\n return this;\n }\n\n join(separator: string = \",\"): string {\n if (isBoolean()) return joinBooleanArray(changetype(this), this.length, separator);\n if (isInteger()) return joinIntegerArray(changetype(this), this.length, separator);\n if (isFloat()) return joinFloatArray(changetype(this), this.length, separator);\n if (ASC_SHRINK_LEVEL < 1) {\n if (isString()) return joinStringArray(changetype(this), this.length, separator);\n }\n if (isReference()) return joinReferenceArray(changetype(this), this.length, separator);\n ERROR(\"unspported element type\");\n return unreachable();\n }\n\n reverse(): this {\n REVERSE(changetype(this), this.length);\n return this;\n }\n\n toString(): string {\n return this.join();\n }\n\n // RT integration\n\n @unsafe private __visit(cookie: u32): void {\n if (isManaged()) {\n let cur = changetype(this);\n let end = cur + changetype(changetype(this) - TOTAL_OVERHEAD).rtSize;\n while (cur < end) {\n let val = load(cur);\n if (val) __visit(val, cookie);\n cur += sizeof();\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/oldwasm/wasm/build/optimized.wat b/oldwasm/wasm/build/optimized.wat deleted file mode 100644 index 2c9218e9..00000000 --- a/oldwasm/wasm/build/optimized.wat +++ /dev/null @@ -1,7591 +0,0 @@ -(module - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $f64_=>_f64 (func (param f64) (result f64))) - (type $none_=>_f64 (func (result f64))) - (type $i32_=>_f64 (func (param i32) (result f64))) - (type $i64_i64_i32_i64_i32_=>_i32 (func (param i64 i64 i32 i64 i32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (import "aegis" "log" (func $assembly/aegis/log (param i32))) - (import "aegis" "addListener" (func $assembly/aegis/addListener (param i32 i32))) - (import "aegis" "fireEvent" (func $assembly/aegis/fireEvent (param i32 i32 f64))) - (import "env" "Date.now" (func $~lib/bindings/dom/Date.now (result f64))) - (global $assembly/index/ArrayOfStrings_ID i32 (i32.const 4)) - (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) - (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) - (global $~lib/util/number/_exp (mut i32) (i32.const 0)) - (global $~lib/util/number/_K (mut i32) (i32.const 0)) - (global $~lib/util/number/_frc_pow (mut i64) (i64.const 0)) - (global $~lib/util/number/_exp_pow (mut i32) (i32.const 0)) - (global $~lib/date/_day (mut i32) (i32.const 0)) - (global $~lib/date/_month (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 9408)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 25876)) - (memory $0 1) - (data (i32.const 1036) "<") - (data (i32.const 1048) "\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s") - (data (i32.const 1132) "<") - (data (i32.const 1144) "\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e") - (data (i32.const 1196) ",") - (data (i32.const 1208) "\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s") - (data (i32.const 1244) "<") - (data (i32.const 1256) "\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e") - (data (i32.const 1372) "<") - (data (i32.const 1384) "\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s") - (data (i32.const 1436) "\1c") - (data (i32.const 1448) "\01\00\00\00\08\00\00\00w\00a\00s\00m") - (data (i32.const 1468) ",") - (data (i32.const 1480) "\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h") - (data (i32.const 1516) ",") - (data (i32.const 1528) "\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s") - (data (i32.const 1564) "\1c") - (data (i32.const 1576) "\01\00\00\00\08\00\00\00k\00e\00y\001") - (data (i32.const 1596) "|") - (data (i32.const 1608) "\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y") - (data (i32.const 1724) "\1c") - (data (i32.const 1736) "\01") - (data (i32.const 1756) "\1c") - (data (i32.const 1768) "\01\00\00\00\08\00\00\00k\00e\00y\002") - (data (i32.const 1788) ",") - (data (i32.const 1800) "\01\00\00\00\12\00\00\00f\00i\00b\00o\00n\00a\00c\00c\00i") - (data (i32.const 1836) "\1c") - (data (i32.const 1848) "\01\00\00\00\n\00\00\00p\00o\00r\00t\001") - (data (i32.const 1868) "|") - (data (i32.const 1880) "\01\00\00\00^\00\00\00d\00F\00l\00o\00w\00,\00o\00u\00t\00b\00o\00u\00n\00d\00,\00d\00F\00l\00o\00w\00_\00s\00t\00a\00r\00t\00,\00p\00o\00r\00t\001\00_\00d\00o\00n\00e\00,\00p\00o\00r\00t\001\00C\00b\00,\001") - (data (i32.const 1996) "\1c") - (data (i32.const 2012) "\08\00\00\00@\07\00\00`\07") - (data (i32.const 2028) "\1c") - (data (i32.const 2040) "\01\00\00\00\n\00\00\00p\00o\00r\00t\002") - (data (i32.const 2060) "l") - (data (i32.const 2072) "\01\00\00\00\\\00\00\00d\00F\00l\00o\00w\00,\00o\00u\00t\00b\00o\00u\00n\00d\00,\00p\00o\00r\00t\001\00_\00d\00o\00n\00e\00,\00p\00o\00r\00t\002\00_\00d\00o\00n\00e\00,\00p\00o\00r\00t\002\00C\00b\00,\001") - (data (i32.const 2172) "\1c") - (data (i32.const 2188) "\08\00\00\00\00\08\00\00 \08") - (data (i32.const 2204) "\1c") - (data (i32.const 2216) "\01\00\00\00\08\00\00\00p\00o\00r\00t") - (data (i32.const 2236) "\1c") - (data (i32.const 2252) "\08\00\00\00\b0\08\00\00@\07") - (data (i32.const 2268) ",") - (data (i32.const 2280) "\01\00\00\00\10\00\00\00c\00a\00l\00l\00b\00a\00c\00k") - (data (i32.const 2316) ",") - (data (i32.const 2328) "\01\00\00\00\0e\00\00\00p\00o\00r\00t\001\00C\00b") - (data (i32.const 2364) "\1c") - (data (i32.const 2380) "\08\00\00\00\f0\08\00\00 \t") - (data (i32.const 2396) ",") - (data (i32.const 2408) "\01\00\00\00\1a\00\00\00c\00o\00n\00s\00u\00m\00e\00s\00E\00v\00e\00n\00t") - (data (i32.const 2444) ",") - (data (i32.const 2456) "\01\00\00\00\16\00\00\00d\00F\00l\00o\00w\00_\00s\00t\00a\00r\00t") - (data (i32.const 2492) "\1c") - (data (i32.const 2508) "\08\00\00\00p\t\00\00\a0\t") - (data (i32.const 2524) ",") - (data (i32.const 2536) "\01\00\00\00\1a\00\00\00p\00r\00o\00d\00u\00c\00e\00s\00E\00v\00e\00n\00t") - (data (i32.const 2572) ",") - (data (i32.const 2584) "\01\00\00\00\14\00\00\00p\00o\00r\00t\001\00_\00d\00o\00n\00e") - (data (i32.const 2620) "\1c") - (data (i32.const 2636) "\08\00\00\00\f0\t\00\00 \n") - (data (i32.const 2652) ",") - (data (i32.const 2664) "\01\00\00\00\1a\00\00\00p\00o\00r\00f\00 \00i\00n\00v\00o\00k\00c\00e\00d") - (data (i32.const 2700) "\1c") - (data (i32.const 2712) "\01\00\00\00\02\00\00\00 ") - (data (i32.const 2732) "\1c") - (data (i32.const 2748) "\08\00\00\00\b0\08\00\00\00\08") - (data (i32.const 2764) ",") - (data (i32.const 2776) "\01\00\00\00\0e\00\00\00p\00o\00r\00t\002\00C\00b") - (data (i32.const 2812) "\1c") - (data (i32.const 2828) "\08\00\00\00\f0\08\00\00\e0\n") - (data (i32.const 2844) "\1c") - (data (i32.const 2860) "\08\00\00\00p\t\00\00 \n") - (data (i32.const 2876) ",") - (data (i32.const 2888) "\01\00\00\00\14\00\00\00p\00o\00r\00t\002\00_\00d\00o\00n\00e") - (data (i32.const 2924) "\1c") - (data (i32.const 2940) "\08\00\00\00\f0\t\00\00P\0b") - (data (i32.const 2956) ",") - (data (i32.const 2968) "\01\00\00\00\18\00\00\00p\00o\00r\00f\00 \00i\00n\00v\00o\00k\00e\00d") - (data (i32.const 3004) "<") - (data (i32.const 3016) "\01\00\00\00\"\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00L\00i\00s\00t\00e\00n") - (data (i32.const 3068) "\\") - (data (i32.const 3080) "\01\00\00\00F\00\00\00t\00e\00l\00l\00 \00w\00a\00s\00m\00 \00m\00o\00d\00u\00l\00e\00 \00t\00o\00 \00b\00e\00g\00i\00n\00 \00l\00i\00s\00t\00e\00n\00i\00n\00g") - (data (i32.const 3164) "\1c") - (data (i32.const 3180) "\08\00\00\00\d0\0b\00\00\10\0c") - (data (i32.const 3196) "<") - (data (i32.const 3208) "\01\00\00\00\"\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00N\00o\00t\00i\00f\00y") - (data (i32.const 3260) "\\") - (data (i32.const 3272) "\01\00\00\00D\00\00\00t\00e\00l\00l\00 \00w\00a\00s\00m\00 \00m\00o\00d\00u\00l\00e\00 \00t\00o\00 \00s\00e\00n\00d\00 \00b\00r\00o\00a\00d\00c\00a\00s\00t") - (data (i32.const 3356) "\1c") - (data (i32.const 3372) "\08\00\00\00\90\0c\00\00\d0\0c") - (data (i32.const 3388) "<") - (data (i32.const 3400) "\01\00\00\00&\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00C\00a\00l\00l\00b\00a\00c\00k") - (data (i32.const 3452) "<") - (data (i32.const 3464) "\01\00\00\00,\00\00\00s\00u\00b\00s\00c\00r\00i\00b\00e\00d\00 \00e\00v\00e\00n\00t\00 \00f\00i\00r\00e\00d") - (data (i32.const 3516) "\1c") - (data (i32.const 3532) "\08\00\00\00P\0d\00\00\90\0d") - (data (i32.const 3548) ",") - (data (i32.const 3560) "\01\00\00\00\18\00\00\00r\00u\00n\00F\00i\00b\00o\00n\00a\00c\00c\00i") - (data (i32.const 3596) "L") - (data (i32.const 3608) "\01\00\00\004\00\00\00r\00e\00m\00o\00t\00e\00 \00c\00a\00l\00c\00u\00l\00a\00t\00e\00 \00f\00i\00b\00o\00n\00a\00c\00c\00i") - (data (i32.const 3676) "\1c") - (data (i32.const 3692) "\08\00\00\00\f0\0d\00\00 \0e") - (data (i32.const 3708) "\\") - (data (i32.const 3720) "\01\00\00\00@\00\00\00c\00a\00l\00c\00u\00l\00a\00t\00e\00 \00f\00i\00b\00o\00n\00a\00c\00c\00i\00 \00f\00o\00r\00 \00a\00 \00n\00u\00m\00b\00e\00r") - (data (i32.const 3804) "\1c") - (data (i32.const 3820) "\08\00\00\00\10\07\00\00\90\0e") - (data (i32.const 3836) ",") - (data (i32.const 3848) "\01\00\00\00\18\00\00\00d\00e\00p\00l\00o\00y\00M\00o\00d\00u\00l\00e") - (data (i32.const 3884) "L") - (data (i32.const 3896) "\01\00\00\00<\00\00\00r\00e\00q\00u\00e\00s\00t\00 \00d\00e\00p\00l\00o\00y\00m\00e\00n\00t\00 \00o\00f\00 \00a\00 \00m\00o\00d\00u\00l\00e") - (data (i32.const 3964) "\1c") - (data (i32.const 3980) "\08\00\00\00\10\0f\00\00@\0f") - (data (i32.const 3996) ",") - (data (i32.const 4008) "\01\00\00\00\12\00\00\00c\00o\00m\00m\00a\00n\00d\00E\00x") - (data (i32.const 4044) "<") - (data (i32.const 4056) "\01\00\00\00\1e\00\00\00c\00o\00m\00m\00a\00n\00d\00 \00e\00x\00a\00m\00p\00l\00e") - (data (i32.const 4108) "\1c") - (data (i32.const 4124) "\08\00\00\00\b0\0f\00\00\e0\0f") - (data (i32.const 4140) "<") - (data (i32.const 4152) "\01\00\00\00$\00\00\00\n\00c\00o\00m\00m\00a\00n\00d\00E\00x\00 \00c\00a\00l\00l\00e\00d\00 ") - (data (i32.const 4204) "\1c") - (data (i32.const 4216) "\01\00\00\00\02\00\00\00:") - (data (i32.const 4236) "<") - (data (i32.const 4248) "\01\00\00\00\"\00\00\00c\00o\00m\00m\00a\00n\00d\00E\00x\00_\00u\00p\00d\00a\00t\00e\00!") - (data (i32.const 4300) "\1c") - (data (i32.const 4316) "\08\00\00\000\06\00\00\a0\10") - (data (i32.const 4332) "<") - (data (i32.const 4344) "\01\00\00\00&\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00L\00i\00s\00t\00e\00n\00:\00 ") - (data (i32.const 4396) "\1c") - (data (i32.const 4408) "\01\00\00\00\04\00\00\00:\00 ") - (data (i32.const 4428) ",") - (data (i32.const 4440) "\01\00\00\00\12\00\00\00e\00v\00e\00n\00t\00N\00a\00m\00e") - (data (i32.const 4476) ",") - (data (i32.const 4488) "\01\00\00\00\12\00\00\00m\00o\00d\00e\00l\00N\00a\00m\00e") - (data (i32.const 4524) ",") - (data (i32.const 4536) "\01\00\00\00\0e\00\00\00m\00o\00d\00e\00l\00I\00d") - (data (i32.const 4572) "L") - (data (i32.const 4584) "\01\00\00\00<\00\00\00w\00a\00s\00m\00 \00n\00o\00t\00i\00f\00y\00 \00c\00a\00l\00l\00e\00d\00 \00w\00i\00t\00h\00 \00a\00r\00g\00s\00:\00 ") - (data (i32.const 4652) ",") - (data (i32.const 4664) "\01\00\00\00\1a\00\00\00w\00a\00s\00m\00W\00e\00b\00L\00i\00s\00t\00e\00n") - (data (i32.const 4700) "L") - (data (i32.const 4712) "\01\00\00\004\00\00\00w\00e\00b\00s\00o\00c\00k\00e\00t\00 \00c\00a\00l\00l\00b\00a\00c\00k\00 \00f\00i\00r\00e\00d\00:\00 ") - (data (i32.const 4780) "\1c") - (data (i32.const 4796) "\08\00\00\000\06\00\00P\0d") - (data (i32.const 4812) "\1c") - (data (i32.const 4824) "\01\00\00\00\0c\00\00\00r\00e\00s\00u\00l\00t") - (data (i32.const 4844) "\1c") - (data (i32.const 4856) "\01\00\00\00\06\00\00\000\00.\000") - (data (i32.const 4876) "\1c") - (data (i32.const 4888) "\01\00\00\00\06\00\00\00N\00a\00N") - (data (i32.const 4908) ",") - (data (i32.const 4920) "\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 4956) ",") - (data (i32.const 4968) "\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y") - (data (i32.const 5064) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8#__uset (param $0 i32) (param $1 i32) (param $2 i32) - local.get $0 - i32.load offset=4 - local.get $1 - i32.const 2 - i32.shl - i32.add - local.get $2 - i32.store - local.get $2 - if - local.get $0 - local.get $2 - i32.const 1 - call $byn-split-outlined-A$~lib/rt/itcms/__link - end - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 1152 - i32.const 1536 - i32.const 130 - i32.const 22 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 1 - i32.add - local.tee $3 - local.get $0 - i32.load offset=8 - local.tee $4 - i32.const 2 - i32.shr_u - i32.gt_u - if - local.get $3 - i32.const 268435455 - i32.gt_u - if - i32.const 1488 - i32.const 1536 - i32.const 19 - i32.const 48 - call $~lib/builtins/abort - unreachable - end - block $__inlined_func$~lib/rt/itcms/__renew - local.get $4 - i32.const 1 - i32.shl - local.tee $4 - i32.const 1073741820 - local.get $4 - i32.const 1073741820 - i32.lt_u - select - local.tee $4 - local.get $3 - i32.const 8 - local.get $3 - i32.const 8 - i32.gt_u - select - i32.const 2 - i32.shl - local.tee $3 - local.get $3 - local.get $4 - i32.lt_u - select - local.tee $5 - local.get $0 - i32.load - local.tee $4 - i32.const 20 - i32.sub - local.tee $6 - i32.load - i32.const -4 - i32.and - i32.const 16 - i32.sub - i32.le_u - if - local.get $6 - local.get $5 - i32.store offset=16 - local.get $4 - local.set $3 - br $__inlined_func$~lib/rt/itcms/__renew - end - local.get $5 - local.get $6 - i32.load offset=12 - call $~lib/rt/itcms/__new - local.tee $3 - local.get $4 - local.get $5 - local.get $6 - i32.load offset=16 - local.tee $6 - local.get $5 - local.get $6 - i32.lt_u - select - memory.copy - end - local.get $3 - local.get $4 - i32.ne - if - local.get $0 - local.get $3 - i32.store - local.get $0 - local.get $3 - i32.store offset=4 - local.get $3 - if - local.get $0 - local.get $3 - i32.const 0 - call $byn-split-outlined-A$~lib/rt/itcms/__link - end - end - local.get $0 - local.get $5 - i32.store offset=8 - end - local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.store offset=12 - end - local.get $0 - local.get $1 - local.get $2 - call $~lib/array/Array<~lib/string/String>#__uset - ) - (func $~lib/string/String.__concat (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - block $__inlined_func$~lib/string/String#concat - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $3 - local.get $1 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $4 - i32.add - local.tee $2 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 1744 - local.set $2 - br $__inlined_func$~lib/string/String#concat - end - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $2 - i32.store - local.get $2 - local.get $0 - local.get $3 - memory.copy - local.get $2 - local.get $3 - i32.add - local.get $1 - local.get $4 - memory.copy - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - end - local.get $2 - ) - (func $assembly/index/fibonacci (param $0 f64) (result f64) - local.get $0 - f64.const 0 - f64.eq - if - f64.const 0 - return - end - local.get $0 - f64.const 1 - f64.eq - if - f64.const 1 - return - end - local.get $0 - f64.const 1 - f64.sub - call $assembly/index/fibonacci - local.get $0 - f64.const 2 - f64.sub - call $assembly/index/fibonacci - f64.add - ) - (func $~lib/util/string/strtol (param $0 i32) (result f64) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 f64) - (local $5 f64) - (local $6 i32) - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - local.tee $1 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - local.get $0 - local.tee $2 - i32.load16_u - local.set $0 - loop $while-continue|0 - block $__inlined_func$~lib/util/string/isSpace (result i32) - local.get $0 - i32.const 128 - i32.or - i32.const 160 - i32.eq - local.get $0 - i32.const 9 - i32.sub - i32.const 4 - i32.le_u - i32.or - local.get $0 - i32.const 5760 - i32.lt_u - br_if $__inlined_func$~lib/util/string/isSpace - drop - i32.const 1 - local.get $0 - i32.const -8192 - i32.add - i32.const 10 - i32.le_u - br_if $__inlined_func$~lib/util/string/isSpace - drop - block $break|0 - block $case6|0 - local.get $0 - i32.const 5760 - i32.eq - br_if $case6|0 - local.get $0 - i32.const 8232 - i32.eq - br_if $case6|0 - local.get $0 - i32.const 8233 - i32.eq - br_if $case6|0 - local.get $0 - i32.const 8239 - i32.eq - br_if $case6|0 - local.get $0 - i32.const 8287 - i32.eq - br_if $case6|0 - local.get $0 - i32.const 12288 - i32.eq - br_if $case6|0 - local.get $0 - i32.const 65279 - i32.eq - br_if $case6|0 - br $break|0 - end - i32.const 1 - br $__inlined_func$~lib/util/string/isSpace - end - i32.const 0 - end - if - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - local.set $0 - local.get $1 - i32.const 1 - i32.sub - local.set $1 - br $while-continue|0 - end - end - f64.const 1 - local.set $4 - local.get $0 - i32.const 43 - i32.eq - local.get $0 - i32.const 45 - i32.eq - i32.or - if (result i32) - local.get $1 - i32.const 1 - i32.sub - local.tee $1 - i32.eqz - if - f64.const nan:0x8000000000000 - return - end - f64.const -1 - f64.const 1 - local.get $0 - i32.const 45 - i32.eq - select - local.set $4 - local.get $2 - i32.const 2 - i32.add - local.tee $2 - i32.load16_u - else - local.get $0 - end - i32.const 48 - i32.eq - local.get $1 - i32.const 2 - i32.gt_s - i32.and - if - block $break|1 - block $case2|1 - block $case1|1 - local.get $2 - i32.load16_u offset=2 - i32.const 32 - i32.or - local.tee $0 - i32.const 98 - i32.ne - if - local.get $0 - i32.const 111 - i32.eq - br_if $case1|1 - local.get $0 - i32.const 120 - i32.eq - br_if $case2|1 - br $break|1 - end - local.get $2 - i32.const 4 - i32.add - local.set $2 - local.get $1 - i32.const 2 - i32.sub - local.set $1 - i32.const 2 - local.set $3 - br $break|1 - end - local.get $2 - i32.const 4 - i32.add - local.set $2 - local.get $1 - i32.const 2 - i32.sub - local.set $1 - i32.const 8 - local.set $3 - br $break|1 - end - local.get $2 - i32.const 4 - i32.add - local.set $2 - local.get $1 - i32.const 2 - i32.sub - local.set $1 - i32.const 16 - local.set $3 - end - end - local.get $3 - i32.const 10 - local.get $3 - select - local.set $3 - local.get $1 - i32.const 1 - i32.sub - local.set $6 - loop $while-continue|2 - block $while-break|2 - local.get $1 - local.tee $0 - i32.const 1 - i32.sub - local.set $1 - local.get $0 - if - local.get $3 - local.get $2 - i32.load16_u - local.tee $0 - i32.const 48 - i32.sub - i32.const 10 - i32.lt_u - if (result i32) - local.get $0 - i32.const 48 - i32.sub - else - local.get $0 - i32.const 65 - i32.sub - i32.const 25 - i32.le_u - if (result i32) - local.get $0 - i32.const 55 - i32.sub - else - local.get $0 - i32.const 87 - i32.sub - local.get $0 - local.get $0 - i32.const 97 - i32.sub - i32.const 25 - i32.le_u - select - end - end - local.tee $0 - i32.le_u - if - local.get $1 - local.get $6 - i32.eq - if - f64.const nan:0x8000000000000 - return - end - br $while-break|2 - end - local.get $5 - local.get $3 - f64.convert_i32_s - f64.mul - local.get $0 - f64.convert_i32_u - f64.add - local.set $5 - local.get $2 - i32.const 2 - i32.add - local.set $2 - br $while-continue|2 - end - end - end - local.get $4 - local.get $5 - f64.mul - ) - (func $~lib/util/number/genDigits (param $0 i64) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (result i32) - (local $5 i32) - (local $6 i32) - (local $7 i64) - (local $8 i64) - (local $9 i32) - (local $10 i64) - (local $11 i64) - local.get $1 - local.get $0 - i64.sub - local.set $8 - i64.const 1 - i32.const 0 - local.get $2 - i32.sub - local.tee $9 - i64.extend_i32_s - local.tee $0 - i64.shl - local.tee $10 - i64.const 1 - i64.sub - local.tee $11 - local.get $1 - i64.and - local.set $7 - local.get $1 - local.get $0 - i64.shr_u - i32.wrap_i64 - local.tee $5 - i32.const 100000 - i32.lt_u - if (result i32) - local.get $5 - i32.const 100 - i32.lt_u - if (result i32) - local.get $5 - i32.const 10 - i32.ge_u - i32.const 1 - i32.add - else - local.get $5 - i32.const 10000 - i32.ge_u - i32.const 3 - i32.add - local.get $5 - i32.const 1000 - i32.ge_u - i32.add - end - else - local.get $5 - i32.const 10000000 - i32.lt_u - if (result i32) - local.get $5 - i32.const 1000000 - i32.ge_u - i32.const 6 - i32.add - else - local.get $5 - i32.const 1000000000 - i32.ge_u - i32.const 8 - i32.add - local.get $5 - i32.const 100000000 - i32.ge_u - i32.add - end - end - local.set $2 - loop $while-continue|0 - local.get $2 - i32.const 0 - i32.gt_s - if - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $2 - i32.const 1 - i32.sub - br_table $case9|1 $case8|1 $case7|1 $case6|1 $case5|1 $case4|1 $case3|1 $case2|1 $case1|1 $case0|1 $case10|1 - end - local.get $5 - i32.const 1000000000 - i32.div_u - local.set $6 - local.get $5 - i32.const 1000000000 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 100000000 - i32.div_u - local.set $6 - local.get $5 - i32.const 100000000 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 10000000 - i32.div_u - local.set $6 - local.get $5 - i32.const 10000000 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 1000000 - i32.div_u - local.set $6 - local.get $5 - i32.const 1000000 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 100000 - i32.div_u - local.set $6 - local.get $5 - i32.const 100000 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 10000 - i32.div_u - local.set $6 - local.get $5 - i32.const 10000 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 1000 - i32.div_u - local.set $6 - local.get $5 - i32.const 1000 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 100 - i32.div_u - local.set $6 - local.get $5 - i32.const 100 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - i32.const 10 - i32.div_u - local.set $6 - local.get $5 - i32.const 10 - i32.rem_u - local.set $5 - br $break|1 - end - local.get $5 - local.set $6 - i32.const 0 - local.set $5 - br $break|1 - end - i32.const 0 - local.set $6 - end - local.get $4 - local.get $6 - i32.or - if - local.get $4 - i32.const 1 - i32.shl - i32.const 5008 - i32.add - local.get $6 - i32.const 65535 - i32.and - i32.const 48 - i32.add - i32.store16 - local.get $4 - i32.const 1 - i32.add - local.set $4 - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $3 - local.get $5 - i64.extend_i32_u - local.get $9 - i64.extend_i32_s - i64.shl - local.get $7 - i64.add - local.tee $0 - i64.ge_u - if - global.get $~lib/util/number/_K - local.get $2 - i32.add - global.set $~lib/util/number/_K - local.get $2 - i32.const 2 - i32.shl - i32.const 5936 - i32.add - i64.load32_u - local.get $9 - i64.extend_i32_s - i64.shl - local.set $1 - local.get $4 - i32.const 1 - i32.shl - i32.const 5006 - i32.add - local.tee $5 - i32.load16_u - local.set $2 - loop $while-continue|3 - local.get $0 - local.get $8 - i64.lt_u - local.get $3 - local.get $0 - i64.sub - local.get $1 - i64.ge_u - i32.and - if (result i32) - local.get $8 - local.get $0 - local.get $1 - i64.add - local.tee $7 - i64.gt_u - local.get $8 - local.get $0 - i64.sub - local.get $7 - local.get $8 - i64.sub - i64.gt_u - i32.or - else - i32.const 0 - end - if - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.get $1 - i64.add - local.set $0 - br $while-continue|3 - end - end - local.get $5 - local.get $2 - i32.store16 - local.get $4 - return - end - br $while-continue|0 - end - end - loop $while-continue|4 - local.get $3 - i64.const 10 - i64.mul - local.set $3 - local.get $7 - i64.const 10 - i64.mul - local.tee $0 - local.get $9 - i64.extend_i32_s - i64.shr_u - local.tee $1 - local.get $4 - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if - local.get $4 - local.tee $5 - i32.const 1 - i32.add - local.set $4 - local.get $5 - i32.const 1 - i32.shl - i32.const 5008 - i32.add - local.get $1 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.const 48 - i32.add - i32.store16 - end - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.get $11 - i64.and - local.tee $7 - local.get $3 - i64.ge_u - br_if $while-continue|4 - end - global.get $~lib/util/number/_K - local.get $2 - i32.add - global.set $~lib/util/number/_K - local.get $7 - local.set $0 - local.get $8 - i32.const 0 - local.get $2 - i32.sub - i32.const 2 - i32.shl - i32.const 5936 - i32.add - i64.load32_u - i64.mul - local.set $1 - local.get $4 - i32.const 1 - i32.shl - i32.const 5006 - i32.add - local.tee $5 - i32.load16_u - local.set $2 - loop $while-continue|6 - local.get $0 - local.get $1 - i64.lt_u - local.get $3 - local.get $0 - i64.sub - local.get $10 - i64.ge_u - i32.and - if (result i32) - local.get $1 - local.get $0 - i64.sub - local.get $0 - local.get $10 - i64.add - local.tee $7 - local.get $1 - i64.sub - i64.gt_u - local.get $1 - local.get $7 - i64.gt_u - i32.or - else - i32.const 0 - end - if - local.get $2 - i32.const 1 - i32.sub - local.set $2 - local.get $0 - local.get $10 - i64.add - local.set $0 - br $while-continue|6 - end - end - local.get $5 - local.get $2 - i32.store16 - local.get $4 - ) - (func $~lib/util/number/utoa32_dec_lut (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - loop $while-continue|0 - local.get $1 - i32.const 10000 - i32.ge_u - if - local.get $1 - i32.const 10000 - i32.rem_u - local.set $3 - local.get $1 - i32.const 10000 - i32.div_u - local.set $1 - local.get $0 - local.get $2 - i32.const 4 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - i32.add - local.get $3 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i64.load32_u - local.get $3 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $while-continue|0 - end - end - local.get $1 - i32.const 100 - i32.ge_u - if - local.get $0 - local.get $2 - i32.const 2 - i32.sub - local.tee $2 - i32.const 1 - i32.shl - i32.add - local.get $1 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i32.load - i32.store - local.get $1 - i32.const 100 - i32.div_u - local.set $1 - end - local.get $1 - i32.const 10 - i32.ge_u - if - local.get $0 - local.get $2 - i32.const 2 - i32.sub - i32.const 1 - i32.shl - i32.add - local.get $1 - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i32.load - i32.store - else - local.get $0 - local.get $2 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.get $1 - i32.const 48 - i32.add - i32.store16 - end - ) - (func $~lib/util/number/prettify (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - local.get $2 - i32.eqz - if - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.const 3145774 - i32.store - local.get $1 - i32.const 2 - i32.add - return - end - local.get $1 - local.get $2 - i32.add - local.tee $3 - i32.const 21 - i32.le_s - local.get $1 - local.get $3 - i32.le_s - i32.and - if (result i32) - loop $for-loop|0 - local.get $1 - local.get $3 - i32.lt_s - if - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.const 48 - i32.store16 - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $for-loop|0 - end - end - local.get $0 - local.get $3 - i32.const 1 - i32.shl - i32.add - i32.const 3145774 - i32.store - local.get $3 - i32.const 2 - i32.add - else - local.get $3 - i32.const 21 - i32.le_s - local.get $3 - i32.const 0 - i32.gt_s - i32.and - if (result i32) - local.get $0 - local.get $3 - i32.const 1 - i32.shl - i32.add - local.tee $0 - i32.const 2 - i32.add - local.get $0 - i32.const 0 - local.get $2 - i32.sub - i32.const 1 - i32.shl - memory.copy - local.get $0 - i32.const 46 - i32.store16 - local.get $1 - i32.const 1 - i32.add - else - local.get $3 - i32.const 0 - i32.le_s - local.get $3 - i32.const -6 - i32.gt_s - i32.and - if (result i32) - local.get $0 - i32.const 2 - local.get $3 - i32.sub - local.tee $3 - i32.const 1 - i32.shl - i32.add - local.get $0 - local.get $1 - i32.const 1 - i32.shl - memory.copy - local.get $0 - i32.const 3014704 - i32.store - i32.const 2 - local.set $2 - loop $for-loop|1 - local.get $2 - local.get $3 - i32.lt_s - if - local.get $0 - local.get $2 - i32.const 1 - i32.shl - i32.add - i32.const 48 - i32.store16 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|1 - end - end - local.get $1 - local.get $3 - i32.add - else - local.get $1 - i32.const 1 - i32.eq - if - local.get $0 - i32.const 101 - i32.store16 offset=2 - local.get $0 - i32.const 4 - i32.add - local.tee $2 - local.get $3 - i32.const 1 - i32.sub - local.tee $0 - i32.const 0 - i32.lt_s - local.tee $3 - if - i32.const 0 - local.get $0 - i32.sub - local.set $0 - end - local.get $0 - local.get $0 - i32.const 100000 - i32.lt_u - if (result i32) - local.get $0 - i32.const 100 - i32.lt_u - if (result i32) - local.get $0 - i32.const 10 - i32.ge_u - i32.const 1 - i32.add - else - local.get $0 - i32.const 10000 - i32.ge_u - i32.const 3 - i32.add - local.get $0 - i32.const 1000 - i32.ge_u - i32.add - end - else - local.get $0 - i32.const 10000000 - i32.lt_u - if (result i32) - local.get $0 - i32.const 1000000 - i32.ge_u - i32.const 6 - i32.add - else - local.get $0 - i32.const 1000000000 - i32.ge_u - i32.const 8 - i32.add - local.get $0 - i32.const 100000000 - i32.ge_u - i32.add - end - end - i32.const 1 - i32.add - local.tee $1 - call $~lib/util/number/utoa32_dec_lut - local.get $2 - i32.const 45 - i32.const 43 - local.get $3 - select - i32.store16 - else - local.get $0 - i32.const 4 - i32.add - local.get $0 - i32.const 2 - i32.add - local.get $1 - i32.const 1 - i32.shl - local.tee $2 - i32.const 2 - i32.sub - memory.copy - local.get $0 - i32.const 46 - i32.store16 offset=2 - local.get $0 - local.get $2 - i32.add - local.tee $0 - i32.const 101 - i32.store16 offset=2 - local.get $0 - i32.const 4 - i32.add - local.tee $4 - local.get $3 - i32.const 1 - i32.sub - local.tee $0 - i32.const 0 - i32.lt_s - local.tee $2 - if - i32.const 0 - local.get $0 - i32.sub - local.set $0 - end - local.get $0 - local.get $0 - i32.const 100000 - i32.lt_u - if (result i32) - local.get $0 - i32.const 100 - i32.lt_u - if (result i32) - local.get $0 - i32.const 10 - i32.ge_u - i32.const 1 - i32.add - else - local.get $0 - i32.const 10000 - i32.ge_u - i32.const 3 - i32.add - local.get $0 - i32.const 1000 - i32.ge_u - i32.add - end - else - local.get $0 - i32.const 10000000 - i32.lt_u - if (result i32) - local.get $0 - i32.const 1000000 - i32.ge_u - i32.const 6 - i32.add - else - local.get $0 - i32.const 1000000000 - i32.ge_u - i32.const 8 - i32.add - local.get $0 - i32.const 100000000 - i32.ge_u - i32.add - end - end - i32.const 1 - i32.add - local.tee $0 - call $~lib/util/number/utoa32_dec_lut - local.get $4 - i32.const 45 - i32.const 43 - local.get $2 - select - i32.store16 - local.get $0 - local.get $1 - i32.add - local.set $1 - end - local.get $1 - i32.const 2 - i32.add - end - end - end - ) - (func $~lib/util/number/dtoa_core (param $0 f64) (result i32) - (local $1 i64) - (local $2 i32) - (local $3 i64) - (local $4 i64) - (local $5 i64) - (local $6 i64) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i64) - (local $11 i64) - (local $12 i64) - (local $13 i64) - (local $14 i64) - local.get $0 - f64.const 0 - f64.lt - local.tee $2 - if (result f64) - i32.const 5008 - i32.const 45 - i32.store16 - local.get $0 - f64.neg - else - local.get $0 - end - i64.reinterpret_f64 - local.tee $1 - i64.const 9218868437227405312 - i64.and - i64.const 52 - i64.shr_u - i32.wrap_i64 - local.tee $7 - i32.const 1 - local.get $7 - select - i32.const 1075 - i32.sub - local.tee $8 - i32.const 1 - i32.sub - local.get $1 - i64.const 4503599627370495 - i64.and - local.get $7 - i32.const 0 - i32.ne - i64.extend_i32_u - i64.const 52 - i64.shl - i64.add - local.tee $1 - i64.const 1 - i64.shl - i64.const 1 - i64.add - local.tee $3 - i64.clz - i32.wrap_i64 - local.tee $7 - i32.sub - local.set $9 - local.get $3 - local.get $7 - i64.extend_i32_s - i64.shl - global.set $~lib/util/number/_frc_plus - local.get $1 - local.get $1 - i64.const 4503599627370496 - i64.eq - i32.const 1 - i32.add - local.tee $7 - i64.extend_i32_s - i64.shl - i64.const 1 - i64.sub - local.get $8 - local.get $7 - i32.sub - local.get $9 - i32.sub - i64.extend_i32_s - i64.shl - global.set $~lib/util/number/_frc_minus - local.get $9 - global.set $~lib/util/number/_exp - i32.const 348 - i32.const -61 - global.get $~lib/util/number/_exp - local.tee $7 - i32.sub - f64.convert_i32_s - f64.const 0.30102999566398114 - f64.mul - f64.const 347 - f64.add - local.tee $0 - i32.trunc_sat_f64_s - local.tee $8 - local.get $8 - f64.convert_i32_s - local.get $0 - f64.ne - i32.add - i32.const 3 - i32.shr_s - i32.const 1 - i32.add - local.tee $8 - i32.const 3 - i32.shl - local.tee $9 - i32.sub - global.set $~lib/util/number/_K - local.get $9 - i32.const 5064 - i32.add - i64.load - global.set $~lib/util/number/_frc_pow - local.get $8 - i32.const 1 - i32.shl - i32.const 5760 - i32.add - i32.load16_s - global.set $~lib/util/number/_exp_pow - local.get $1 - local.get $1 - i64.clz - i64.shl - local.tee $1 - i64.const 4294967295 - i64.and - local.set $4 - global.get $~lib/util/number/_frc_pow - local.tee $10 - i64.const 4294967295 - i64.and - local.tee $11 - local.get $1 - i64.const 32 - i64.shr_u - local.tee $1 - i64.mul - local.get $4 - local.get $11 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.set $5 - global.get $~lib/util/number/_frc_plus - local.tee $3 - i64.const 4294967295 - i64.and - local.set $12 - local.get $3 - i64.const 32 - i64.shr_u - local.tee $3 - local.get $11 - i64.mul - local.get $11 - local.get $12 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.set $6 - global.get $~lib/util/number/_frc_minus - local.tee $13 - i64.const 4294967295 - i64.and - local.set $14 - local.get $13 - i64.const 32 - i64.shr_u - local.tee $13 - local.get $11 - i64.mul - local.get $11 - local.get $14 - i64.mul - i64.const 32 - i64.shr_u - i64.add - local.set $11 - local.get $2 - i32.const 1 - i32.shl - i32.const 5008 - i32.add - local.get $1 - local.get $10 - i64.const 32 - i64.shr_u - local.tee $1 - i64.mul - local.get $5 - i64.const 32 - i64.shr_u - i64.add - local.get $1 - local.get $4 - i64.mul - local.get $5 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - i64.add - local.get $1 - local.get $3 - i64.mul - local.get $6 - i64.const 32 - i64.shr_u - i64.add - local.get $1 - local.get $12 - i64.mul - local.get $6 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - i64.add - i64.const 1 - i64.sub - local.tee $3 - local.get $7 - global.get $~lib/util/number/_exp_pow - i32.add - i32.const -64 - i32.sub - local.get $3 - local.get $1 - local.get $13 - i64.mul - local.get $11 - i64.const 32 - i64.shr_u - i64.add - local.get $1 - local.get $14 - i64.mul - local.get $11 - i64.const 4294967295 - i64.and - i64.add - i64.const 2147483647 - i64.add - i64.const 32 - i64.shr_u - i64.add - i64.const 1 - i64.add - i64.sub - local.get $2 - call $~lib/util/number/genDigits - local.get $2 - i32.sub - global.get $~lib/util/number/_K - call $~lib/util/number/prettify - local.get $2 - i32.add - ) - (func $~lib/staticarray/StaticArray<~lib/string/String>#__uset (param $0 i32) (param $1 i32) - local.get $0 - i32.const 2 - i32.shl - i32.const 8832 - i32.add - local.get $1 - i32.store - local.get $1 - if - i32.const 8832 - local.get $1 - i32.const 1 - call $byn-split-outlined-A$~lib/rt/itcms/__link - end - ) - (func $~lib/rt/itcms/__pin (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - if - local.get $0 - i32.const 20 - i32.sub - local.tee $1 - i32.load offset=4 - i32.const 3 - i32.and - i32.const 3 - i32.eq - if - i32.const 9296 - i32.const 1056 - i32.const 337 - i32.const 7 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/rt/itcms/Object#unlink - global.get $~lib/rt/itcms/pinSpace - local.tee $3 - i32.load offset=8 - local.set $2 - local.get $1 - local.get $3 - i32.const 3 - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - local.get $2 - local.get $1 - local.get $2 - i32.load offset=4 - i32.const 3 - i32.and - i32.or - i32.store offset=4 - local.get $3 - local.get $1 - i32.store offset=8 - end - local.get $0 - ) - (func $~lib/rt/itcms/__unpin (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - i32.eqz - if - return - end - local.get $0 - i32.const 20 - i32.sub - local.tee $1 - i32.load offset=4 - i32.const 3 - i32.and - i32.const 3 - i32.ne - if - i32.const 9360 - i32.const 1056 - i32.const 351 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/itcms/state - i32.const 1 - i32.eq - if - local.get $1 - call $~lib/rt/itcms/Object#makeGray - else - local.get $1 - call $~lib/rt/itcms/Object#unlink - global.get $~lib/rt/itcms/fromSpace - local.tee $0 - i32.load offset=8 - local.set $2 - local.get $1 - local.get $0 - global.get $~lib/rt/itcms/white - i32.or - i32.store offset=4 - local.get $1 - local.get $2 - i32.store offset=8 - local.get $2 - local.get $1 - local.get $2 - i32.load offset=4 - i32.const 3 - i32.and - i32.or - i32.store offset=4 - local.get $0 - local.get $1 - i32.store offset=8 - end - ) - (func $~lib/rt/itcms/__collect - global.get $~lib/rt/itcms/state - i32.const 0 - i32.gt_s - if - loop $while-continue|0 - global.get $~lib/rt/itcms/state - if - call $~lib/rt/itcms/step - drop - br $while-continue|0 - end - end - end - call $~lib/rt/itcms/step - drop - loop $while-continue|1 - global.get $~lib/rt/itcms/state - if - call $~lib/rt/itcms/step - drop - br $while-continue|1 - end - end - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i64.const 200 - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - ) - (func $~lib/array/Array<~lib/string/String>~visit (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - local.get $0 - i32.load offset=4 - local.tee $1 - local.get $0 - i32.load offset=12 - i32.const 2 - i32.shl - i32.add - local.set $3 - loop $while-continue|0 - local.get $1 - local.get $3 - i32.lt_u - if - local.get $1 - i32.load - local.tee $2 - if - local.get $2 - call $byn-split-outlined-A$~lib/rt/itcms/__visit - end - local.get $1 - i32.const 4 - i32.add - local.set $1 - br $while-continue|0 - end - end - local.get $0 - i32.load - local.tee $0 - if - local.get $0 - call $byn-split-outlined-A$~lib/rt/itcms/__visit - end - ) - (func $~lib/rt/__visit_members (param $0 i32) - (local $1 i32) - (local $2 i32) - block $folding-inner0 - block $invalid - block $~lib/staticarray/StaticArray<~lib/string/String> - block $~lib/date/Date - block $~lib/array/Array<~lib/array/Array<~lib/string/String>> - block $assembly/index/ModelSpec - block $~lib/array/Array<~lib/string/String> - block $assembly/neural-net/IRegularizationFunction - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $folding-inner0 $assembly/neural-net/IRegularizationFunction $~lib/array/Array<~lib/string/String> $assembly/index/ModelSpec $~lib/array/Array<~lib/array/Array<~lib/string/String>> $folding-inner0 $~lib/date/Date $~lib/staticarray/StaticArray<~lib/string/String> $invalid - end - return - end - return - end - return - end - local.get $0 - call $~lib/array/Array<~lib/string/String>~visit - return - end - local.get $0 - i32.load - local.tee $1 - if - local.get $1 - call $byn-split-outlined-A$~lib/rt/itcms/__visit - end - local.get $0 - i32.load offset=4 - local.tee $0 - if - local.get $0 - call $byn-split-outlined-A$~lib/rt/itcms/__visit - end - return - end - local.get $0 - call $~lib/array/Array<~lib/string/String>~visit - return - end - return - end - local.get $0 - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.add - local.set $1 - loop $while-continue|0 - local.get $0 - local.get $1 - i32.lt_u - if - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - call $byn-split-outlined-A$~lib/rt/itcms/__visit - end - local.get $0 - i32.const 4 - i32.add - local.set $0 - br $while-continue|0 - end - end - return - end - unreachable - end - local.get $0 - i32.load - local.tee $0 - if - local.get $0 - call $byn-split-outlined-A$~lib/rt/itcms/__visit - end - ) - (func $~start - i32.const 1108 - i32.const 1104 - i32.store - i32.const 1112 - i32.const 1104 - i32.store - i32.const 1104 - global.set $~lib/rt/itcms/toSpace - memory.size - i32.const 16 - i32.shl - i32.const 25876 - i32.sub - i32.const 1 - i32.shr_u - global.set $~lib/rt/itcms/threshold - i32.const 1316 - i32.const 1312 - i32.store - i32.const 1320 - i32.const 1312 - i32.store - i32.const 1312 - global.set $~lib/rt/itcms/pinSpace - i32.const 1348 - i32.const 1344 - i32.store - i32.const 1352 - i32.const 1344 - i32.store - i32.const 1344 - global.set $~lib/rt/itcms/fromSpace - ) - (func $assembly/index/getModelSpec (result i32) - (local $0 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i64.const 0 - i64.store - local.get $0 - i32.const 1456 - i32.store - local.get $0 - i32.const 1456 - i32.store offset=4 - local.get $0 - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 8 - i32.const 5 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 1456 - i32.store - local.get $0 - i32.const 1456 - i32.const 0 - call $byn-split-outlined-A$~lib/rt/itcms/__link - local.get $0 - i32.const 1456 - i32.store offset=4 - local.get $0 - i32.const 1456 - i32.const 0 - call $byn-split-outlined-A$~lib/rt/itcms/__link - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $assembly/index/findVal (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - loop $for-loop|0 - local.get $3 - local.get $1 - i32.load offset=12 - i32.lt_s - if - local.get $1 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.store - local.get $4 - local.get $0 - call $~lib/string/String.__eq - if - local.get $2 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.tee $1 - local.get $0 - i32.store - local.get $1 - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - return - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $for-loop|0 - end - end - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 1744 - ) - (func $assembly/index/getCommands (result i32) - (local $0 i32) - (local $1 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $0 - i64.const 0 - i64.store - local.get $0 - i32.const 7 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $0 - i32.store - i32.const 2 - i32.const 4 - i32.const 3184 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 0 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 3376 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 1 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 3536 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 2 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 3696 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 3 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 3824 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 4 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 3984 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 5 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 4128 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 6 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - ) - (func $~lib/date/stringify (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner1 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner1 - global.get $~lib/memory/__stack_pointer - local.tee $3 - i64.const 0 - i64.store - local.get $3 - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner1 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - block $__inlined_func$~lib/util/number/itoa32 - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 6624 - local.set $0 - br $__inlined_func$~lib/util/number/itoa32 - end - global.get $~lib/memory/__stack_pointer - i32.const 0 - local.get $0 - i32.sub - local.get $0 - local.get $0 - i32.const 31 - i32.shr_u - i32.const 1 - i32.shl - local.tee $3 - select - local.tee $4 - i32.const 100000 - i32.lt_u - if (result i32) - local.get $4 - i32.const 100 - i32.lt_u - if (result i32) - local.get $4 - i32.const 10 - i32.ge_u - i32.const 1 - i32.add - else - local.get $4 - i32.const 10000 - i32.ge_u - i32.const 3 - i32.add - local.get $4 - i32.const 1000 - i32.ge_u - i32.add - end - else - local.get $4 - i32.const 10000000 - i32.lt_u - if (result i32) - local.get $4 - i32.const 1000000 - i32.ge_u - i32.const 6 - i32.add - else - local.get $4 - i32.const 1000000000 - i32.ge_u - i32.const 8 - i32.add - local.get $4 - i32.const 100000000 - i32.ge_u - i32.add - end - end - local.tee $5 - i32.const 1 - i32.shl - local.get $3 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - local.get $0 - local.get $3 - i32.add - local.get $4 - local.get $5 - call $~lib/util/number/utoa32_dec_lut - local.get $3 - if - local.get $0 - i32.const 45 - i32.store16 - end - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - end - global.get $~lib/memory/__stack_pointer - local.tee $3 - local.get $0 - i32.store - local.get $3 - i32.const 6624 - i32.store offset=4 - local.get $3 - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner1 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - block $__inlined_func$~lib/string/String#padStart - i32.const 6620 - i32.load - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $4 - i32.eqz - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $5 - local.get $1 - i32.const 1 - i32.shl - local.tee $3 - i32.gt_u - i32.or - if - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - br $__inlined_func$~lib/string/String#padStart - end - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $1 - i32.store - local.get $3 - local.get $5 - i32.sub - local.tee $6 - local.get $4 - i32.gt_u - if - local.get $6 - local.get $6 - i32.const 2 - i32.sub - local.get $4 - i32.div_u - local.get $4 - i32.mul - local.tee $3 - i32.sub - local.set $7 - loop $while-continue|0 - local.get $2 - local.get $3 - i32.lt_u - if - local.get $1 - local.get $2 - i32.add - i32.const 6624 - local.get $4 - memory.copy - local.get $2 - local.get $4 - i32.add - local.set $2 - br $while-continue|0 - end - end - local.get $1 - local.get $3 - i32.add - i32.const 6624 - local.get $7 - memory.copy - else - local.get $1 - i32.const 6624 - local.get $6 - memory.copy - end - local.get $1 - local.get $6 - i32.add - local.get $0 - local.get $5 - memory.copy - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - local.set $0 - end - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $~lib/date/Date#toISOString (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - global.get $~lib/memory/__stack_pointer - i32.const 48 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $4 - i32.const 0 - i32.const 48 - memory.fill - i32.const 28 - i32.const 9 - call $~lib/rt/itcms/__new - local.tee $5 - i32.const 8272 - i32.const 28 - memory.copy - local.get $4 - local.get $5 - i32.store - global.get $~lib/memory/__stack_pointer - local.set $4 - i32.const 48 - i32.const 9 - call $~lib/rt/itcms/__new - local.tee $6 - i32.const 8704 - i32.const 48 - memory.copy - local.get $4 - local.get $6 - i32.store offset=4 - local.get $0 - i32.load - local.tee $4 - local.get $0 - i32.load offset=4 - local.tee $7 - i32.const 3 - i32.lt_s - i32.sub - local.tee $8 - i32.const 0 - i32.lt_s - local.set $9 - local.get $7 - i32.const 8763 - i32.add - i32.load8_u - local.get $8 - i32.const 3 - i32.const 0 - local.get $9 - select - i32.sub - i32.const 4 - i32.div_s - local.get $8 - i32.const 99 - i32.const 0 - local.get $9 - select - i32.sub - i32.const 100 - i32.div_s - i32.sub - local.get $8 - i32.const 399 - i32.const 0 - local.get $9 - select - i32.sub - i32.const 400 - i32.div_s - i32.add - local.get $8 - i32.add - i32.add - local.get $0 - i32.load offset=8 - local.tee $8 - i32.add - i32.const 7 - i32.rem_s - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 31 - i32.shr_s - local.tee $10 - local.get $4 - i32.add - local.get $10 - i32.xor - i32.const 4 - call $~lib/date/stringify - local.tee $10 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $6 - local.get $7 - i32.const 1 - i32.sub - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $6 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - local.get $5 - local.get $9 - i32.const 7 - i32.const 0 - local.get $9 - i32.const 0 - i32.lt_s - select - i32.add - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $5 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.const 2 - call $~lib/date/stringify - local.tee $7 - i32.store offset=20 - global.get $~lib/memory/__stack_pointer - local.get $0 - i64.load offset=16 - i64.const 86400000 - i64.rem_s - local.tee $3 - i64.const 86400000 - i64.const 0 - local.get $3 - i64.const 0 - i64.lt_s - select - i64.add - i32.wrap_i64 - i32.const 3600000 - i32.div_s - i32.const 2 - call $~lib/date/stringify - local.tee $8 - i32.store offset=24 - global.get $~lib/memory/__stack_pointer - local.get $0 - i64.load offset=16 - i64.const 3600000 - i64.rem_s - local.tee $3 - i64.const 3600000 - i64.const 0 - local.get $3 - i64.const 0 - i64.lt_s - select - i64.add - i32.wrap_i64 - i32.const 60000 - i32.div_s - i32.const 2 - call $~lib/date/stringify - local.tee $9 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - local.get $0 - i64.load offset=16 - i64.const 60000 - i64.rem_s - local.tee $3 - i64.const 60000 - i64.const 0 - local.get $3 - i64.const 0 - i64.lt_s - select - i64.add - i32.wrap_i64 - i32.const 1000 - i32.div_s - i32.const 2 - call $~lib/date/stringify - local.tee $0 - i32.store offset=32 - global.get $~lib/memory/__stack_pointer - i32.const 8912 - i32.const 1744 - local.get $4 - i32.const 0 - i32.lt_s - select - local.tee $4 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 0 - local.get $5 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 1 - local.get $7 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 2 - local.get $6 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 3 - local.get $4 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 4 - local.get $10 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 6 - local.get $8 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 8 - local.get $9 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - i32.const 10 - local.get $0 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 8832 - i32.store offset=40 - global.get $~lib/memory/__stack_pointer - i32.const 1744 - i32.store offset=44 - i32.const 8828 - i32.load - i32.const 2 - i32.shr_u - local.set $4 - i32.const 0 - local.set $0 - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $5 - i64.const 0 - i64.store - local.get $5 - i32.const 0 - i32.store offset=8 - block $__inlined_func$~lib/util/string/joinStringArray - local.get $4 - i32.const 1 - i32.sub - local.tee $5 - i32.const 0 - i32.lt_s - if - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 1744 - local.set $0 - br $__inlined_func$~lib/util/string/joinStringArray - end - local.get $5 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 8832 - i32.load - local.tee $1 - i32.store - local.get $0 - i32.const 12 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - i32.const 1744 - local.get $1 - select - local.set $0 - br $__inlined_func$~lib/util/string/joinStringArray - end - loop $for-loop|0 - local.get $2 - local.get $4 - i32.lt_s - if - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.const 2 - i32.shl - i32.const 8832 - i32.add - i32.load - local.tee $6 - i32.store offset=4 - local.get $6 - if - local.get $0 - local.get $6 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.add - local.set $0 - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|0 - end - end - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.const 1740 - i32.load - i32.const 1 - i32.shr_u - local.tee $4 - local.get $5 - i32.mul - i32.add - i32.const 1 - i32.shl - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store offset=8 - i32.const 0 - local.set $2 - loop $for-loop|1 - local.get $2 - local.get $5 - i32.lt_s - if - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.const 2 - i32.shl - i32.const 8832 - i32.add - i32.load - local.tee $6 - i32.store offset=4 - local.get $6 - if - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - local.get $6 - local.get $6 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - local.tee $6 - i32.const 1 - i32.shl - memory.copy - local.get $1 - local.get $6 - i32.add - local.set $1 - end - local.get $4 - if - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - i32.const 1744 - local.get $4 - i32.const 1 - i32.shl - memory.copy - local.get $1 - local.get $4 - i32.add - local.set $1 - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|1 - end - end - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.const 2 - i32.shl - i32.const 8832 - i32.add - i32.load - local.tee $2 - i32.store offset=4 - local.get $2 - if - local.get $0 - local.get $1 - i32.const 1 - i32.shl - i32.add - local.get $2 - local.get $2 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - memory.copy - end - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.add - global.set $~lib/memory/__stack_pointer - end - global.get $~lib/memory/__stack_pointer - i32.const 48 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $assembly/index/onUpdate (result i32) - (local $0 i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.const 20 - memory.fill - local.get $0 - i32.const 1 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $2 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.load offset=4 - i32.store offset=12 - local.get $2 - i32.const 0 - i32.const 7904 - call $~lib/array/Array<~lib/string/String>#__uset - call $~lib/bindings/dom/Date.now - i64.trunc_sat_f64_s - local.set $1 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 24 - i32.const 8 - call $~lib/rt/itcms/__new - local.tee $6 - i32.store - local.get $6 - local.get $1 - i64.store offset=16 - local.get $6 - i32.const 0 - i32.store - local.get $6 - i32.const 0 - i32.store offset=4 - local.get $6 - i32.const 0 - i32.store offset=8 - local.get $1 - i64.const -8640000000000000 - i64.lt_s - local.get $1 - i64.const 8640000000000000 - i64.gt_s - i32.or - if - i32.const 7952 - i32.const 8000 - i32.const 100 - i32.const 35 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i64.const 86399999 - i64.const 0 - local.get $1 - i64.const 0 - i64.lt_s - select - i64.sub - i64.const 86400000 - i64.div_s - i32.wrap_i64 - i32.const 2 - i32.shl - i32.const 2877872 - i32.add - i32.const 3 - i32.or - local.tee $0 - i32.const 146096 - i32.const 0 - local.get $0 - i32.const 0 - i32.lt_s - select - i32.sub - i32.const 146097 - i32.div_s - local.set $7 - local.get $0 - local.get $7 - i32.const 146097 - i32.mul - i32.sub - i32.const 3 - i32.or - i64.extend_i32_u - i64.const 2939745 - i64.mul - local.tee $1 - i32.wrap_i64 - i32.const 11758980 - i32.div_u - local.tee $5 - i32.const 2141 - i32.mul - i32.const 197913 - i32.add - local.set $4 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - local.get $7 - i32.const 100 - i32.mul - i32.add - local.set $0 - local.get $4 - i32.const 16 - i32.shr_u - local.set $7 - local.get $4 - i32.const 65535 - i32.and - i32.const 2141 - i32.div_u - i32.const 1 - i32.add - global.set $~lib/date/_day - local.get $5 - i32.const 306 - i32.ge_u - if (result i32) - local.get $0 - i32.const 1 - i32.add - local.set $0 - local.get $7 - i32.const 12 - i32.sub - else - local.get $7 - end - global.set $~lib/date/_month - local.get $6 - local.get $0 - i32.store - local.get $6 - global.get $~lib/date/_month - i32.store offset=4 - local.get $6 - global.get $~lib/date/_day - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=16 - local.get $2 - i32.const 1 - local.get $6 - call $~lib/date/Date#toISOString - call $~lib/array/Array<~lib/string/String>#__uset - local.get $3 - i32.const 0 - local.get $2 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $1 - i64.const 0 - i64.store - local.get $1 - i32.const 16 - i32.const 6 - call $~lib/rt/itcms/__new - local.tee $2 - i32.store - local.get $2 - i32.const 0 - i32.store - local.get $2 - i32.const 0 - i32.store offset=4 - local.get $2 - i32.const 0 - i32.store offset=8 - local.get $2 - i32.const 0 - i32.store offset=12 - local.get $0 - i32.const 268435455 - i32.gt_u - if - i32.const 1488 - i32.const 1536 - i32.const 70 - i32.const 60 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.const 8 - local.get $0 - i32.const 8 - i32.gt_u - select - i32.const 2 - i32.shl - local.tee $1 - i32.const 0 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store offset=4 - local.get $2 - local.get $3 - i32.store - local.get $3 - if - local.get $2 - local.get $3 - i32.const 0 - call $byn-split-outlined-A$~lib/rt/itcms/__link - end - local.get $2 - local.get $3 - i32.store offset=4 - local.get $2 - local.get $1 - i32.store offset=8 - local.get $2 - local.get $0 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $~lib/array/Array<~lib/string/String>#__get (param $0 i32) (param $1 i32) (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 1152 - i32.const 1536 - i32.const 114 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load offset=4 - local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $0 - i32.store - local.get $0 - i32.eqz - if - i32.const 1616 - i32.const 1536 - i32.const 118 - i32.const 40 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - ) - (func $~lib/rt/__newArray (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $5 - i32.const 0 - i32.store - local.get $0 - i32.const 2 - i32.shl - local.tee $4 - i32.const 0 - call $~lib/rt/itcms/__new - local.set $3 - local.get $2 - if - local.get $3 - local.get $2 - local.get $4 - memory.copy - end - local.get $5 - local.get $3 - i32.store - i32.const 16 - local.get $1 - call $~lib/rt/itcms/__new - local.tee $1 - local.get $3 - i32.store - local.get $3 - if - local.get $1 - local.get $3 - i32.const 0 - call $byn-split-outlined-A$~lib/rt/itcms/__link - end - local.get $1 - local.get $3 - i32.store offset=4 - local.get $1 - local.get $4 - i32.store offset=8 - local.get $1 - local.get $0 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - ) - (func $~lib/util/number/itoa64 (param $0 i64) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i64.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 6624 - return - end - i64.const 0 - local.get $0 - i64.sub - local.get $0 - local.get $0 - i64.const 63 - i64.shr_u - i32.wrap_i64 - i32.const 1 - i32.shl - local.tee $2 - select - local.tee $0 - i64.const 4294967295 - i64.le_u - if - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.wrap_i64 - local.tee $1 - i32.const 100000 - i32.lt_u - if (result i32) - local.get $1 - i32.const 100 - i32.lt_u - if (result i32) - local.get $1 - i32.const 10 - i32.ge_u - i32.const 1 - i32.add - else - local.get $1 - i32.const 10000 - i32.ge_u - i32.const 3 - i32.add - local.get $1 - i32.const 1000 - i32.ge_u - i32.add - end - else - local.get $1 - i32.const 10000000 - i32.lt_u - if (result i32) - local.get $1 - i32.const 1000000 - i32.ge_u - i32.const 6 - i32.add - else - local.get $1 - i32.const 1000000000 - i32.ge_u - i32.const 8 - i32.add - local.get $1 - i32.const 100000000 - i32.ge_u - i32.add - end - end - local.tee $4 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $2 - local.get $3 - i32.add - local.get $1 - local.get $4 - call $~lib/util/number/utoa32_dec_lut - else - global.get $~lib/memory/__stack_pointer - local.get $0 - i64.const 1000000000000000 - i64.lt_u - if (result i32) - local.get $0 - i64.const 1000000000000 - i64.lt_u - if (result i32) - local.get $0 - i64.const 100000000000 - i64.ge_u - i32.const 10 - i32.add - local.get $0 - i64.const 10000000000 - i64.ge_u - i32.add - else - local.get $0 - i64.const 100000000000000 - i64.ge_u - i32.const 13 - i32.add - local.get $0 - i64.const 10000000000000 - i64.ge_u - i32.add - end - else - local.get $0 - i64.const 100000000000000000 - i64.lt_u - if (result i32) - local.get $0 - i64.const 10000000000000000 - i64.ge_u - i32.const 16 - i32.add - else - local.get $0 - i64.const -8446744073709551616 - i64.ge_u - i32.const 18 - i32.add - local.get $0 - i64.const 1000000000000000000 - i64.ge_u - i32.add - end - end - local.tee $1 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $2 - local.get $3 - i32.add - local.set $5 - loop $while-continue|0 - local.get $0 - i64.const 100000000 - i64.ge_u - if - local.get $5 - local.get $1 - i32.const 4 - i32.sub - local.tee $1 - i32.const 1 - i32.shl - i32.add - local.get $0 - local.get $0 - i64.const 100000000 - i64.div_u - local.tee $0 - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee $4 - i32.const 10000 - i32.rem_u - local.tee $6 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i64.load32_u - local.get $6 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - local.get $5 - local.get $1 - i32.const 4 - i32.sub - local.tee $1 - i32.const 1 - i32.shl - i32.add - local.get $4 - i32.const 10000 - i32.div_u - local.tee $4 - i32.const 100 - i32.div_u - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i64.load32_u - local.get $4 - i32.const 100 - i32.rem_u - i32.const 2 - i32.shl - i32.const 5976 - i32.add - i64.load32_u - i64.const 32 - i64.shl - i64.or - i64.store - br $while-continue|0 - end - end - local.get $5 - local.get $0 - i32.wrap_i64 - local.get $1 - call $~lib/util/number/utoa32_dec_lut - end - local.get $2 - if - local.get $3 - i32.const 45 - i32.store16 - end - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $export:assembly/index/modelFactory (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 20 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - i32.const 0 - i32.const 20 - memory.fill - local.get $2 - i32.const 3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $2 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - i32.store offset=12 - local.get $3 - i32.const 0 - i32.const 1584 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 1584 - i32.store offset=16 - local.get $3 - i32.const 1 - i32.const 1584 - local.get $0 - local.get $1 - call $assembly/index/findVal - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $2 - i32.const 0 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - i32.store offset=8 - local.get $3 - i32.const 0 - i32.const 1776 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 1776 - i32.store offset=16 - local.get $3 - i32.const 1 - i32.const 1776 - local.get $0 - local.get $1 - call $assembly/index/findVal - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $2 - i32.const 1 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - i32.store offset=12 - local.get $3 - i32.const 0 - i32.const 1808 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 1808 - i32.store offset=16 - local.get $3 - i32.const 1 - i32.const 1808 - local.get $0 - local.get $1 - call $assembly/index/findVal - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $2 - i32.const 2 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/getPorts (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i64.const 0 - i64.store - local.get $0 - i32.const 2 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $0 - i32.store - i32.const 2 - i32.const 4 - i32.const 2016 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 0 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 2192 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - i32.const 1 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/port1Cb (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const -64 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.const 64 - memory.fill - local.get $0 - i32.const 4 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $1 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.load offset=4 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.const 2 - i32.const 4 - i32.const 2256 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $1 - i32.const 1 - i32.const 2 - i32.const 4 - i32.const 2384 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $1 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2512 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $1 - i32.const 3 - i32.const 2 - i32.const 4 - i32.const 2640 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $0 - local.get $1 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 2672 - i32.store offset=52 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=60 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=56 - i32.const 2672 - local.get $0 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=44 - global.get $~lib/memory/__stack_pointer - i32.const 2720 - i32.store offset=48 - local.get $0 - i32.const 2720 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=36 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=44 - local.get $2 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=40 - local.get $0 - local.get $2 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - i32.const 2720 - i32.store offset=32 - local.get $0 - i32.const 2720 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=20 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=28 - local.get $2 - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=24 - local.get $0 - local.get $2 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=12 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=20 - local.get $2 - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=16 - local.get $0 - local.get $2 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=8 - local.get $0 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const -64 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/port2Cb (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const -64 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.const 64 - memory.fill - local.get $0 - i32.const 4 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $1 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.load offset=4 - i32.store offset=4 - local.get $1 - i32.const 0 - i32.const 2 - i32.const 4 - i32.const 2752 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $1 - i32.const 1 - i32.const 2 - i32.const 4 - i32.const 2832 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $1 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2864 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $1 - i32.const 3 - i32.const 2 - i32.const 4 - i32.const 2944 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - local.get $0 - local.get $1 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 2976 - i32.store offset=52 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=60 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=56 - i32.const 2976 - local.get $0 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=44 - global.get $~lib/memory/__stack_pointer - i32.const 2720 - i32.store offset=48 - local.get $0 - i32.const 2720 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=36 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=44 - local.get $2 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=40 - local.get $0 - local.get $2 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - i32.const 2720 - i32.store offset=32 - local.get $0 - i32.const 2720 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=20 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=28 - local.get $2 - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=24 - local.get $0 - local.get $2 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=12 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=20 - local.get $2 - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=16 - local.get $0 - local.get $2 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=8 - local.get $0 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const -64 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/commandEx (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 32 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - i32.const 0 - i32.const 32 - memory.fill - local.get $2 - i32.const 4160 - i32.store offset=20 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=24 - i32.const 4160 - local.get $0 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 4224 - i32.store offset=16 - local.get $0 - i32.const 4224 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=8 - local.get $0 - local.get $1 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $0 - i32.store offset=28 - i32.const 2 - i32.const 4 - i32.const 4320 - call $~lib/rt/__newArray - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=8 - local.get $0 - i32.const 0 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/serviceMeshListen (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 32 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - i32.const 0 - i32.const 32 - memory.fill - local.get $2 - i32.const 4352 - i32.store offset=20 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=24 - i32.const 4352 - local.get $2 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 4416 - i32.store offset=16 - local.get $2 - i32.const 4416 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=8 - local.get $2 - local.get $3 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 4448 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 4448 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $0 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - i32.const 3408 - i32.store offset=4 - local.get $0 - i32.const 3408 - call $assembly/aegis/addListener - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/serviceMeshNotify (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 44 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - i32.const 0 - i32.const 44 - memory.fill - local.get $2 - i32.const 4496 - i32.store - local.get $2 - i32.const 4496 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $2 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 4544 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 4544 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $3 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 4448 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 4448 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $4 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $5 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - i32.const 4592 - i32.store offset=32 - i32.const 4592 - local.get $2 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=24 - global.get $~lib/memory/__stack_pointer - i32.const 4416 - i32.store offset=28 - local.get $6 - i32.const 4416 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=20 - local.get $6 - local.get $3 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store - local.get $6 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $6 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.load offset=4 - i32.store offset=40 - local.get $6 - i32.const 0 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $6 - i32.const 1 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=24 - local.get $5 - i32.const 0 - local.get $6 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $0 - i32.store offset=40 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load offset=4 - i32.store offset=36 - local.get $0 - i32.const 0 - i32.const 4496 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $0 - i32.const 1 - local.get $2 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=24 - local.get $5 - i32.const 1 - local.get $0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $0 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load offset=4 - i32.store offset=40 - local.get $0 - i32.const 0 - i32.const 4544 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $0 - i32.const 1 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=24 - local.get $5 - i32.const 2 - local.get $0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 4672 - local.get $4 - select - local.tee $0 - i32.store - local.get $0 - local.get $5 - f64.const 1 - call $assembly/aegis/fireEvent - global.get $~lib/memory/__stack_pointer - i32.const 44 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/serviceMeshCallback (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 44 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - i32.const 0 - i32.const 44 - memory.fill - local.get $2 - i32.const 4720 - i32.store offset=20 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=24 - i32.const 4720 - local.get $2 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 4416 - i32.store offset=16 - local.get $2 - i32.const 4416 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=8 - local.get $2 - local.get $3 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 4448 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 4448 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $2 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - i32.const 2 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $3 - i32.store offset=32 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $4 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.load offset=4 - i32.store offset=40 - local.get $4 - i32.const 0 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - i32.const 1 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.store offset=8 - local.get $3 - i32.const 0 - local.get $4 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $4 - i32.store offset=40 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.load offset=4 - i32.store offset=36 - local.get $4 - i32.const 0 - local.get $0 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - i32.const 1 - local.get $1 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.store offset=8 - local.get $3 - i32.const 1 - local.get $4 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2288 - i32.store offset=8 - local.get $2 - i32.const 2288 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - local.get $3 - f64.const 1 - call $assembly/aegis/fireEvent - global.get $~lib/memory/__stack_pointer - i32.const 1 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $0 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load offset=4 - i32.store offset=40 - local.get $0 - i32.const 0 - i32.const 2 - i32.const 4 - i32.const 4800 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 44 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/runFibonacci (param $0 i32) (param $1 i32) (result i32) - (local $2 f64) - (local $3 i32) - (local $4 i64) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $5 - local.get $0 - i32.store - local.get $5 - local.get $1 - i32.store offset=4 - local.get $5 - i32.const 24 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 24 - memory.fill - call $~lib/bindings/dom/Date.now - i64.trunc_sat_f64_s - local.set $4 - loop $for-loop|0 - local.get $3 - local.get $0 - i32.load offset=12 - i32.lt_s - if - block $for-break0 - global.get $~lib/memory/__stack_pointer - i32.const 1808 - i32.store - local.get $0 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - i32.const 1808 - local.get $5 - call $~lib/string/String.__eq - if - local.get $1 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - call $~lib/util/string/strtol - local.set $2 - br $for-break0 - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $for-loop|0 - end - end - end - local.get $2 - call $assembly/index/fibonacci - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 2 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $1 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - i32.store offset=20 - local.get $3 - i32.const 0 - i32.const 4832 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - block $__inlined_func$~lib/util/number/dtoa - local.get $2 - f64.const 0 - f64.eq - if - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 4864 - local.set $0 - br $__inlined_func$~lib/util/number/dtoa - end - local.get $2 - local.get $2 - f64.sub - f64.const 0 - f64.ne - if - local.get $2 - local.get $2 - f64.ne - if - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 4896 - local.set $0 - br $__inlined_func$~lib/util/number/dtoa - end - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const 4928 - i32.const 4976 - local.get $2 - f64.const 0 - f64.lt - select - local.set $0 - br $__inlined_func$~lib/util/number/dtoa - end - local.get $2 - call $~lib/util/number/dtoa_core - i32.const 1 - i32.shl - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - local.get $0 - i32.const 5008 - local.get $5 - memory.copy - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - end - local.get $3 - i32.const 1 - local.get $0 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=12 - local.get $1 - i32.const 0 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $0 - i32.store offset=20 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load offset=4 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.const 6400 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $0 - i32.const 1 - call $~lib/bindings/dom/Date.now - i64.trunc_sat_f64_s - local.get $4 - i64.sub - call $~lib/util/number/itoa64 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=12 - local.get $1 - i32.const 1 - local.get $0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/portEx (param $0 i32) (param $1 i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 28 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - i32.const 0 - i32.const 28 - memory.fill - local.get $2 - i32.const 7808 - i32.store offset=20 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=24 - i32.const 7808 - local.get $0 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 4224 - i32.store offset=16 - local.get $0 - i32.const 4224 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=8 - local.get $0 - local.get $1 - call $~lib/string/String.__concat - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 28 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/onUpdate (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - if - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - call $assembly/index/onUpdate - local.set $0 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - ) - (func $export:assembly/index/onDelete (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 8944 - i32.store - i32.const 8944 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - i32.const -1 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/validate (param $0 i32) (param $1 i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $0 - i32.const 0 - i32.store - local.get $0 - i32.const 9008 - i32.store - i32.const 9008 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $export:assembly/index/test (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - block $folding-inner0 - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - local.get $0 - i32.store - local.get $2 - local.get $1 - i32.store offset=4 - local.get $2 - i32.const 32 - i32.sub - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 9492 - i32.lt_s - br_if $folding-inner0 - global.get $~lib/memory/__stack_pointer - local.tee $2 - i32.const 0 - i32.const 32 - memory.fill - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 1584 - i32.store offset=4 - local.get $2 - local.get $3 - i32.const 1584 - call $~lib/string/String.__eq - if (result i32) - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - else - i32.const 9072 - end - local.tee $2 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.set $3 - local.get $0 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 1776 - i32.store offset=4 - local.get $3 - local.get $0 - i32.const 1776 - call $~lib/string/String.__eq - if (result i32) - local.get $1 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - else - i32.const 9072 - end - local.tee $0 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $1 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store offset=24 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - i32.store offset=28 - local.get $3 - i32.const 0 - i32.const 1584 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $3 - i32.const 1 - local.get $2 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=20 - local.get $1 - i32.const 0 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $2 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.load offset=4 - i32.store offset=24 - local.get $2 - i32.const 0 - i32.const 1776 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $2 - i32.const 1 - local.get $0 - call $~lib/array/Array<~lib/string/String>#__uset - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=20 - local.get $1 - i32.const 1 - local.get $2 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 2 - i32.const 4 - i32.const 9216 - call $~lib/rt/__newArray - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=20 - local.get $1 - i32.const 2 - local.get $0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - global.get $~lib/memory/__stack_pointer - i32.const 9248 - i32.store - i32.const 9248 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.add - global.set $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $1 - return - end - i32.const 25904 - i32.const 25952 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - ) - (func $byn-split-outlined-A$~lib/rt/itcms/__visit (param $0 i32) - global.get $~lib/rt/itcms/white - local.get $0 - i32.const 20 - i32.sub - local.tee $0 - i32.load offset=4 - i32.const 3 - i32.and - i32.eq - if - local.get $0 - call $~lib/rt/itcms/Object#makeGray - global.get $~lib/rt/itcms/visitCount - i32.const 1 - i32.add - global.set $~lib/rt/itcms/visitCount - end - ) - (func $byn-split-outlined-A$~lib/rt/itcms/__link (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - local.get $0 - i32.eqz - if - i32.const 0 - i32.const 1056 - i32.const 294 - i32.const 14 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/itcms/white - local.get $1 - i32.const 20 - i32.sub - local.tee $1 - i32.load offset=4 - i32.const 3 - i32.and - i32.eq - if - local.get $0 - i32.const 20 - i32.sub - local.tee $0 - i32.load offset=4 - i32.const 3 - i32.and - local.tee $3 - global.get $~lib/rt/itcms/white - i32.eqz - i32.eq - if - local.get $0 - local.get $1 - local.get $2 - select - call $~lib/rt/itcms/Object#makeGray - else - global.get $~lib/rt/itcms/state - i32.const 1 - i32.eq - local.get $3 - i32.const 3 - i32.eq - i32.and - if - local.get $1 - call $~lib/rt/itcms/Object#makeGray - end - end - end - ) -) diff --git a/oldwasm/wasm/build/untouched.wasm b/oldwasm/wasm/build/untouched.wasm deleted file mode 100644 index 8041bb5f2ee0185e29fe7b91879ad6a0fb310190..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38013 zcmeHw3wTvmnfAV%Te1_ffdC;1uuqbz zy;v<;tlBHuSTC&_MjUVb6)knVRAnlT&djf(MXh61X5{zw>p)@Ncdfnmxu&F!&&)H= zGv~0+*?X<^ee1ie@B7x}1TB{A)-_Gj->Xl(-PpfhL@$KzNv#WQz7Et$AtgUTBdomU8i6=Bol@)DkPsCU6iua_n zae-B_RNU<8-L2W?u>OACFu-lVFbp$b;)eGqz$+Lsv_K#dG7Mcabrj-5RvAXAZkT4! z)WfE!ml?&y#&|P0VWL%1QdC}KvCX8Q9!6`!2!w#qe}zJkppI7r64rIiz@?*LvaU}l zs?dXmW@xfrRkJn_(EHHF#BJyaefoY)Xcj(newfyNosX~S!$qK3gL;$ukwzfP)T1W$ zXJXbwfL)$ACc8iMob2|{bCM4EMIyrAH)j-W>}`v8ZSIS=niVD6<0=19OO6+bL~LNw zw#}(Td(ZY{^SV{0VWG*&-tO*LPg_zOfSy`%s3pFQGG1$k>DSrR8=;_LC z5_f&9JFXqnGpdqVRqxU#XG6t%+WLCiVLT6J))2_AdAB|(4b$4&lT0Q0TT{IW?LB&l z>~u|xj|19!^#};L0mhru9@4{oxS7AQMSED?F2L<0dQq#A$m%`Xqx$${Jh7|2HNG*P z+@b7Rdn~K)`rcIgwgK&NePTw-m9eg_mRM`2c1SNt^!Kds<@!E7#6E%g{d%OgXKP;@ zhJ*G5?^ngU;dLR`~rnD#ZqL5Cr(~5ubF$|hw&CzBW0b%a6O1)dL zKe^K?!jq#fF(Uq5z#1>hJb;89v0}Qh-_h()RCi!EYXXfzuVj6M52&fFUKfNttwx0= z9C1Mt6KqYh$}HI^YOuNC)!wBGo3)Pa7%S@P-=`RG`2vLXl>NtrZeaZ2){q`fK#nKt;yht&8dC8c40W0GP9j!Fv$j zrGfpm=IWp@EPI^Qt()iu?3P(lP9EbQF~m5RSUTv_PTnRP3EG!~stkhC&-P*~AnjoBSs4^qQDr$XG|)hLTJX*cA;zD>Wf; z?!tu&W=+@$IpK9x(U6$ogtk+WAtxXLox23gGnIr&10o{yPSi+y2#6``Fld6p&KNYH z=#bYPq!5Tkl%WZas+7 zX`US9W`_PD;Q%2yDD<7OvFivSSB>*f2py}uUE>U)8D!U6wyVKO5 z)}2TyVOL0?QUH}e7aG7K00TpwEyApdQVF0ebxP8PXFX)-VP#&9vC$v7fA)tG%1MnTD2-4-l&K$iH9KlpXNe7Tie}VuB21TH&69Z3&#;8|4LEG6$<3W6deEC@= zT_Q|`#*bk{+ma$HaspJ4V=f^Z7=sae8sh$24ZRdGtFpG*XFsZ~&_J=IP{46@@I%VQ z-bMfG=WJ1`yg0W1K}+KMEQ>!^w{490>W^p0pmMFo!ij%ZLmD4wDvj5nrJ zvO*Jf%ASt53@ZiCB#ws-gqOHy?fT`2-Rr6{xK#fT3O)nV=cy zM1ze_v#K;i{%R<(%&IK`pgjZM2wjdHwPt&D=t-tD_zVYYk=58!I_n@50?6i@vTnn2e>E*wXnsLw@$CV-W)^t+Jgz+@2Cj;51G!JmcO z$IINv!&qxY4G@eWPzO5dOePX_0b$gItV|vPQHm`n>68sHo>uIr3y$fIN$ivbco-1NLY z*z}S%^b}fm)M2z$GI15!`ce#BJk`SQMry;gkxqQC>rzdu=^$5>Fv%=I2AJb#EUS*y zGC@$O>lvM)@0+HWMh-Zv>`Se$7_6K%9a5@KX)Q)^+iQbn%9A@$g>Rsm3>5|0rEx&@t4A_FXOJl1ax*?L_?3 zm=Qq!%2&$@0|O6rh`v%U(J=0Ixb8F}aYf*wWE#R0LWWSKK?vZV4K+28Jr|*M#0l*{ z_Y6*mF7Vb8@OCR2wt{16K1&TlrAJ>ryw$kTZVbK z&1+L=0+?K{2GUC{11qM$tu=7458-ME|X zFe_pjM296YcUa(6m)TNIIhz;?)UtLmrPS@qASUo)&!pFvipRq&uZXO$R3&m}+^{HZ zEuEn`Mmlo-)^u|{l`r8F=w?${rZrK^a-ElhY(IN1@$YQwlco{guMZk9LU5r&Ohyy| zN$BeX28AVLtY>F1iNk`BrUTT7Gevu`7v3Gn`K)w#S4+_T%$H@BQa(*ICbAkkG zHW~%|pCj%z#0=&B=uS~#Ut$T{(K_ro5Hv#;Ebt0^YW7^msI_WMdmQ4XVNdC(!xw^< z%0*B=4+a$0q+4>oy@dru2^@GJth~snDA5UflR`sE;e4c~=&b1A z{O1UtBkAW7K9_jU$h+yQk>ZgCp!7RK=u?xyS3?aLB1b>~Y#_hAtPi;LoEef-XyGay zqM_gkk1q+&$)}Wv%tbLiltknc{ERCRE`u2uOK9u9rCcZpCV2o8Nb=Agt1oV@C#4fL zFOK`K(E`Mo5Teq!81JbF=1-Z!D(OQjcENZtQKQOq5tKDpGo$hXtb{xBDvLZY$T<(P z)Q5yxb0J63EYe?Qxqn5WfMtYRkL3wzmJN?~5N?xY+v6(a6E0asC0clu#U7YqIU91E z4=GvBh8&G$+J-F~(Etqb4#m1cZ#~0J2do%OM@&#DG~EvUJDn6bxQ^suTG$n_$s)Ioj}6F2K17 z9Wptlb6%ptd(QO$BWD*Oi%5{=f{h?^HRfMo278&gaZN7l278&0NjD6CyU9g@-jES8 zgGQlBmSt9mhzeKR>{Jdd{ic93UeJMwX(8Ac7Tk;(Q7b2L@JL-J8WQGm3=k3a&vla{h>cp z7`w16gP!FIje0T~#R*dk1;hkV@2$}=0YVCmBsZe=d9JH+j1;tlJu?JTJq2q}yFggE zbt3DkYLK*}C7!Osasdr3WH-u%UCjTHGdqD!OkFUClIvV*qNnkTX%-iHZDi?ODvekd zk?U`DWWQavUI%Tg z(%e@p(CFWD-rzo*S&^Ve61Cl`n>_z*vJShxCLP*4N;!s8f{U zV`G9S#LzLVQ@s6{x`A#vfiW7h-;Ng5LHy7aOqg}?^f65>kA9RlT-f;pZ?M@QUgQmp zYUmVhIRClu3KHv3Nf_qH7tv!vb25PGjj`986LC>PuXOqR(|!`hxh5xI0Xd!n_8NEc zf)$018dXDEg@MXJ;mZi-5fE3n)31QIoYODautx5IXZIpodcr>QENvzOKdf7tsj=3Z z%+;;uWG)*A=0tE^=)&L%en8Z#E#mzo-w;kh{7LgSjghf)B+C5P!oD(F1BkGk=4DJ$ zTwpm*`6)!niOO&A&6x@idQ%lM6QeM&YwM=#*%c8~xJhkxg)R4anH+MHUlUgo@#?)L&p5y%#=HKxC!N4E!X_0XI;ev?3Ty z@KD!UEw~ZG?+B?O@RG)`qob&JQ%4zQe7HOKg0`sx-!F$zWNAU%4julfj87rlAG`Z% z*%T)g#L#DYk%<|+zVD0!cDpp9=SIdkUV&bSB;vorG?*8}THM3S9(L&`rzl$Ll!{{70md%Ppj1RS z_DV&VBd=71IPOYCkfW|t1Tg0Cg`pS57iPE-d||#@R8q{zTtqR`6U9cMy6wZ(j-{qO zC;@+N9qw3F>{mfJZWZoWRpeDcR;mU!tcZ9OP=Kny4J*Q41%$6EaKnm_SMhRKmA@Qj zanLK~Mgl2*NwyAn#l@<$m~CD2$4;iu@TiO)wjS*H*u-V6$j8#9JVKp%BM2qF-aM&D;6Nz;)}v52kWqZ#1+N; zV6NN>uoHGvemr)>PSpu=0vMhmU z)+;&|vW-F6moCRWLkythLl09Emi9qJfhgT9tqn`s(%Qn}nM<*bsQ8N(^GP1mfUY5A zEN0O=YPf+VVYA-iN-k1Pr5qh7RGvVT43pA;9TVNCSU`LcVrR;O4MG=D5wbFPX1FVm znQkdlw)~b@ETtR_STYoufrWywz7Wuh;K|`kfgXtnEPk%2Pp_gFaDNWyVSv&da|3MC z6q7bc!-R~yIP92f8I$O$fQLyKMvjy;?!9~(HD+!PbkaOe1z(qq+HDK@W8aF)QsAEB z1*xNt1|5)QI_*0^fkdFWvm0Xopp31r9;XQ(B#S<7d&ZXosyNg=pXdrh>;}4kxTr1 z1U)!^K*i$#Lnb|#>qIO@8qx#i5kv4ui-!FwdO)sIY=fSn40?iAher@Rrh1Qr%wnW# zWrL3HX9umYc+M&G$Ix68SI`LHR&{u2WNi+1iJX!z!bOg28d9%6UC{1oT7)ndM41Zi z7s7X8+``7LJ>0bDUZ-p?+#1y21gpe_uvpa5DG9fw7YRAznHlJN5nZ{#1UXF@U`(Ch zL}bWC;*UZ=kN0|vypF<|P*>)RcZx;;yAKQ(bz;Y8j+2H{92U(Nl$D5K@j3d{qIAE%!QAdoAWmRXCV99;1dN;gFk4QZY#SD~qVwsrE>!_C!=o zlB#_XRgD5!F(_d$XI1k4Z~iou>~ujc_Q&rKr$bkPhm9EM+F!jdl(*7oK&%~ z2f9)*lG~>Ya7b+N-KV0Ymk}W!LyRl-B4{aMRaVR_aZ25onH5_ll#Gmww66lCA}xIX zQp~CQemG&zWD<0C@PX|J5}X#UaI}G^I>ij07U^NIf)Ga-9&l_+$MRL92?KC~x4M24w?k2U zI6-D*jF;{lMm22G(+vY`h!*}VhyLDr1g9JZ9g|%kkwJ;t?Q_f>Sa%wso;apLt{9jZ z_`DA-f__7HJw+d-xWaP~tULIf!;Rb>4Vuh2BoH(|1V7(5^?2 zH@N@H}asx4k{7vrkdFcG@Zfw}QXHsCG!d%-4bt;CjCk?KU^N?Lmk-2J0cFk@EQv^~B zrBPdSx=jw6qc-V)XvLxB$OxfKtT#qg;-F*6580Xs6VNexrMwV_WopHoufy`R_)gtg zjN>#y26e~mauX>o?@<8sYDkt~KL!#N#CI?ZXp3bPkQ!C^Xs8pqkyTs5X$0i0}4lJlev?^g^2#AraVyIQl|sw>c??C8IW zgbr(*#?w)`q;*+q(~K*w)rpnY%(cgCk9CJ;H0Hlyf)O5qA6KN|S95`2C>$xm5e6>F zI+WHnEjQh@v`)=O*(7k-pthrk4H1+$Kx@qEsW?OYZd1|+|8op;2&R`B3 zC@U7n_+?pBwc4uMN*ucrN1oHgDO`ASL|E&fFeK1bpt-KfPFS^7P26Y^@NMFV83ml9 zj+wxhWfZ^`E&Cpw_1J@{LnG?}T^_|nLBK;L2nsmOwJc0a?WOK?3xY%NMIQE69hr2M z6J+oXVpQ5!%0)DUj=W0yDmKM@2^|J02)VE1g;a5ZYny((^#enm!$Cp0N08)Au^2%) z$g}xF8qB3k`(C|&*eVZwb|4$0O5ReU(zdwtA{iUyk~kslMvfR|5%^#A3lhAXrkz)IP+F zy)UT-#6hS*k#>rt*-ccRS5oYium$bpl;xF}UP*~tVo|LD>L&dbL#5FWy2Do0B6$=H z!-2;3HvHT}6)#6I3NSw0f(8`WtGuT<5=tEL(bQ*E*U9QUq=drIPa~a~1ywDfGLSl1 z)#b7}4=JI9k%1J4DKjW7DGWtq7>?|nEMJyW*0ux%Pa2j6dzt03tlzQs*OkjAN zSK^t#F~7t!frDlLYXUU!zorSi*Z1oMolls~$2}U!;G;(82^)%tniyFeim)m;W2~V0 z^#>;us)s*y;g3u#RF4A<9{%z|^%(PB{iH(mIHB*>pP5{!KIGRARTQYlbP7X5I!Dub zS@(Rhb8+98;fIDRJfDn{&~nD2oQ@k?aN3ze*?q#%X(j@vd>96ebTz#?!+I75Y}RKq zVUV|VkPYd(VWL{aTvrmurjk>)KM9MlsltGxg3m8>2GK^~7z?M!Gt^t0n(7$g?>9Q0*CmM(k+o`DdubPK9ckghIgb2I&ngBkS*V*?PnJcZS{q3WGb^UDaZFC8LQ_r8G8-0k?_d z(Kp3vFo-;hz5u4@FbT@n63mWjmnkxgZYERYwAzs-r`3+MIFpo>Kv+QSL;{5Pm5)s5 z>u7BZ2uMeuDp(2-dJj1WAvBKKq2jE5e4$D1%nS{JKc)HaWA zDhQZk)4b6F^w(#N7+T`1jNtN&5sXbC;5s!6@EE~L3{GI5D7Lq-$XBL^QWl5`hL(u+ zN!^9>CLis&N^3)>yLK8EGB}O?yReDglg%v1-cXOXgWD|x^x4_P-#OVOtQV|4J##z)_^>u^#x<&foY7r4f8tiLo z_-lIfUytWgSK*lvMK1GTArLDsJS4~k7`Y^g)k*se%;CWm4}Z?+#~DBTR6ml0N^Xl5 zLvZ*T2oa~)5=@tlUG5d(poe8Ypx0mv9a#n!HdRbJw%lt$ApB*ARk8`Bmj8z7hU_5~j zxG}5wB3Vt#v70k#BUlb?#0;@`cp9?s%#nC#Ty8h@S=Dv2T6S}LW;X=O>4p?#bTcyx zPqoC8(T$T;P0dL;Yj!NN8-nF@Ly9uGsmQ`Z{c?Eu3NM${7MT;LG!EHf>nYt^6u9Uz zPlg+Y#lnKKC;Pd%23$3Lp%-*Y`< zA?r%dwdAgkfyJS#J#U}}H~ttE3)E7Vfdz4Ql`a=l9LoW8VXU{B_)V|$3S-HUX$mEeYWz>-i zZA={994!|QJ%gg<;0n%6vg#?I6rO zJ;5#Hd2Yiy!Tp>jmfKh!=9Wo~fwS8<@#>h@K`E&yrVi8+P(y^6@F8ys;7B%;2lRkX z^neodfXT)Z(#`c7IY|v!cX~6oTxq~jBVzC@Hi#IKhp>OGiP?$>^oYs;h*djLv^v-u zHZg>@TK#1#k{%F40i3WEGZhr3AXzeN_vXiWeS=b;FPOnK+s zxq6g;qli%po2qJcL+V^=C;Z>a<(-~4%;(Z>;0`tSf#i+UDYp8kO>C7>f;db9T}duN zTwj-})|INETBwvegxJ#MW}(SjrCkMK9UXNGAbqr5i^;A|O_PbDGG}%L+}a2H{56J= z!IBnb57ToRgVy2c;>7d}w5|BVJs#~Q5sEXYwl|VxO)uvN`Os`Jbh-G1sWu254ZH3j8k8Z8DDo&NQmi$tz?ms*wFMfR zz|_7d#}$qOlgHXghjAp;(Rf57V6Wrmt6cj4-I8MXNX=+;Ozd0puS-Eg@O?aq#ve?C za881G{ie~u!j6XHIB78Xr>^W9cywJId-o1K7(5X*Iv!+n5|4KfE`Vb+5&L!Q9s)_1zh8-s;eW-7G(Ek)N;U2Jcp> zgENc8@DlN&CTd+bhFI$MyMkNYxd7(@HP%=QM;PkB@1Bo#f*s5Rbo@;yt8uxOe(AV%a1Cl*TD#Vw&C?QE3ZL!x zY}LB8q&63K$ut1(a3%tOWV6sqoYwO3*P-P)tw(Fq;@Tec)~odcC%?DhGoi&$w;gr< zON{7N{T%;M({$Xk!)z*ZC=)03{Jv)bN`SX6^wx@=QsAr?{W-Yn#oIwm3^e%t<7~%h zyd4|0=A@C|^YlD==b_Io$Z}gDnS#ti*u1C)l=mXn5nQ`LVG_EKFLBh&mkpsP;azA+ zJ+?`{;!>_DZ3l3lE&x>tsI){W1?plTO`SM|Kb~2LqE2XQK%4JT6tIT$z3M@JlJGa- zS`A|2Ae@9y;VA(1;mJW+KUiW}i+t|EGnEv>GhrMsLE}gh#gZgSc0g%tF_6)pycI`r zG$fbU+(w!>S)dh#tXNv00K~aqzK|!NZX2j*kp>ilIkn;`<0VG$`-WT!iqW7C5FA!g zVB&bFfVkSwtW8@3)_S4uIr!ulVORYSUK>i%warp=6io`{Y2?jlL)(sLm97MqIcS*x zrpz&RJe*A|8KEE=O-;KUmwbuSIjwXQXR;&(CJsaju+)O4X`&0U^y;K9&(mAkFIFL40pY724)S)cK_8yTe)wUU;>@p1VSWXd;l z^mzo}PezV{oASLq?6wn!%JRcu4Jwn+a{_X0mr~s*wZ22!fM>=6T4TmboGi0$zb&JH z@?L|BEjhLvKQJ<$C`(eYgP~nTmhDoL4D#tdsN3xxUU3wE(x8w`kARyqK1V0**TT{D z=%0zkw(KY+4vo*}Xw_@ri1K4FAa5KyG2An$q4fNhI5)m9M}08EBhq1@tvECxpQB4r zQCLSS(Mth;CQcT>!o-b!rUjp^ppy|ZE~$?DKF5)fG$G4D%f!MI*B4>D)Qb2#iEXV<9GILhz2&H)^md{p{Wi0>Of2bqPbK)IK689RE|UvWd!qHubRmawBmpEEgcno;cGLFr(zt7e4Zulim!PH!4 zJI0ITUmU2;r-eC)hxKOINlR{Q6i2J`X`wgUEn6o+2eZw%9Fxk+q;t?rpPQ|N1JklK zMG1ITK_4t%VkD;(^+}VVFQC8gLa)dP3$#LVpw(kqSuYXcL!2I^6}5J~-|E2hd>PRL zTp=gB^v^v~x><8UakKywb8=3QM}YxFXQo>XUdONb8^3P0o(bM(R7ZyY@qvHe_3SlI z?*GZ(e16x+)_UjcTfze*Ma~T=K1Z zQvdw>ho61;@4tQT@XtqPPkE$x(Qn@Qw~J?=-QMuGSFQNkKfL(8=kNaf-+#CAvQO4f95my zuix7hY;Jk$=KALr-G1TdH@05-`F9<-=lX}fI5?}XZug&GeBha%Kl8*FU;M~>_NDIo zcJoL7^zFx=e&F4GtNu^tq_SuKbSCol&(5D8-+IZBzaQCu=ZUZVbj72gt1h4Y75lcA zzWZRZ{n5I*kB$4LcGqt|^VU~>T{-^2w#d(q9>4E~-lF4256p>A{pl@JKKC7^mc~Q; zwmdqGy3_h@9=$9Y=P{Tj` z?N|RmNLCq2cHF*5ByM&)$4CarVI3 zr_Mfi_TtbUQuWH>S8jNv^ObvE8GhySul(aH zzj>wj{3YjCoWJ#a>ih%eKYIQv=U+Vk=kw(k=3ZELq4mPxg-0)Z>cR^bUcO*z)3pX| zGd%5m+LPKBwg0RARx8yn)0_0$^xgV{`iTB@{U`c4eX=p%*kEik-fTQ>eAYN&{Mrba zj(L^2)$B9xH$QA1Gk;+I!7K~R4&W~nU24sw4`PZ#ul+Le9s4p(8@^Z98k@?rp@$yP zw4eMTsD1OXt2F#*+B#^~!v)o28Kz!afNLSHMYtB@T7qjSt_EDoWQ+OuoR4<%(QZE4 z%}2ZWXg442=A+$wv?CU_SRmgE@wo`sVq8mbEydMO^VnXF|ifj4Y-!!lM*8LY-L4bJrf3Q>SDE`)xP+!~HlGhcFFI=}HeRvWGd6ZJ?T>X8!ELmc&BvmODE);|{8o)7r>fS(We z`GB7f`1ybztIaO}`~tu)0Q>^LF97@kz;o1%Wh^WN{6fGl1pGq4F9iHTz;ncoWsEEW z{35_F0{kMtF9Q4`z;m>ZW$Y{l{9?c_2K-{cF9!T#z>jrIEdl%zz%K#(62LD3{1U*A zb*wD~{8GR#1^iOLF9rNkz>jqdHUPc>@C|@(0DJ@B8vsAnvAGQJ%K*O&@XG+d4DibU zPphJ3P`lI+rA$eYTT;wk2^o`bwE)WD7z2C^@U%!;6)l6>rG_YFN{ZZ)V)jbN7Wr<) zXB#di#M?j(Et*zI%c6Bq!_*QbO=*#1Qq85;7F>LDp(KuL8}2w7XwkGvS{AK?8m5*g zX-bP6lWO)%Xudgd+lEh$B#s7JG_8`BMeCr3sU=F9(jv#CnmrSm?`?RiQOJ?R(Ljr) zRnoF(9n>(jL`hRxRH-i^}3dQpXtl((DD$jVO+;>ox-I}!=fIpMqIb!8p1V<>lm)A7yb&1Ric?j zP&0#iAY>rLA6cGHGgBq}otE@V952v{6gk?pSkm00T8h)l^OH9&40248H!jT4KV&c9 zq`Q%KV&v-4v22A#Jg@QUSWaJ^J$iH?=R%b7%`s^wIo=T(JakRIG{~pgx?U&=)Wp$i z3RB1>XD%)cz;n_sa6{xKJa?hDti?6r5$AIHVxiRX42*GH@+A(f$mfIGhLodP81@#S z=&jtBIKCpE!r7?Ygt6TLNM*C6j7v+5!W@BpptuKb7n3+}tiVx|nR#f`sR6Y@mxlz5 zo&cH+T;pM8ajOGfyBFsMdhmZj>u;O&L0y|T*wx-Lucg1e zE7jhUoG1UEaeYE8nT&V0bPddt|KIpL{D0#{WlmYf|2uA0{MsP0R| zcSSBO2+e9j-`t+sv68(MjgE%ximM8u>F?=k@9DG@XFdn*J?*Itu{#DzCU`*2&8dOD zcze&b-qOPK@PFuTPu{@)YCE3TmWap474DGTZRss5Ol)_oGkz`ppK-g~>sLv%xtU<& zFZDG86~y<{4dQ_B-MgzNk`N$!+sULoGYo*0nL#H+6>B8UJVT-ky0)8#b-H zPS$sKuY*D=v!R>1dRseXHLa&=v`X4UwNJ3@H-Z0veOFw{EYZ3{ z(m2cSM$))F(YsrTV)oQ5QMkw?%;l9?RrrtIdt2c}WZfL!=v|&=?G=Shhvtz;t!ta> zTSu1fQPt#Zo}#i_Druhjn!ByNtE=7@u{Xwg;=AXMKE!CO-Mww`uIu4$7mPl{*v=bb z3x#AimcW>vC-}L%a6vMafJ>dXS$$*~@KMQznb8~#>RccsfRn(?>H%kpHS5OjX+HzX^2Cgn-O|89s1K0T0)Z7d^ zYLdEJaru~7ZEo&|y*B1K)kGYagc?jr-SM7ee*&Z`x@m=GPTv7+zfu=*XHXH%1QNhE#J0e z(KTz8b8yuK?Iz>vdQ$7u=$F`f`ny}=iFs}D*7ojL*UH}hp47qx>y^LBY_L7vv#Nc2 zdn$QdK5&1kH@0v=GjKF_^`|x{(Psj~m!(qe+Xgn~<81>h*iXc-S1h{ptXZ*vx zX;Upg?vh1o+qdtyp)grX7I|d7PK}35vPgIHj`$u@ePcdp{Yd$mTVl!hW+#sTf&zD} zXFw9aC5!lV8N_c@_6e5~pV!{A3$d+@3E)ktJ6Sx?-L@vt+r7H4w{^#=*g*1THCkjH z+e)`KfCzGn>Lt4Zu|2ip^(r7{*R;h3ZdEBsc6po~ZGP<_fjFPEXs=ZZ>1-MY$i?sjF@*3CFVm!g?H)lv< z6}d&()-5a7_Vy=|w=3gLldtMFw)Y?aCu4cZLRG(TP-|gx{^5%`y*7R^^BuX6a8VQj>Ekx52({igoqp z0?DjsO{_JAL9}a14iGTj(3?mlcjsd3L+SjLEqe-;FId?!ke;Hd5CTLiF#(8SMBI@Z zUN|#A#p*qGIyv1VZ{OA48s8XC?%2?dp&FDB*A}4Ku_y%)jkm&DO zV<#UEHjQb>$!sK?b+H#fAN+AHLK!X@l^b-yc+410du!L zF^2?rnbbXcT~4X5>sojkjO2dm@Lv5d&GIskyj35Q2f#3bUhmWWS&Yn{1U>EB^uKW2 zDx7cEm5a~vPh=D6$^E+Wo|z$(;roEDhEHaByNr+T$kSa0ukRcMY~g|j^a5E@ZC|Vn z5ham2s9zD^L)*A=RJA}j=}E`CF5aH=9)FVZpgw0T_`S)>yD#3H=)LCe(J#Lk_6!-l zSFb7DI@5VPq)#v0$a5kO>(dH1aGl8`uT~GI@~A$eFudB9w_r|U zgee_o7oi+@1i@51oKu+UO~tw*eh5`aQ#%p}9=%;{MJk*0b1NCB>ys~-2rkk5LuHLxm#@9D*ShsQAmT`(DR&8E; zQ>rqvtD@)Lb56SX$?b@eB0<##e2nXKzZ!kHYO@BNyg%?U~xSuod4%%20P zPI`Bj7pMZ7=DyzDlT`QqLUjMa1#>rwTbgeY8@8^VJWet%bKz#>>Qn5DXE_O|$c^uQ zoSN!uthqUXnV6i_R4Vbi$$T?#ree)-Q|{WIU#=3LKD9(!t#sp8?uf_wB(`Z0l_|yB sBGQhvOYJ05c;pbVJ}7qk)*CmJ&z*AL_BITS;\n// @ts-ignore: decorator\n@inline export const AL_MASK: usize = AL_SIZE - 1;\n\n// Extra debugging\n\n// @ts-ignore: decorator\n@inline export const DEBUG = true;\n// @ts-ignore: decorator\n@inline export const TRACE = false;\n// @ts-ignore: decorator\n@inline export const RTRACE = isDefined(ASC_RTRACE);\n// @ts-ignore: decorator\n@inline export const PROFILE = isDefined(ASC_PROFILE);\n\n// Memory manager\n\n// ╒════════════ Memory manager block layout (32-bit) ═════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │ MM info │ -4\n// ╞>ptr═══════════════════════════════════════════════════════════╡\n// │ ... │\n@unmanaged export class BLOCK {\n /** Memory manager info. */\n mmInfo: usize;\n}\n\n/** Overhead of a memory manager block. */\n// @ts-ignore: decorator\n@inline export const BLOCK_OVERHEAD: usize = offsetof();\n\n/** Maximum size of a memory manager block's payload. */\n// @ts-ignore: decorator\n@inline export const BLOCK_MAXSIZE: usize = (1 << 30) - BLOCK_OVERHEAD;\n\n// Garbage collector\n\n// ╒══════════ Garbage collector object layout (32-bit) ═══════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │ Memory manager block │ -20\n// ╞═══════════════════════════════════════════════════════════════╡\n// │ GC info │ -16\n// ├───────────────────────────────────────────────────────────────┤\n// │ GC info │ -12\n// ├───────────────────────────────────────────────────────────────┤\n// │ RT id │ -8\n// ├───────────────────────────────────────────────────────────────┤\n// │ RT size │ -4\n// ╞>ptr═══════════════════════════════════════════════════════════╡\n// │ ... │\n@unmanaged export class OBJECT extends BLOCK {\n /** Garbage collector info. */\n gcInfo: u32;\n /** Garbage collector info. */\n gcInfo2: u32;\n /** Runtime class id. */\n rtId: u32;\n /** Runtime object size. */\n rtSize: u32;\n}\n\n/** Overhead of a garbage collector object. Excludes memory manager block overhead. */\n// @ts-ignore: decorator\n@inline export const OBJECT_OVERHEAD: usize = (offsetof() - BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK;\n\n/** Maximum size of a garbage collector object's payload. */\n// @ts-ignore: decorator\n@inline export const OBJECT_MAXSIZE: usize = BLOCK_MAXSIZE - OBJECT_OVERHEAD;\n\n/** Total of memory manager and garbage collector overhead. */\n// @ts-ignore: decorator\n@inline export const TOTAL_OVERHEAD: usize = BLOCK_OVERHEAD + OBJECT_OVERHEAD;\n","import { AL_BITS, AL_SIZE, AL_MASK, DEBUG, BLOCK, BLOCK_OVERHEAD, BLOCK_MAXSIZE } from \"./common\";\nimport { oninit, onalloc, onresize, onmove, onfree } from \"./rtrace\";\nimport { E_ALLOCATION_TOO_LARGE } from \"../util/error\";\n\n// === The TLSF (Two-Level Segregate Fit) memory allocator ===\n// see: http://www.gii.upv.es/tlsf/\n\n// - `ffs(x)` is equivalent to `ctz(x)` with x != 0\n// - `fls(x)` is equivalent to `sizeof(x) * 8 - clz(x) - 1`\n\n// ╒══════════════ Block size interpretation (32-bit) ═════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┴─┴─┴─╫─┴─┴─┴─┤\n// │ | FL │ SB = SL + AL │ ◄─ usize\n// └───────────────────────────────────────────────┴───────╨───────┘\n// FL: first level, SL: second level, AL: alignment, SB: small block\n\n// @ts-ignore: decorator\n@inline const SL_BITS: u32 = 4;\n// @ts-ignore: decorator\n@inline const SL_SIZE: u32 = 1 << SL_BITS;\n\n// @ts-ignore: decorator\n@inline const SB_BITS: u32 = SL_BITS + AL_BITS;\n// @ts-ignore: decorator\n@inline const SB_SIZE: u32 = 1 << SB_BITS;\n\n// @ts-ignore: decorator\n@inline const FL_BITS: u32 = 31 - SB_BITS;\n\n// [00]: < 256B (SB) [12]: < 1M\n// [01]: < 512B [13]: < 2M\n// [02]: < 1K [14]: < 4M\n// [03]: < 2K [15]: < 8M\n// [04]: < 4K [16]: < 16M\n// [05]: < 8K [17]: < 32M\n// [06]: < 16K [18]: < 64M\n// [07]: < 32K [19]: < 128M\n// [08]: < 64K [20]: < 256M\n// [09]: < 128K [21]: < 512M\n// [10]: < 256K [22]: <= 1G - OVERHEAD\n// [11]: < 512K\n// VMs limit to 2GB total (currently), making one 1G block max (or three 512M etc.) due to block overhead\n\n// Tags stored in otherwise unused alignment bits\n\n// @ts-ignore: decorator\n@inline const FREE: usize = 1 << 0;\n// @ts-ignore: decorator\n@inline const LEFTFREE: usize = 1 << 1;\n// @ts-ignore: decorator\n@inline const TAGS_MASK: usize = FREE | LEFTFREE; // <= AL_MASK\n\n// ╒════════════════════ Block layout (32-bit) ════════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┼─┼─┤ ┐\n// │ size │L│F│ ◄─┐ info overhead\n// ╞>ptr═══════════════════════════════════════════════════════╧═╧═╡ │ ┘\n// │ if free: ◄ prev │ ◄─┤ usize\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ if free: next ► │ ◄─┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... │ │ >= 0\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ if free: back ▲ │ ◄─┘\n// └───────────────────────────────────────────────────────────────┘ >= MIN SIZE\n// F: FREE, L: LEFTFREE\n@unmanaged export class Block extends BLOCK {\n\n /** Previous free block, if any. Only valid if free, otherwise part of payload. */\n prev: Block | null;\n /** Next free block, if any. Only valid if free, otherwise part of payload. */\n next: Block | null;\n\n // If the block is free, there is a 'back'reference at its end pointing at its start.\n}\n\n// Block constants. A block must have a minimum size of three pointers so it can hold `prev`,\n// `next` and `back` if free.\n\n// @ts-ignore: decorator\n@inline const BLOCK_MINSIZE: usize = ((3 * sizeof() + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD; // prev + next + back\n// @ts-ignore: decorator\n// @inline const BLOCK_MAXSIZE: usize = 1 << (FL_BITS + SB_BITS - 1); // exclusive, lives in common.ts\n\n/** Gets the left block of a block. Only valid if the left block is free. */\n// @ts-ignore: decorator\n@inline function GETFREELEFT(block: Block): Block {\n return load(changetype(block) - sizeof());\n}\n\n/** Gets the right block of a block by advancing to the right by its size. */\n// @ts-ignore: decorator\n@inline function GETRIGHT(block: Block): Block {\n return changetype(changetype(block) + BLOCK_OVERHEAD + (block.mmInfo & ~TAGS_MASK));\n}\n\n// ╒═════════════════════ Root layout (32-bit) ════════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ┐\n// │ 0 | flMap S│ ◄────┐\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ slMap[0] S │ ◄─┐ │\n// ├───────────────────────────────────────────────────────────────┤ │ │\n// │ slMap[1] │ ◄─┤ │\n// ├───────────────────────────────────────────────────────────────┤ u32 │\n// │ slMap[22] │ ◄─┘ │\n// ╞═══════════════════════════════════════════════════════════════╡ usize\n// │ head[0] │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ ... │ ◄────┤\n// ├───────────────────────────────────────────────────────────────┤ │\n// │ head[367] │ ◄────┤\n// ╞═══════════════════════════════════════════════════════════════╡ │\n// │ tail │ ◄────┘\n// └───────────────────────────────────────────────────────────────┘ SIZE ┘\n// S: Small blocks map\n@unmanaged class Root {\n /** First level bitmap. */\n flMap: usize;\n}\n\n// Root constants. Where stuff is stored inside of the root structure.\n\n// @ts-ignore: decorator\n@inline const SL_START: usize = sizeof();\n// @ts-ignore: decorator\n@inline const SL_END: usize = SL_START + (FL_BITS << alignof());\n// @ts-ignore: decorator\n@inline const HL_START: usize = (SL_END + AL_MASK) & ~AL_MASK;\n// @ts-ignore: decorator\n@inline const HL_END: usize = HL_START + FL_BITS * SL_SIZE * sizeof();\n// @ts-ignore: decorator\n@inline const ROOT_SIZE: usize = HL_END + sizeof();\n\n// @ts-ignore: decorator\n@lazy export var ROOT: Root;\n\n/** Gets the second level map of the specified first level. */\n// @ts-ignore: decorator\n@inline function GETSL(root: Root, fl: usize): u32 {\n return load(\n changetype(root) + (fl << alignof()),\n SL_START\n );\n}\n\n/** Sets the second level map of the specified first level. */\n// @ts-ignore: decorator\n@inline function SETSL(root: Root, fl: usize, slMap: u32): void {\n store(\n changetype(root) + (fl << alignof()),\n slMap,\n SL_START\n );\n}\n\n/** Gets the head of the free list for the specified combination of first and second level. */\n// @ts-ignore: decorator\n@inline function GETHEAD(root: Root, fl: usize, sl: u32): Block | null {\n return load(\n changetype(root) + (((fl << SL_BITS) + sl) << alignof()),\n HL_START\n );\n}\n\n/** Sets the head of the free list for the specified combination of first and second level. */\n// @ts-ignore: decorator\n@inline function SETHEAD(root: Root, fl: usize, sl: u32, head: Block | null): void {\n store(\n changetype(root) + (((fl << SL_BITS) + sl) << alignof()),\n head,\n HL_START\n );\n}\n\n/** Gets the tail block.. */\n// @ts-ignore: decorator\n@inline function GETTAIL(root: Root): Block {\n return load(\n changetype(root),\n HL_END\n );\n}\n\n/** Sets the tail block. */\n// @ts-ignore: decorator\n@inline function SETTAIL(root: Root, tail: Block): void {\n store(\n changetype(root),\n tail,\n HL_END\n );\n}\n\n/** Inserts a previously used block back into the free list. */\nfunction insertBlock(root: Root, block: Block): void {\n if (DEBUG) assert(block); // cannot be null\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(blockInfo & FREE); // must be free\n\n var right = GETRIGHT(block);\n var rightInfo = right.mmInfo;\n\n // merge with right block if also free\n if (rightInfo & FREE) {\n removeBlock(root, right);\n block.mmInfo = blockInfo = blockInfo + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK); // keep block tags\n right = GETRIGHT(block);\n rightInfo = right.mmInfo;\n // 'back' is set below\n }\n\n // merge with left block if also free\n if (blockInfo & LEFTFREE) {\n let left = GETFREELEFT(block);\n let leftInfo = left.mmInfo;\n if (DEBUG) assert(leftInfo & FREE); // must be free according to right tags\n removeBlock(root, left);\n block = left;\n block.mmInfo = blockInfo = leftInfo + BLOCK_OVERHEAD + (blockInfo & ~TAGS_MASK); // keep left tags\n // 'back' is set below\n }\n\n right.mmInfo = rightInfo | LEFTFREE;\n // reference to right is no longer used now, hence rightInfo is not synced\n\n // we now know the size of the block\n var size = blockInfo & ~TAGS_MASK;\n if (DEBUG) assert(size >= BLOCK_MINSIZE); // must be a valid size\n if (DEBUG) assert(changetype(block) + BLOCK_OVERHEAD + size == changetype(right)); // must match\n\n // set 'back' to itself at the end of block\n store(changetype(right) - sizeof(), block);\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const inv: usize = sizeof() * 8 - 1;\n let boundedSize = min(size, BLOCK_MAXSIZE);\n fl = inv - clz(boundedSize);\n sl = ((boundedSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // perform insertion\n var head = GETHEAD(root, fl, sl);\n block.prev = null;\n block.next = head;\n if (head) head.prev = block;\n SETHEAD(root, fl, sl, block);\n\n // update first and second level maps\n root.flMap |= (1 << fl);\n SETSL(root, fl, GETSL(root, fl) | (1 << sl));\n}\n\n/** Removes a free block from internal lists. */\nfunction removeBlock(root: Root, block: Block): void {\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(blockInfo & FREE); // must be free\n var size = blockInfo & ~TAGS_MASK;\n if (DEBUG) assert(size >= BLOCK_MINSIZE); // must be valid\n\n // mapping_insert\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const inv: usize = sizeof() * 8 - 1;\n let boundedSize = min(size, BLOCK_MAXSIZE);\n fl = inv - clz(boundedSize);\n sl = ((boundedSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // link previous and next free block\n var prev = block.prev;\n var next = block.next;\n if (prev) prev.next = next;\n if (next) next.prev = prev;\n\n // update head if we are removing it\n if (block == GETHEAD(root, fl, sl)) {\n SETHEAD(root, fl, sl, next);\n\n // clear second level map if head is empty now\n if (!next) {\n let slMap = GETSL(root, fl);\n SETSL(root, fl, slMap &= ~(1 << sl));\n\n // clear first level map if second level is empty now\n if (!slMap) root.flMap &= ~(1 << fl);\n }\n }\n // note: does not alter left/back because it is likely that splitting\n // is performed afterwards, invalidating those changes. so, the caller\n // must perform those updates.\n}\n\n/** Searches for a free block of at least the specified size. */\nfunction searchBlock(root: Root, size: usize): Block | null {\n // size was already asserted by caller\n\n // mapping_search\n var fl: usize, sl: u32;\n if (size < SB_SIZE) {\n fl = 0;\n sl = (size >> AL_BITS);\n } else {\n const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl\n const inv: usize = sizeof() * 8 - 1;\n const invRound = inv - SL_BITS;\n let requestSize = size < halfMaxSize\n ? size + (1 << (invRound - clz(size))) - 1\n : size;\n fl = inv - clz(requestSize);\n sl = ((requestSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));\n fl -= SB_BITS - 1;\n }\n if (DEBUG) assert(fl < FL_BITS && sl < SL_SIZE); // fl/sl out of range\n\n // search second level\n var slMap = GETSL(root, fl) & (~0 << sl);\n var head: Block | null = null;\n if (!slMap) {\n // search next larger first level\n let flMap = root.flMap & (~0 << (fl + 1));\n if (!flMap) {\n head = null;\n } else {\n fl = ctz(flMap);\n slMap = GETSL(root, fl);\n if (DEBUG) assert(slMap); // can't be zero if fl points here\n head = GETHEAD(root, fl, ctz(slMap));\n }\n } else {\n head = GETHEAD(root, fl, ctz(slMap));\n }\n return head;\n}\n\n/** Prepares the specified block before (re-)use, possibly splitting it. */\nfunction prepareBlock(root: Root, block: Block, size: usize): void {\n // size was already asserted by caller\n\n var blockInfo = block.mmInfo;\n if (DEBUG) assert(!((size + BLOCK_OVERHEAD) & AL_MASK)); // size must be aligned so the new block is\n\n // split if the block can hold another MINSIZE block incl. overhead\n var remaining = (blockInfo & ~TAGS_MASK) - size;\n if (remaining >= BLOCK_OVERHEAD + BLOCK_MINSIZE) {\n block.mmInfo = size | (blockInfo & LEFTFREE); // also discards FREE\n\n let spare = changetype(changetype(block) + BLOCK_OVERHEAD + size);\n spare.mmInfo = (remaining - BLOCK_OVERHEAD) | FREE; // not LEFTFREE\n insertBlock(root, spare); // also sets 'back'\n\n // otherwise tag block as no longer FREE and right as no longer LEFTFREE\n } else {\n block.mmInfo = blockInfo & ~FREE;\n GETRIGHT(block).mmInfo &= ~LEFTFREE;\n }\n}\n\n/** Adds more memory to the pool. */\nfunction addMemory(root: Root, start: usize, end: usize): bool {\n if (DEBUG) assert(start <= end); // must be valid\n start = ((start + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD;\n end &= ~AL_MASK;\n\n var tail = GETTAIL(root);\n var tailInfo: usize = 0;\n if (tail) { // more memory\n if (DEBUG) assert(start >= changetype(tail) + BLOCK_OVERHEAD);\n\n // merge with current tail if adjacent\n const offsetToTail = AL_SIZE;\n if (start - offsetToTail == changetype(tail)) {\n start -= offsetToTail;\n tailInfo = tail.mmInfo;\n } else {\n // We don't do this, but a user might `memory.grow` manually\n // leading to non-adjacent pages managed by TLSF.\n }\n\n } else if (DEBUG) { // first memory\n assert(start >= changetype(root) + ROOT_SIZE); // starts after root\n }\n\n // check if size is large enough for a free block and the tail block\n var size = end - start;\n if (size < BLOCK_OVERHEAD + BLOCK_MINSIZE + BLOCK_OVERHEAD) {\n return false;\n }\n\n // left size is total minus its own and the zero-length tail's header\n var leftSize = size - 2 * BLOCK_OVERHEAD;\n var left = changetype(start);\n left.mmInfo = leftSize | FREE | (tailInfo & LEFTFREE);\n left.prev = null;\n left.next = null;\n\n // tail is a zero-length used block\n tail = changetype(start + BLOCK_OVERHEAD + leftSize);\n tail.mmInfo = 0 | LEFTFREE;\n SETTAIL(root, tail);\n\n insertBlock(root, left); // also merges with free left before tail / sets 'back'\n\n return true;\n}\n\n/** Grows memory to fit at least another block of the specified size. */\nfunction growMemory(root: Root, size: usize): void {\n if (ASC_LOW_MEMORY_LIMIT) {\n unreachable();\n return;\n }\n // Here, both rounding performed in searchBlock ...\n const halfMaxSize = BLOCK_MAXSIZE >> 1;\n if (size < halfMaxSize) { // don't round last fl\n const invRound = (sizeof() * 8 - 1) - SL_BITS;\n size += (1 << (invRound - clz(size))) - 1;\n }\n // and additional BLOCK_OVERHEAD must be taken into account. If we are going\n // to merge with the tail block, that's one time, otherwise it's two times.\n var pagesBefore = memory.size();\n size += BLOCK_OVERHEAD << usize((pagesBefore << 16) - BLOCK_OVERHEAD != changetype(GETTAIL(root)));\n var pagesNeeded = (((size + 0xffff) & ~0xffff) >>> 16);\n var pagesWanted = max(pagesBefore, pagesNeeded); // double memory\n if (memory.grow(pagesWanted) < 0) {\n if (memory.grow(pagesNeeded) < 0) unreachable();\n }\n var pagesAfter = memory.size();\n addMemory(root, pagesBefore << 16, pagesAfter << 16);\n}\n\n/** Computes the size (excl. header) of a block. */\nfunction computeSize(size: usize): usize {\n // Size must be large enough and aligned minus preceeding overhead\n return size <= BLOCK_MINSIZE\n ? BLOCK_MINSIZE\n : ((size + BLOCK_OVERHEAD + AL_MASK) & ~AL_MASK) - BLOCK_OVERHEAD;\n}\n\n/** Prepares and checks an allocation size. */\nfunction prepareSize(size: usize): usize {\n if (size > BLOCK_MAXSIZE) throw new Error(E_ALLOCATION_TOO_LARGE);\n return computeSize(size);\n}\n\n/** Initializes the root structure. */\nfunction initialize(): void {\n if (isDefined(ASC_RTRACE)) oninit(__heap_base);\n var rootOffset = (__heap_base + AL_MASK) & ~AL_MASK;\n var pagesBefore = memory.size();\n var pagesNeeded = ((((rootOffset + ROOT_SIZE) + 0xffff) & ~0xffff) >>> 16);\n if (pagesNeeded > pagesBefore && memory.grow(pagesNeeded - pagesBefore) < 0) unreachable();\n var root = changetype(rootOffset);\n root.flMap = 0;\n SETTAIL(root, changetype(0));\n for (let fl: usize = 0; fl < FL_BITS; ++fl) {\n SETSL(root, fl, 0);\n for (let sl: u32 = 0; sl < SL_SIZE; ++sl) {\n SETHEAD(root, fl, sl, null);\n }\n }\n var memStart = rootOffset + ROOT_SIZE;\n if (ASC_LOW_MEMORY_LIMIT) {\n const memEnd = ASC_LOW_MEMORY_LIMIT & ~AL_MASK;\n if (memStart <= memEnd) addMemory(root, memStart, memEnd);\n else unreachable(); // low memory limit already exceeded\n } else {\n addMemory(root, memStart, memory.size() << 16);\n }\n ROOT = root;\n}\n\n/** Allocates a block of the specified size. */\nexport function allocateBlock(root: Root, size: usize): Block {\n var payloadSize = prepareSize(size);\n var block = searchBlock(root, payloadSize);\n if (!block) {\n growMemory(root, payloadSize);\n block = changetype(searchBlock(root, payloadSize));\n if (DEBUG) assert(block); // must be found now\n }\n if (DEBUG) assert((block.mmInfo & ~TAGS_MASK) >= payloadSize); // must fit\n removeBlock(root, block);\n prepareBlock(root, block, payloadSize);\n if (isDefined(ASC_RTRACE)) onalloc(block);\n return block;\n}\n\n/** Reallocates a block to the specified size. */\nexport function reallocateBlock(root: Root, block: Block, size: usize): Block {\n var payloadSize = prepareSize(size);\n var blockInfo = block.mmInfo;\n var blockSize = blockInfo & ~TAGS_MASK;\n\n // possibly split and update runtime size if it still fits\n if (payloadSize <= blockSize) {\n prepareBlock(root, block, payloadSize);\n if (isDefined(ASC_RTRACE)) {\n if (payloadSize != blockSize) onresize(block, BLOCK_OVERHEAD + blockSize);\n }\n return block;\n }\n\n // merge with right free block if merger is large enough\n var right = GETRIGHT(block);\n var rightInfo = right.mmInfo;\n if (rightInfo & FREE) {\n let mergeSize = blockSize + BLOCK_OVERHEAD + (rightInfo & ~TAGS_MASK);\n if (mergeSize >= payloadSize) {\n removeBlock(root, right);\n block.mmInfo = (blockInfo & TAGS_MASK) | mergeSize;\n prepareBlock(root, block, payloadSize);\n if (isDefined(ASC_RTRACE)) onresize(block, BLOCK_OVERHEAD + blockSize);\n return block;\n }\n }\n\n // otherwise move the block\n return moveBlock(root, block, size);\n}\n\n/** Moves a block to a new one of the specified size. */\nfunction moveBlock(root: Root, block: Block, newSize: usize): Block {\n var newBlock = allocateBlock(root, newSize);\n memory.copy(changetype(newBlock) + BLOCK_OVERHEAD, changetype(block) + BLOCK_OVERHEAD, block.mmInfo & ~TAGS_MASK);\n if (changetype(block) >= __heap_base) {\n if (isDefined(ASC_RTRACE)) onmove(block, newBlock);\n freeBlock(root, block);\n }\n return newBlock;\n}\n\n/** Frees a block. */\nexport function freeBlock(root: Root, block: Block): void {\n if (isDefined(ASC_RTRACE)) onfree(block);\n block.mmInfo = block.mmInfo | FREE;\n insertBlock(root, block);\n}\n\n/** Checks that a used block is valid to be freed or reallocated. */\nfunction checkUsedBlock(ptr: usize): Block {\n var block = changetype(ptr - BLOCK_OVERHEAD);\n assert(\n ptr != 0 && !(ptr & AL_MASK) && // must exist and be aligned\n !(block.mmInfo & FREE) // must be used\n );\n return block;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __alloc(size: usize): usize {\n if (!ROOT) initialize();\n return changetype(allocateBlock(ROOT, size)) + BLOCK_OVERHEAD;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __realloc(ptr: usize, size: usize): usize {\n if (!ROOT) initialize();\n return (ptr < __heap_base\n ? changetype(moveBlock(ROOT, checkUsedBlock(ptr), size))\n : changetype(reallocateBlock(ROOT, checkUsedBlock(ptr), size))\n ) + BLOCK_OVERHEAD;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __free(ptr: usize): void {\n if (ptr < __heap_base) return;\n if (!ROOT) initialize();\n freeBlock(ROOT, checkUsedBlock(ptr));\n}\n","// This file is shared with the compiler and must remain portable\n\n// ╒═══════════════════ Typeinfo interpretation ═══════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ◄─ __rtti_base\n// │ count │\n// ╞═══════════════════════════════════════════════════════════════╡ ┐\n// │ Typeinfo#flags [id=0] │ id < count\n// ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┤\n// │ Typeinfo#base [id=0] │\n// ├───────────────────────────────────────────────────────────────┤\n// │ ... │\n\n/** Runtime type information data structure. */\n@unmanaged\nexport class Typeinfo {\n /** Flags describing the shape of this class type. */\n flags: TypeinfoFlags = TypeinfoFlags.NONE;\n /** Base class id or `0` if none. */\n base: u32 = 0;\n}\n\n/** Runtime type information flags. */\nexport const enum TypeinfoFlags {\n /** No specific flags. */\n NONE = 0,\n /** Type is an `ArrayBufferView`. */\n ARRAYBUFFERVIEW = 1 << 0,\n /** Type is an `Array`. */\n ARRAY = 1 << 1,\n /** Type is a `StaticArray`. */\n STATICARRAY = 1 << 2,\n /** Type is a `Set`. */\n SET = 1 << 3,\n /** Type is a `Map`. */\n MAP = 1 << 4,\n /** Type has no outgoing pointers. */\n POINTERFREE = 1 << 5,\n /** Value alignment of 1 byte. */\n VALUE_ALIGN_0 = 1 << 6,\n /** Value alignment of 2 bytes. */\n VALUE_ALIGN_1 = 1 << 7,\n /** Value alignment of 4 bytes. */\n VALUE_ALIGN_2 = 1 << 8,\n /** Value alignment of 8 bytes. */\n VALUE_ALIGN_3 = 1 << 9,\n /** Value alignment of 16 bytes. */\n VALUE_ALIGN_4 = 1 << 10,\n /** Value is a signed type. */\n VALUE_SIGNED = 1 << 11,\n /** Value is a float type. */\n VALUE_FLOAT = 1 << 12,\n /** Value type is nullable. */\n VALUE_NULLABLE = 1 << 13,\n /** Value type is managed. */\n VALUE_MANAGED = 1 << 14,\n /** Key alignment of 1 byte. */\n KEY_ALIGN_0 = 1 << 15,\n /** Key alignment of 2 bytes. */\n KEY_ALIGN_1 = 1 << 16,\n /** Key alignment of 4 bytes. */\n KEY_ALIGN_2 = 1 << 17,\n /** Key alignment of 8 bytes. */\n KEY_ALIGN_3 = 1 << 18,\n /** Key alignment of 16 bytes. */\n KEY_ALIGN_4 = 1 << 19,\n /** Key is a signed type. */\n KEY_SIGNED = 1 << 20,\n /** Key is a float type. */\n KEY_FLOAT = 1 << 21,\n /** Key type is nullable. */\n KEY_NULLABLE = 1 << 22,\n /** Key type is managed. */\n KEY_MANAGED = 1 << 23\n}\n","import { BLOCK, BLOCK_OVERHEAD, OBJECT_OVERHEAD, OBJECT_MAXSIZE, TOTAL_OVERHEAD, DEBUG, TRACE, RTRACE, PROFILE } from \"./common\";\nimport { onvisit, oncollect, oninterrupt, onyield } from \"./rtrace\";\nimport { TypeinfoFlags } from \"../shared/typeinfo\";\nimport { E_ALLOCATION_TOO_LARGE, E_ALREADY_PINNED, E_NOT_PINNED } from \"../util/error\";\n\n// === ITCMS: An incremental Tri-Color Mark & Sweep garbage collector ===\n// Adapted from Bach Le's μgc, see: https://github.com/bullno1/ugc\n\n// ╒═════════════╤══════════════ Colors ═══════════════════════════╕\n// │ Color │ Meaning │\n// ├─────────────┼─────────────────────────────────────────────────┤\n// │ WHITE* │ Unprocessed │\n// │ BLACK* │ Processed │\n// │ GRAY │ Processed with unprocessed children │\n// │ TRANSPARENT │ Manually pinned (always reachable) │\n// └─────────────┴─────────────────────────────────────────────────┘\n// * flipped between cycles\n\n// @ts-ignore: decorator\n@lazy var white = 0;\n// @ts-ignore: decorator\n@inline const gray = 2;\n// @ts-ignore: decorator\n@inline const transparent = 3;\n// @ts-ignore: decorator\n@inline const COLOR_MASK = 3;\n\n/** Size in memory of all objects currently managed by the GC. */\n// @ts-ignore: decorator\n@lazy var total: usize = 0;\n\n/** Currently transitioning from SWEEP to MARK state. */\n// @ts-ignore: decorator\n@inline const STATE_IDLE = 0;\n/** Currently marking reachable objects. */\n// @ts-ignore: decorator\n@inline const STATE_MARK = 1;\n/** Currently sweeping unreachable objects. */\n// @ts-ignore: decorator\n@inline const STATE_SWEEP = 2;\n/** Current collector state. */\n// @ts-ignore: decorator\n@lazy var state = STATE_IDLE;\n\n// @ts-ignore: decorator\n@lazy var fromSpace = initLazy(changetype(memory.data(offsetof())));\n// @ts-ignore: decorator\n@lazy var toSpace = initLazy(changetype(memory.data(offsetof())));\n// @ts-ignore: decorator\n@lazy var pinSpace = initLazy(changetype(memory.data(offsetof())));\n// @ts-ignore: decorator\n@lazy var iter: Object; // null\n\nfunction initLazy(space: Object): Object {\n space.nextWithColor = changetype(space);\n space.prev = space;\n return space;\n}\n\n/** Visit cookie indicating scanning of an object. */\n// @ts-ignore: decorator\n@inline const VISIT_SCAN = 0;\n\n// ╒═══════════════ Managed object layout (32-bit) ════════════════╕\n// 3 2 1\n// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits\n// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤\n// │ Memory manager block │\n// ╞═══════════════════════════════════════════════════════════╤═══╡\n// │ next │ C │ = nextWithColor\n// ├───────────────────────────────────────────────────────────┴───┤\n// │ prev │\n// ├───────────────────────────────────────────────────────────────┤\n// │ rtId │\n// ├───────────────────────────────────────────────────────────────┤\n// │ rtSize │\n// ╞>ptr═══════════════════════════════════════════════════════════╡\n// │ ... │\n// C: color\n\n/** Represents a managed object in memory, consisting of a header followed by the object's data. */\n@unmanaged class Object extends BLOCK {\n /** Pointer to the next object with color flags stored in the alignment bits. */\n nextWithColor: usize; // *u32\n /** Pointer to the previous object. */\n prev: Object; // *u32\n /** Runtime id. */\n rtId: u32;\n /** Runtime size. */\n rtSize: u32;\n\n /** Gets the pointer to the next object. */\n get next(): Object {\n return changetype(this.nextWithColor & ~COLOR_MASK);\n }\n\n /** Sets the pointer to the next object. */\n set next(obj: Object) {\n this.nextWithColor = changetype(obj) | (this.nextWithColor & COLOR_MASK);\n }\n\n /** Gets this object's color. */\n get color(): i32 {\n return i32(this.nextWithColor & COLOR_MASK);\n }\n\n /** Sets this object's color. */\n set color(color: i32) {\n this.nextWithColor = (this.nextWithColor & ~COLOR_MASK) | color;\n }\n\n /** Gets the size of this object in memory. */\n get size(): usize {\n return BLOCK_OVERHEAD + (this.mmInfo & ~3);\n }\n\n /** Tests if this object is pointerfree. */\n get isPointerfree(): bool {\n var rtId = this.rtId;\n return rtId <= idof() || (__typeinfo(rtId) & TypeinfoFlags.POINTERFREE) != 0;\n }\n\n /** Unlinks this object from its list. */\n unlink(): void {\n var next = this.next;\n if (next == null) {\n if (DEBUG) assert(this.prev == null && changetype(this) < __heap_base);\n return; // static data not yet linked\n }\n var prev = this.prev;\n if (DEBUG) assert(prev);\n next.prev = prev;\n prev.next = next;\n }\n\n /** Links this object to the specified list, with the given color. */\n linkTo(list: Object, withColor: i32): void {\n let prev = list.prev;\n this.nextWithColor = changetype(list) | withColor;\n this.prev = prev;\n prev.next = this;\n list.prev = this;\n }\n\n /** Marks this object as gray, that is reachable with unscanned children. */\n makeGray(): void {\n if (this == iter) iter = assert(this.prev);\n this.unlink();\n this.linkTo(toSpace, this.isPointerfree ? i32(!white) : gray);\n }\n}\n\n/** Visits all objects considered to be program roots. */\nfunction visitRoots(cookie: u32): void {\n __visit_globals(cookie);\n var pn = pinSpace;\n var iter = pn.next;\n while (iter != pn) {\n if (DEBUG) assert(iter.color == transparent);\n __visit_members(changetype(iter) + TOTAL_OVERHEAD, cookie);\n iter = iter.next;\n }\n}\n\n/** Visits all objects on the stack. */\nfunction visitStack(cookie: u32): void {\n var ptr = __stack_pointer;\n while (ptr < __heap_base) {\n __visit(load(ptr), cookie);\n ptr += sizeof();\n }\n}\n\n/** Performs a single step according to the current state. */\nfunction step(): usize {\n // Magic constants responsible for pause times. Obtained experimentally\n // using the compiler compiling itself. 2048 budget pro run by default.\n const MARKCOST = isDefined(ASC_GC_MARKCOST) ? ASC_GC_MARKCOST : 1;\n const SWEEPCOST = isDefined(ASC_GC_SWEEPCOST) ? ASC_GC_SWEEPCOST : 10;\n var obj: Object;\n switch (state) {\n case STATE_IDLE: {\n state = STATE_MARK;\n visitCount = 0;\n visitRoots(VISIT_SCAN);\n iter = toSpace;\n return visitCount * MARKCOST;\n }\n case STATE_MARK: {\n let black = i32(!white);\n obj = iter.next;\n while (obj != toSpace) {\n iter = obj;\n if (obj.color != black) { // skip already-blacks (pointerfree)\n obj.color = black;\n visitCount = 0;\n __visit_members(changetype(obj) + TOTAL_OVERHEAD, VISIT_SCAN);\n return visitCount * MARKCOST;\n }\n obj = obj.next;\n }\n visitCount = 0;\n visitRoots(VISIT_SCAN);\n obj = iter.next;\n if (obj == toSpace) {\n visitStack(VISIT_SCAN);\n obj = iter.next;\n while (obj != toSpace) {\n if (obj.color != black) {\n obj.color = black;\n __visit_members(changetype(obj) + TOTAL_OVERHEAD, VISIT_SCAN);\n }\n obj = obj.next;\n }\n let from = fromSpace;\n fromSpace = toSpace;\n toSpace = from;\n white = black;\n iter = from.next;\n state = STATE_SWEEP;\n }\n return visitCount * MARKCOST;\n }\n case STATE_SWEEP: {\n obj = iter;\n if (obj != toSpace) {\n iter = obj.next;\n if (DEBUG) assert(obj.color == i32(!white)); // old white\n free(obj);\n return SWEEPCOST;\n }\n toSpace.nextWithColor = changetype(toSpace);\n toSpace.prev = toSpace;\n state = STATE_IDLE;\n break;\n }\n }\n return 0;\n}\n\n/** Frees an object. */\nfunction free(obj: Object): void {\n if (changetype(obj) < __heap_base) {\n obj.nextWithColor = 0; // may become linked again\n obj.prev = changetype(0);\n } else {\n total -= obj.size;\n if (isDefined(__finalize)) {\n __finalize(changetype(obj) + TOTAL_OVERHEAD);\n }\n __free(changetype(obj) + BLOCK_OVERHEAD);\n }\n}\n\n// Garbage collector interface\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __new(size: usize, id: i32): usize {\n if (size >= OBJECT_MAXSIZE) throw new Error(E_ALLOCATION_TOO_LARGE);\n if (total >= threshold) interrupt();\n var obj = changetype(__alloc(OBJECT_OVERHEAD + size) - BLOCK_OVERHEAD);\n obj.rtId = id;\n obj.rtSize = size;\n obj.linkTo(fromSpace, white); // inits next/prev\n total += obj.size;\n var ptr = changetype(obj) + TOTAL_OVERHEAD;\n // may be visited before being fully initialized, so must fill\n memory.fill(ptr, 0, size);\n return ptr;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __renew(oldPtr: usize, size: usize): usize {\n var oldObj = changetype(oldPtr - TOTAL_OVERHEAD);\n // Update object size if its block is large enough\n if (size <= (oldObj.mmInfo & ~3) - OBJECT_OVERHEAD) {\n oldObj.rtSize = size;\n return oldPtr;\n }\n // If not the same object anymore, we have to move it move it due to the\n // shadow stack potentially still referencing the old object\n var newPtr = __new(size, oldObj.rtId);\n memory.copy(newPtr, oldPtr, min(size, oldObj.rtSize));\n return newPtr;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __link(parentPtr: usize, childPtr: usize, expectMultiple: bool): void {\n // Write barrier is unnecessary if non-incremental\n if (!childPtr) return;\n if (DEBUG) assert(parentPtr);\n var child = changetype(childPtr - TOTAL_OVERHEAD);\n if (child.color == white) {\n let parent = changetype(parentPtr - TOTAL_OVERHEAD);\n let parentColor = parent.color;\n if (parentColor == i32(!white)) {\n // Maintain the invariant that no black object may point to a white object.\n if (expectMultiple) {\n // Move the barrier \"backward\". Suitable for containers receiving multiple stores.\n // Avoids a barrier for subsequent objects stored into the same container.\n parent.makeGray();\n } else {\n // Move the barrier \"forward\". Suitable for objects receiving isolated stores.\n child.makeGray();\n }\n } else if (parentColor == transparent && state == STATE_MARK) {\n // Pinned objects are considered 'black' during the mark phase.\n child.makeGray();\n }\n }\n}\n\n// @ts-ignore: decorator\n@lazy var visitCount = 0;\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __visit(ptr: usize, cookie: i32): void {\n if (!ptr) return;\n let obj = changetype(ptr - TOTAL_OVERHEAD);\n if (RTRACE) if (!onvisit(obj)) return;\n if (obj.color == white) {\n obj.makeGray();\n ++visitCount;\n }\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __pin(ptr: usize): usize {\n if (ptr) {\n let obj = changetype(ptr - TOTAL_OVERHEAD);\n if (obj.color == transparent) {\n throw new Error(E_ALREADY_PINNED);\n }\n obj.unlink(); // from fromSpace\n obj.linkTo(pinSpace, transparent);\n }\n return ptr;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __unpin(ptr: usize): void {\n if (!ptr) return;\n var obj = changetype(ptr - TOTAL_OVERHEAD);\n if (obj.color != transparent) {\n throw new Error(E_NOT_PINNED);\n }\n if (state == STATE_MARK) {\n // We may be right at the point after marking roots for the second time and\n // entering the sweep phase, in which case the object would be missed if it\n // is not only pinned but also a root. Make sure it isn't missed.\n obj.makeGray();\n } else {\n obj.unlink();\n obj.linkTo(fromSpace, white);\n }\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nexport function __collect(): void {\n if (TRACE) trace(\"GC (full) at\", 1, total);\n if (state > STATE_IDLE) {\n // finish current cycle\n while (state != STATE_IDLE) step();\n }\n // perform a full cycle\n step();\n while (state != STATE_IDLE) step();\n threshold = (total * IDLEFACTOR / 100) + GRANULARITY;\n if (TRACE) trace(\"GC (full) done at cur/max\", 2, total, memory.size() << 16);\n if (RTRACE || PROFILE) oncollect(total);\n}\n\n// Garbage collector automation\n\n/** How often to interrupt. The default of 1024 means \"interrupt each 1024 bytes allocated\". */\n// @ts-ignore: decorator\n@inline const GRANULARITY: usize = isDefined(ASC_GC_GRANULARITY) ? ASC_GC_GRANULARITY : 1024;\n/** How long to interrupt. The default of 200% means \"run at double the speed of allocations\". */\n// @ts-ignore: decorator\n@inline const STEPFACTOR: usize = isDefined(ASC_GC_SWEEPFACTOR) ? ASC_GC_SWEEPFACTOR : 200;\n/** How long to idle. The default of 200% means \"wait for memory to double before kicking in again\". */\n// @ts-ignore: decorator\n@inline const IDLEFACTOR: usize = isDefined(ASC_GC_IDLEFACTOR) ? ASC_GC_IDLEFACTOR : 200;\n\n/** Threshold of memory used by objects to exceed before interrupting again. */\n// @ts-ignore: decorator\n@lazy var threshold: usize = ((memory.size() << 16) - __heap_base) >> 1;\n\n/** Performs a reasonable amount of incremental GC steps. */\nfunction interrupt(): void {\n if (PROFILE) oninterrupt(total);\n if (TRACE) trace(\"GC (auto) at\", 1, total);\n var budget: isize = GRANULARITY * STEPFACTOR / 100;\n do {\n budget -= step();\n if (state == STATE_IDLE) {\n if (TRACE) trace(\"└ GC (auto) done at cur/max\", 2, total, memory.size() << 16);\n threshold = (total * IDLEFACTOR / 100) + GRANULARITY;\n if (PROFILE) onyield(total);\n return;\n }\n } while (budget > 0);\n if (TRACE) trace(\"└ GC (auto) ongoing at\", 1, total);\n threshold = total + GRANULARITY * usize(total - threshold < GRANULARITY);\n if (PROFILE) onyield(total);\n}\n","import * as aegis from \"./aegis\";\n//import * as nn from \"./neural-net\";\n//import * as tst from \"./test\";\n\nconst key: i32 = 0;\nconst val: i32 = 1;\n\nexport class ModelSpec {\n modelName: string;\n endpoint: string;\n constructor(name: string, endpoint: string) {\n this.modelName = name;\n this.endpoint = endpoint;\n }\n}\n\nexport function getModelSpec(): ModelSpec {\n return new ModelSpec(\"wasm\", \"wasm\");\n}\n\nexport const ArrayOfStrings_ID = idof();\n\nfunction findVal(key: string, keys: string[], vals: string[]): string {\n for (let i: i32 = 0; i < keys.length; i++) {\n if (keys[i] == key) {\n return vals[i].toString();\n }\n }\n return \"\";\n}\n\nexport function modelFactory(keys: string[], values: string[]): string[][] {\n const arr = new Array(3);\n arr[0] = [\"key1\", findVal(\"key1\", keys, values)];\n arr[1] = [\"key2\", findVal(\"key2\", keys, values)];\n arr[2] = [\"fibonacci\", findVal(\"fibonacci\", keys, values)];\n return arr;\n}\n\nexport function getPorts(keys: string[], vals: string[]): string[][] {\n //aegis.log(\"getPorts called \" + keys[0] + \":\" + vals[0]);\n const ports = new Array(2);\n //service,type,consumesEvent,producesEvent,callback,undo\n ports[0] = [\"port1\", \"dFlow,outbound,dFlow_start,port1_done,port1Cb,true\"];\n ports[1] = [\"port2\", \"dFlow,outbound,port1_done,port2_done,port2Cb,true\"];\n return ports;\n}\n\nexport function port1Cb(keys: string[], vals: string[]): string[][] {\n const cfg = [\n [\"port\", \"port1\"],\n [\"callback\", \"port1Cb\"],\n [\"consumesEvent\", \"dFlow_start\"],\n [\"producesEvent\", \"port1_done\"],\n ];\n aegis.log(\n \"porf invokced\" + cfg[0][0] + \" \" + cfg[0][1] + \" \" + cfg[0][2] + cfg[0][3]\n );\n return cfg;\n}\n\nexport function port2Cb(keys: string[], vals: string[]): string[][] {\n const cfg = [\n [\"port\", \"port2\"],\n [\"callback\", \"port2Cb\"],\n [\"consumesEvent\", \"port1_done\"],\n [\"producesEvent\", \"port2_done\"],\n ];\n aegis.log(\n \"porf invokced\" + cfg[0][0] + \" \" + cfg[0][1] + \" \" + cfg[0][2] + cfg[0][3]\n );\n return cfg;\n}\n\nexport function getCommands(): string[][] {\n const commands = new Array(7);\n commands[0] = [\"serviceMeshListen\", \"tell wasm module to begin listening\"];\n commands[1] = [\"serviceMeshNotify\", \"tell wasm module to send broadcast\"];\n commands[2] = [\"serviceMeshCallback\", \"subscribed event fired\"];\n commands[3] = [\"runFibonacci\", \"remote calculate fibonacci\"];\n commands[4] = [\"fibonacci\", \"calculate fibonacci for a number\"];\n commands[5] = [\"deployModule\", \"request deployment of a module\"];\n commands[6] = [\"commandEx\", \"command example\"];\n return commands;\n}\n\nexport function commandEx(keys: string[], vals: string[]): string[][] {\n aegis.log(\"\\ncommandEx called \" + keys[0] + \":\" + vals[0]);\n const retval = new Array(1);\n retval[0] = [\"key1\", \"commandEx_update!\"];\n return retval;\n}\n\nexport function serviceMeshListen(keys: string[], vals: string[]): void {\n aegis.log(\"serviceMeshListen: \" + keys[0] + \": \" + vals[0]);\n const eventName = findVal(\"eventName\", keys, vals);\n aegis.addListener(eventName, \"serviceMeshCallback\");\n}\n\nexport function serviceMeshNotify(keys: string[], vals: string[]): void {\n const modelName = findVal(\"modelName\", keys, vals);\n const modelId = findVal(\"modelId\", keys, vals);\n const eventName = findVal(\"eventName\", keys, vals);\n const eventData = new Array(3);\n aegis.log(\"wasm notify called with args: \" + modelName + \": \" + modelId);\n eventData[0] = [keys[0], vals[0]];\n eventData[1] = [\"modelName\", modelName];\n eventData[2] = [\"modelId\", modelId];\n aegis.fireEvent(eventName || \"wasmWebListen\", eventData, 1);\n}\n\nexport function serviceMeshCallback(\n keys: string[],\n vals: string[]\n): string[][] {\n aegis.log(\"websocket callback fired: \" + keys[0] + \": \" + vals[0]);\n const eventName = findVal(\"eventName\", keys, vals);\n const eventData = new Array(2);\n eventData[0] = [keys[0], vals[0]];\n eventData[1] = [keys[1], vals[1]];\n aegis.fireEvent(eventName+'callback', eventData, 1);\n return [[\"key1\", \"serviceMeshCallback\"]];\n}\n\nexport function fibonacci(x: number): number {\n if (x === 0) {\n return 0;\n }\n\n if (x === 1) {\n return 1;\n }\n\n return fibonacci(x - 1) + fibonacci(x - 2);\n}\n\nexport function runFibonacci(keys: string[], vals: string[]): string[][] {\n let val: number = 0;\n let startTime: i64 = Date.now();\n\n for (let i = 0; i < keys.length; i++) {\n if (\"fibonacci\" == keys[i]) {\n val = parseInt(vals[i]);\n break;\n }\n }\n const sum = fibonacci(val);\n const ret = new Array(2);\n ret[0] = [\"result\", sum.toString()];\n ret[1] = [\"time\", (Date.now() - startTime).toString()];\n return ret;\n}\n\nexport function portEx(keys: string[], vals: string[]): void {\n aegis.log(\"portEx calling port wasmTestPort\" + keys[0] + \":\" + vals[0]);\n return;\n}\n\nexport function onUpdate(keys: string[], vals: string[]): string[][] {\n return [[\"updatedByWasm\", new Date(Date.now()).toISOString()]];\n}\n\nexport function onDelete(keys: string[], vals: string[]): i8 {\n // return negative to stop the action\n aegis.log(\"onDelete called\");\n return -1;\n}\n\nexport function validate(keys: string[], vals: string[]): void {\n aegis.log(\"onUpdate called\");\n return;\n}\n\n// export function inboundPort(keys: string[], vals: string[]): string[][] {\n// aegis.log(\"inbound port called: \" + keys[0] + \": \" + vals[0]);\n// const outval = new Array(1);\n// outval[0] = [\"key1\", \"val1\"];\n// aegis.invokePort(\"task1\", \"task data\", \"task1Event\", 1, 2);\n// return outval;\n// }\n\nexport function test(keys: string[], values: string[]): string[][] {\n const key1 = keys[0] == \"key1\" ? values[0] : \"default\";\n const key2 = keys[1] == \"key2\" ? values[1] : \"default\";\n const arr = new Array(3);\n arr[0] = [\"key1\", key1];\n arr[1] = [\"key2\", key2];\n arr[2] = [\"key3\", \"alwaysThisValue\"];\n aegis.log(\"test called\");\n return arr;\n}\n","import { Typeinfo, TypeinfoFlags } from \"./shared/typeinfo\";\nimport { E_INDEXOUTOFRANGE } from \"./util/error\";\nimport { OBJECT, TOTAL_OVERHEAD } from \"./rt/common\";\nimport { ArrayBufferView } from \"./arraybuffer\";\n\n// @ts-ignore: decorator\n@builtin\nexport declare const __rtti_base: usize;\n\n// @ts-ignore: decorator\n@builtin @unsafe\nexport declare function __visit_globals(cookie: u32): void;\n\n// @ts-ignore: decorator\n@builtin @unsafe\nexport declare function __visit_members(ref: usize, cookie: u32): void;\n\n// @ts-ignore: decorator\n@unsafe\nexport function __typeinfo(id: u32): TypeinfoFlags {\n var ptr = __rtti_base;\n if (id > load(ptr)) throw new Error(E_INDEXOUTOFRANGE);\n return changetype(ptr + sizeof() + id * offsetof()).flags;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __instanceof(ptr: usize, classId: u32): bool { // keyword\n var id = changetype(ptr - TOTAL_OVERHEAD).rtId;\n var rttiBase = __rtti_base;\n if (id <= load(rttiBase)) {\n do if (id == classId) return true;\n while (id = changetype(rttiBase + sizeof() + id * offsetof()).base);\n }\n return false;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __newBuffer(size: usize, id: u32, data: usize = 0): usize {\n var buffer = __new(size, id);\n if (data) memory.copy(buffer, data, size);\n return buffer;\n}\n\n// @ts-ignore: decorator\n@unsafe\nexport function __newArray(length: i32, alignLog2: usize, id: u32, data: usize = 0): usize {\n var bufferSize = length << alignLog2;\n // make sure `buffer` is tracked by the shadow stack\n var buffer = changetype(__newBuffer(bufferSize, idof(), data));\n // ...since allocating the array may trigger GC steps\n var array = __new(offsetof(), id);\n store(array, changetype(buffer), offsetof(\"buffer\"));\n __link(array, changetype(buffer), false);\n store(array, changetype(buffer), offsetof(\"dataStart\"));\n store(array, bufferSize, offsetof(\"byteLength\"));\n store(array, length, offsetof(\"length_\"));\n return array;\n}\n\n// @ts-ignore: decorator\n@global @unsafe\nfunction __tostack(ptr: usize): usize { // eslint-disable-line\n return ptr;\n}\n\n// These are provided by the respective implementation, included as another entry file by asc:\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __alloc(size: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __realloc(ptr: usize, size: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __free(ptr: usize): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __new(size: usize, id: u32): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __renew(ptr: usize, size: usize): usize;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __link(parentPtr: usize, childPtr: usize, expectMultiple: bool): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __collect(): void;\n\n// // @ts-ignore: decorator\n// @builtin @unsafe\n// export declare function __visit(ptr: usize, cookie: u32): void;\n","// Common error messages for use across the standard library. Keeping error messages compact\n// and reusing them where possible ensures minimal static data in binaries.\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INDEXOUTOFRANGE: string = \"Index out of range\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_VALUEOUTOFRANGE: string = \"Value out of range\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INVALIDLENGTH: string = \"Invalid length\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_ILLEGALGENTYPE: string = \"Illegal generic type\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_EMPTYARRAY: string = \"Array is empty\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_HOLEYARRAY: string = \"Element type must be nullable if array is holey\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_NOTIMPLEMENTED: string = \"Not implemented\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_KEYNOTFOUND: string = \"Key does not exist\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_ALLOCATION_TOO_LARGE: string = \"Allocation too large\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_ALREADY_PINNED: string = \"Object already pinned\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_NOT_PINNED: string = \"Object is not pinned\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_URI_MALFORMED: string = \"URI malformed\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_INVALIDDATE: string = \"Invalid Date\";\n\n// @ts-ignore: decorator\n@lazy @inline\nexport const E_UNPAIRED_SURROGATE: string = \"Unpaired surrogate\";\n","import { memcmp, memmove, memset } from \"./util/memory\";\nimport { E_NOTIMPLEMENTED } from \"./util/error\";\n\n/** Memory manager interface. */\nexport namespace memory {\n\n /** Gets the size of the memory in pages. */\n // @ts-ignore: decorator\n @builtin\n export declare function size(): i32;\n\n /** Grows the memory by the given size in pages and returns the previous size in pages. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function grow(pages: i32): i32;\n\n /** Fills a section in memory with the specified byte value. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export function fill(dst: usize, c: u8, n: usize): void {\n memset(dst, c, n); // fallback if \"bulk-memory\" isn't enabled\n }\n\n /** Copies a section of memory to another. Has move semantics. */\n // @ts-ignore: decorator\n @unsafe @builtin\n export function copy(dst: usize, src: usize, n: usize): void {\n memmove(dst, src, n); // fallback if \"bulk-memory\" isn't enabled\n }\n\n /** Initializes a memory segment. */\n // @ts-ignore: decorator\n @unsafe\n export function init(segmentIndex: u32, srcOffset: usize, dstOffset: usize, n: usize): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n /** Drops a memory segment. */\n // @ts-ignore: decorator\n @unsafe\n export function drop(segmentIndex: u32): void {\n throw new Error(E_NOTIMPLEMENTED);\n }\n\n /** Repeats a section of memory at a specific address. */\n // @ts-ignore: decorator\n @unsafe\n export function repeat(dst: usize, src: usize, srcLength: usize, count: usize): void {\n var index: usize = 0;\n var total = srcLength * count;\n while (index < total) {\n memory.copy(dst + index, src, srcLength);\n index += srcLength;\n }\n }\n\n /** Compares a section of memory to another. */\n // @ts-ignore: decorator\n @inline\n export function compare(vl: usize, vr: usize, n: usize): i32 {\n return memcmp(vl, vr, n);\n }\n\n /** Gets a pointer to a static chunk of memory of the given size. */\n // @ts-ignore: decorator\n @builtin\n export declare function data(size: T, align?: i32): usize;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare const __data_end: usize;\n\n// @ts-ignore: decorator\n@builtin\nexport declare var __stack_pointer: usize;\n\n// @ts-ignore: decorator\n@builtin\nexport declare const __heap_base: usize;\n\n/** Heap memory interface. */\nexport namespace heap {\n\n /** Allocates a chunk of memory of at least the specified size. */\n // @ts-ignore: decorator\n @unsafe export function alloc(size: usize): usize {\n return __alloc(size);\n }\n\n /** Reallocates a chunk of memory to have at least the specified size. */\n // @ts-ignore: decorator\n @unsafe export function realloc(ptr: usize, size: usize): usize {\n return __realloc(ptr, size);\n }\n\n /** Frees a chunk of memory. Does hardly anything (most recent block only) with the stub runtime. */\n // @ts-ignore: decorator\n @unsafe export function free(ptr: usize): void {\n __free(ptr);\n }\n\n /** Dangerously resets the entire heap. Specific to the stub runtime. */\n // @ts-ignore: decorator\n @unsafe export function reset(): void {\n if (isDefined(__reset)) {\n __reset();\n } else {\n throw new Error(E_NOTIMPLEMENTED);\n }\n }\n}\n","export function memcpy(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memcpy.c\n var w: u32, x: u32;\n\n // copy 1 byte each until src is aligned to 4 bytes\n while (n && (src & 3)) {\n store(dest++, load(src++));\n n--;\n }\n\n // if dst is aligned to 4 bytes as well, copy 4 bytes each\n if ((dest & 3) == 0) {\n while (n >= 16) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n store(dest + 8, load(src + 8));\n store(dest + 12, load(src + 12));\n src += 16; dest += 16; n -= 16;\n }\n if (n & 8) {\n store(dest , load(src ));\n store(dest + 4, load(src + 4));\n dest += 8; src += 8;\n }\n if (n & 4) {\n store(dest, load(src));\n dest += 4; src += 4;\n }\n if (n & 2) { // drop to 2 bytes each\n store(dest, load(src));\n dest += 2; src += 2;\n }\n if (n & 1) { // drop to 1 byte\n store(dest++, load(src++));\n }\n return;\n }\n\n // if dst is not aligned to 4 bytes, use alternating shifts to copy 4 bytes each\n // doing shifts if faster when copying enough bytes (here: 32 or more)\n if (n >= 32) {\n switch (dest & 3) {\n // known to be != 0\n case 1: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 3;\n while (n >= 17) {\n x = load(src + 1);\n store(dest, w >> 24 | x << 8);\n w = load(src + 5);\n store(dest + 4, x >> 24 | w << 8);\n x = load(src + 9);\n store(dest + 8, w >> 24 | x << 8);\n w = load(src + 13);\n store(dest + 12, x >> 24 | w << 8);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 2: {\n w = load(src);\n store(dest++, load(src++));\n store(dest++, load(src++));\n n -= 2;\n while (n >= 18) {\n x = load(src + 2);\n store(dest, w >> 16 | x << 16);\n w = load(src + 6);\n store(dest + 4, x >> 16 | w << 16);\n x = load(src + 10);\n store(dest + 8, w >> 16 | x << 16);\n w = load(src + 14);\n store(dest + 12, x >> 16 | w << 16);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n case 3: {\n w = load(src);\n store(dest++, load(src++));\n n -= 1;\n while (n >= 19) {\n x = load(src + 3);\n store(dest, w >> 8 | x << 24);\n w = load(src + 7);\n store(dest + 4, x >> 8 | w << 24);\n x = load(src + 11);\n store(dest + 8, w >> 8 | x << 24);\n w = load(src + 15);\n store(dest + 12, x >> 8 | w << 24);\n src += 16; dest += 16; n -= 16;\n }\n break;\n }\n }\n }\n\n // copy remaining bytes one by one\n if (n & 16) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 8) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 4) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 2) {\n store(dest++, load(src++));\n store(dest++, load(src++));\n }\n if (n & 1) {\n store(dest++, load(src++));\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c\n if (dest === src) return;\n if (ASC_SHRINK_LEVEL < 1) {\n if (src - dest - n <= -(n << 1)) {\n memcpy(dest, src, n);\n return;\n }\n }\n if (dest < src) {\n if (ASC_SHRINK_LEVEL < 2) {\n if ((src & 7) == (dest & 7)) {\n while (dest & 7) {\n if (!n) return;\n --n;\n store(dest++, load(src++));\n }\n while (n >= 8) {\n store(dest, load(src));\n n -= 8;\n dest += 8;\n src += 8;\n }\n }\n }\n while (n) {\n store(dest++, load(src++));\n --n;\n }\n } else {\n if (ASC_SHRINK_LEVEL < 2) {\n if ((src & 7) == (dest & 7)) {\n while ((dest + n) & 7) {\n if (!n) return;\n store(dest + --n, load(src + n));\n }\n while (n >= 8) {\n n -= 8;\n store(dest + n, load(src + n));\n }\n }\n }\n while (n) {\n store(dest + --n, load(src + n));\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset\n if (ASC_SHRINK_LEVEL > 1) {\n while (n) {\n store(dest++, c);\n --n;\n }\n } else {\n // fill head and tail with minimal branching\n if (!n) return;\n let dend = dest + n;\n store(dest, c);\n store(dend - 1, c);\n if (n <= 2) return;\n store(dest, c, 1);\n store(dest, c, 2);\n store(dend - 2, c);\n store(dend - 3, c);\n if (n <= 6) return;\n store(dest, c, 3);\n store(dend - 4, c);\n if (n <= 8) return;\n\n // advance pointer to align it at 4-byte boundary\n let k: usize = -dest & 3;\n dest += k;\n n -= k;\n n &= -4;\n\n let c32: u32 = -1 / 255 * c;\n\n // fill head/tail up to 28 bytes each in preparation\n dend = dest + n;\n store(dest, c32);\n store(dend - 4, c32);\n if (n <= 8) return;\n store(dest, c32, 4);\n store(dest, c32, 8);\n store(dend - 12, c32);\n store(dend - 8, c32);\n if (n <= 24) return;\n store(dest, c32, 12);\n store(dest, c32, 16);\n store(dest, c32, 20);\n store(dest, c32, 24);\n store(dend - 28, c32);\n store(dend - 24, c32);\n store(dend - 20, c32);\n store(dend - 16, c32);\n\n // align to a multiple of 8\n k = 24 + (dest & 4);\n dest += k;\n n -= k;\n\n // copy 32 bytes each\n let c64: u64 = c32 | (c32 << 32);\n while (n >= 32) {\n store(dest, c64);\n store(dest, c64, 8);\n store(dest, c64, 16);\n store(dest, c64, 24);\n n -= 32;\n dest += 32;\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function memcmp(vl: usize, vr: usize, n: usize): i32 {\n if (vl == vr) return 0;\n if (ASC_SHRINK_LEVEL < 2) {\n if ((vl & 7) == (vr & 7)) {\n while (vl & 7) {\n if (!n) return 0;\n let a = load(vl);\n let b = load(vr);\n if (a != b) return a - b;\n n--; vl++; vr++;\n }\n while (n >= 8) {\n if (load(vl) != load(vr)) break;\n vl += 8;\n vr += 8;\n n -= 8;\n }\n }\n }\n while (n--) {\n let a = load(vl);\n let b = load(vr);\n if (a != b) return a - b;\n vl++; vr++;\n }\n return 0;\n}\n","/// \n\nimport { idof } from \"../builtins\";\nimport { CharCode } from \"./string\";\n\n// @ts-ignore: decorator\n@inline\nexport const MAX_DOUBLE_LENGTH = 28;\n\n// @ts-ignore: decorator\n@lazy @inline const POWERS10 = memory.data([\n 1,\n 10,\n 100,\n 1000,\n 10000,\n 100000,\n 1000000,\n 10000000,\n 100000000,\n 1000000000\n]);\n\n/*\n Lookup table for pairwise char codes in range [0-99]\n\n \"00\", \"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\",\n \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\",\n \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\",\n \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\",\n \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\",\n \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\",\n \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\",\n \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\",\n \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\",\n \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\"\n*/\n// @ts-ignore: decorator\n@lazy @inline const DIGITS = memory.data([\n 0x00300030, 0x00310030, 0x00320030, 0x00330030, 0x00340030,\n 0x00350030, 0x00360030, 0x00370030, 0x00380030, 0x00390030,\n 0x00300031, 0x00310031, 0x00320031, 0x00330031, 0x00340031,\n 0x00350031, 0x00360031, 0x00370031, 0x00380031, 0x00390031,\n 0x00300032, 0x00310032, 0x00320032, 0x00330032, 0x00340032,\n 0x00350032, 0x00360032, 0x00370032, 0x00380032, 0x00390032,\n 0x00300033, 0x00310033, 0x00320033, 0x00330033, 0x00340033,\n 0x00350033, 0x00360033, 0x00370033, 0x00380033, 0x00390033,\n 0x00300034, 0x00310034, 0x00320034, 0x00330034, 0x00340034,\n 0x00350034, 0x00360034, 0x00370034, 0x00380034, 0x00390034,\n 0x00300035, 0x00310035, 0x00320035, 0x00330035, 0x00340035,\n 0x00350035, 0x00360035, 0x00370035, 0x00380035, 0x00390035,\n 0x00300036, 0x00310036, 0x00320036, 0x00330036, 0x00340036,\n 0x00350036, 0x00360036, 0x00370036, 0x00380036, 0x00390036,\n 0x00300037, 0x00310037, 0x00320037, 0x00330037, 0x00340037,\n 0x00350037, 0x00360037, 0x00370037, 0x00380037, 0x00390037,\n 0x00300038, 0x00310038, 0x00320038, 0x00330038, 0x00340038,\n 0x00350038, 0x00360038, 0x00370038, 0x00380038, 0x00390038,\n 0x00300039, 0x00310039, 0x00320039, 0x00330039, 0x00340039,\n 0x00350039, 0x00360039, 0x00370039, 0x00380039, 0x00390039\n]);\n\n// Lookup table for pairwise char codes in range [0x00-0xFF]\n// @ts-ignore: decorator\n@lazy @inline const HEX_DIGITS =\n\"000102030405060708090a0b0c0d0e0f\\\n101112131415161718191a1b1c1d1e1f\\\n202122232425262728292a2b2c2d2e2f\\\n303132333435363738393a3b3c3d3e3f\\\n404142434445464748494a4b4c4d4e4f\\\n505152535455565758595a5b5c5d5e5f\\\n606162636465666768696a6b6c6d6e6f\\\n707172737475767778797a7b7c7d7e7f\\\n808182838485868788898a8b8c8d8e8f\\\n909192939495969798999a9b9c9d9e9f\\\na0a1a2a3a4a5a6a7a8a9aaabacadaeaf\\\nb0b1b2b3b4b5b6b7b8b9babbbcbdbebf\\\nc0c1c2c3c4c5c6c7c8c9cacbcccdcecf\\\nd0d1d2d3d4d5d6d7d8d9dadbdcdddedf\\\ne0e1e2e3e4e5e6e7e8e9eaebecedeeef\\\nf0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\";\n\n// @ts-ignore: decorator\n@lazy @inline const ANY_DIGITS = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\n// @ts-ignore: decorator\n@lazy @inline const EXP_POWERS = memory.data([/* eslint-disable indent */\n -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,\n -954, -927, -901, -874, -847, -821, -794, -768, -741, -715,\n -688, -661, -635, -608, -582, -555, -529, -502, -475, -449,\n -422, -396, -369, -343, -316, -289, -263, -236, -210, -183,\n -157, -130, -103, -77, -50, -24, 3, 30, 56, 83,\n 109, 136, 162, 189, 216, 242, 269, 295, 322, 348,\n 375, 402, 428, 455, 481, 508, 534, 561, 588, 614,\n 641, 667, 694, 720, 747, 774, 800, 827, 853, 880,\n 907, 933, 960, 986, 1013, 1039, 1066\n/* eslint-enable indent */]);\n\n// 1e-348, 1e-340, ..., 1e340\n// @ts-ignore: decorator\n@lazy @inline const FRC_POWERS = memory.data([\n 0xFA8FD5A0081C0288, 0xBAAEE17FA23EBF76, 0x8B16FB203055AC76, 0xCF42894A5DCE35EA,\n 0x9A6BB0AA55653B2D, 0xE61ACF033D1A45DF, 0xAB70FE17C79AC6CA, 0xFF77B1FCBEBCDC4F,\n 0xBE5691EF416BD60C, 0x8DD01FAD907FFC3C, 0xD3515C2831559A83, 0x9D71AC8FADA6C9B5,\n 0xEA9C227723EE8BCB, 0xAECC49914078536D, 0x823C12795DB6CE57, 0xC21094364DFB5637,\n 0x9096EA6F3848984F, 0xD77485CB25823AC7, 0xA086CFCD97BF97F4, 0xEF340A98172AACE5,\n 0xB23867FB2A35B28E, 0x84C8D4DFD2C63F3B, 0xC5DD44271AD3CDBA, 0x936B9FCEBB25C996,\n 0xDBAC6C247D62A584, 0xA3AB66580D5FDAF6, 0xF3E2F893DEC3F126, 0xB5B5ADA8AAFF80B8,\n 0x87625F056C7C4A8B, 0xC9BCFF6034C13053, 0x964E858C91BA2655, 0xDFF9772470297EBD,\n 0xA6DFBD9FB8E5B88F, 0xF8A95FCF88747D94, 0xB94470938FA89BCF, 0x8A08F0F8BF0F156B,\n 0xCDB02555653131B6, 0x993FE2C6D07B7FAC, 0xE45C10C42A2B3B06, 0xAA242499697392D3,\n 0xFD87B5F28300CA0E, 0xBCE5086492111AEB, 0x8CBCCC096F5088CC, 0xD1B71758E219652C,\n 0x9C40000000000000, 0xE8D4A51000000000, 0xAD78EBC5AC620000, 0x813F3978F8940984,\n 0xC097CE7BC90715B3, 0x8F7E32CE7BEA5C70, 0xD5D238A4ABE98068, 0x9F4F2726179A2245,\n 0xED63A231D4C4FB27, 0xB0DE65388CC8ADA8, 0x83C7088E1AAB65DB, 0xC45D1DF942711D9A,\n 0x924D692CA61BE758, 0xDA01EE641A708DEA, 0xA26DA3999AEF774A, 0xF209787BB47D6B85,\n 0xB454E4A179DD1877, 0x865B86925B9BC5C2, 0xC83553C5C8965D3D, 0x952AB45CFA97A0B3,\n 0xDE469FBD99A05FE3, 0xA59BC234DB398C25, 0xF6C69A72A3989F5C, 0xB7DCBF5354E9BECE,\n 0x88FCF317F22241E2, 0xCC20CE9BD35C78A5, 0x98165AF37B2153DF, 0xE2A0B5DC971F303A,\n 0xA8D9D1535CE3B396, 0xFB9B7CD9A4A7443C, 0xBB764C4CA7A44410, 0x8BAB8EEFB6409C1A,\n 0xD01FEF10A657842C, 0x9B10A4E5E9913129, 0xE7109BFBA19C0C9D, 0xAC2820D9623BF429,\n 0x80444B5E7AA7CF85, 0xBF21E44003ACDD2D, 0x8E679C2F5E44FF8F, 0xD433179D9C8CB841,\n 0x9E19DB92B4E31BA9, 0xEB96BF6EBADF77D9, 0xAF87023B9BF0EE6B\n]);\n\n// @ts-ignore: decorator\n@inline\nexport function isPowerOf2(value: T): bool {\n return popcnt(value) == 1;\n}\n\n// Count number of decimals for u32 values\n// In our case input value always non-zero so we can simplify some parts\nexport function decimalCount32(value: u32): u32 {\n if (value < 100000) {\n if (value < 100) {\n return 1 + u32(value >= 10);\n } else {\n return 3 + u32(value >= 10000) + u32(value >= 1000);\n }\n } else {\n if (value < 10000000) {\n return 6 + u32(value >= 1000000);\n } else {\n return 8 + u32(value >= 1000000000) + u32(value >= 100000000);\n }\n }\n}\n\n// Count number of decimals for u64 values\n// In our case input value always greater than 2^32-1 so we can skip some parts\nexport function decimalCount64High(value: u64): u32 {\n if (value < 1000000000000000) {\n if (value < 1000000000000) {\n return 10 + u32(value >= 100000000000) + u32(value >= 10000000000);\n } else {\n return 13 + u32(value >= 100000000000000) + u32(value >= 10000000000000);\n }\n } else {\n if (value < 100000000000000000) {\n return 16 + u32(value >= 10000000000000000);\n } else {\n return 18 + u32(value >= 10000000000000000000) + u32(value >= 1000000000000000000);\n }\n }\n}\n\nfunction ulog_base(num: u64, base: i32): u32 {\n if (isPowerOf2(base)) {\n return (63 - clz(num)) / (31 - clz(base)) + 1;\n }\n var b64 = u64(base), b = b64, e: u32 = 1;\n while (num >= b) {\n num /= b;\n b *= b;\n e <<= 1;\n }\n while (num >= 1) {\n num /= b64;\n e++;\n }\n return e - 1;\n}\n\nfunction utoa32_dec_lut(buffer: usize, num: u32, offset: usize): void {\n while (num >= 10000) {\n // in most VMs i32/u32 div and modulo by constant can be shared and simplificate\n let t = num / 10000;\n let r = num % 10000;\n num = t;\n\n let d1 = r / 100;\n let d2 = r % 100;\n\n let digits1 = load(DIGITS + (d1 << alignof()));\n let digits2 = load(DIGITS + (d2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n }\n\n if (num >= 100) {\n let t = num / 100;\n let d1 = num % 100;\n num = t;\n offset -= 2;\n let digits = load(DIGITS + (d1 << alignof()));\n store(buffer + (offset << 1), digits);\n }\n\n if (num >= 10) {\n offset -= 2;\n let digits = load(DIGITS + (num << alignof()));\n store(buffer + (offset << 1), digits);\n } else {\n offset -= 1;\n let digit = CharCode._0 + num;\n store(buffer + (offset << 1), digit);\n }\n}\n\nfunction utoa64_dec_lut(buffer: usize, num: u64, offset: usize): void {\n while (num >= 100000000) {\n let t = num / 100000000;\n let r = (num - t * 100000000);\n num = t;\n\n let b = r / 10000;\n let c = r % 10000;\n\n let b1 = b / 100;\n let b2 = b % 100;\n let c1 = c / 100;\n let c2 = c % 100;\n\n let digits1 = load(DIGITS + (c1 << alignof()));\n let digits2 = load(DIGITS + (c2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n\n digits1 = load(DIGITS + (b1 << alignof()));\n digits2 = load(DIGITS + (b2 << alignof()));\n\n offset -= 4;\n store(buffer + (offset << 1), digits1 | (digits2 << 32));\n }\n\n utoa32_dec_lut(buffer, num, offset);\n}\n\nfunction utoa_hex_lut(buffer: usize, num: u64, offset: usize): void {\n const lut = changetype(HEX_DIGITS);\n while (offset >= 2) {\n offset -= 2;\n store(\n buffer + (offset << 1),\n load(lut + ((num & 0xFF) << alignof()))\n );\n num >>= 8;\n }\n if (offset & 1) {\n store(buffer, load(lut + (num << 6)));\n }\n}\n\nfunction utoa_dec_simple(buffer: usize, num: T, offset: usize): void {\n do {\n let t = num / 10;\n let r = (num % 10);\n num = changetype(t);\n offset--;\n store(buffer + (offset << 1), CharCode._0 + r);\n } while (num);\n}\n\nfunction utoa_hex_simple(buffer: usize, num: T, offset: usize): void {\n do {\n let d = num & 0x0F | CharCode._0;\n d += select(0x27, 0, d > CharCode._9);\n offset--;\n store(buffer + (offset << 1), d);\n // @ts-ignore: type\n num >>= 4;\n } while (num);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function utoa32_dec_core(buffer: usize, num: u32, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_dec_simple(buffer, num, offset);\n } else {\n utoa32_dec_lut(buffer, num, offset);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction utoa32_hex_core(buffer: usize, num: u32, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_hex_simple(buffer, num, offset);\n } else {\n utoa_hex_lut(buffer, num, offset);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction utoa64_dec_core(buffer: usize, num: u64, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_dec_simple(buffer, num, offset);\n } else {\n utoa64_dec_lut(buffer, num, offset);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction utoa64_hex_core(buffer: usize, num: u64, offset: usize): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n utoa_hex_simple(buffer, num, offset);\n } else {\n utoa_hex_lut(buffer, num, offset);\n }\n}\n\nfunction utoa64_any_core(buffer: usize, num: u64, offset: usize, radix: i32): void {\n const lut = changetype(ANY_DIGITS);\n var base = u64(radix);\n if ((radix & (radix - 1)) == 0) { // for radix which pow of two\n let shift = u64(ctz(radix) & 7);\n let mask = base - 1;\n do {\n offset--;\n store(buffer + (offset << 1), load(lut + (usize(num & mask) << 1)));\n num >>= shift;\n } while (num);\n } else {\n do {\n offset--;\n let q = num / base;\n store(buffer + (offset << 1), load(lut + (usize(num - q * base) << 1)));\n num = q;\n } while (num);\n }\n}\n\nexport function utoa32(value: u32, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n var out: String;\n\n if (radix == 10) {\n let decimals = decimalCount32(value);\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), value, decimals);\n } else if (radix == 16) {\n let decimals = (31 - clz(value) >> 2) + 1;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_hex_core(changetype(out), value, decimals);\n } else {\n let decimals = ulog_base(value, radix);\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), value, decimals, radix);\n }\n return out;\n}\n\nexport function itoa32(value: i32, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n\n var sign = value >>> 31;\n if (sign) value = -value;\n var out: String;\n\n if (radix == 10) {\n let decimals = decimalCount32(value) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), value, decimals);\n } else if (radix == 16) {\n let decimals = (31 - clz(value) >> 2) + 1 + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_hex_core(changetype(out), value, decimals);\n } else {\n let val32 = u32(value);\n let decimals = ulog_base(val32, radix) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), val32, decimals, radix);\n }\n if (sign) store(changetype(out), CharCode.MINUS);\n return out;\n}\n\nexport function utoa64(value: u64, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n var out: String;\n\n if (radix == 10) {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32);\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), val32, decimals);\n } else {\n let decimals = decimalCount64High(value);\n out = changetype(__new(decimals << 1, idof()));\n utoa64_dec_core(changetype(out), value, decimals);\n }\n } else if (radix == 16) {\n let decimals = (63 - u32(clz(value)) >> 2) + 1;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_hex_core(changetype(out), value, decimals);\n } else {\n let decimals = ulog_base(value, radix);\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), value, decimals, radix);\n }\n return out;\n}\n\nexport function itoa64(value: i64, radix: i32): String {\n if (radix < 2 || radix > 36) {\n throw new RangeError(\"toString() radix argument must be between 2 and 36\");\n }\n if (!value) return \"0\";\n\n var sign = u32(value >>> 63);\n if (sign) value = -value;\n var out: String;\n\n if (radix == 10) {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n let decimals = decimalCount32(val32) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa32_dec_core(changetype(out), val32, decimals);\n } else {\n let decimals = decimalCount64High(value) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_dec_core(changetype(out), value, decimals);\n }\n } else if (radix == 16) {\n let decimals = (63 - u32(clz(value)) >> 2) + 1 + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_hex_core(changetype(out), value, decimals);\n } else {\n let decimals = ulog_base(value, radix) + sign;\n out = changetype(__new(decimals << 1, idof()));\n utoa64_any_core(changetype(out), value, decimals, radix);\n }\n if (sign) store(changetype(out), CharCode.MINUS);\n return out;\n}\n\n// @ts-ignore: decorator\n@lazy var _K: i32 = 0;\n\n// // @ts-ignore: decorator\n// @lazy\n// var _frc: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _exp: i32 = 0;\n\n// @ts-ignore: decorator\n@lazy var _frc_minus: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _frc_plus: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _frc_pow: u64 = 0;\n\n// @ts-ignore: decorator\n@lazy var _exp_pow: i32 = 0;\n\n// @ts-ignore: decorator\n@inline\nfunction umul64f(u: u64, v: u64): u64 {\n var u0 = u & 0xFFFFFFFF;\n var v0 = v & 0xFFFFFFFF;\n\n var u1 = u >> 32;\n var v1 = v >> 32;\n\n var l = u0 * v0;\n var t = u1 * v0 + (l >> 32);\n var w = u0 * v1 + (t & 0xFFFFFFFF);\n\n w += 0x7FFFFFFF; // rounding\n\n t >>= 32;\n w >>= 32;\n\n return u1 * v1 + t + w;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction umul64e(e1: i32, e2: i32): i32 {\n return e1 + e2 + 64; // where 64 is significand size\n}\n\n// @ts-ignore: decorator\n@inline\nfunction normalizedBoundaries(f: u64, e: i32): void {\n var frc = (f << 1) + 1;\n var exp = e - 1;\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var m = 1 + i32(f == 0x0010000000000000);\n\n _frc_plus = frc;\n _frc_minus = ((f << m) - 1) << e - m - exp;\n _exp = exp;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction grisuRound(buffer: usize, len: i32, delta: u64, rest: u64, ten_kappa: u64, wp_w: u64): void {\n var lastp = buffer + ((len - 1) << 1);\n var digit = load(lastp);\n while (\n rest < wp_w &&\n delta - rest >= ten_kappa && (\n rest + ten_kappa < wp_w ||\n wp_w - rest > rest + ten_kappa - wp_w\n )\n ) {\n --digit;\n rest += ten_kappa;\n }\n store(lastp, digit);\n}\n\n// @ts-ignore: decorator\n@inline\nfunction getCachedPower(minExp: i32): void {\n const c = reinterpret(0x3FD34413509F79FE); // 1 / lg(10) = 0.30102999566398114\n var dk = (-61 - minExp) * c + 347;\t // dk must be positive, so can do ceiling in positive\n var k = dk;\n k += i32(k != dk); // conversion with ceil\n\n var index = (k >> 3) + 1;\n _K = 348 - (index << 3);\t// decimal exponent no need lookup table\n _frc_pow = load(FRC_POWERS + (index << alignof()));\n _exp_pow = load(EXP_POWERS + (index << alignof()));\n}\n\n// @ts-ignore: decorator\n@inline\nfunction grisu2(value: f64, buffer: usize, sign: i32): i32 {\n\n // frexp routine\n var uv = reinterpret(value);\n var exp = i32((uv & 0x7FF0000000000000) >>> 52);\n var sid = uv & 0x000FFFFFFFFFFFFF;\n var frc = (u64(exp != 0) << 52) + sid;\n exp = select(exp, 1, exp) - (0x3FF + 52);\n\n normalizedBoundaries(frc, exp);\n getCachedPower(_exp);\n\n // normalize\n var off = clz(frc);\n frc <<= off;\n exp -= off;\n\n var frc_pow = _frc_pow;\n var exp_pow = _exp_pow;\n\n var w_frc = umul64f(frc, frc_pow);\n var w_exp = umul64e(exp, exp_pow);\n\n var wp_frc = umul64f(_frc_plus, frc_pow) - 1;\n var wp_exp = umul64e(_exp, exp_pow);\n\n var wm_frc = umul64f(_frc_minus, frc_pow) + 1;\n var delta = wp_frc - wm_frc;\n\n return genDigits(buffer, w_frc, w_exp, wp_frc, wp_exp, delta, sign);\n}\n\nfunction genDigits(buffer: usize, w_frc: u64, w_exp: i32, mp_frc: u64, mp_exp: i32, delta: u64, sign: i32): i32 {\n var one_exp = -mp_exp;\n var one_frc = (1) << one_exp;\n var mask = one_frc - 1;\n\n var wp_w_frc = mp_frc - w_frc;\n\n var p1 = u32(mp_frc >> one_exp);\n var p2 = mp_frc & mask;\n\n var kappa = decimalCount32(p1);\n var len = sign;\n\n while (kappa > 0) {\n let d: u32;\n switch (kappa) {\n case 10: { d = p1 / 1000000000; p1 %= 1000000000; break; }\n case 9: { d = p1 / 100000000; p1 %= 100000000; break; }\n case 8: { d = p1 / 10000000; p1 %= 10000000; break; }\n case 7: { d = p1 / 1000000; p1 %= 1000000; break; }\n case 6: { d = p1 / 100000; p1 %= 100000; break; }\n case 5: { d = p1 / 10000; p1 %= 10000; break; }\n case 4: { d = p1 / 1000; p1 %= 1000; break; }\n case 3: { d = p1 / 100; p1 %= 100; break; }\n case 2: { d = p1 / 10; p1 %= 10; break; }\n case 1: { d = p1; p1 = 0; break; }\n default: { d = 0; break; }\n }\n\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d);\n\n --kappa;\n let tmp = ((p1) << one_exp) + p2;\n if (tmp <= delta) {\n _K += kappa;\n grisuRound(buffer, len, delta, tmp, load(POWERS10 + (kappa << alignof())) << one_exp, wp_w_frc);\n return len;\n }\n }\n\n while (true) {\n p2 *= 10;\n delta *= 10;\n\n let d = p2 >> one_exp;\n if (d | len) store(buffer + (len++ << 1), CharCode._0 + d);\n\n p2 &= mask;\n --kappa;\n if (p2 < delta) {\n _K += kappa;\n wp_w_frc *= load(POWERS10 + (-kappa << alignof()));\n grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc);\n return len;\n }\n }\n}\n\n// @ts-ignore: decorator\n@inline\nfunction genExponent(buffer: usize, k: i32): i32 {\n var sign = k < 0;\n if (sign) k = -k;\n var decimals = decimalCount32(k) + 1;\n utoa32_dec_core(buffer, k, decimals);\n store(buffer, select(CharCode.MINUS, CharCode.PLUS, sign));\n return decimals;\n}\n\nfunction prettify(buffer: usize, length: i32, k: i32): i32 {\n if (!k) {\n store(buffer + (length << 1), CharCode.DOT | (CharCode._0 << 16));\n return length + 2;\n }\n\n var kk = length + k;\n if (length <= kk && kk <= 21) {\n // 1234e7 -> 12340000000\n for (let i = length; i < kk; ++i) {\n store(buffer + (i << 1), CharCode._0);\n }\n store(buffer + (kk << 1), CharCode.DOT | (CharCode._0 << 16));\n return kk + 2;\n } else if (kk > 0 && kk <= 21) {\n // 1234e-2 -> 12.34\n let ptr = buffer + (kk << 1);\n memory.copy(\n ptr + 2,\n ptr,\n -k << 1\n );\n store(buffer + (kk << 1), CharCode.DOT);\n return length + 1;\n } else if (-6 < kk && kk <= 0) {\n // 1234e-6 -> 0.001234\n let offset = 2 - kk;\n memory.copy(\n buffer + (offset << 1),\n buffer,\n length << 1\n );\n store(buffer, CharCode._0 | (CharCode.DOT << 16));\n for (let i = 2; i < offset; ++i) {\n store(buffer + (i << 1), CharCode._0);\n }\n return length + offset;\n } else if (length == 1) {\n // 1e30\n store(buffer, CharCode.e, 2);\n length = genExponent(buffer + 4, kk - 1);\n return length + 2;\n } else {\n let len = length << 1;\n memory.copy(\n buffer + 4,\n buffer + 2,\n len - 2\n );\n store(buffer, CharCode.DOT, 2);\n store(buffer + len, CharCode.e, 2);\n length += genExponent(buffer + len + 4, kk - 1);\n return length + 2;\n }\n}\n\nfunction dtoa_core(buffer: usize, value: f64): i32 {\n var sign = i32(value < 0);\n if (sign) {\n value = -value;\n store(buffer, CharCode.MINUS);\n }\n // assert(value > 0 && value <= 1.7976931348623157e308);\n var len = grisu2(value, buffer, sign);\n len = prettify(buffer + (sign << 1), len - sign, _K);\n return len + sign;\n}\n\n// @ts-ignore: decorator\n@lazy @inline const dtoa_buf = memory.data(MAX_DOUBLE_LENGTH << 1);\n\nexport function dtoa(value: f64): String {\n if (value == 0) return \"0.0\";\n if (!isFinite(value)) {\n if (isNaN(value)) return \"NaN\";\n return select(\"-Infinity\", \"Infinity\", value < 0);\n }\n var size = dtoa_core(dtoa_buf, value) << 1;\n var result = changetype(__new(size, idof()));\n memory.copy(changetype(result), dtoa_buf, size);\n return result;\n}\n\nexport function itoa_buffered(buffer: usize, value: T): u32 {\n var sign: u32 = 0;\n if (isSigned()) {\n sign = u32(value < 0);\n if (sign) {\n value = changetype(-value);\n store(buffer, CharCode.MINUS);\n }\n }\n if (ASC_SHRINK_LEVEL <= 1) {\n if (isSigned()) {\n if (sizeof() <= 4) {\n if (value < 10) {\n store(buffer + (sign << 1), value | CharCode._0);\n return 1 + sign;\n }\n } else {\n if (value < 10) {\n store(buffer + (sign << 1), value | CharCode._0);\n return 1 + sign;\n }\n }\n } else {\n if (value < 10) {\n store(buffer, value | CharCode._0);\n return 1;\n }\n }\n }\n var decimals = sign;\n if (sizeof() <= 4) {\n decimals += decimalCount32(value);\n utoa32_dec_core(buffer, value, decimals);\n } else {\n if (value <= u32.MAX_VALUE) {\n let val32 = value;\n decimals += decimalCount32(val32);\n utoa32_dec_core(buffer, val32, decimals);\n } else {\n decimals += decimalCount64High(value);\n utoa64_dec_core(buffer, value, decimals);\n }\n }\n return decimals;\n}\n\nexport function dtoa_buffered(buffer: usize, value: f64): u32 {\n if (value == 0) {\n store(buffer, CharCode._0);\n store(buffer, CharCode.DOT, 2);\n store(buffer, CharCode._0, 4);\n return 3;\n }\n if (!isFinite(value)) {\n if (isNaN(value)) {\n store(buffer, CharCode.N);\n store(buffer, CharCode.a, 2);\n store(buffer, CharCode.N, 4);\n return 3;\n } else {\n let sign = value < 0;\n if (sign) {\n store(buffer, CharCode.MINUS); // -\n buffer += 2;\n }\n store(buffer, 0x690066006E0049, 0); // ifnI\n store(buffer, 0x7900740069006E, 8); // ytin\n return 8 + u32(sign);\n }\n }\n return dtoa_core(buffer, value);\n}\n","//\n// Lookup data for exp2f\n//\n\n// @ts-ignore: decorator\n@inline const EXP2F_TABLE_BITS = 5;\n\n// @ts-ignore: decorator\n@lazy @inline const EXP2F_DATA_TAB = memory.data([\n // exp2f_data_tab[i] = uint(2^(i/N)) - (i << 52-BITS)\n // used for computing 2^(k/N) for an int |k| < 150 N as\n // double(tab[k%N] + (k << 52-BITS))\n 0x3FF0000000000000, 0x3FEFD9B0D3158574, 0x3FEFB5586CF9890F, 0x3FEF9301D0125B51,\n 0x3FEF72B83C7D517B, 0x3FEF54873168B9AA, 0x3FEF387A6E756238, 0x3FEF1E9DF51FDEE1,\n 0x3FEF06FE0A31B715, 0x3FEEF1A7373AA9CB, 0x3FEEDEA64C123422, 0x3FEECE086061892D,\n 0x3FEEBFDAD5362A27, 0x3FEEB42B569D4F82, 0x3FEEAB07DD485429, 0x3FEEA47EB03A5585,\n 0x3FEEA09E667F3BCD, 0x3FEE9F75E8EC5F74, 0x3FEEA11473EB0187, 0x3FEEA589994CCE13,\n 0x3FEEACE5422AA0DB, 0x3FEEB737B0CDC5E5, 0x3FEEC49182A3F090, 0x3FEED503B23E255D,\n 0x3FEEE89F995AD3AD, 0x3FEEFF76F2FB5E47, 0x3FEF199BDD85529C, 0x3FEF3720DCEF9069,\n 0x3FEF5818DCFBA487, 0x3FEF7C97337B9B5F, 0x3FEFA4AFA2A490DA, 0x3FEFD0765B6E4540\n]);\n\n// ULP error: 0.502 (nearest rounding.)\n// Relative error: 1.69 * 2^-34 in [-1/64, 1/64] (before rounding.)\n// Wrong count: 168353 (all nearest rounding wrong results with fma.)\n// @ts-ignore: decorator\n@inline\nexport function exp2f_lut(x: f32): f32 {\n const\n N = 1 << EXP2F_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000) / N, // 0x1.8p+52\n Ox127f = reinterpret(0x7F000000);\n\n const\n C0 = reinterpret(0x3FAC6AF84B912394), // 0x1.c6af84b912394p-5\n C1 = reinterpret(0x3FCEBFCE50FAC4F3), // 0x1.ebfce50fac4f3p-3\n C2 = reinterpret(0x3FE62E42FF0C52D6); // 0x1.62e42ff0c52d6p-1\n\n var xd = x;\n var ix = reinterpret(x);\n var ux = ix >> 20 & 0x7FF;\n if (ux >= 0x430) {\n // |x| >= 128 or x is nan.\n if (ix == 0xFF800000) return 0; // x == -Inf -> 0\n if (ux >= 0x7F8) return x + x; // x == Inf/NaN -> Inf/NaN\n if (x > 0) return x * Ox127f; // x > 0 -> HugeVal (Owerflow)\n if (x <= -150) return 0; // x <= -150 -> 0 (Underflow)\n }\n\n // x = k/N + r with r in [-1/(2N), 1/(2N)] and int k.\n var kd = xd + shift;\n var ki = reinterpret(kd);\n var r = xd - (kd - shift);\n var t: u64, y: f64, s: f64;\n\n // exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1)\n t = load(EXP2F_DATA_TAB + ((ki & N_MASK) << alignof()));\n t += ki << (52 - EXP2F_TABLE_BITS);\n s = reinterpret(t);\n y = C2 * r + 1;\n y += (C0 * r + C1) * (r * r);\n y *= s;\n\n return y;\n}\n\n// ULP error: 0.502 (nearest rounding.)\n// Relative error: 1.69 * 2^-34 in [-ln2/64, ln2/64] (before rounding.)\n// Wrong count: 170635 (all nearest rounding wrong results with fma.)\n// @ts-ignore: decorator\n@inline\nexport function expf_lut(x: f32): f32 {\n const\n N = 1 << EXP2F_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000), // 0x1.8p+52\n InvLn2N = reinterpret(0x3FF71547652B82FE) * N, // 0x1.71547652b82fep+0\n Ox1p127f = reinterpret(0x7F000000);\n\n const\n C0 = reinterpret(0x3FAC6AF84B912394) / N / N / N, // 0x1.c6af84b912394p-5\n C1 = reinterpret(0x3FCEBFCE50FAC4F3) / N / N, // 0x1.ebfce50fac4f3p-3\n C2 = reinterpret(0x3FE62E42FF0C52D6) / N; // 0x1.62e42ff0c52d6p-1\n\n var xd = x;\n var ix = reinterpret(x);\n var ux = ix >> 20 & 0x7FF;\n if (ux >= 0x42B) {\n // |x| >= 88 or x is nan.\n if (ix == 0xFF800000) return 0; // x == -Inf -> 0\n if (ux >= 0x7F8) return x + x; // x == Inf/NaN -> Inf/NaN\n if (x > reinterpret(0x42B17217)) return x * Ox1p127f; // x > log(0x1p128) ~= 88.72 -> HugeVal (Owerflow)\n if (x < reinterpret(0xC2CFF1B4)) return 0; // x < log(0x1p-150) ~= -103.97 -> 0 (Underflow)\n }\n\n // x*N/Ln2 = k + r with r in [-1/2, 1/2] and int k.\n var z = InvLn2N * xd;\n\n // Round and convert z to int, the result is in [-150*N, 128*N] and\n // ideally ties-to-even rule is used, otherwise the magnitude of r\n // can be bigger which gives larger approximation error.\n var kd = (z + shift);\n var ki = reinterpret(kd);\n var r = z - (kd - shift);\n var s: f64, y: f64, t: u64;\n\n // exp(x) = 2^(k/N) * 2^(r/N) ~= s * (C0*r^3 + C1*r^2 + C2*r + 1)\n t = load(EXP2F_DATA_TAB + ((ki & N_MASK) << alignof()));\n t += ki << (52 - EXP2F_TABLE_BITS);\n s = reinterpret(t);\n z = C0 * r + C1;\n y = C2 * r + 1;\n y += z * (r * r);\n y *= s;\n\n return y;\n}\n\n//\n// Lookup data for log2f\n//\n\n// @ts-ignore: decorator\n@inline const LOG2F_TABLE_BITS = 4;\n\n// @ts-ignore: decorator\n@lazy @inline const LOG2F_DATA_TAB = memory.data([\n reinterpret(0x3FF661EC79F8F3BE), reinterpret(0xBFDEFEC65B963019), // 0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2,\n reinterpret(0x3FF571ED4AAF883D), reinterpret(0xBFDB0B6832D4FCA4), // 0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2,\n reinterpret(0x3FF49539F0F010B0), reinterpret(0xBFD7418B0A1FB77B), // 0x1.49539f0f010bp+0 , -0x1.7418b0a1fb77bp-2,\n reinterpret(0x3FF3C995B0B80385), reinterpret(0xBFD39DE91A6DCF7B), // 0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2,\n reinterpret(0x3FF30D190C8864A5), reinterpret(0xBFD01D9BF3F2B631), // 0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2,\n reinterpret(0x3FF25E227B0B8EA0), reinterpret(0xBFC97C1D1B3B7AF0), // 0x1.25e227b0b8eap+0 , -0x1.97c1d1b3b7afp-3 ,\n reinterpret(0x3FF1BB4A4A1A343F), reinterpret(0xBFC2F9E393AF3C9F), // 0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3,\n reinterpret(0x3FF12358F08AE5BA), reinterpret(0xBFB960CBBF788D5C), // 0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4,\n reinterpret(0x3FF0953F419900A7), reinterpret(0xBFAA6F9DB6475FCE), // 0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5,\n reinterpret(0x3FF0000000000000), 0, // 0x1p+0, 0x0,\n reinterpret(0x3FEE608CFD9A47AC), reinterpret(0x3FB338CA9F24F53D), // 0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4,\n reinterpret(0x3FECA4B31F026AA0), reinterpret(0x3FC476A9543891BA), // 0x1.ca4b31f026aap-1 , 0x1.476a9543891bap-3,\n reinterpret(0x3FEB2036576AFCE6), reinterpret(0x3FCE840B4AC4E4D2), // 0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3,\n reinterpret(0x3FE9C2D163A1AA2D), reinterpret(0x3FD40645F0C6651C), // 0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2,\n reinterpret(0x3FE886E6037841ED), reinterpret(0x3FD88E9C2C1B9FF8), // 0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2,\n reinterpret(0x3FE767DCF5534862), reinterpret(0x3FDCE0A44EB17BCC) // 0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2\n]);\n\n// ULP error: 0.752 (nearest rounding.)\n// Relative error: 1.9 * 2^-26 (before rounding.)\n// @ts-ignore: decorator\n@inline\nexport function log2f_lut(x: f32): f32 {\n const\n N_MASK = (1 << LOG2F_TABLE_BITS) - 1,\n Ox1p23f = reinterpret(0x4B000000); // 0x1p23f\n\n const\n A0 = reinterpret(0xBFD712B6F70A7E4D), // -0x1.712b6f70a7e4dp-2\n A1 = reinterpret(0x3FDECABF496832E0), // 0x1.ecabf496832ep-2\n A2 = reinterpret(0xBFE715479FFAE3DE), // -0x1.715479ffae3dep-1\n A3 = reinterpret(0x3FF715475F35C8B8); // 0x1.715475f35c8b8p0\n\n var ux = reinterpret(x);\n // Fix sign of zero with downward rounding when x==1.\n // if (WANT_ROUNDING && predict_false(ix == 0x3f800000)) return 0;\n if (ux - 0x00800000 >= 0x7F800000 - 0x00800000) {\n // x < 0x1p-126 or inf or nan.\n if (ux * 2 == 0) return -Infinity;\n if (ux == 0x7F800000) return x; // log2(inf) == inf.\n if ((ux >> 31) || ux * 2 >= 0xFF000000) return (x - x) / (x - x);\n // x is subnormal, normalize it.\n ux = reinterpret(x * Ox1p23f);\n ux -= 23 << 23;\n }\n // x = 2^k z; where z is in range [OFF,2*OFF] and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ux - 0x3F330000;\n var i = (tmp >> (23 - LOG2F_TABLE_BITS)) & N_MASK;\n var top = tmp & 0xFF800000;\n var iz = ux - top;\n var k = tmp >> 23;\n\n var invc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 0 << alignof());\n var logc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 1 << alignof());\n var z = reinterpret(iz);\n\n // log2(x) = log1p(z/c-1)/ln2 + log2(c) + k\n var r = z * invc - 1;\n var y0 = logc + k;\n\n // Pipelined polynomial evaluation to approximate log1p(r)/ln2.\n var y = A1 * r + A2;\n var p = A3 * r + y0;\n var r2 = r * r;\n y += A0 * r2;\n y = y * r2 + p;\n\n return y;\n}\n\n//\n// Lookup data for logf. See: https://git.musl-libc.org/cgit/musl/tree/src/math/logf.c\n//\n\n// @ts-ignore: decorator\n@inline const LOGF_TABLE_BITS = 4;\n\n// @ts-ignore: decorator\n@lazy @inline const LOGF_DATA_TAB = memory.data([\n reinterpret(0x3FF661EC79F8F3BE), reinterpret(0xBFD57BF7808CAADE), // 0x1.661ec79f8f3bep+0, -0x1.57bf7808caadep-2,\n reinterpret(0x3FF571ED4AAF883D), reinterpret(0xBFD2BEF0A7C06DDB), // 0x1.571ed4aaf883dp+0, -0x1.2bef0a7c06ddbp-2,\n reinterpret(0x3FF49539F0F010B0), reinterpret(0xBFD01EAE7F513A67), // 0x1.49539f0f010bp+0 , -0x1.01eae7f513a67p-2,\n reinterpret(0x3FF3C995B0B80385), reinterpret(0xBFCB31D8A68224E9), // 0x1.3c995b0b80385p+0, -0x1.b31d8a68224e9p-3,\n reinterpret(0x3FF30D190C8864A5), reinterpret(0xBFC6574F0AC07758), // 0x1.30d190c8864a5p+0, -0x1.6574f0ac07758p-3,\n reinterpret(0x3FF25E227B0B8EA0), reinterpret(0xBFC1AA2BC79C8100), // 0x1.25e227b0b8eap+0 , -0x1.1aa2bc79c81p-3 ,\n reinterpret(0x3FF1BB4A4A1A343F), reinterpret(0xBFBA4E76CE8C0E5E), // 0x1.1bb4a4a1a343fp+0, -0x1.a4e76ce8c0e5ep-4,\n reinterpret(0x3FF12358F08AE5BA), reinterpret(0xBFB1973C5A611CCC), // 0x1.12358f08ae5bap+0, -0x1.1973c5a611cccp-4,\n reinterpret(0x3FF0953F419900A7), reinterpret(0xBFA252F438E10C1E), // 0x1.0953f419900a7p+0, -0x1.252f438e10c1ep-5,\n reinterpret(0x3FF0000000000000), 0, // 0x1p+0, 0,\n reinterpret(0x3FEE608CFD9A47AC), reinterpret(0x3FAAA5AA5DF25984), // 0x1.e608cfd9a47acp-1, 0x1.aa5aa5df25984p-5,\n reinterpret(0x3FECA4B31F026AA0), reinterpret(0x3FBC5E53AA362EB4), // 0x1.ca4b31f026aap-1 , 0x1.c5e53aa362eb4p-4,\n reinterpret(0x3FEB2036576AFCE6), reinterpret(0x3FC526E57720DB08), // 0x1.b2036576afce6p-1, 0x1.526e57720db08p-3,\n reinterpret(0x3FE9C2D163A1AA2D), reinterpret(0x3FCBC2860D224770), // 0x1.9c2d163a1aa2dp-1, 0x1.bc2860d22477p-3 ,\n reinterpret(0x3FE886E6037841ED), reinterpret(0x3FD1058BC8A07EE1), // 0x1.886e6037841edp-1, 0x1.1058bc8a07ee1p-2,\n reinterpret(0x3FE767DCF5534862), reinterpret(0x3FD4043057B6EE09) // 0x1.767dcf5534862p-1, 0x1.4043057b6ee09p-2\n]);\n\n// ULP error: 0.818 (nearest rounding.)\n// Relative error: 1.957 * 2^-26 (before rounding.)\n// @ts-ignore: decorator\n@inline\nexport function logf_lut(x: f32): f32 {\n const\n N_MASK = (1 << LOGF_TABLE_BITS) - 1,\n Ox1p23f = reinterpret(0x4B000000); // 0x1p23f\n\n const\n Ln2 = reinterpret(0x3FE62E42FEFA39EF), // 0x1.62e42fefa39efp-1;\n A0 = reinterpret(0xBFD00EA348B88334), // -0x1.00ea348b88334p-2\n A1 = reinterpret(0x3FD5575B0BE00B6A), // 0x1.5575b0be00b6ap-2\n A2 = reinterpret(0xBFDFFFFEF20A4123); // -0x1.ffffef20a4123p-2\n\n var ux = reinterpret(x);\n // Fix sign of zero with downward rounding when x==1.\n // if (WANT_ROUNDING && ux == 0x3f800000) return 0;\n if (ux - 0x00800000 >= 0x7F800000 - 0x00800000) {\n // x < 0x1p-126 or inf or nan.\n if ((ux << 1) == 0) return -Infinity;\n if (ux == 0x7F800000) return x; // log(inf) == inf.\n if ((ux >> 31) || (ux << 1) >= 0xFF000000) return (x - x) / (x - x);\n // x is subnormal, normalize it.\n ux = reinterpret(x * Ox1p23f);\n ux -= 23 << 23;\n }\n // x = 2^k z; where z is in range [OFF,2*OFF] and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ux - 0x3F330000;\n var i = (tmp >> (23 - LOGF_TABLE_BITS)) & N_MASK;\n var k = tmp >> 23;\n var iz = ux - (tmp & 0x1FF << 23);\n\n var invc = load(LOGF_DATA_TAB + (i << (1 + alignof())), 0 << alignof());\n var logc = load(LOGF_DATA_TAB + (i << (1 + alignof())), 1 << alignof());\n\n var z = reinterpret(iz);\n\n // log(x) = log1p(z/c-1) + log(c) + k*Ln2\n var r = z * invc - 1;\n var y0 = logc + k * Ln2;\n\n // Pipelined polynomial evaluation to approximate log1p(r).\n var r2 = r * r;\n var y = A1 * r + A2;\n y += A0 * r2;\n y = y * r2 + (y0 + r);\n\n return y;\n}\n\n//\n// Lookup data for powf. See: https://git.musl-libc.org/cgit/musl/tree/src/math/powf.c\n//\n\n// @ts-ignore: decorator\n@inline\nfunction zeroinfnanf(ux: u32): bool {\n return (ux << 1) - 1 >= (0x7f800000 << 1) - 1;\n}\n\n// Returns 0 if not int, 1 if odd int, 2 if even int. The argument is\n// the bit representation of a non-zero finite floating-point value.\n// @ts-ignore: decorator\n@inline\nfunction checkintf(iy: u32): i32 {\n var e = iy >> 23 & 0xFF;\n if (e < 0x7F ) return 0;\n if (e > 0x7F + 23) return 2;\n e = 1 << (0x7F + 23 - e);\n if (iy & (e - 1)) return 0;\n if (iy & e ) return 1;\n return 2;\n}\n\n// Subnormal input is normalized so ix has negative biased exponent.\n// Output is multiplied by N (POWF_SCALE) if TOINT_INTRINICS is set.\n// @ts-ignore: decorator\n@inline\nfunction log2f_inline(ux: u32): f64 {\n const N_MASK = (1 << LOG2F_TABLE_BITS) - 1;\n\n const\n A0 = reinterpret(0x3FD27616C9496E0B), // 0x1.27616c9496e0bp-2\n A1 = reinterpret(0xBFD71969A075C67A), // -0x1.71969a075c67ap-2\n A2 = reinterpret(0x3FDEC70A6CA7BADD), // 0x1.ec70a6ca7baddp-2\n A3 = reinterpret(0xBFE7154748BEF6C8), // -0x1.7154748bef6c8p-1\n A4 = reinterpret(0x3FF71547652AB82B); // 0x1.71547652ab82bp+0\n\n // x = 2^k z; where z is in range [OFF,2*OFF] and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ux - 0x3F330000;\n var i = ((tmp >> (23 - LOG2F_TABLE_BITS)) & N_MASK);\n var top = tmp & 0xFF800000;\n var uz = ux - top;\n var k = (top >> 23);\n\n var invc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 0 << alignof());\n var logc = load(LOG2F_DATA_TAB + (i << (1 + alignof())), 1 << alignof());\n var z = reinterpret(uz);\n\n // log2(x) = log1p(z/c-1)/ln2 + log2(c) + k\n var r = z * invc - 1;\n var y0 = logc + k;\n\n // Pipelined polynomial evaluation to approximate log1p(r)/ln2.\n var y = A0 * r + A1;\n var p = A2 * r + A3;\n var q = A4 * r + y0;\n\n r *= r;\n q += p * r;\n y = y * (r * r) + q;\n\n return y;\n}\n\n// The output of log2 and thus the input of exp2 is either scaled by N\n// (in case of fast toint intrinsics) or not. The unscaled xd must be\n// in [-1021,1023], sign_bias sets the sign of the result.\n// @ts-ignore: decorator\n@inline\nfunction exp2f_inline(xd: f64, signBias: u32): f32 {\n const\n N = 1 << EXP2F_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000) / N; // 0x1.8p+52\n\n const\n C0 = reinterpret(0x3FAC6AF84B912394), // 0x1.c6af84b912394p-5\n C1 = reinterpret(0x3FCEBFCE50FAC4F3), // 0x1.ebfce50fac4f3p-3\n C2 = reinterpret(0x3FE62E42FF0C52D6); // 0x1.62e42ff0c52d6p-1\n\n // x = k/N + r with r in [-1/(2N), 1/(2N)]\n var kd = (xd + shift);\n var ki = reinterpret(kd);\n var r = xd - (kd - shift);\n var t: u64, z: f64, y: f64, s: f64;\n\n // exp2(x) = 2^(k/N) * 2^r ~= s * (C0*r^3 + C1*r^2 + C2*r + 1)\n t = load(EXP2F_DATA_TAB + ((ki & N_MASK) << alignof()));\n t += (ki + signBias) << (52 - EXP2F_TABLE_BITS);\n s = reinterpret(t);\n z = C0 * r + C1;\n y = C2 * r + 1;\n y += z * (r * r);\n y *= s;\n return y;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction xflowf(sign: u32, y: f32): f32 {\n return select(-y, y, sign) * y;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction oflowf(sign: u32): f32 {\n return xflowf(sign, reinterpret(0x70000000)); // 0x1p97f\n}\n\n// @ts-ignore: decorator\n@inline\nfunction uflowf(sign: u32): f32 {\n return xflowf(sign, reinterpret(0x10000000)); // 0x1p-95f\n}\n\n// @ts-ignore: decorator\n@inline\nexport function powf_lut(x: f32, y: f32): f32 {\n const\n Ox1p23f = reinterpret(0x4B000000), // 0x1p23f\n UPPER_LIMIT = reinterpret(0x405FFFFFFFD1D571), // 0x1.fffffffd1d571p+6\n LOWER_LIMIT = -150.0,\n SIGN_BIAS = 1 << (EXP2F_TABLE_BITS + 11);\n\n var signBias: u32 = 0;\n var ix = reinterpret(x);\n var iy = reinterpret(y);\n var ny = 0;\n\n if (i32(ix - 0x00800000 >= 0x7f800000 - 0x00800000) | (ny = i32(zeroinfnanf(iy)))) {\n // Either (x < 0x1p-126 or inf or nan) or (y is 0 or inf or nan).\n if (ny) {\n if ((iy << 1) == 0) return 1.0;\n if (ix == 0x3F800000) return NaN; // original: 1.0\n if ((ix << 1) > (0x7F800000 << 1) || (iy << 1) > (0x7F800000 << 1)) return x + y;\n if ((ix << 1) == (0x3F800000 << 1)) return NaN; // original: 1.0\n if (((ix << 1) < (0x3F800000 << 1)) == !(iy >> 31)) return 0; // |x| < 1 && y==inf or |x| > 1 && y==-inf.\n return y * y;\n }\n if (zeroinfnanf(ix)) {\n let x2 = x * x;\n if ((ix >> 31) && checkintf(iy) == 1) x2 = -x2;\n return iy >> 31 ? 1 / x2 : x2;\n }\n // x and y are non-zero finite.\n if (ix >> 31) {\n // Finite x < 0.\n let yint = checkintf(iy);\n if (yint == 0) return (x - x) / (x - x);\n if (yint == 1) signBias = SIGN_BIAS;\n ix &= 0x7FFFFFFF;\n }\n if (ix < 0x00800000) {\n // Normalize subnormal x so exponent becomes negative.\n ix = reinterpret(x * Ox1p23f);\n ix &= 0x7FFFFFFF;\n ix -= 23 << 23;\n }\n }\n var logx = log2f_inline(ix);\n var ylogx = y * logx; // cannot overflow, y is single prec.\n if ((reinterpret(ylogx) >> 47 & 0xFFFF) >= 0x80BF) { // reinterpret(126.0) >> 47\n // |y * log(x)| >= 126\n if (ylogx > UPPER_LIMIT) return oflowf(signBias); // overflow\n if (ylogx <= LOWER_LIMIT) return uflowf(signBias); // underflow\n }\n return exp2f_inline(ylogx, signBias);\n}\n\n//\n// Lookup data for exp. See: https://git.musl-libc.org/cgit/musl/tree/src/math/exp.c\n//\n\n// @ts-ignore: decorator\n@inline const EXP_TABLE_BITS = 7;\n\n// @ts-ignore: decorator\n@lazy @inline const EXP_DATA_TAB = memory.data([\n 0x0000000000000000, 0x3FF0000000000000,\n 0x3C9B3B4F1A88BF6E, 0x3FEFF63DA9FB3335,\n 0xBC7160139CD8DC5D, 0x3FEFEC9A3E778061,\n 0xBC905E7A108766D1, 0x3FEFE315E86E7F85,\n 0x3C8CD2523567F613, 0x3FEFD9B0D3158574,\n 0xBC8BCE8023F98EFA, 0x3FEFD06B29DDF6DE,\n 0x3C60F74E61E6C861, 0x3FEFC74518759BC8,\n 0x3C90A3E45B33D399, 0x3FEFBE3ECAC6F383,\n 0x3C979AA65D837B6D, 0x3FEFB5586CF9890F,\n 0x3C8EB51A92FDEFFC, 0x3FEFAC922B7247F7,\n 0x3C3EBE3D702F9CD1, 0x3FEFA3EC32D3D1A2,\n 0xBC6A033489906E0B, 0x3FEF9B66AFFED31B,\n 0xBC9556522A2FBD0E, 0x3FEF9301D0125B51,\n 0xBC5080EF8C4EEA55, 0x3FEF8ABDC06C31CC,\n 0xBC91C923B9D5F416, 0x3FEF829AAEA92DE0,\n 0x3C80D3E3E95C55AF, 0x3FEF7A98C8A58E51,\n 0xBC801B15EAA59348, 0x3FEF72B83C7D517B,\n 0xBC8F1FF055DE323D, 0x3FEF6AF9388C8DEA,\n 0x3C8B898C3F1353BF, 0x3FEF635BEB6FCB75,\n 0xBC96D99C7611EB26, 0x3FEF5BE084045CD4,\n 0x3C9AECF73E3A2F60, 0x3FEF54873168B9AA,\n 0xBC8FE782CB86389D, 0x3FEF4D5022FCD91D,\n 0x3C8A6F4144A6C38D, 0x3FEF463B88628CD6,\n 0x3C807A05B0E4047D, 0x3FEF3F49917DDC96,\n 0x3C968EFDE3A8A894, 0x3FEF387A6E756238,\n 0x3C875E18F274487D, 0x3FEF31CE4FB2A63F,\n 0x3C80472B981FE7F2, 0x3FEF2B4565E27CDD,\n 0xBC96B87B3F71085E, 0x3FEF24DFE1F56381,\n 0x3C82F7E16D09AB31, 0x3FEF1E9DF51FDEE1,\n 0xBC3D219B1A6FBFFA, 0x3FEF187FD0DAD990,\n 0x3C8B3782720C0AB4, 0x3FEF1285A6E4030B,\n 0x3C6E149289CECB8F, 0x3FEF0CAFA93E2F56,\n 0x3C834D754DB0ABB6, 0x3FEF06FE0A31B715,\n 0x3C864201E2AC744C, 0x3FEF0170FC4CD831,\n 0x3C8FDD395DD3F84A, 0x3FEEFC08B26416FF,\n 0xBC86A3803B8E5B04, 0x3FEEF6C55F929FF1,\n 0xBC924AEDCC4B5068, 0x3FEEF1A7373AA9CB,\n 0xBC9907F81B512D8E, 0x3FEEECAE6D05D866,\n 0xBC71D1E83E9436D2, 0x3FEEE7DB34E59FF7,\n 0xBC991919B3CE1B15, 0x3FEEE32DC313A8E5,\n 0x3C859F48A72A4C6D, 0x3FEEDEA64C123422,\n 0xBC9312607A28698A, 0x3FEEDA4504AC801C,\n 0xBC58A78F4817895B, 0x3FEED60A21F72E2A,\n 0xBC7C2C9B67499A1B, 0x3FEED1F5D950A897,\n 0x3C4363ED60C2AC11, 0x3FEECE086061892D,\n 0x3C9666093B0664EF, 0x3FEECA41ED1D0057,\n 0x3C6ECCE1DAA10379, 0x3FEEC6A2B5C13CD0,\n 0x3C93FF8E3F0F1230, 0x3FEEC32AF0D7D3DE,\n 0x3C7690CEBB7AAFB0, 0x3FEEBFDAD5362A27,\n 0x3C931DBDEB54E077, 0x3FEEBCB299FDDD0D,\n 0xBC8F94340071A38E, 0x3FEEB9B2769D2CA7,\n 0xBC87DECCDC93A349, 0x3FEEB6DAA2CF6642,\n 0xBC78DEC6BD0F385F, 0x3FEEB42B569D4F82,\n 0xBC861246EC7B5CF6, 0x3FEEB1A4CA5D920F,\n 0x3C93350518FDD78E, 0x3FEEAF4736B527DA,\n 0x3C7B98B72F8A9B05, 0x3FEEAD12D497C7FD,\n 0x3C9063E1E21C5409, 0x3FEEAB07DD485429,\n 0x3C34C7855019C6EA, 0x3FEEA9268A5946B7,\n 0x3C9432E62B64C035, 0x3FEEA76F15AD2148,\n 0xBC8CE44A6199769F, 0x3FEEA5E1B976DC09,\n 0xBC8C33C53BEF4DA8, 0x3FEEA47EB03A5585,\n 0xBC845378892BE9AE, 0x3FEEA34634CCC320,\n 0xBC93CEDD78565858, 0x3FEEA23882552225,\n 0x3C5710AA807E1964, 0x3FEEA155D44CA973,\n 0xBC93B3EFBF5E2228, 0x3FEEA09E667F3BCD,\n 0xBC6A12AD8734B982, 0x3FEEA012750BDABF,\n 0xBC6367EFB86DA9EE, 0x3FEE9FB23C651A2F,\n 0xBC80DC3D54E08851, 0x3FEE9F7DF9519484,\n 0xBC781F647E5A3ECF, 0x3FEE9F75E8EC5F74,\n 0xBC86EE4AC08B7DB0, 0x3FEE9F9A48A58174,\n 0xBC8619321E55E68A, 0x3FEE9FEB564267C9,\n 0x3C909CCB5E09D4D3, 0x3FEEA0694FDE5D3F,\n 0xBC7B32DCB94DA51D, 0x3FEEA11473EB0187,\n 0x3C94ECFD5467C06B, 0x3FEEA1ED0130C132,\n 0x3C65EBE1ABD66C55, 0x3FEEA2F336CF4E62,\n 0xBC88A1C52FB3CF42, 0x3FEEA427543E1A12,\n 0xBC9369B6F13B3734, 0x3FEEA589994CCE13,\n 0xBC805E843A19FF1E, 0x3FEEA71A4623C7AD,\n 0xBC94D450D872576E, 0x3FEEA8D99B4492ED,\n 0x3C90AD675B0E8A00, 0x3FEEAAC7D98A6699,\n 0x3C8DB72FC1F0EAB4, 0x3FEEACE5422AA0DB,\n 0xBC65B6609CC5E7FF, 0x3FEEAF3216B5448C,\n 0x3C7BF68359F35F44, 0x3FEEB1AE99157736,\n 0xBC93091FA71E3D83, 0x3FEEB45B0B91FFC6,\n 0xBC5DA9B88B6C1E29, 0x3FEEB737B0CDC5E5,\n 0xBC6C23F97C90B959, 0x3FEEBA44CBC8520F,\n 0xBC92434322F4F9AA, 0x3FEEBD829FDE4E50,\n 0xBC85CA6CD7668E4B, 0x3FEEC0F170CA07BA,\n 0x3C71AFFC2B91CE27, 0x3FEEC49182A3F090,\n 0x3C6DD235E10A73BB, 0x3FEEC86319E32323,\n 0xBC87C50422622263, 0x3FEECC667B5DE565,\n 0x3C8B1C86E3E231D5, 0x3FEED09BEC4A2D33,\n 0xBC91BBD1D3BCBB15, 0x3FEED503B23E255D,\n 0x3C90CC319CEE31D2, 0x3FEED99E1330B358,\n 0x3C8469846E735AB3, 0x3FEEDE6B5579FDBF,\n 0xBC82DFCD978E9DB4, 0x3FEEE36BBFD3F37A,\n 0x3C8C1A7792CB3387, 0x3FEEE89F995AD3AD,\n 0xBC907B8F4AD1D9FA, 0x3FEEEE07298DB666,\n 0xBC55C3D956DCAEBA, 0x3FEEF3A2B84F15FB,\n 0xBC90A40E3DA6F640, 0x3FEEF9728DE5593A,\n 0xBC68D6F438AD9334, 0x3FEEFF76F2FB5E47,\n 0xBC91EEE26B588A35, 0x3FEF05B030A1064A,\n 0x3C74FFD70A5FDDCD, 0x3FEF0C1E904BC1D2,\n 0xBC91BDFBFA9298AC, 0x3FEF12C25BD71E09,\n 0x3C736EAE30AF0CB3, 0x3FEF199BDD85529C,\n 0x3C8EE3325C9FFD94, 0x3FEF20AB5FFFD07A,\n 0x3C84E08FD10959AC, 0x3FEF27F12E57D14B,\n 0x3C63CDAF384E1A67, 0x3FEF2F6D9406E7B5,\n 0x3C676B2C6C921968, 0x3FEF3720DCEF9069,\n 0xBC808A1883CCB5D2, 0x3FEF3F0B555DC3FA,\n 0xBC8FAD5D3FFFFA6F, 0x3FEF472D4A07897C,\n 0xBC900DAE3875A949, 0x3FEF4F87080D89F2,\n 0x3C74A385A63D07A7, 0x3FEF5818DCFBA487,\n 0xBC82919E2040220F, 0x3FEF60E316C98398,\n 0x3C8E5A50D5C192AC, 0x3FEF69E603DB3285,\n 0x3C843A59AC016B4B, 0x3FEF7321F301B460,\n 0xBC82D52107B43E1F, 0x3FEF7C97337B9B5F,\n 0xBC892AB93B470DC9, 0x3FEF864614F5A129,\n 0x3C74B604603A88D3, 0x3FEF902EE78B3FF6,\n 0x3C83C5EC519D7271, 0x3FEF9A51FBC74C83,\n 0xBC8FF7128FD391F0, 0x3FEFA4AFA2A490DA,\n 0xBC8DAE98E223747D, 0x3FEFAF482D8E67F1,\n 0x3C8EC3BC41AA2008, 0x3FEFBA1BEE615A27,\n 0x3C842B94C3A9EB32, 0x3FEFC52B376BBA97,\n 0x3C8A64A931D185EE, 0x3FEFD0765B6E4540,\n 0xBC8E37BAE43BE3ED, 0x3FEFDBFDAD9CBE14,\n 0x3C77893B4D91CD9D, 0x3FEFE7C1819E90D8,\n 0x3C5305C14160CC89, 0x3FEFF3C22B8F71F1\n]);\n\n// Handle cases that may overflow or underflow when computing the result that\n// is scale*(1+TMP) without intermediate rounding. The bit representation of\n// scale is in SBITS, however it has a computed exponent that may have\n// overflown into the sign bit so that needs to be adjusted before using it as\n// a double. (int32_t)KI is the k used in the argument reduction and exponent\n// adjustment of scale, positive k here means the result may overflow and\n// negative k means the result may underflow.\n// @ts-ignore: decorator\n@inline\nfunction specialcase(tmp: f64, sbits: u64, ki: u64): f64 {\n const\n Ox1p_1022 = reinterpret(0x0010000000000000), // 0x1p-1022\n Ox1p1009 = reinterpret(0x7F00000000000000); // 0x1p1009\n\n var scale: f64;\n if (!(ki & 0x80000000)) {\n // k > 0, the exponent of scale might have overflowed by <= 460.\n sbits -= u64(1009) << 52;\n scale = reinterpret(sbits);\n return Ox1p1009 * (scale + scale * tmp); // 0x1p1009\n }\n // k < 0, need special care in the subnormal range.\n sbits += u64(1022) << 52;\n // Note: sbits is signed scale.\n scale = reinterpret(sbits);\n var y = scale + scale * tmp;\n if (abs(y) < 1.0) {\n // Round y to the right precision before scaling it into the subnormal\n // range to avoid double rounding that can cause 0.5+E/2 ulp error where\n // E is the worst-case ulp error outside the subnormal range. So this\n // is only useful if the goal is better than 1 ulp worst-case error.\n let one = copysign(1.0, y);\n let lo = scale - y + scale * tmp;\n let hi = one + y;\n lo = one - hi + y + lo;\n y = (hi + lo) - one;\n // Fix the sign of 0.\n if (y == 0.0) y = reinterpret(sbits & 0x8000000000000000);\n }\n return y * Ox1p_1022;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function exp_lut(x: f64): f64 {\n const\n N = 1 << EXP_TABLE_BITS,\n N_MASK = N - 1;\n\n const\n InvLn2N = reinterpret(0x3FF71547652B82FE) * N, // 0x1.71547652b82fep0\n NegLn2hiN = reinterpret(0xBF762E42FEFA0000), // -0x1.62e42fefa0000p-8\n NegLn2loN = reinterpret(0xBD0CF79ABC9E3B3A), // -0x1.cf79abc9e3b3ap-47\n shift = reinterpret(0x4338000000000000); // 0x1.8p52;\n\n const\n C2 = reinterpret(0x3FDFFFFFFFFFFDBD), // __exp_data.poly[0] (0x1.ffffffffffdbdp-2)\n C3 = reinterpret(0x3FC555555555543C), // __exp_data.poly[1] (0x1.555555555543cp-3)\n C4 = reinterpret(0x3FA55555CF172B91), // __exp_data.poly[2] (0x1.55555cf172b91p-5)\n C5 = reinterpret(0x3F81111167A4D017); // __exp_data.poly[3] (0x1.1111167a4d017p-7)\n\n var ux = reinterpret(x);\n var abstop = (ux >> 52 & 0x7FF);\n if (abstop - 0x3C9 >= 0x03F) {\n if (abstop - 0x3C9 >= 0x80000000) return 1;\n if (abstop >= 0x409) {\n if (ux == 0xFFF0000000000000) return 0;\n if (abstop >= 0x7FF) return 1.0 + x;\n return select(0, Infinity, ux >> 63);\n }\n // Large x is special cased below.\n abstop = 0;\n }\n\n // exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]\n // x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]\n var z = InvLn2N * x;\n // #if TOINT_INTRINSICS\n // \tkd = roundtoint(z);\n // \tki = converttoint(z);\n // #elif EXP_USE_TOINT_NARROW\n // \t// z - kd is in [-0.5-2^-16, 0.5] in all rounding modes.\n // var kd = z + shift;\n // var ki = reinterpret(kd) >> 16;\n // var kd = ki;\n // #else\n // z - kd is in [-1, 1] in non-nearest rounding modes.\n var kd = z + shift;\n var ki = reinterpret(kd);\n kd -= shift;\n // #endif\n var r = x + kd * NegLn2hiN + kd * NegLn2loN;\n // 2^(k/N) ~= scale * (1 + tail).\n var idx = ((ki & N_MASK) << 1);\n var top = ki << (52 - EXP_TABLE_BITS);\n\n var tail = reinterpret(load(EXP_DATA_TAB + (idx << alignof()))); // T[idx]\n // This is only a valid scale when -1023*N < k < 1024*N\n var sbits = load(EXP_DATA_TAB + (idx << alignof()), 1 << alignof()) + top; // T[idx + 1]\n // exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1).\n // Evaluation is optimized assuming superscalar pipelined execution.\n var r2 = r * r;\n // Without fma the worst case error is 0.25/N ulp larger.\n // Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp.\n var tmp = tail + r + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5);\n if (abstop == 0) return specialcase(tmp, sbits, ki);\n var scale = reinterpret(sbits);\n // Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there\n // is no spurious underflow here even without fma.\n return scale + scale * tmp;\n}\n\n//\n// Lookup data for exp2. See: https://git.musl-libc.org/cgit/musl/tree/src/math/exp2.c\n//\n\n// Handle cases that may overflow or underflow when computing the result that\n// is scale*(1+TMP) without intermediate rounding. The bit representation of\n// scale is in SBITS, however it has a computed exponent that may have\n// overflown into the sign bit so that needs to be adjusted before using it as\n// a double. (int32_t)KI is the k used in the argument reduction and exponent\n// adjustment of scale, positive k here means the result may overflow and\n// negative k means the result may underflow.\n// @ts-ignore: decorator\n@inline\nfunction specialcase2(tmp: f64, sbits: u64, ki: u64): f64 {\n const Ox1p_1022 = reinterpret(0x10000000000000); // 0x1p-1022\n var scale: f64;\n if ((ki & 0x80000000) == 0) {\n // k > 0, the exponent of scale might have overflowed by 1\n sbits -= u64(1) << 52;\n scale = reinterpret(sbits);\n return 2 * (scale * tmp + scale);\n }\n // k < 0, need special care in the subnormal range\n sbits += u64(1022) << 52;\n scale = reinterpret(sbits);\n var y = scale * tmp + scale;\n if (y < 1.0) {\n // Round y to the right precision before scaling it into the subnormal\n // range to avoid double rounding that can cause 0.5+E/2 ulp error where\n // E is the worst-case ulp error outside the subnormal range. So this\n // is only useful if the goal is better than 1 ulp worst-case error.\n let hi: f64, lo: f64;\n lo = scale - y + scale * tmp;\n hi = 1.0 + y;\n lo = 1.0 - hi + y + lo;\n y = (hi + lo) - 1.0;\n }\n return y * Ox1p_1022;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function exp2_lut(x: f64): f64 {\n const\n N = 1 << EXP_TABLE_BITS,\n N_MASK = N - 1,\n shift = reinterpret(0x4338000000000000) / N; // 0x1.8p52\n\n const\n C1 = reinterpret(0x3FE62E42FEFA39EF), // 0x1.62e42fefa39efp-1\n C2 = reinterpret(0x3FCEBFBDFF82C424), // 0x1.ebfbdff82c424p-3\n C3 = reinterpret(0x3FAC6B08D70CF4B5), // 0x1.c6b08d70cf4b5p-5\n C4 = reinterpret(0x3F83B2ABD24650CC), // 0x1.3b2abd24650ccp-7\n C5 = reinterpret(0x3F55D7E09B4E3A84); // 0x1.5d7e09b4e3a84p-10\n\n var ux = reinterpret(x);\n var abstop = (ux >> 52 & 0x7ff);\n if (abstop - 0x3C9 >= 0x03F) {\n if (abstop - 0x3C9 >= 0x80000000) return 1.0;\n if (abstop >= 0x409) {\n if (ux == 0xFFF0000000000000) return 0;\n if (abstop >= 0x7FF) return 1.0 + x;\n if (!(ux >> 63)) return Infinity;\n else if (ux >= 0xC090CC0000000000) return 0;\n }\n if ((ux << 1) > 0x811A000000000000) abstop = 0; // Large x is special cased below.\n }\n\n // exp2(x) = 2^(k/N) * 2^r, with 2^r in [2^(-1/2N),2^(1/2N)].\n // x = k/N + r, with int k and r in [-1/2N, 1/2N]\n var kd = x + shift;\n var ki = reinterpret(kd);\n kd -= shift; // k/N for int k\n var r = x - kd;\n // 2^(k/N) ~= scale * (1 + tail)\n var idx = ((ki & N_MASK) << 1);\n var top = ki << (52 - EXP_TABLE_BITS);\n\n var tail = reinterpret(load(EXP_DATA_TAB + (idx << alignof()), 0 << alignof())); // T[idx])\n // This is only a valid scale when -1023*N < k < 1024*N\n var sbits = load(EXP_DATA_TAB + (idx << alignof()), 1 << alignof()) + top; // T[idx + 1]\n // exp2(x) = 2^(k/N) * 2^r ~= scale + scale * (tail + 2^r - 1).\n // Evaluation is optimized assuming superscalar pipelined execution\n var r2 = r * r;\n // Without fma the worst case error is 0.5/N ulp larger.\n // Worst case error is less than 0.5+0.86/N+(abs poly error * 2^53) ulp.\n var tmp = tail + r * C1 + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5);\n if (abstop == 0) return specialcase2(tmp, sbits, ki);\n var scale = reinterpret(sbits);\n // Note: tmp == 0 or |tmp| > 2^-65 and scale > 2^-928, so there\n // is no spurious underflow here even without fma.\n return scale * tmp + scale;\n}\n\n//\n// Lookup data for log2. See: https://git.musl-libc.org/cgit/musl/tree/src/math/log2.c\n//\n\n// @ts-ignore: decorator\n@inline const LOG2_TABLE_BITS = 6;\n\n/* Algorithm:\n\n x = 2^k z\n log2(x) = k + log2(c) + log2(z/c)\n log2(z/c) = poly(z/c - 1)\n\nwhere z is in [1.6p-1; 1.6p0] which is split into N subintervals and z falls\ninto the ith one, then table entries are computed as\n\n tab[i].invc = 1/c\n tab[i].logc = (double)log2(c)\n tab2[i].chi = (double)c\n tab2[i].clo = (double)(c - (double)c)\n\nwhere c is near the center of the subinterval and is chosen by trying +-2^29\nfloating point invc candidates around 1/center and selecting one for which\n\n 1) the rounding error in 0x1.8p10 + logc is 0,\n 2) the rounding error in z - chi - clo is < 0x1p-64 and\n 3) the rounding error in (double)log2(c) is minimized (< 0x1p-68).\n\nNote: 1) ensures that k + logc can be computed without rounding error, 2)\nensures that z/c - 1 can be computed as (z - chi - clo)*invc with close to a\nsingle rounding error when there is no fast fma for z*invc - 1, 3) ensures\nthat logc + poly(z/c - 1) has small error, however near x == 1 when\n|log2(x)| < 0x1p-4, this is not enough so that is special cased. */\n\n// @ts-ignore: decorator\n@lazy @inline const LOG2_DATA_TAB1 = memory.data([\n // invc , logc\n reinterpret(0x3FF724286BB1ACF8), reinterpret(0xBFE1095FEECDB000),\n reinterpret(0x3FF6E1F766D2CCA1), reinterpret(0xBFE08494BD76D000),\n reinterpret(0x3FF6A13D0E30D48A), reinterpret(0xBFE00143AEE8F800),\n reinterpret(0x3FF661EC32D06C85), reinterpret(0xBFDEFEC5360B4000),\n reinterpret(0x3FF623FA951198F8), reinterpret(0xBFDDFDD91AB7E000),\n reinterpret(0x3FF5E75BA4CF026C), reinterpret(0xBFDCFFAE0CC79000),\n reinterpret(0x3FF5AC055A214FB8), reinterpret(0xBFDC043811FDA000),\n reinterpret(0x3FF571ED0F166E1E), reinterpret(0xBFDB0B67323AE000),\n reinterpret(0x3FF53909590BF835), reinterpret(0xBFDA152F5A2DB000),\n reinterpret(0x3FF5014FED61ADDD), reinterpret(0xBFD9217F5AF86000),\n reinterpret(0x3FF4CAB88E487BD0), reinterpret(0xBFD8304DB0719000),\n reinterpret(0x3FF49539B4334FEE), reinterpret(0xBFD74189F9A9E000),\n reinterpret(0x3FF460CBDFAFD569), reinterpret(0xBFD6552BB5199000),\n reinterpret(0x3FF42D664EE4B953), reinterpret(0xBFD56B23A29B1000),\n reinterpret(0x3FF3FB01111DD8A6), reinterpret(0xBFD483650F5FA000),\n reinterpret(0x3FF3C995B70C5836), reinterpret(0xBFD39DE937F6A000),\n reinterpret(0x3FF3991C4AB6FD4A), reinterpret(0xBFD2BAA1538D6000),\n reinterpret(0x3FF3698E0CE099B5), reinterpret(0xBFD1D98340CA4000),\n reinterpret(0x3FF33AE48213E7B2), reinterpret(0xBFD0FA853A40E000),\n reinterpret(0x3FF30D191985BDB1), reinterpret(0xBFD01D9C32E73000),\n reinterpret(0x3FF2E025CAB271D7), reinterpret(0xBFCE857DA2FA6000),\n reinterpret(0x3FF2B404CF13CD82), reinterpret(0xBFCCD3C8633D8000),\n reinterpret(0x3FF288B02C7CCB50), reinterpret(0xBFCB26034C14A000),\n reinterpret(0x3FF25E2263944DE5), reinterpret(0xBFC97C1C2F4FE000),\n reinterpret(0x3FF234563D8615B1), reinterpret(0xBFC7D6023F800000),\n reinterpret(0x3FF20B46E33EAF38), reinterpret(0xBFC633A71A05E000),\n reinterpret(0x3FF1E2EEFDCDA3DD), reinterpret(0xBFC494F5E9570000),\n reinterpret(0x3FF1BB4A580B3930), reinterpret(0xBFC2F9E424E0A000),\n reinterpret(0x3FF19453847F2200), reinterpret(0xBFC162595AFDC000),\n reinterpret(0x3FF16E06C0D5D73C), reinterpret(0xBFBF9C9A75BD8000),\n reinterpret(0x3FF1485F47B7E4C2), reinterpret(0xBFBC7B575BF9C000),\n reinterpret(0x3FF12358AD0085D1), reinterpret(0xBFB960C60FF48000),\n reinterpret(0x3FF0FEF00F532227), reinterpret(0xBFB64CE247B60000),\n reinterpret(0x3FF0DB2077D03A8F), reinterpret(0xBFB33F78B2014000),\n reinterpret(0x3FF0B7E6D65980D9), reinterpret(0xBFB0387D1A42C000),\n reinterpret(0x3FF0953EFE7B408D), reinterpret(0xBFAA6F9208B50000),\n reinterpret(0x3FF07325CAC53B83), reinterpret(0xBFA47A954F770000),\n reinterpret(0x3FF05197E40D1B5C), reinterpret(0xBF9D23A8C50C0000),\n reinterpret(0x3FF03091C1208EA2), reinterpret(0xBF916A2629780000),\n reinterpret(0x3FF0101025B37E21), reinterpret(0xBF7720F8D8E80000),\n reinterpret(0x3FEFC07EF9CAA76B), reinterpret(0x3F86FE53B1500000),\n reinterpret(0x3FEF4465D3F6F184), reinterpret(0x3FA11CCCE10F8000),\n reinterpret(0x3FEECC079F84107F), reinterpret(0x3FAC4DFC8C8B8000),\n reinterpret(0x3FEE573A99975AE8), reinterpret(0x3FB3AA321E574000),\n reinterpret(0x3FEDE5D6F0BD3DE6), reinterpret(0x3FB918A0D08B8000),\n reinterpret(0x3FED77B681FF38B3), reinterpret(0x3FBE72E9DA044000),\n reinterpret(0x3FED0CB5724DE943), reinterpret(0x3FC1DCD2507F6000),\n reinterpret(0x3FECA4B2DC0E7563), reinterpret(0x3FC476AB03DEA000),\n reinterpret(0x3FEC3F8EE8D6CB51), reinterpret(0x3FC7074377E22000),\n reinterpret(0x3FEBDD2B4F020C4C), reinterpret(0x3FC98EDE8BA94000),\n reinterpret(0x3FEB7D6C006015CA), reinterpret(0x3FCC0DB86AD2E000),\n reinterpret(0x3FEB20366E2E338F), reinterpret(0x3FCE840AAFCEE000),\n reinterpret(0x3FEAC57026295039), reinterpret(0x3FD0790AB4678000),\n reinterpret(0x3FEA6D01BC2731DD), reinterpret(0x3FD1AC056801C000),\n reinterpret(0x3FEA16D3BC3FF18B), reinterpret(0x3FD2DB11D4FEE000),\n reinterpret(0x3FE9C2D14967FEAD), reinterpret(0x3FD406464EC58000),\n reinterpret(0x3FE970E4F47C9902), reinterpret(0x3FD52DBE093AF000),\n reinterpret(0x3FE920FB3982BCF2), reinterpret(0x3FD651902050D000),\n reinterpret(0x3FE8D30187F759F1), reinterpret(0x3FD771D2CDEAF000),\n reinterpret(0x3FE886E5EBB9F66D), reinterpret(0x3FD88E9C857D9000),\n reinterpret(0x3FE83C97B658B994), reinterpret(0x3FD9A80155E16000),\n reinterpret(0x3FE7F405FFC61022), reinterpret(0x3FDABE186ED3D000),\n reinterpret(0x3FE7AD22181415CA), reinterpret(0x3FDBD0F2AEA0E000),\n reinterpret(0x3FE767DCF99EFF8C), reinterpret(0x3FDCE0A43DBF4000)\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const LOG2_DATA_TAB2 = memory.data([\n // chi , clo\n reinterpret(0x3FE6200012B90A8E), reinterpret(0x3C8904AB0644B605),\n reinterpret(0x3FE66000045734A6), reinterpret(0x3C61FF9BEA62F7A9),\n reinterpret(0x3FE69FFFC325F2C5), reinterpret(0x3C827ECFCB3C90BA),\n reinterpret(0x3FE6E00038B95A04), reinterpret(0x3C88FF8856739326),\n reinterpret(0x3FE71FFFE09994E3), reinterpret(0x3C8AFD40275F82B1),\n reinterpret(0x3FE7600015590E10), reinterpret(0xBC72FD75B4238341),\n reinterpret(0x3FE7A00012655BD5), reinterpret(0x3C7808E67C242B76),\n reinterpret(0x3FE7E0003259E9A6), reinterpret(0xBC6208E426F622B7),\n reinterpret(0x3FE81FFFEDB4B2D2), reinterpret(0xBC8402461EA5C92F),\n reinterpret(0x3FE860002DFAFCC3), reinterpret(0x3C6DF7F4A2F29A1F),\n reinterpret(0x3FE89FFFF78C6B50), reinterpret(0xBC8E0453094995FD),\n reinterpret(0x3FE8E00039671566), reinterpret(0xBC8A04F3BEC77B45),\n reinterpret(0x3FE91FFFE2BF1745), reinterpret(0xBC77FA34400E203C),\n reinterpret(0x3FE95FFFCC5C9FD1), reinterpret(0xBC76FF8005A0695D),\n reinterpret(0x3FE9A0003BBA4767), reinterpret(0x3C70F8C4C4EC7E03),\n reinterpret(0x3FE9DFFFE7B92DA5), reinterpret(0x3C8E7FD9478C4602),\n reinterpret(0x3FEA1FFFD72EFDAF), reinterpret(0xBC6A0C554DCDAE7E),\n reinterpret(0x3FEA5FFFDE04FF95), reinterpret(0x3C867DA98CE9B26B),\n reinterpret(0x3FEA9FFFCA5E8D2B), reinterpret(0xBC8284C9B54C13DE),\n reinterpret(0x3FEADFFFDDAD03EA), reinterpret(0x3C5812C8EA602E3C),\n reinterpret(0x3FEB1FFFF10D3D4D), reinterpret(0xBC8EFADDAD27789C),\n reinterpret(0x3FEB5FFFCE21165A), reinterpret(0x3C53CB1719C61237),\n reinterpret(0x3FEB9FFFD950E674), reinterpret(0x3C73F7D94194CE00),\n reinterpret(0x3FEBE000139CA8AF), reinterpret(0x3C750AC4215D9BC0),\n reinterpret(0x3FEC20005B46DF99), reinterpret(0x3C6BEEA653E9C1C9),\n reinterpret(0x3FEC600040B9F7AE), reinterpret(0xBC7C079F274A70D6),\n reinterpret(0x3FECA0006255FD8A), reinterpret(0xBC7A0B4076E84C1F),\n reinterpret(0x3FECDFFFD94C095D), reinterpret(0x3C88F933F99AB5D7),\n reinterpret(0x3FED1FFFF975D6CF), reinterpret(0xBC582C08665FE1BE),\n reinterpret(0x3FED5FFFA2561C93), reinterpret(0xBC7B04289BD295F3),\n reinterpret(0x3FED9FFF9D228B0C), reinterpret(0x3C870251340FA236),\n reinterpret(0x3FEDE00065BC7E16), reinterpret(0xBC75011E16A4D80C),\n reinterpret(0x3FEE200002F64791), reinterpret(0x3C89802F09EF62E0),\n reinterpret(0x3FEE600057D7A6D8), reinterpret(0xBC7E0B75580CF7FA),\n reinterpret(0x3FEEA00027EDC00C), reinterpret(0xBC8C848309459811),\n reinterpret(0x3FEEE0006CF5CB7C), reinterpret(0xBC8F8027951576F4),\n reinterpret(0x3FEF2000782B7DCC), reinterpret(0xBC8F81D97274538F),\n reinterpret(0x3FEF6000260C450A), reinterpret(0xBC4071002727FFDC),\n reinterpret(0x3FEF9FFFE88CD533), reinterpret(0xBC581BDCE1FDA8B0),\n reinterpret(0x3FEFDFFFD50F8689), reinterpret(0x3C87F91ACB918E6E),\n reinterpret(0x3FF0200004292367), reinterpret(0x3C9B7FF365324681),\n reinterpret(0x3FF05FFFE3E3D668), reinterpret(0x3C86FA08DDAE957B),\n reinterpret(0x3FF0A0000A85A757), reinterpret(0xBC57E2DE80D3FB91),\n reinterpret(0x3FF0E0001A5F3FCC), reinterpret(0xBC91823305C5F014),\n reinterpret(0x3FF11FFFF8AFBAF5), reinterpret(0xBC8BFABB6680BAC2),\n reinterpret(0x3FF15FFFE54D91AD), reinterpret(0xBC9D7F121737E7EF),\n reinterpret(0x3FF1A00011AC36E1), reinterpret(0x3C9C000A0516F5FF),\n reinterpret(0x3FF1E00019C84248), reinterpret(0xBC9082FBE4DA5DA0),\n reinterpret(0x3FF220000FFE5E6E), reinterpret(0xBC88FDD04C9CFB43),\n reinterpret(0x3FF26000269FD891), reinterpret(0x3C8CFE2A7994D182),\n reinterpret(0x3FF2A00029A6E6DA), reinterpret(0xBC700273715E8BC5),\n reinterpret(0x3FF2DFFFE0293E39), reinterpret(0x3C9B7C39DAB2A6F9),\n reinterpret(0x3FF31FFFF7DCF082), reinterpret(0x3C7DF1336EDC5254),\n reinterpret(0x3FF35FFFF05A8B60), reinterpret(0xBC9E03564CCD31EB),\n reinterpret(0x3FF3A0002E0EAECC), reinterpret(0x3C75F0E74BD3A477),\n reinterpret(0x3FF3E000043BB236), reinterpret(0x3C9C7DCB149D8833),\n reinterpret(0x3FF4200002D187FF), reinterpret(0x3C7E08AFCF2D3D28),\n reinterpret(0x3FF460000D387CB1), reinterpret(0x3C820837856599A6),\n reinterpret(0x3FF4A00004569F89), reinterpret(0xBC89FA5C904FBCD2),\n reinterpret(0x3FF4E000043543F3), reinterpret(0xBC781125ED175329),\n reinterpret(0x3FF51FFFCC027F0F), reinterpret(0x3C9883D8847754DC),\n reinterpret(0x3FF55FFFFD87B36F), reinterpret(0xBC8709E731D02807),\n reinterpret(0x3FF59FFFF21DF7BA), reinterpret(0x3C87F79F68727B02),\n reinterpret(0x3FF5DFFFEBFC3481), reinterpret(0xBC9180902E30E93E)\n]);\n\n// @ts-ignore: decorator\n@inline\nexport function log2_lut(x: f64): f64 {\n const N_MASK = (1 << LOG2_TABLE_BITS) - 1;\n\n const\n LO: u64 = 0x3FEEA4AF00000000, // reinterpret(1.0 - 0x1.5b51p-5)\n HI: u64 = 0x3FF0B55900000000; // reinterpret(1.0 + 0x1.6ab2p-5)\n\n const\n InvLn2hi = reinterpret(0x3FF7154765200000), // 0x1.7154765200000p+0\n InvLn2lo = reinterpret(0x3DE705FC2EEFA200), // 0x1.705fc2eefa200p-33\n Ox1p52 = reinterpret(0x4330000000000000); // 0x1p52\n\n const\n B0 = reinterpret(0xBFE71547652B82FE), // -0x1.71547652b82fep-1\n B1 = reinterpret(0x3FDEC709DC3A03F7), // 0x1.ec709dc3a03f7p-2\n B2 = reinterpret(0xBFD71547652B7C3F), // -0x1.71547652b7c3fp-2\n B3 = reinterpret(0x3FD2776C50F05BE4), // 0x1.2776c50f05be4p-2\n B4 = reinterpret(0xBFCEC709DD768FE5), // -0x1.ec709dd768fe5p-3\n B5 = reinterpret(0x3FCA61761EC4E736), // 0x1.a61761ec4e736p-3\n B6 = reinterpret(0xBFC7153FBC64A79B), // -0x1.7153fbc64a79bp-3\n B7 = reinterpret(0x3FC484D154F01B4A), // 0x1.484d154f01b4ap-3\n B8 = reinterpret(0xBFC289E4A72C383C), // -0x1.289e4a72c383cp-3\n B9 = reinterpret(0x3FC0B32F285AEE66); // 0x1.0b32f285aee66p-3\n\n const\n A0 = reinterpret(0xBFE71547652B8339), // -0x1.71547652b8339p-1\n A1 = reinterpret(0x3FDEC709DC3A04BE), // 0x1.ec709dc3a04bep-2\n A2 = reinterpret(0xBFD7154764702FFB), // -0x1.7154764702ffbp-2\n A3 = reinterpret(0x3FD2776C50034C48), // 0x1.2776c50034c48p-2\n A4 = reinterpret(0xBFCEC7B328EA92BC), // -0x1.ec7b328ea92bcp-3\n A5 = reinterpret(0x3FCA6225E117F92E); // 0x1.a6225e117f92ep-3\n\n var ix = reinterpret(x);\n if (ix - LO < HI - LO) {\n let r = x - 1.0;\n // #if __FP_FAST_FMA\n // hi = r * InvLn2hi;\n // lo = r * InvLn2lo + __builtin_fma(r, InvLn2hi, -hi);\n // #else\n let rhi = reinterpret(reinterpret(r) & 0xFFFFFFFF00000000);\n let rlo = r - rhi;\n let hi = rhi * InvLn2hi;\n let lo = rlo * InvLn2hi + r * InvLn2lo;\n // #endif\n let r2 = r * r; // rounding error: 0x1p-62\n let r4 = r2 * r2;\n // Worst-case error is less than 0.54 ULP (0.55 ULP without fma)\n let p = r2 * (B0 + r * B1);\n let y = hi + p;\n lo += hi - y + p;\n lo += r4 * (B2 + r * B3 + r2 * (B4 + r * B5) +\n r4 * (B6 + r * B7 + r2 * (B8 + r * B9)));\n return y + lo;\n }\n var top = (ix >> 48);\n if (top - 0x0010 >= 0x7ff0 - 0x0010) {\n // x < 0x1p-1022 or inf or nan.\n if ((ix << 1) == 0) return -1.0 / (x * x);\n if (ix == 0x7FF0000000000000) return x; // log(inf) == inf\n if ((top & 0x8000) || (top & 0x7FF0) == 0x7FF0) return (x - x) / (x - x);\n // x is subnormal, normalize it.\n ix = reinterpret(x * Ox1p52);\n ix -= u64(52) << 52;\n }\n\n // x = 2^k z; where z is in range [OFF,2*OFF) and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ix - 0x3FE6000000000000;\n var i = ((tmp >> (52 - LOG2_TABLE_BITS)) & N_MASK);\n var k = tmp >> 52;\n var iz = ix - (tmp & 0xFFF0000000000000);\n\n var invc = load(LOG2_DATA_TAB1 + (i << (1 + alignof())), 0 << alignof()); // T[i].invc;\n var logc = load(LOG2_DATA_TAB1 + (i << (1 + alignof())), 1 << alignof()); // T[i].logc;\n var z = reinterpret(iz);\n var kd = k;\n\n // log2(x) = log2(z/c) + log2(c) + k.\n // r ~= z/c - 1, |r| < 1/(2*N).\n // #if __FP_FAST_FMA\n // \t// rounding error: 0x1p-55/N.\n // \tr = __builtin_fma(z, invc, -1.0);\n // \tt1 = r * InvLn2hi;\n // \tt2 = r * InvLn2lo + __builtin_fma(r, InvLn2hi, -t1);\n // #else\n // rounding error: 0x1p-55/N + 0x1p-65.\n var chi = load(LOG2_DATA_TAB2 + (i << (1 + alignof())), 0 << alignof()); // T[i].chi;\n var clo = load(LOG2_DATA_TAB2 + (i << (1 + alignof())), 1 << alignof()); // T[i].clo;\n\n var r = (z - chi - clo) * invc;\n var rhi = reinterpret(reinterpret(r) & 0xFFFFFFFF00000000);\n var rlo = r - rhi;\n var t1 = rhi * InvLn2hi;\n var t2 = rlo * InvLn2hi + r * InvLn2lo;\n // #endif\n\n // hi + lo = r/ln2 + log2(c) + k\n var t3 = kd + logc;\n var hi = t3 + t1;\n var lo = t3 - hi + t1 + t2;\n\n // log2(r+1) = r/ln2 + r^2*poly(r)\n // Evaluation is optimized assuming superscalar pipelined execution\n var r2 = r * r; // rounding error: 0x1p-54/N^2\n // Worst-case error if |y| > 0x1p-4: 0.547 ULP (0.550 ULP without fma).\n // ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma).\n var p = A0 + r * A1 + r2 * (A2 + r * A3) + (r2 * r2) * (A4 + r * A5);\n return lo + r2 * p + hi;\n}\n\n//\n// Lookup data for log. See: https://git.musl-libc.org/cgit/musl/tree/src/math/log.c\n//\n\n// @ts-ignore: decorator\n@inline const LOG_TABLE_BITS = 7;\n\n/* Algorithm:\n\n x = 2^k z\n log(x) = k ln2 + log(c) + log(z/c)\n log(z/c) = poly(z/c - 1)\n\nwhere z is in [1.6p-1; 1.6p0] which is split into N subintervals and z falls\ninto the ith one, then table entries are computed as\n\n tab[i].invc = 1/c\n tab[i].logc = (double)log(c)\n tab2[i].chi = (double)c\n tab2[i].clo = (double)(c - (double)c)\n\nwhere c is near the center of the subinterval and is chosen by trying +-2^29\nfloating point invc candidates around 1/center and selecting one for which\n\n 1) the rounding error in 0x1.8p9 + logc is 0,\n 2) the rounding error in z - chi - clo is < 0x1p-66 and\n 3) the rounding error in (double)log(c) is minimized (< 0x1p-66).\n\nNote: 1) ensures that k*ln2hi + logc can be computed without rounding error,\n2) ensures that z/c - 1 can be computed as (z - chi - clo)*invc with close to\na single rounding error when there is no fast fma for z*invc - 1, 3) ensures\nthat logc + poly(z/c - 1) has small error, however near x == 1 when\n|log(x)| < 0x1p-4, this is not enough so that is special cased.*/\n\n// @ts-ignore: decorator\n@lazy @inline const LOG_DATA_TAB1 = memory.data([\n // invc , logc\n reinterpret(0x3FF734F0C3E0DE9F), reinterpret(0xBFD7CC7F79E69000),\n reinterpret(0x3FF713786A2CE91F), reinterpret(0xBFD76FEEC20D0000),\n reinterpret(0x3FF6F26008FAB5A0), reinterpret(0xBFD713E31351E000),\n reinterpret(0x3FF6D1A61F138C7D), reinterpret(0xBFD6B85B38287800),\n reinterpret(0x3FF6B1490BC5B4D1), reinterpret(0xBFD65D5590807800),\n reinterpret(0x3FF69147332F0CBA), reinterpret(0xBFD602D076180000),\n reinterpret(0x3FF6719F18224223), reinterpret(0xBFD5A8CA86909000),\n reinterpret(0x3FF6524F99A51ED9), reinterpret(0xBFD54F4356035000),\n reinterpret(0x3FF63356AA8F24C4), reinterpret(0xBFD4F637C36B4000),\n reinterpret(0x3FF614B36B9DDC14), reinterpret(0xBFD49DA7FDA85000),\n reinterpret(0x3FF5F66452C65C4C), reinterpret(0xBFD445923989A800),\n reinterpret(0x3FF5D867B5912C4F), reinterpret(0xBFD3EDF439B0B800),\n reinterpret(0x3FF5BABCCB5B90DE), reinterpret(0xBFD396CE448F7000),\n reinterpret(0x3FF59D61F2D91A78), reinterpret(0xBFD3401E17BDA000),\n reinterpret(0x3FF5805612465687), reinterpret(0xBFD2E9E2EF468000),\n reinterpret(0x3FF56397CEE76BD3), reinterpret(0xBFD2941B3830E000),\n reinterpret(0x3FF54725E2A77F93), reinterpret(0xBFD23EC58CDA8800),\n reinterpret(0x3FF52AFF42064583), reinterpret(0xBFD1E9E129279000),\n reinterpret(0x3FF50F22DBB2BDDF), reinterpret(0xBFD1956D2B48F800),\n reinterpret(0x3FF4F38F4734DED7), reinterpret(0xBFD141679AB9F800),\n reinterpret(0x3FF4D843CFDE2840), reinterpret(0xBFD0EDD094EF9800),\n reinterpret(0x3FF4BD3EC078A3C8), reinterpret(0xBFD09AA518DB1000),\n reinterpret(0x3FF4A27FC3E0258A), reinterpret(0xBFD047E65263B800),\n reinterpret(0x3FF4880524D48434), reinterpret(0xBFCFEB224586F000),\n reinterpret(0x3FF46DCE1B192D0B), reinterpret(0xBFCF474A7517B000),\n reinterpret(0x3FF453D9D3391854), reinterpret(0xBFCEA4443D103000),\n reinterpret(0x3FF43A2744B4845A), reinterpret(0xBFCE020D44E9B000),\n reinterpret(0x3FF420B54115F8FB), reinterpret(0xBFCD60A22977F000),\n reinterpret(0x3FF40782DA3EF4B1), reinterpret(0xBFCCC00104959000),\n reinterpret(0x3FF3EE8F5D57FE8F), reinterpret(0xBFCC202956891000),\n reinterpret(0x3FF3D5D9A00B4CE9), reinterpret(0xBFCB81178D811000),\n reinterpret(0x3FF3BD60C010C12B), reinterpret(0xBFCAE2C9CCD3D000),\n reinterpret(0x3FF3A5242B75DAB8), reinterpret(0xBFCA45402E129000),\n reinterpret(0x3FF38D22CD9FD002), reinterpret(0xBFC9A877681DF000),\n reinterpret(0x3FF3755BC5847A1C), reinterpret(0xBFC90C6D69483000),\n reinterpret(0x3FF35DCE49AD36E2), reinterpret(0xBFC87120A645C000),\n reinterpret(0x3FF34679984DD440), reinterpret(0xBFC7D68FB4143000),\n reinterpret(0x3FF32F5CCEFFCB24), reinterpret(0xBFC73CB83C627000),\n reinterpret(0x3FF3187775A10D49), reinterpret(0xBFC6A39A9B376000),\n reinterpret(0x3FF301C8373E3990), reinterpret(0xBFC60B3154B7A000),\n reinterpret(0x3FF2EB4EBB95F841), reinterpret(0xBFC5737D76243000),\n reinterpret(0x3FF2D50A0219A9D1), reinterpret(0xBFC4DC7B8FC23000),\n reinterpret(0x3FF2BEF9A8B7FD2A), reinterpret(0xBFC4462C51D20000),\n reinterpret(0x3FF2A91C7A0C1BAB), reinterpret(0xBFC3B08ABC830000),\n reinterpret(0x3FF293726014B530), reinterpret(0xBFC31B996B490000),\n reinterpret(0x3FF27DFA5757A1F5), reinterpret(0xBFC2875490A44000),\n reinterpret(0x3FF268B39B1D3BBF), reinterpret(0xBFC1F3B9F879A000),\n reinterpret(0x3FF2539D838FF5BD), reinterpret(0xBFC160C8252CA000),\n reinterpret(0x3FF23EB7AAC9083B), reinterpret(0xBFC0CE7F57F72000),\n reinterpret(0x3FF22A012BA940B6), reinterpret(0xBFC03CDC49FEA000),\n reinterpret(0x3FF2157996CC4132), reinterpret(0xBFBF57BDBC4B8000),\n reinterpret(0x3FF201201DD2FC9B), reinterpret(0xBFBE370896404000),\n reinterpret(0x3FF1ECF4494D480B), reinterpret(0xBFBD17983EF94000),\n reinterpret(0x3FF1D8F5528F6569), reinterpret(0xBFBBF9674ED8A000),\n reinterpret(0x3FF1C52311577E7C), reinterpret(0xBFBADC79202F6000),\n reinterpret(0x3FF1B17C74CB26E9), reinterpret(0xBFB9C0C3E7288000),\n reinterpret(0x3FF19E010C2C1AB6), reinterpret(0xBFB8A646B372C000),\n reinterpret(0x3FF18AB07BB670BD), reinterpret(0xBFB78D01B3AC0000),\n reinterpret(0x3FF1778A25EFBCB6), reinterpret(0xBFB674F145380000),\n reinterpret(0x3FF1648D354C31DA), reinterpret(0xBFB55E0E6D878000),\n reinterpret(0x3FF151B990275FDD), reinterpret(0xBFB4485CDEA1E000),\n reinterpret(0x3FF13F0EA432D24C), reinterpret(0xBFB333D94D6AA000),\n reinterpret(0x3FF12C8B7210F9DA), reinterpret(0xBFB22079F8C56000),\n reinterpret(0x3FF11A3028ECB531), reinterpret(0xBFB10E4698622000),\n reinterpret(0x3FF107FBDA8434AF), reinterpret(0xBFAFFA6C6AD20000),\n reinterpret(0x3FF0F5EE0F4E6BB3), reinterpret(0xBFADDA8D4A774000),\n reinterpret(0x3FF0E4065D2A9FCE), reinterpret(0xBFABBCECE4850000),\n reinterpret(0x3FF0D244632CA521), reinterpret(0xBFA9A1894012C000),\n reinterpret(0x3FF0C0A77CE2981A), reinterpret(0xBFA788583302C000),\n reinterpret(0x3FF0AF2F83C636D1), reinterpret(0xBFA5715E67D68000),\n reinterpret(0x3FF09DDB98A01339), reinterpret(0xBFA35C8A49658000),\n reinterpret(0x3FF08CABAF52E7DF), reinterpret(0xBFA149E364154000),\n reinterpret(0x3FF07B9F2F4E28FB), reinterpret(0xBF9E72C082EB8000),\n reinterpret(0x3FF06AB58C358F19), reinterpret(0xBF9A55F152528000),\n reinterpret(0x3FF059EEA5ECF92C), reinterpret(0xBF963D62CF818000),\n reinterpret(0x3FF04949CDD12C90), reinterpret(0xBF9228FB8CAA0000),\n reinterpret(0x3FF038C6C6F0ADA9), reinterpret(0xBF8C317B20F90000),\n reinterpret(0x3FF02865137932A9), reinterpret(0xBF8419355DAA0000),\n reinterpret(0x3FF0182427EA7348), reinterpret(0xBF781203C2EC0000),\n reinterpret(0x3FF008040614B195), reinterpret(0xBF60040979240000),\n reinterpret(0x3FEFE01FF726FA1A), reinterpret(0x3F6FEFF384900000),\n reinterpret(0x3FEFA11CC261EA74), reinterpret(0x3F87DC41353D0000),\n reinterpret(0x3FEF6310B081992E), reinterpret(0x3F93CEA3C4C28000),\n reinterpret(0x3FEF25F63CEEADCD), reinterpret(0x3F9B9FC114890000),\n reinterpret(0x3FEEE9C8039113E7), reinterpret(0x3FA1B0D8CE110000),\n reinterpret(0x3FEEAE8078CBB1AB), reinterpret(0x3FA58A5BD001C000),\n reinterpret(0x3FEE741AA29D0C9B), reinterpret(0x3FA95C8340D88000),\n reinterpret(0x3FEE3A91830A99B5), reinterpret(0x3FAD276AEF578000),\n reinterpret(0x3FEE01E009609A56), reinterpret(0x3FB07598E598C000),\n reinterpret(0x3FEDCA01E577BB98), reinterpret(0x3FB253F5E30D2000),\n reinterpret(0x3FED92F20B7C9103), reinterpret(0x3FB42EDD8B380000),\n reinterpret(0x3FED5CAC66FB5CCE), reinterpret(0x3FB606598757C000),\n reinterpret(0x3FED272CAA5EDE9D), reinterpret(0x3FB7DA76356A0000),\n reinterpret(0x3FECF26E3E6B2CCD), reinterpret(0x3FB9AB434E1C6000),\n reinterpret(0x3FECBE6DA2A77902), reinterpret(0x3FBB78C7BB0D6000),\n reinterpret(0x3FEC8B266D37086D), reinterpret(0x3FBD431332E72000),\n reinterpret(0x3FEC5894BD5D5804), reinterpret(0x3FBF0A3171DE6000),\n reinterpret(0x3FEC26B533BB9F8C), reinterpret(0x3FC067152B914000),\n reinterpret(0x3FEBF583EEECE73F), reinterpret(0x3FC147858292B000),\n reinterpret(0x3FEBC4FD75DB96C1), reinterpret(0x3FC2266ECDCA3000),\n reinterpret(0x3FEB951E0C864A28), reinterpret(0x3FC303D7A6C55000),\n reinterpret(0x3FEB65E2C5EF3E2C), reinterpret(0x3FC3DFC33C331000),\n reinterpret(0x3FEB374867C9888B), reinterpret(0x3FC4BA366B7A8000),\n reinterpret(0x3FEB094B211D304A), reinterpret(0x3FC5933928D1F000),\n reinterpret(0x3FEADBE885F2EF7E), reinterpret(0x3FC66ACD2418F000),\n reinterpret(0x3FEAAF1D31603DA2), reinterpret(0x3FC740F8EC669000),\n reinterpret(0x3FEA82E63FD358A7), reinterpret(0x3FC815C0F51AF000),\n reinterpret(0x3FEA5740EF09738B), reinterpret(0x3FC8E92954F68000),\n reinterpret(0x3FEA2C2A90AB4B27), reinterpret(0x3FC9BB3602F84000),\n reinterpret(0x3FEA01A01393F2D1), reinterpret(0x3FCA8BED1C2C0000),\n reinterpret(0x3FE9D79F24DB3C1B), reinterpret(0x3FCB5B515C01D000),\n reinterpret(0x3FE9AE2505C7B190), reinterpret(0x3FCC2967CCBCC000),\n reinterpret(0x3FE9852EF297CE2F), reinterpret(0x3FCCF635D5486000),\n reinterpret(0x3FE95CBAEEA44B75), reinterpret(0x3FCDC1BD3446C000),\n reinterpret(0x3FE934C69DE74838), reinterpret(0x3FCE8C01B8CFE000),\n reinterpret(0x3FE90D4F2F6752E6), reinterpret(0x3FCF5509C0179000),\n reinterpret(0x3FE8E6528EFFD79D), reinterpret(0x3FD00E6C121FB800),\n reinterpret(0x3FE8BFCE9FCC007C), reinterpret(0x3FD071B80E93D000),\n reinterpret(0x3FE899C0DABEC30E), reinterpret(0x3FD0D46B9E867000),\n reinterpret(0x3FE87427AA2317FB), reinterpret(0x3FD13687334BD000),\n reinterpret(0x3FE84F00ACB39A08), reinterpret(0x3FD1980D67234800),\n reinterpret(0x3FE82A49E8653E55), reinterpret(0x3FD1F8FFE0CC8000),\n reinterpret(0x3FE8060195F40260), reinterpret(0x3FD2595FD7636800),\n reinterpret(0x3FE7E22563E0A329), reinterpret(0x3FD2B9300914A800),\n reinterpret(0x3FE7BEB377DCB5AD), reinterpret(0x3FD3187210436000),\n reinterpret(0x3FE79BAA679725C2), reinterpret(0x3FD377266DEC1800),\n reinterpret(0x3FE77907F2170657), reinterpret(0x3FD3D54FFBAF3000),\n reinterpret(0x3FE756CADBD6130C), reinterpret(0x3FD432EEE32FE000)\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const LOG_DATA_TAB2 = memory.data([\n // chi , clo\n reinterpret(0x3FE61000014FB66B), reinterpret(0x3C7E026C91425B3C),\n reinterpret(0x3FE63000034DB495), reinterpret(0x3C8DBFEA48005D41),\n reinterpret(0x3FE650000D94D478), reinterpret(0x3C8E7FA786D6A5B7),\n reinterpret(0x3FE67000074E6FAD), reinterpret(0x3C61FCEA6B54254C),\n reinterpret(0x3FE68FFFFEDF0FAE), reinterpret(0xBC7C7E274C590EFD),\n reinterpret(0x3FE6B0000763C5BC), reinterpret(0xBC8AC16848DCDA01),\n reinterpret(0x3FE6D0001E5CC1F6), reinterpret(0x3C833F1C9D499311),\n reinterpret(0x3FE6EFFFEB05F63E), reinterpret(0xBC7E80041AE22D53),\n reinterpret(0x3FE710000E869780), reinterpret(0x3C7BFF6671097952),\n reinterpret(0x3FE72FFFFC67E912), reinterpret(0x3C8C00E226BD8724),\n reinterpret(0x3FE74FFFDF81116A), reinterpret(0xBC6E02916EF101D2),\n reinterpret(0x3FE770000F679C90), reinterpret(0xBC67FC71CD549C74),\n reinterpret(0x3FE78FFFFA7EC835), reinterpret(0x3C81BEC19EF50483),\n reinterpret(0x3FE7AFFFFE20C2E6), reinterpret(0xBC707E1729CC6465),\n reinterpret(0x3FE7CFFFED3FC900), reinterpret(0xBC808072087B8B1C),\n reinterpret(0x3FE7EFFFE9261A76), reinterpret(0x3C8DC0286D9DF9AE),\n reinterpret(0x3FE81000049CA3E8), reinterpret(0x3C897FD251E54C33),\n reinterpret(0x3FE8300017932C8F), reinterpret(0xBC8AFEE9B630F381),\n reinterpret(0x3FE850000633739C), reinterpret(0x3C89BFBF6B6535BC),\n reinterpret(0x3FE87000204289C6), reinterpret(0xBC8BBF65F3117B75),\n reinterpret(0x3FE88FFFEBF57904), reinterpret(0xBC89006EA23DCB57),\n reinterpret(0x3FE8B00022BC04DF), reinterpret(0xBC7D00DF38E04B0A),\n reinterpret(0x3FE8CFFFE50C1B8A), reinterpret(0xBC88007146FF9F05),\n reinterpret(0x3FE8EFFFFC918E43), reinterpret(0x3C83817BD07A7038),\n reinterpret(0x3FE910001EFA5FC7), reinterpret(0x3C893E9176DFB403),\n reinterpret(0x3FE9300013467BB9), reinterpret(0x3C7F804E4B980276),\n reinterpret(0x3FE94FFFE6EE076F), reinterpret(0xBC8F7EF0D9FF622E),\n reinterpret(0x3FE96FFFDE3C12D1), reinterpret(0xBC7082AA962638BA),\n reinterpret(0x3FE98FFFF4458A0D), reinterpret(0xBC87801B9164A8EF),\n reinterpret(0x3FE9AFFFDD982E3E), reinterpret(0xBC8740E08A5A9337),\n reinterpret(0x3FE9CFFFED49FB66), reinterpret(0x3C3FCE08C19BE000),\n reinterpret(0x3FE9F00020F19C51), reinterpret(0xBC8A3FAA27885B0A),\n reinterpret(0x3FEA10001145B006), reinterpret(0x3C74FF489958DA56),\n reinterpret(0x3FEA300007BBF6FA), reinterpret(0x3C8CBEAB8A2B6D18),\n reinterpret(0x3FEA500010971D79), reinterpret(0x3C88FECADD787930),\n reinterpret(0x3FEA70001DF52E48), reinterpret(0xBC8F41763DD8ABDB),\n reinterpret(0x3FEA90001C593352), reinterpret(0xBC8EBF0284C27612),\n reinterpret(0x3FEAB0002A4F3E4B), reinterpret(0xBC69FD043CFF3F5F),\n reinterpret(0x3FEACFFFD7AE1ED1), reinterpret(0xBC823EE7129070B4),\n reinterpret(0x3FEAEFFFEE510478), reinterpret(0x3C6A063EE00EDEA3),\n reinterpret(0x3FEB0FFFDB650D5B), reinterpret(0x3C5A06C8381F0AB9),\n reinterpret(0x3FEB2FFFFEAACA57), reinterpret(0xBC79011E74233C1D),\n reinterpret(0x3FEB4FFFD995BADC), reinterpret(0xBC79FF1068862A9F),\n reinterpret(0x3FEB7000249E659C), reinterpret(0x3C8AFF45D0864F3E),\n reinterpret(0x3FEB8FFFF9871640), reinterpret(0x3C7CFE7796C2C3F9),\n reinterpret(0x3FEBAFFFD204CB4F), reinterpret(0xBC63FF27EEF22BC4),\n reinterpret(0x3FEBCFFFD2415C45), reinterpret(0xBC6CFFB7EE3BEA21),\n reinterpret(0x3FEBEFFFF86309DF), reinterpret(0xBC814103972E0B5C),\n reinterpret(0x3FEC0FFFE1B57653), reinterpret(0x3C8BC16494B76A19),\n reinterpret(0x3FEC2FFFF1FA57E3), reinterpret(0xBC64FEEF8D30C6ED),\n reinterpret(0x3FEC4FFFDCBFE424), reinterpret(0xBC843F68BCEC4775),\n reinterpret(0x3FEC6FFFED54B9F7), reinterpret(0x3C847EA3F053E0EC),\n reinterpret(0x3FEC8FFFEB998FD5), reinterpret(0x3C7383068DF992F1),\n reinterpret(0x3FECB0002125219A), reinterpret(0xBC68FD8E64180E04),\n reinterpret(0x3FECCFFFDD94469C), reinterpret(0x3C8E7EBE1CC7EA72),\n reinterpret(0x3FECEFFFEAFDC476), reinterpret(0x3C8EBE39AD9F88FE),\n reinterpret(0x3FED1000169AF82B), reinterpret(0x3C757D91A8B95A71),\n reinterpret(0x3FED30000D0FF71D), reinterpret(0x3C89C1906970C7DA),\n reinterpret(0x3FED4FFFEA790FC4), reinterpret(0xBC580E37C558FE0C),\n reinterpret(0x3FED70002EDC87E5), reinterpret(0xBC7F80D64DC10F44),\n reinterpret(0x3FED900021DC82AA), reinterpret(0xBC747C8F94FD5C5C),\n reinterpret(0x3FEDAFFFD86B0283), reinterpret(0x3C8C7F1DC521617E),\n reinterpret(0x3FEDD000296C4739), reinterpret(0x3C88019EB2FFB153),\n reinterpret(0x3FEDEFFFE54490F5), reinterpret(0x3C6E00D2C652CC89),\n reinterpret(0x3FEE0FFFCDABF694), reinterpret(0xBC7F8340202D69D2),\n reinterpret(0x3FEE2FFFDB52C8DD), reinterpret(0x3C7B00C1CA1B0864),\n reinterpret(0x3FEE4FFFF24216EF), reinterpret(0x3C72FFA8B094AB51),\n reinterpret(0x3FEE6FFFE88A5E11), reinterpret(0xBC57F673B1EFBE59),\n reinterpret(0x3FEE9000119EFF0D), reinterpret(0xBC84808D5E0BC801),\n reinterpret(0x3FEEAFFFDFA51744), reinterpret(0x3C780006D54320B5),\n reinterpret(0x3FEED0001A127FA1), reinterpret(0xBC5002F860565C92),\n reinterpret(0x3FEEF00007BABCC4), reinterpret(0xBC8540445D35E611),\n reinterpret(0x3FEF0FFFF57A8D02), reinterpret(0xBC4FFB3139EF9105),\n reinterpret(0x3FEF30001EE58AC7), reinterpret(0x3C8A81ACF2731155),\n reinterpret(0x3FEF4FFFF5823494), reinterpret(0x3C8A3F41D4D7C743),\n reinterpret(0x3FEF6FFFFCA94C6B), reinterpret(0xBC6202F41C987875),\n reinterpret(0x3FEF8FFFE1F9C441), reinterpret(0x3C777DD1F477E74B),\n reinterpret(0x3FEFAFFFD2E0E37E), reinterpret(0xBC6F01199A7CA331),\n reinterpret(0x3FEFD0001C77E49E), reinterpret(0x3C7181EE4BCEACB1),\n reinterpret(0x3FEFEFFFF7E0C331), reinterpret(0xBC6E05370170875A),\n reinterpret(0x3FF00FFFF465606E), reinterpret(0xBC8A7EAD491C0ADA),\n reinterpret(0x3FF02FFFF3867A58), reinterpret(0xBC977F69C3FCB2E0),\n reinterpret(0x3FF04FFFFDFC0D17), reinterpret(0x3C97BFFE34CB945B),\n reinterpret(0x3FF0700003CD4D82), reinterpret(0x3C820083C0E456CB),\n reinterpret(0x3FF08FFFF9F2CBE8), reinterpret(0xBC6DFFDFBE37751A),\n reinterpret(0x3FF0B000010CDA65), reinterpret(0xBC913F7FAEE626EB),\n reinterpret(0x3FF0D00001A4D338), reinterpret(0x3C807DFA79489FF7),\n reinterpret(0x3FF0EFFFFADAFDFD), reinterpret(0xBC77040570D66BC0),\n reinterpret(0x3FF110000BBAFD96), reinterpret(0x3C8E80D4846D0B62),\n reinterpret(0x3FF12FFFFAE5F45D), reinterpret(0x3C9DBFFA64FD36EF),\n reinterpret(0x3FF150000DD59AD9), reinterpret(0x3C9A0077701250AE),\n reinterpret(0x3FF170000F21559A), reinterpret(0x3C8DFDF9E2E3DEEE),\n reinterpret(0x3FF18FFFFC275426), reinterpret(0x3C910030DC3B7273),\n reinterpret(0x3FF1B000123D3C59), reinterpret(0x3C997F7980030188),\n reinterpret(0x3FF1CFFFF8299EB7), reinterpret(0xBC65F932AB9F8C67),\n reinterpret(0x3FF1EFFFF48AD400), reinterpret(0x3C937FBF9DA75BEB),\n reinterpret(0x3FF210000C8B86A4), reinterpret(0x3C9F806B91FD5B22),\n reinterpret(0x3FF2300003854303), reinterpret(0x3C93FFC2EB9FBF33),\n reinterpret(0x3FF24FFFFFBCF684), reinterpret(0x3C7601E77E2E2E72),\n reinterpret(0x3FF26FFFF52921D9), reinterpret(0x3C7FFCBB767F0C61),\n reinterpret(0x3FF2900014933A3C), reinterpret(0xBC7202CA3C02412B),\n reinterpret(0x3FF2B00014556313), reinterpret(0xBC92808233F21F02),\n reinterpret(0x3FF2CFFFEBFE523B), reinterpret(0xBC88FF7E384FDCF2),\n reinterpret(0x3FF2F0000BB8AD96), reinterpret(0xBC85FF51503041C5),\n reinterpret(0x3FF30FFFFB7AE2AF), reinterpret(0xBC810071885E289D),\n reinterpret(0x3FF32FFFFEAC5F7F), reinterpret(0xBC91FF5D3FB7B715),\n reinterpret(0x3FF350000CA66756), reinterpret(0x3C957F82228B82BD),\n reinterpret(0x3FF3700011FBF721), reinterpret(0x3C8000BAC40DD5CC),\n reinterpret(0x3FF38FFFF9592FB9), reinterpret(0xBC943F9D2DB2A751),\n reinterpret(0x3FF3B00004DDD242), reinterpret(0x3C857F6B707638E1),\n reinterpret(0x3FF3CFFFF5B2C957), reinterpret(0x3C7A023A10BF1231),\n reinterpret(0x3FF3EFFFEAB0B418), reinterpret(0x3C987F6D66B152B0),\n reinterpret(0x3FF410001532AFF4), reinterpret(0x3C67F8375F198524),\n reinterpret(0x3FF4300017478B29), reinterpret(0x3C8301E672DC5143),\n reinterpret(0x3FF44FFFE795B463), reinterpret(0x3C89FF69B8B2895A),\n reinterpret(0x3FF46FFFE80475E0), reinterpret(0xBC95C0B19BC2F254),\n reinterpret(0x3FF48FFFEF6FC1E7), reinterpret(0x3C9B4009F23A2A72),\n reinterpret(0x3FF4AFFFE5BEA704), reinterpret(0xBC94FFB7BF0D7D45),\n reinterpret(0x3FF4D000171027DE), reinterpret(0xBC99C06471DC6A3D),\n reinterpret(0x3FF4F0000FF03EE2), reinterpret(0x3C977F890B85531C),\n reinterpret(0x3FF5100012DC4BD1), reinterpret(0x3C6004657166A436),\n reinterpret(0x3FF530001605277A), reinterpret(0xBC96BFCECE233209),\n reinterpret(0x3FF54FFFECDB704C), reinterpret(0xBC8902720505A1D7),\n reinterpret(0x3FF56FFFEF5F54A9), reinterpret(0x3C9BBFE60EC96412),\n reinterpret(0x3FF5900017E61012), reinterpret(0x3C887EC581AFEF90),\n reinterpret(0x3FF5B00003C93E92), reinterpret(0xBC9F41080ABF0CC0),\n reinterpret(0x3FF5D0001D4919BC), reinterpret(0xBC98812AFB254729),\n reinterpret(0x3FF5EFFFE7B87A89), reinterpret(0xBC947EB780ED6904)\n]);\n\n// @ts-ignore: decorator\n@inline\nexport function log_lut(x: f64): f64 {\n const N_MASK = (1 << LOG_TABLE_BITS) - 1;\n\n const\n B0 = reinterpret(0xBFE0000000000000), // -0x1p-1\n B1 = reinterpret(0x3FD5555555555577), // 0x1.5555555555577p-2\n B2 = reinterpret(0xBFCFFFFFFFFFFDCB), // -0x1.ffffffffffdcbp-3\n B3 = reinterpret(0x3FC999999995DD0C), // 0x1.999999995dd0cp-3\n B4 = reinterpret(0xBFC55555556745A7), // -0x1.55555556745a7p-3\n B5 = reinterpret(0x3FC24924A344DE30), // 0x1.24924a344de3p-3\n B6 = reinterpret(0xBFBFFFFFA4423D65), // -0x1.fffffa4423d65p-4\n B7 = reinterpret(0x3FBC7184282AD6CA), // 0x1.c7184282ad6cap-4\n B8 = reinterpret(0xBFB999EB43B068FF), // -0x1.999eb43b068ffp-4\n B9 = reinterpret(0x3FB78182F7AFD085), // 0x1.78182f7afd085p-4\n B10 = reinterpret(0xBFB5521375D145CD); // -0x1.5521375d145cdp-4\n\n const\n A0 = reinterpret(0xBFE0000000000001), // -0x1.0000000000001p-1\n A1 = reinterpret(0x3FD555555551305B), // 0x1.555555551305bp-2\n A2 = reinterpret(0xBFCFFFFFFFEB4590), // -0x1.fffffffeb459p-3\n A3 = reinterpret(0x3FC999B324F10111), // 0x1.999b324f10111p-3\n A4 = reinterpret(0xBFC55575E506C89F); // -0x1.55575e506c89fp-3\n\n const\n LO: u64 = 0x3FEE000000000000,\n HI: u64 = 0x3FF1090000000000;\n\n const\n Ln2hi = reinterpret(0x3FE62E42FEFA3800), // 0x1.62e42fefa3800p-1\n Ln2lo = reinterpret(0x3D2EF35793C76730), // 0x1.ef35793c76730p-45\n Ox1p27 = reinterpret(0x41A0000000000000), // 0x1p27\n Ox1p52 = reinterpret(0x4330000000000000); // 0x1p52\n\n var ix = reinterpret(x);\n if (ix - LO < HI - LO) {\n let r = x - 1.0;\n let r2 = r * r;\n let r3 = r2 * r;\n let y =\n r3 * (B1 + r * B2 + r2 * B3 +\n r3 * (B4 + r * B5 + r2 * B6 +\n r3 * (B7 + r * B8 + r2 * B9 + r3 * B10)));\n // Worst-case error is around 0.507 ULP\n let w = r * Ox1p27;\n let rhi = r + w - w;\n let rlo = r - rhi;\n w = rhi * rhi * B0; // B[0] == -0.5\n let hi = r + w;\n let lo = r - hi + w;\n lo += B0 * rlo * (rhi + r);\n return y + lo + hi;\n }\n var top = u32(ix >> 48);\n if (top - 0x0010 >= 0x7FF0 - 0x0010) {\n // x < 0x1p-1022 or inf or nan\n if ((ix << 1) == 0) return -1.0 / (x * x);\n if (ix == reinterpret(Infinity)) return x; // log(inf) == inf\n if ((top & 0x8000) || (top & 0x7FF0) == 0x7FF0) return (x - x) / (x - x);\n // x is subnormal, normalize it\n ix = reinterpret(x * Ox1p52);\n ix -= u64(52) << 52;\n }\n\n // x = 2^k z; where z is in range [OFF,2*OFF) and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ix - 0x3FE6000000000000;\n var i = ((tmp >> (52 - LOG_TABLE_BITS)) & N_MASK);\n var k = tmp >> 52;\n var iz = ix - (tmp & (u64(0xFFF) << 52));\n\n var invc = load(LOG_DATA_TAB1 + (i << (1 + alignof())), 0 << alignof()); // T[i].invc;\n var logc = load(LOG_DATA_TAB1 + (i << (1 + alignof())), 1 << alignof()); // T[i].logc;\n var z = reinterpret(iz);\n\n // log(x) = log1p(z/c-1) + log(c) + k*Ln2.\n // r ~= z/c - 1, |r| < 1/(2*N)\n // #if __FP_FAST_FMA\n // \t// rounding error: 0x1p-55/N\n // \tr = __builtin_fma(z, invc, -1.0);\n // #else\n // rounding error: 0x1p-55/N + 0x1p-66\n const chi = load(LOG_DATA_TAB2 + (i << (1 + alignof())), 0 << alignof()); // T2[i].chi\n const clo = load(LOG_DATA_TAB2 + (i << (1 + alignof())), 1 << alignof()); // T2[i].clo\n var r = (z - chi - clo) * invc;\n // #endif\n var kd = k;\n\n // hi + lo = r + log(c) + k*Ln2\n var w = kd * Ln2hi + logc;\n var hi = w + r;\n var lo = w - hi + r + kd * Ln2lo;\n\n // log(x) = lo + (log1p(r) - r) + hi\n var r2 = r * r; // rounding error: 0x1p-54/N^2\n // Worst case error if |y| > 0x1p-5:\n // 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma)\n // Worst case error if |y| > 0x1p-4:\n // 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma).\n return lo + r2 * A0 + r * r2 * (A1 + r * A2 + r2 * (A3 + r * A4)) + hi;\n}\n\n//\n// Lookup data for pow. See: https://git.musl-libc.org/cgit/musl/tree/src/math/pow.c\n//\n\n// @ts-ignore: decorator\n@inline const POW_LOG_TABLE_BITS = 7;\n\n/* Algorithm:\n\n x = 2^k z\n log(x) = k ln2 + log(c) + log(z/c)\n log(z/c) = poly(z/c - 1)\n\nwhere z is in [0x1.69555p-1; 0x1.69555p0] which is split into N subintervals\nand z falls into the ith one, then table entries are computed as\n\n tab[i].invc = 1/c\n tab[i].logc = round(0x1p43*log(c))/0x1p43\n tab[i].logctail = (double)(log(c) - logc)\n\nwhere c is chosen near the center of the subinterval such that 1/c has only a\nfew precision bits so z/c - 1 is exactly representible as double:\n\n 1/c = center < 1 ? round(N/center)/N : round(2*N/center)/N/2\n\nNote: |z/c - 1| < 1/N for the chosen c, |log(c) - logc - logctail| < 0x1p-97,\nthe last few bits of logc are rounded away so k*ln2hi + logc has no rounding\nerror and the interval for z is selected such that near x == 1, where log(x)\nis tiny, large cancellation error is avoided in logc + poly(z/c - 1). */\n\n// @ts-ignore: decorator\n@lazy @inline const POW_LOG_DATA_TAB = memory.data([\n // invc ,pad, logc , logctail\n reinterpret(0x3FF6A00000000000), 0, reinterpret(0xBFD62C82F2B9C800), reinterpret(0x3CFAB42428375680),\n reinterpret(0x3FF6800000000000), 0, reinterpret(0xBFD5D1BDBF580800), reinterpret(0xBD1CA508D8E0F720),\n reinterpret(0x3FF6600000000000), 0, reinterpret(0xBFD5767717455800), reinterpret(0xBD2362A4D5B6506D),\n reinterpret(0x3FF6400000000000), 0, reinterpret(0xBFD51AAD872DF800), reinterpret(0xBCE684E49EB067D5),\n reinterpret(0x3FF6200000000000), 0, reinterpret(0xBFD4BE5F95777800), reinterpret(0xBD041B6993293EE0),\n reinterpret(0x3FF6000000000000), 0, reinterpret(0xBFD4618BC21C6000), reinterpret(0x3D13D82F484C84CC),\n reinterpret(0x3FF5E00000000000), 0, reinterpret(0xBFD404308686A800), reinterpret(0x3CDC42F3ED820B3A),\n reinterpret(0x3FF5C00000000000), 0, reinterpret(0xBFD3A64C55694800), reinterpret(0x3D20B1C686519460),\n reinterpret(0x3FF5A00000000000), 0, reinterpret(0xBFD347DD9A988000), reinterpret(0x3D25594DD4C58092),\n reinterpret(0x3FF5800000000000), 0, reinterpret(0xBFD2E8E2BAE12000), reinterpret(0x3D267B1E99B72BD8),\n reinterpret(0x3FF5600000000000), 0, reinterpret(0xBFD2895A13DE8800), reinterpret(0x3D15CA14B6CFB03F),\n reinterpret(0x3FF5600000000000), 0, reinterpret(0xBFD2895A13DE8800), reinterpret(0x3D15CA14B6CFB03F),\n reinterpret(0x3FF5400000000000), 0, reinterpret(0xBFD22941FBCF7800), reinterpret(0xBD165A242853DA76),\n reinterpret(0x3FF5200000000000), 0, reinterpret(0xBFD1C898C1699800), reinterpret(0xBD1FAFBC68E75404),\n reinterpret(0x3FF5000000000000), 0, reinterpret(0xBFD1675CABABA800), reinterpret(0x3D1F1FC63382A8F0),\n reinterpret(0x3FF4E00000000000), 0, reinterpret(0xBFD1058BF9AE4800), reinterpret(0xBD26A8C4FD055A66),\n reinterpret(0x3FF4C00000000000), 0, reinterpret(0xBFD0A324E2739000), reinterpret(0xBD0C6BEE7EF4030E),\n reinterpret(0x3FF4A00000000000), 0, reinterpret(0xBFD0402594B4D000), reinterpret(0xBCF036B89EF42D7F),\n reinterpret(0x3FF4A00000000000), 0, reinterpret(0xBFD0402594B4D000), reinterpret(0xBCF036B89EF42D7F),\n reinterpret(0x3FF4800000000000), 0, reinterpret(0xBFCFB9186D5E4000), reinterpret(0x3D0D572AAB993C87),\n reinterpret(0x3FF4600000000000), 0, reinterpret(0xBFCEF0ADCBDC6000), reinterpret(0x3D2B26B79C86AF24),\n reinterpret(0x3FF4400000000000), 0, reinterpret(0xBFCE27076E2AF000), reinterpret(0xBD172F4F543FFF10),\n reinterpret(0x3FF4200000000000), 0, reinterpret(0xBFCD5C216B4FC000), reinterpret(0x3D21BA91BBCA681B),\n reinterpret(0x3FF4000000000000), 0, reinterpret(0xBFCC8FF7C79AA000), reinterpret(0x3D27794F689F8434),\n reinterpret(0x3FF4000000000000), 0, reinterpret(0xBFCC8FF7C79AA000), reinterpret(0x3D27794F689F8434),\n reinterpret(0x3FF3E00000000000), 0, reinterpret(0xBFCBC286742D9000), reinterpret(0x3D194EB0318BB78F),\n reinterpret(0x3FF3C00000000000), 0, reinterpret(0xBFCAF3C94E80C000), reinterpret(0x3CBA4E633FCD9066),\n reinterpret(0x3FF3A00000000000), 0, reinterpret(0xBFCA23BC1FE2B000), reinterpret(0xBD258C64DC46C1EA),\n reinterpret(0x3FF3A00000000000), 0, reinterpret(0xBFCA23BC1FE2B000), reinterpret(0xBD258C64DC46C1EA),\n reinterpret(0x3FF3800000000000), 0, reinterpret(0xBFC9525A9CF45000), reinterpret(0xBD2AD1D904C1D4E3),\n reinterpret(0x3FF3600000000000), 0, reinterpret(0xBFC87FA06520D000), reinterpret(0x3D2BBDBF7FDBFA09),\n reinterpret(0x3FF3400000000000), 0, reinterpret(0xBFC7AB890210E000), reinterpret(0x3D2BDB9072534A58),\n reinterpret(0x3FF3400000000000), 0, reinterpret(0xBFC7AB890210E000), reinterpret(0x3D2BDB9072534A58),\n reinterpret(0x3FF3200000000000), 0, reinterpret(0xBFC6D60FE719D000), reinterpret(0xBD10E46AA3B2E266),\n reinterpret(0x3FF3000000000000), 0, reinterpret(0xBFC5FF3070A79000), reinterpret(0xBD1E9E439F105039),\n reinterpret(0x3FF3000000000000), 0, reinterpret(0xBFC5FF3070A79000), reinterpret(0xBD1E9E439F105039),\n reinterpret(0x3FF2E00000000000), 0, reinterpret(0xBFC526E5E3A1B000), reinterpret(0xBD20DE8B90075B8F),\n reinterpret(0x3FF2C00000000000), 0, reinterpret(0xBFC44D2B6CCB8000), reinterpret(0x3D170CC16135783C),\n reinterpret(0x3FF2C00000000000), 0, reinterpret(0xBFC44D2B6CCB8000), reinterpret(0x3D170CC16135783C),\n reinterpret(0x3FF2A00000000000), 0, reinterpret(0xBFC371FC201E9000), reinterpret(0x3CF178864D27543A),\n reinterpret(0x3FF2800000000000), 0, reinterpret(0xBFC29552F81FF000), reinterpret(0xBD248D301771C408),\n reinterpret(0x3FF2600000000000), 0, reinterpret(0xBFC1B72AD52F6000), reinterpret(0xBD2E80A41811A396),\n reinterpret(0x3FF2600000000000), 0, reinterpret(0xBFC1B72AD52F6000), reinterpret(0xBD2E80A41811A396),\n reinterpret(0x3FF2400000000000), 0, reinterpret(0xBFC0D77E7CD09000), reinterpret(0x3D0A699688E85BF4),\n reinterpret(0x3FF2400000000000), 0, reinterpret(0xBFC0D77E7CD09000), reinterpret(0x3D0A699688E85BF4),\n reinterpret(0x3FF2200000000000), 0, reinterpret(0xBFBFEC9131DBE000), reinterpret(0xBD2575545CA333F2),\n reinterpret(0x3FF2000000000000), 0, reinterpret(0xBFBE27076E2B0000), reinterpret(0x3D2A342C2AF0003C),\n reinterpret(0x3FF2000000000000), 0, reinterpret(0xBFBE27076E2B0000), reinterpret(0x3D2A342C2AF0003C),\n reinterpret(0x3FF1E00000000000), 0, reinterpret(0xBFBC5E548F5BC000), reinterpret(0xBD1D0C57585FBE06),\n reinterpret(0x3FF1C00000000000), 0, reinterpret(0xBFBA926D3A4AE000), reinterpret(0x3D253935E85BAAC8),\n reinterpret(0x3FF1C00000000000), 0, reinterpret(0xBFBA926D3A4AE000), reinterpret(0x3D253935E85BAAC8),\n reinterpret(0x3FF1A00000000000), 0, reinterpret(0xBFB8C345D631A000), reinterpret(0x3D137C294D2F5668),\n reinterpret(0x3FF1A00000000000), 0, reinterpret(0xBFB8C345D631A000), reinterpret(0x3D137C294D2F5668),\n reinterpret(0x3FF1800000000000), 0, reinterpret(0xBFB6F0D28AE56000), reinterpret(0xBD269737C93373DA),\n reinterpret(0x3FF1600000000000), 0, reinterpret(0xBFB51B073F062000), reinterpret(0x3D1F025B61C65E57),\n reinterpret(0x3FF1600000000000), 0, reinterpret(0xBFB51B073F062000), reinterpret(0x3D1F025B61C65E57),\n reinterpret(0x3FF1400000000000), 0, reinterpret(0xBFB341D7961BE000), reinterpret(0x3D2C5EDACCF913DF),\n reinterpret(0x3FF1400000000000), 0, reinterpret(0xBFB341D7961BE000), reinterpret(0x3D2C5EDACCF913DF),\n reinterpret(0x3FF1200000000000), 0, reinterpret(0xBFB16536EEA38000), reinterpret(0x3D147C5E768FA309),\n reinterpret(0x3FF1000000000000), 0, reinterpret(0xBFAF0A30C0118000), reinterpret(0x3D2D599E83368E91),\n reinterpret(0x3FF1000000000000), 0, reinterpret(0xBFAF0A30C0118000), reinterpret(0x3D2D599E83368E91),\n reinterpret(0x3FF0E00000000000), 0, reinterpret(0xBFAB42DD71198000), reinterpret(0x3D1C827AE5D6704C),\n reinterpret(0x3FF0E00000000000), 0, reinterpret(0xBFAB42DD71198000), reinterpret(0x3D1C827AE5D6704C),\n reinterpret(0x3FF0C00000000000), 0, reinterpret(0xBFA77458F632C000), reinterpret(0xBD2CFC4634F2A1EE),\n reinterpret(0x3FF0C00000000000), 0, reinterpret(0xBFA77458F632C000), reinterpret(0xBD2CFC4634F2A1EE),\n reinterpret(0x3FF0A00000000000), 0, reinterpret(0xBFA39E87B9FEC000), reinterpret(0x3CF502B7F526FEAA),\n reinterpret(0x3FF0A00000000000), 0, reinterpret(0xBFA39E87B9FEC000), reinterpret(0x3CF502B7F526FEAA),\n reinterpret(0x3FF0800000000000), 0, reinterpret(0xBF9F829B0E780000), reinterpret(0xBD2980267C7E09E4),\n reinterpret(0x3FF0800000000000), 0, reinterpret(0xBF9F829B0E780000), reinterpret(0xBD2980267C7E09E4),\n reinterpret(0x3FF0600000000000), 0, reinterpret(0xBF97B91B07D58000), reinterpret(0xBD288D5493FAA639),\n reinterpret(0x3FF0400000000000), 0, reinterpret(0xBF8FC0A8B0FC0000), reinterpret(0xBCDF1E7CF6D3A69C),\n reinterpret(0x3FF0400000000000), 0, reinterpret(0xBF8FC0A8B0FC0000), reinterpret(0xBCDF1E7CF6D3A69C),\n reinterpret(0x3FF0200000000000), 0, reinterpret(0xBF7FE02A6B100000), reinterpret(0xBD19E23F0DDA40E4),\n reinterpret(0x3FF0200000000000), 0, reinterpret(0xBF7FE02A6B100000), reinterpret(0xBD19E23F0DDA40E4),\n reinterpret(0x3FF0000000000000), 0, 0, 0,\n reinterpret(0x3FF0000000000000), 0, 0, 0,\n reinterpret(0x3FEFC00000000000), 0, reinterpret(0x3F80101575890000), reinterpret(0xBD10C76B999D2BE8),\n reinterpret(0x3FEF800000000000), 0, reinterpret(0x3F90205658938000), reinterpret(0xBD23DC5B06E2F7D2),\n reinterpret(0x3FEF400000000000), 0, reinterpret(0x3F98492528C90000), reinterpret(0xBD2AA0BA325A0C34),\n reinterpret(0x3FEF000000000000), 0, reinterpret(0x3FA0415D89E74000), reinterpret(0x3D0111C05CF1D753),\n reinterpret(0x3FEEC00000000000), 0, reinterpret(0x3FA466AED42E0000), reinterpret(0xBD2C167375BDFD28),\n reinterpret(0x3FEE800000000000), 0, reinterpret(0x3FA894AA149FC000), reinterpret(0xBD197995D05A267D),\n reinterpret(0x3FEE400000000000), 0, reinterpret(0x3FACCB73CDDDC000), reinterpret(0xBD1A68F247D82807),\n reinterpret(0x3FEE200000000000), 0, reinterpret(0x3FAEEA31C006C000), reinterpret(0xBD0E113E4FC93B7B),\n reinterpret(0x3FEDE00000000000), 0, reinterpret(0x3FB1973BD1466000), reinterpret(0xBD25325D560D9E9B),\n reinterpret(0x3FEDA00000000000), 0, reinterpret(0x3FB3BDF5A7D1E000), reinterpret(0x3D2CC85EA5DB4ED7),\n reinterpret(0x3FED600000000000), 0, reinterpret(0x3FB5E95A4D97A000), reinterpret(0xBD2C69063C5D1D1E),\n reinterpret(0x3FED400000000000), 0, reinterpret(0x3FB700D30AEAC000), reinterpret(0x3CEC1E8DA99DED32),\n reinterpret(0x3FED000000000000), 0, reinterpret(0x3FB9335E5D594000), reinterpret(0x3D23115C3ABD47DA),\n reinterpret(0x3FECC00000000000), 0, reinterpret(0x3FBB6AC88DAD6000), reinterpret(0xBD1390802BF768E5),\n reinterpret(0x3FECA00000000000), 0, reinterpret(0x3FBC885801BC4000), reinterpret(0x3D2646D1C65AACD3),\n reinterpret(0x3FEC600000000000), 0, reinterpret(0x3FBEC739830A2000), reinterpret(0xBD2DC068AFE645E0),\n reinterpret(0x3FEC400000000000), 0, reinterpret(0x3FBFE89139DBE000), reinterpret(0xBD2534D64FA10AFD),\n reinterpret(0x3FEC000000000000), 0, reinterpret(0x3FC1178E8227E000), reinterpret(0x3D21EF78CE2D07F2),\n reinterpret(0x3FEBE00000000000), 0, reinterpret(0x3FC1AA2B7E23F000), reinterpret(0x3D2CA78E44389934),\n reinterpret(0x3FEBA00000000000), 0, reinterpret(0x3FC2D1610C868000), reinterpret(0x3D039D6CCB81B4A1),\n reinterpret(0x3FEB800000000000), 0, reinterpret(0x3FC365FCB0159000), reinterpret(0x3CC62FA8234B7289),\n reinterpret(0x3FEB400000000000), 0, reinterpret(0x3FC4913D8333B000), reinterpret(0x3D25837954FDB678),\n reinterpret(0x3FEB200000000000), 0, reinterpret(0x3FC527E5E4A1B000), reinterpret(0x3D2633E8E5697DC7),\n reinterpret(0x3FEAE00000000000), 0, reinterpret(0x3FC6574EBE8C1000), reinterpret(0x3D19CF8B2C3C2E78),\n reinterpret(0x3FEAC00000000000), 0, reinterpret(0x3FC6F0128B757000), reinterpret(0xBD25118DE59C21E1),\n reinterpret(0x3FEAA00000000000), 0, reinterpret(0x3FC7898D85445000), reinterpret(0xBD1C661070914305),\n reinterpret(0x3FEA600000000000), 0, reinterpret(0x3FC8BEAFEB390000), reinterpret(0xBD073D54AAE92CD1),\n reinterpret(0x3FEA400000000000), 0, reinterpret(0x3FC95A5ADCF70000), reinterpret(0x3D07F22858A0FF6F),\n reinterpret(0x3FEA000000000000), 0, reinterpret(0x3FCA93ED3C8AE000), reinterpret(0xBD28724350562169),\n reinterpret(0x3FE9E00000000000), 0, reinterpret(0x3FCB31D8575BD000), reinterpret(0xBD0C358D4EACE1AA),\n reinterpret(0x3FE9C00000000000), 0, reinterpret(0x3FCBD087383BE000), reinterpret(0xBD2D4BC4595412B6),\n reinterpret(0x3FE9A00000000000), 0, reinterpret(0x3FCC6FFBC6F01000), reinterpret(0xBCF1EC72C5962BD2),\n reinterpret(0x3FE9600000000000), 0, reinterpret(0x3FCDB13DB0D49000), reinterpret(0xBD2AFF2AF715B035),\n reinterpret(0x3FE9400000000000), 0, reinterpret(0x3FCE530EFFE71000), reinterpret(0x3CC212276041F430),\n reinterpret(0x3FE9200000000000), 0, reinterpret(0x3FCEF5ADE4DD0000), reinterpret(0xBCCA211565BB8E11),\n reinterpret(0x3FE9000000000000), 0, reinterpret(0x3FCF991C6CB3B000), reinterpret(0x3D1BCBECCA0CDF30),\n reinterpret(0x3FE8C00000000000), 0, reinterpret(0x3FD07138604D5800), reinterpret(0x3CF89CDB16ED4E91),\n reinterpret(0x3FE8A00000000000), 0, reinterpret(0x3FD0C42D67616000), reinterpret(0x3D27188B163CEAE9),\n reinterpret(0x3FE8800000000000), 0, reinterpret(0x3FD1178E8227E800), reinterpret(0xBD2C210E63A5F01C),\n reinterpret(0x3FE8600000000000), 0, reinterpret(0x3FD16B5CCBACF800), reinterpret(0x3D2B9ACDF7A51681),\n reinterpret(0x3FE8400000000000), 0, reinterpret(0x3FD1BF99635A6800), reinterpret(0x3D2CA6ED5147BDB7),\n reinterpret(0x3FE8200000000000), 0, reinterpret(0x3FD214456D0EB800), reinterpret(0x3D0A87DEBA46BAEA),\n reinterpret(0x3FE7E00000000000), 0, reinterpret(0x3FD2BEF07CDC9000), reinterpret(0x3D2A9CFA4A5004F4),\n reinterpret(0x3FE7C00000000000), 0, reinterpret(0x3FD314F1E1D36000), reinterpret(0xBD28E27AD3213CB8),\n reinterpret(0x3FE7A00000000000), 0, reinterpret(0x3FD36B6776BE1000), reinterpret(0x3D116ECDB0F177C8),\n reinterpret(0x3FE7800000000000), 0, reinterpret(0x3FD3C25277333000), reinterpret(0x3D183B54B606BD5C),\n reinterpret(0x3FE7600000000000), 0, reinterpret(0x3FD419B423D5E800), reinterpret(0x3D08E436EC90E09D),\n reinterpret(0x3FE7400000000000), 0, reinterpret(0x3FD4718DC271C800), reinterpret(0xBD2F27CE0967D675),\n reinterpret(0x3FE7200000000000), 0, reinterpret(0x3FD4C9E09E173000), reinterpret(0xBD2E20891B0AD8A4),\n reinterpret(0x3FE7000000000000), 0, reinterpret(0x3FD522AE0738A000), reinterpret(0x3D2EBE708164C759),\n reinterpret(0x3FE6E00000000000), 0, reinterpret(0x3FD57BF753C8D000), reinterpret(0x3D1FADEDEE5D40EF),\n reinterpret(0x3FE6C00000000000), 0, reinterpret(0x3FD5D5BDDF596000), reinterpret(0xBD0A0B2A08A465DC)\n]);\n\n// Returns 0 if not int, 1 if odd int, 2 if even int. The argument is\n// the bit representation of a non-zero finite floating-point value.\n// @ts-ignore: decorator\n@inline\nfunction checkint(iy: u64): i32 {\n var e = iy >> 52 & 0x7FF;\n if (e < 0x3FF ) return 0;\n if (e > 0x3FF + 52) return 2;\n e = u64(1) << (0x3FF + 52 - e);\n if (iy & (e - 1)) return 0;\n if (iy & e ) return 1;\n return 2;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction xflow(sign: u32, y: f64): f64 {\n return select(-y, y, sign) * y;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction uflow(sign: u32): f64 {\n return xflow(sign, reinterpret(0x1000000000000000)); // 0x1p-767\n}\n\n// @ts-ignore: decorator\n@inline\nfunction oflow(sign: u32): f64 {\n return xflow(sign, reinterpret(0x7000000000000000)); // 0x1p769\n}\n\n// Returns 1 if input is the bit representation of 0, infinity or nan.\n// @ts-ignore: decorator\n@inline\nfunction zeroinfnan(u: u64): bool {\n return (u << 1) - 1 >= 0xFFE0000000000000 - 1;\n}\n\n// @ts-ignore: decorator\n@lazy var log_tail: f64 = 0;\n\n// Compute y+TAIL = log(x) where the rounded result is y and TAIL has about\n// additional 15 bits precision. IX is the bit representation of x, but\n// normalized in the subnormal range using the sign bit for the exponent.\n// @ts-ignore: decorator\n@inline\nfunction log_inline(ix: u64): f64 {\n const N = 1 << POW_LOG_TABLE_BITS;\n const N_MASK = N - 1;\n\n const\n Ln2hi = reinterpret(0x3FE62E42FEFA3800),\n Ln2lo = reinterpret(0x3D2EF35793C76730);\n\n const\n A0 = reinterpret(0xBFE0000000000000),\n A1 = reinterpret(0xBFE5555555555560),\n A2 = reinterpret(0x3FE0000000000006),\n A3 = reinterpret(0x3FE999999959554E),\n A4 = reinterpret(0xBFE555555529A47A),\n A5 = reinterpret(0xBFF2495B9B4845E9),\n A6 = reinterpret(0x3FF0002B8B263FC3);\n\n // x = 2^k z; where z is in range [OFF,2*OFF) and exact.\n // The range is split into N subintervals.\n // The ith subinterval contains z and c is near its center.\n var tmp = ix - 0x3fE6955500000000;\n var i = ((tmp >> (52 - POW_LOG_TABLE_BITS)) & N_MASK);\n var k = tmp >> 52;\n var iz = ix - (tmp & u64(0xFFF) << 52);\n var z = reinterpret(iz);\n var kd = k;\n\n // log(x) = k*Ln2 + log(c) + log1p(z/c-1).\n var invc = load(POW_LOG_DATA_TAB + (i << (2 + alignof())), 0 << alignof()); // tab[i].invc\n var logc = load(POW_LOG_DATA_TAB + (i << (2 + alignof())), 2 << alignof()); // tab[i].logc\n var logctail = load(POW_LOG_DATA_TAB + (i << (2 + alignof())), 3 << alignof()); // tab[i].logctail\n\n // Note: 1/c is j/N or j/N/2 where j is an integer in [N,2N) and\n // |z/c - 1| < 1/N, so r = z/c - 1 is exactly representible.\n // Split z such that rhi, rlo and rhi*rhi are exact and |rlo| <= |r|.\n var zhi = reinterpret((iz + u64(0x80000000)) & 0xFFFFFFFF00000000);\n var zlo = z - zhi;\n var rhi = zhi * invc - 1.0;\n var rlo = zlo * invc;\n var r = rhi + rlo;\n\n // k * Ln2 + log(c) + r.\n var t1 = kd * Ln2hi + logc;\n var t2 = t1 + r;\n var lo1 = kd * Ln2lo + logctail;\n var lo2 = t1 - t2 + r;\n\n // Evaluation is optimized assuming superscalar pipelined execution.\n var ar = A0 * r; // A[0] = -0.5\n var ar2 = r * ar;\n var ar3 = r * ar2;\n // k * Ln2 + log(c) + r + A[0] * r * r.\n var arhi = A0 * rhi;\n var arhi2 = rhi * arhi;\n var hi = t2 + arhi2;\n var lo3 = rlo * (ar + arhi);\n var lo4 = t2 - hi + arhi2;\n\n // p = log1p(r) - r - A[0] * r * r.\n var p = ar3 * (A1 + r * A2 + ar2 * (A3 + r * A4 + ar2 * (A5 + r * A6)));\n var lo = lo1 + lo2 + lo3 + lo4 + p;\n var y = hi + lo;\n log_tail = hi - y + lo;\n\n return y;\n}\n\n// @ts-ignore: decorator\n@inline const SIGN_BIAS = 0x800 << EXP_TABLE_BITS;\n\n// Computes sign*exp(x+xtail) where |xtail| < 2^-8/N and |xtail| <= |x|.\n// The sign_bias argument is SIGN_BIAS or 0 and sets the sign to -1 or 1.\n// @ts-ignore: decorator\n@inline\nfunction exp_inline(x: f64, xtail: f64, sign_bias: u32): f64 {\n const N = 1 << EXP_TABLE_BITS;\n const N_MASK = N - 1;\n\n const\n InvLn2N = reinterpret(0x3FF71547652B82FE) * N, // 0x1.71547652b82fep0\n NegLn2hiN = reinterpret(0xBF762E42FEFA0000), // -0x1.62e42fefa0000p-8\n NegLn2loN = reinterpret(0xBD0CF79ABC9E3B3A), // -0x1.cf79abc9e3b3ap-47\n shift = reinterpret(0x4338000000000000); // 0x1.8p52\n\n const\n C2 = reinterpret(0x3FDFFFFFFFFFFDBD), // __exp_data.poly[0] (0x1.ffffffffffdbdp-2)\n C3 = reinterpret(0x3FC555555555543C), // __exp_data.poly[1] (0x1.555555555543cp-3)\n C4 = reinterpret(0x3FA55555CF172B91), // __exp_data.poly[2] (0x1.55555cf172b91p-5)\n C5 = reinterpret(0x3F81111167A4D017); // __exp_data.poly[3] (0x1.1111167a4d017p-7)\n\n var abstop: u32;\n var ki: u64, top: u64, sbits: u64;\n var idx: usize;\n // double_t for better performance on targets with FLT_EVAL_METHOD==2.\n var kd: f64, z: f64, r: f64, r2: f64, scale: f64, tail: f64, tmp: f64;\n\n var ux = reinterpret(x);\n abstop = (ux >> 52) & 0x7FF;\n if (abstop - 0x3C9 >= 0x03F) {\n if (abstop - 0x3C9 >= 0x80000000) {\n // Avoid spurious underflow for tiny x.\n // Note: 0 is common input.\n return select(-1.0, 1.0, sign_bias);\n }\n if (abstop >= 0x409) { // top12(1024.0)\n // Note: inf and nan are already handled.\n return ux >> 63 ? uflow(sign_bias) : oflow(sign_bias);\n }\n // Large x is special cased below.\n abstop = 0;\n }\n\n // exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)].\n // x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N].\n z = InvLn2N * x;\n\n // #if TOINT_INTRINSICS\n // kd = roundtoint(z);\n // ki = converttoint(z);\n // #elif EXP_USE_TOINT_NARROW\n // // z - kd is in [-0.5-2^-16, 0.5] in all rounding modes.\n // kd = eval_as_double(z + shift);\n // ki = asuint64(kd) >> 16;\n // kd = (double_t)(int32_t)ki;\n // #else\n // z - kd is in [-1, 1] in non-nearest rounding modes\n kd = z + shift;\n ki = reinterpret(kd);\n kd -= shift;\n // #endif\n r = x + kd * NegLn2hiN + kd * NegLn2loN;\n // The code assumes 2^-200 < |xtail| < 2^-8/N\n r += xtail;\n // 2^(k/N) ~= scale * (1 + tail)\n idx = ((ki & N_MASK) << 1);\n top = (ki + sign_bias) << (52 - EXP_TABLE_BITS);\n\n tail = reinterpret(load(EXP_DATA_TAB + (idx << alignof())));\n // This is only a valid scale when -1023*N < k < 1024*N\n sbits = load(EXP_DATA_TAB + (idx << alignof()), 1 << alignof()) + top;\n // exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1).\n // Evaluation is optimized assuming superscalar pipelined execution.\n r2 = r * r;\n // Without fma the worst case error is 0.25/N ulp larger.\n // Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp\n tmp = tail + r + r2 * (C2 + r * C3) + r2 * r2 * (C4 + r * C5);\n if (abstop == 0) return specialcase(tmp, sbits, ki);\n scale = reinterpret(sbits);\n // Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there\n // is no spurious underflow here even without fma.\n return scale + scale * tmp;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function pow_lut(x: f64, y: f64): f64 {\n const Ox1p52 = reinterpret(0x4330000000000000); // 0x1p52\n\n var sign_bias: u32 = 0;\n var ix = reinterpret(x);\n var iy = reinterpret(y);\n var topx = ix >> 52;\n var topy = iy >> 52;\n\n if (topx - 0x001 >= 0x7FF - 0x001 || (topy & 0x7FF) - 0x3BE >= 0x43e - 0x3BE) {\n // Note: if |y| > 1075 * ln2 * 2^53 ~= 0x1.749p62 then pow(x,y) = inf/0\n // and if |y| < 2^-54 / 1075 ~= 0x1.e7b6p-65 then pow(x,y) = +-1.\n // Special cases: (x < 0x1p-126 or inf or nan) or\n // (|y| < 0x1p-65 or |y| >= 0x1p63 or nan).\n if (zeroinfnan(iy)) {\n if ((iy << 1) == 0) return 1.0;\n if (ix == 0x3FF0000000000000) return NaN; // original: 1.0\n if ((ix << 1) > 0xFFE0000000000000 || (iy << 1) > 0xFFE0000000000000) return x + y;\n if ((ix << 1) == 0x7FE0000000000000) return NaN; // original: 1.0\n if (((ix << 1) < 0x7FE0000000000000) == !(iy >> 63)) return 0; // |x|<1 && y==inf or |x|>1 && y==-inf.\n return y * y;\n }\n if (zeroinfnan(ix)) {\n let x2 = x * x;\n if (i32(ix >> 63) && checkint(iy) == 1) x2 = -x2;\n return iy >> 63 ? 1 / x2 : x2;\n }\n // Here x and y are non-zero finite\n if (ix >> 63) {\n // Finite x < 0\n let yint = checkint(iy);\n if (yint == 0) return (x - x) / (x - x);\n if (yint == 1) sign_bias = SIGN_BIAS;\n ix &= 0x7FFFFFFFFFFFFFFF;\n topx &= 0x7FF;\n }\n if ((topy & 0x7FF) - 0x3BE >= 0x43E - 0x3BE) {\n // Note: sign_bias == 0 here because y is not odd.\n if (ix == 0x3FF0000000000000) return 1;\n if ((topy & 0x7FF) < 0x3BE) return 1; // |y| < 2^-65, x^y ~= 1 + y*log(x).\n return (ix > 0x3FF0000000000000) == (topy < 0x800) ? Infinity : 0;\n }\n if (topx == 0) {\n // Normalize subnormal x so exponent becomes negative.\n ix = reinterpret(x * Ox1p52);\n ix &= 0x7FFFFFFFFFFFFFFF;\n ix -= u64(52) << 52;\n }\n }\n\n var hi = log_inline(ix);\n var lo = log_tail;\n var ehi: f64, elo: f64;\n // #if __FP_FAST_FMA\n // ehi = y * hi;\n // elo = y * lo + __builtin_fma(y, hi, -ehi);\n // #else\n var yhi = reinterpret(iy & 0xFFFFFFFFF8000000);\n var ylo = y - yhi;\n var lhi = reinterpret(reinterpret(hi) & 0xFFFFFFFFF8000000);\n var llo = hi - lhi + lo;\n ehi = yhi * lhi;\n elo = ylo * lhi + y * llo; // |elo| < |ehi| * 2^-25.\n // #endif\n return exp_inline(ehi, elo, sign_bias);\n}\n","import { itoa32, utoa32, itoa64, utoa64, dtoa, itoa_buffered, dtoa_buffered, MAX_DOUBLE_LENGTH } from \"./number\";\nimport { ipow32 } from \"../math\";\n\n// All tables are stored as two staged lookup tables (static tries)\n// because the full range of Unicode symbols can't be efficiently\n// represented as-is in memory (see Unicode spec ch 5, p.196):\n// https://www.unicode.org/versions/Unicode12.0.0/ch05.pdf\n// Tables have been generated using these forked musl tools:\n// https://github.com/MaxGraey/musl-chartable-tools/tree/case-ignorable\n\n// Lookup table to check if a character is alphanumeric or not\n// See: https://git.musl-libc.org/cgit/musl/tree/src/ctype/alpha.h\n// size: 3904 bytes\n// @ts-ignore\n@inline @lazy const ALPHA_TABLE = memory.data([\n 18,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,17,34,35,36,17,37,38,39,40,\n 41,42,43,44,17,45,46,47,16,16,48,16,16,16,16,16,16,16,49,50,51,16,52,53,16,16,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,54,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,55,17,17,17,17,56,17,57,58,59,60,61,62,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,63,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,64,65,17,66,67,\n 68,69,70,71,72,73,74,17,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,\n 93,94,16,95,96,97,98,17,17,17,99,100,101,16,16,16,16,16,16,16,16,16,16,17,17,\n 17,17,102,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,103,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,17,17,104,105,16,16,106,107,17,17,17,17,17,17,17,17,17,17,17,17,17,\n 17,17,17,17,17,17,17,17,17,17,108,17,17,17,17,109,110,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 17,111,112,16,16,16,16,16,16,16,16,16,113,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,114,115,116,117,16,16,16,16,16,16,16,16,118,\n 119,120,16,16,16,16,16,121,122,16,16,16,16,123,16,16,124,16,16,16,16,16,16,16,\n 16,16,125,16,16,16,\n 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,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,254,255,255,7,254,\n 255,255,7,0,0,0,0,0,4,32,4,255,255,127,255,255,255,127,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,195,255,3,0,31,80,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,223,188,64,215,255,255,\n 251,255,255,255,255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,3,252,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,254,255,255,255,127,2,255,255,255,\n 255,255,1,0,0,0,0,255,191,182,0,255,255,255,135,7,0,0,0,255,7,255,255,255,255,\n 255,255,255,254,255,195,255,255,255,255,255,255,255,255,255,255,255,255,239,\n 31,254,225,255,\n 159,0,0,255,255,255,255,255,255,0,224,255,255,255,255,255,255,255,255,255,255,\n 255,255,3,0,255,255,255,255,255,7,48,4,255,255,255,252,255,31,0,0,255,255,255,\n 1,255,7,0,0,0,0,0,0,255,255,223,255,255,0,240,255,248,3,255,255,255,255,255,\n 255,255,255,255,239,255,223,225,255,207,255,254,255,239,159,249,255,255,253,\n 197,227,159,89,128,176,207,255,3,16,238,135,249,255,255,253,109,195,135,25,2,\n 94,192,255,63,0,238,191,251,255,255,253,237,227,191,27,1,0,207,255,0,30,238,\n 159,249,255,255,253,237,227,159,25,192,176,207,255,2,0,236,199,61,214,24,199,\n 255,195,199,29,129,0,192,255,0,0,239,223,253,255,255,253,255,227,223,29,96,7,\n 207,255,0,0,239,223,253,255,255,253,239,227,223,29,96,64,207,255,6,0,255,223,\n 253,255,255,255,255,231,223,93,240,128,207,255,0,252,238,255,127,252,255,255,\n 251,47,127,128,95,255,192,255,12,0,254,255,255,255,255,127,255,7,63,32,255,3,\n 0,0,0,0,214,247,255,255,175,255,255,59,95,32,255,243,0,0,0,\n 0,1,0,0,0,255,3,0,0,255,254,255,255,255,31,254,255,3,255,255,254,255,255,255,\n 31,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,249,255,3,255,255,255,255,255,\n 255,255,255,255,63,255,255,255,255,191,32,255,255,255,255,255,247,255,255,255,\n 255,255,255,255,255,255,61,127,61,255,255,255,255,255,61,255,255,255,255,61,\n 127,61,255,127,255,255,255,255,255,255,255,61,255,255,255,255,255,255,255,255,\n 7,0,0,0,0,255,255,0,0,255,255,255,255,255,255,255,255,255,255,63,63,254,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,159,255,255,254,255,255,7,255,255,255,255,255,255,255,255,\n 255,199,255,1,255,223,15,0,255,255,15,0,255,255,15,0,255,223,13,0,255,255,255,\n 255,255,255,207,255,255,1,128,16,255,3,0,0,0,0,255,3,255,255,255,255,255,255,\n 255,255,255,255,255,1,255,255,255,255,255,7,255,255,255,255,255,255,255,255,\n 63,\n 0,255,255,255,127,255,15,255,1,192,255,255,255,255,63,31,0,255,255,255,255,\n 255,15,255,255,255,3,255,3,0,0,0,0,255,255,255,15,255,255,255,255,255,255,255,\n 127,254,255,31,0,255,3,255,3,128,0,0,128,1,0,0,0,0,0,0,0,255,255,255,255,255,\n 255,239,255,239,15,255,3,0,0,0,0,255,255,255,255,255,243,255,255,255,255,255,\n 255,191,255,3,0,255,255,255,255,255,255,127,0,255,227,255,255,255,255,255,63,\n 255,1,255,255,255,255,255,231,0,0,0,0,0,222,111,4,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,\n 128,255,31,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,255,\n 255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,132,252,47,62,80,189,255,243,\n 224,67,0,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,\n 0,255,255,255,255,255,127,255,255,255,255,255,127,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,31,120,12,0,255,255,255,255,191,32,255,\n 255,255,255,255,255,255,128,0,0,255,255,127,0,127,127,127,127,127,127,127,127,\n 255,255,255,255,0,0,0,0,0,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,\n 0,0,224,0,0,0,254,3,62,31,254,255,255,255,255,255,255,255,255,255,127,224,254,\n 255,255,255,255,255,255,255,255,255,255,247,224,255,255,255,255,255,254,255,\n 255,255,255,255,255,255,255,255,255,127,0,0,255,255,255,255,0,0,0,0,0,0,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,\n 31,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,\n 0,0,0,0,0,0,255,255,255,255,255,63,255,31,255,255,255,15,0,0,255,255,255,255,\n 255,127,240,143,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,\n 0,128,255,252,255,255,255,255,255,255,255,255,255,255,255,255,249,255,255,255,\n 255,255,255,252,7,0,0,0,0,224,255,191,255,255,255,255,0,0,0,255,255,255,255,\n 255,255,15,0,255,255,255,255,255,255,255,255,47,0,255,3,0,0,252,232,255,255,\n 255,255,255,7,255,255,255,255,7,0,255,255,255,31,255,255,255,255,255,255,247,\n 255,0,128,255,3,255,255,255,127,255,255,255,255,255,255,127,0,255,63,255,3,\n 255,255,127,252,255,255,255,255,255,255,255,127,5,0,0,56,255,255,60,0,126,126,\n 126,0,127,127,255,255,255,255,255,247,255,3,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,7,255,3,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,15,0,255,255,127,248,255,255,255,255,\n 255,\n 15,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,3,0,0,0,0,127,0,248,224,255,253,127,95,219,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,248,255,255,255,\n 255,255,255,255,255,255,255,255,255,63,0,0,255,255,255,255,255,255,255,255,\n 252,255,255,255,255,255,255,0,0,0,0,0,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,223,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,255,3,\n 254,255,255,7,254,255,255,7,192,255,255,255,255,255,255,255,255,255,255,127,\n 252,252,252,28,0,0,0,0,255,239,255,255,127,255,255,183,255,63,255,63,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,31,255,255,255,255,255,255,1,0,0,0,0,\n 0,255,255,255,255,0,224,255,255,255,7,255,255,255,255,255,7,255,255,255,63,\n 255,255,255,255,15,255,62,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,63,255,3,255,255,255,255,15,255,255,255,\n 255,15,255,255,255,255,255,0,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,0,255,255,63,0,255,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,63,253,255,255,255,255,191,145,255,255,63,0,255,255,\n 127,0,255,255,255,127,0,0,0,0,0,0,0,0,255,255,55,0,255,255,63,0,255,255,255,3,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,192,0,0,0,0,0,0,0,0,111,240,239,\n 254,255,255,63,0,0,0,0,0,255,255,255,31,255,255,255,31,0,0,0,0,255,254,255,\n 255,31,0,0,0,255,255,255,255,255,255,63,0,255,255,63,0,255,255,7,0,255,255,3,\n 0,0,0,0,0,0,0,0,0,0,0,0,\n 0,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,255,255,255,255,255,255,7,\n 0,255,255,255,255,255,255,7,0,255,255,255,255,255,0,255,3,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,\n 255,27,3,0,0,0,0,0,0,0,0,0,255,255,255,31,128,0,255,255,63,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,255,255,31,0,0,0,255,255,127,0,255,255,255,255,255,255,255,255,63,0,0,\n 0,192,255,0,0,252,255,255,255,255,255,255,1,0,0,255,255,255,1,255,3,255,255,\n 255,255,255,255,199,255,240,0,255,255,255,255,71,0,255,255,255,255,255,255,\n 255,255,30,192,255,23,0,0,0,0,255,255,251,255,255,255,159,64,0,0,0,0,0,0,0,0,\n 127,189,255,191,255,1,255,255,255,255,255,255,255,1,255,3,239,159,249,255,255,\n 253,237,227,159,25,129,224,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,255,255,255,255,255,255,255,255,187,7,255,131,3,0,0,0,255,255,255,255,255,\n 255,255,255,179,0,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,\n 255,255,255,63,127,0,0,0,63,0,0,0,0,255,255,255,255,255,255,255,127,17,0,255,\n 3,0,0,0,0,255,255,255,255,255,255,63,1,255,3,0,0,0,0,0,0,255,255,255,231,255,\n 7,255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,\n 255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,3,0,128,\n 127,242,111,255,255,255,191,153,7,0,255,3,0,0,0,0,0,0,0,0,255,252,255,255,255,\n 255,255,252,26,0,0,0,255,255,255,255,255,255,231,127,0,0,255,255,255,255,255,\n 255,255,255,255,32,0,0,0,0,255,255,255,255,255,255,255,1,255,253,255,255,255,\n 255,127,127,1,0,255,3,0,0,252,255,255,255,252,255,255,254,127,0,0,0,0,0,0,0,0,\n 0,127,251,255,255,255,255,127,180,203,0,255,3,191,253,255,255,255,127,123,1,\n 255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,\n 0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,3,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,127,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,255,255,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,\n 0,255,255,255,255,255,255,255,1,255,255,255,127,255,3,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,63,0,0,255,255,255,255,255,255,0,0,15,0,255,3,248,255,255,224,255,\n 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,\n 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,135,\n 255,255,255,255,255,255,255,128,255,255,0,0,0,0,0,0,0,0,11,0,3,0,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,0,\n 255,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,255,255,255,\n 127,0,0,0,0,0,0,7,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,7,255,31,255,1,255,67,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,255,255,255,\n 223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,\n 255,123,95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,63,255,255,255,253,255,255,247,255,255,255,\n 247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,255,253,\n 255,255,255,253,255,255,247,207,255,255,255,255,255,255,127,255,255,249,219,7,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,31,\n 128,63,255,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,15,255,\n 3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,31,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,143,8,\n 255,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239,255,255,255,150,254,247,10,\n 132,234,150,170,150,247,247,94,255,251,255,15,238,251,255,15,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,255,255,255,3,255,255,255,3,255,255,255,3,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,3\n]);\n\n// size: 1568 bytes (compressed to ~1380 bytes after binaryen)\n// @ts-ignore: decorator\n@lazy @inline const CASED = memory.data([\n 18,19,20,21,22,23,16,16,16,16,16,16,16,16,16,16,\n 24,16,16,25,16,16,16,16,16,16,16,16,26,27,17,28,\n 29,30,16,16,31,16,16,16,16,16,16,16,32,33,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,34,35,16,16,16,36,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,37,16,16,16,38,\n 16,16,16,16,39,16,16,16,16,16,16,16,40,16,16,16,\n 16,16,16,16,16,16,16,16,41,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,42,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,43,44,45,46,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,47,16,16,16,16,16,16,\n 16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,0,0,0,0,254,255,255,7,254,255,255,7,0,0,0,0,0,4,32,4,\n 255,255,127,255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,247,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,239,255,255,255,255,1,3,0,0,0,31,0,0,0,\n 0,0,0,0,0,0,0,0,32,0,0,0,0,0,207,188,64,215,255,255,251,255,255,255,\n 255,255,255,255,255,255,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 3,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,\n 255,255,127,0,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,\n 191,32,255,255,255,255,255,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,255,255,255,255,255,255,255,255,255,255,63,63,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,1,255,255,255,255,255,231,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,0,0,0,0,255,255,63,63,255,255,255,255,63,63,255,170,255,255,255,63,\n 255,255,255,255,255,255,223,95,220,31,207,15,255,31,220,31,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,2,128,0,0,255,31,0,0,0,0,0,0,0,0,0,0,0,0,\n 132,252,47,62,80,189,31,242,224,67,0,0,255,255,255,255,24,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,192,255,255,255,255,255,255,3,0,0,255,255,255,255,255,127,255,255,\n 255,255,255,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,120,12,0,\n 255,255,255,255,191,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,63,0,0,\n 255,255,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,255,255,255,\n 255,255,255,255,255,255,255,255,255,120,255,255,255,255,255,255,252,7,0,0,0,0,96,7,\n 0,0,0,0,0,0,255,255,255,255,255,247,255,1,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,0,0,0,0,127,0,248,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,7,\n 254,255,255,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,\n 255,255,15,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,7,0,255,255,255,255,255,255,7,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,223,255,255,255,255,255,\n 255,255,255,223,100,222,255,235,239,255,255,255,255,255,255,255,191,231,223,223,255,255,255,123,\n 95,252,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,255,255,255,\n 253,255,255,247,255,255,255,247,255,255,223,255,255,255,223,255,255,127,255,255,255,127,255,255,\n 255,253,255,255,255,253,255,255,247,15,0,0,0,0,0,0,255,255,255,255,255,255,255,255,\n 15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,255,255,255,3,255,255,255,3,255,255,255,3,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0\n]);\n\n// size: 2976 bytes (compressed to ~2050 bytes after binaryen)\n// @ts-ignore: decorator\n@lazy @inline const CASE_IGNORABLES = memory.data([\n 18,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,\n 33,16,16,34,16,16,16,35,36,37,38,39,40,41,16,42,\n 43,16,16,16,16,16,16,16,16,16,16,16,44,45,46,16,\n 47,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 48,16,16,16,49,16,50,51,52,53,54,55,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,56,16,16,57,58,\n 16,59,60,61,16,16,16,16,16,16,62,16,16,63,64,65,\n 66,67,68,69,70,71,72,73,74,75,76,16,77,78,79,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,80,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,81,82,16,16,16,83,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,84,16,16,16,\n 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,\n 16,85,86,16,16,16,16,16,16,16,87,16,16,16,16,16,\n 88,89,90,16,16,16,16,16,91,92,16,16,16,16,16,16,\n 16,16,16,93,16,16,16,16,16,16,16,16,16,16,16,16,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 0,0,0,0,128,64,0,4,0,0,0,64,1,0,0,0,0,0,0,0,0,161,144,1,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,\n 255,255,255,255,255,255,48,4,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,3,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130,0,0,0,0,\n 0,0,254,255,255,255,255,191,182,0,0,0,0,0,16,0,63,0,255,23,0,0,0,0,\n 1,248,255,255,0,0,1,0,0,0,0,0,0,0,0,0,0,0,192,191,255,61,0,0,\n 0,128,2,0,0,0,255,255,255,7,0,0,0,0,0,0,0,0,0,0,192,255,1,0,\n 0,0,0,0,0,248,63,36,0,0,192,255,255,63,0,0,0,0,0,14,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,255,7,0,0,0,0,0,0,20,\n 254,33,254,0,12,0,2,0,2,0,0,0,0,0,0,16,30,32,0,0,12,0,0,64,\n 6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,\n 190,33,0,0,12,0,0,252,2,0,0,0,0,0,0,144,30,32,96,0,12,0,0,0,\n 4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,17,0,0,0,0,0,0,192,\n 193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,\n 3,0,0,0,0,0,0,24,30,32,0,0,12,0,0,0,2,0,0,0,0,0,0,0,\n 0,4,92,0,0,0,0,0,0,0,0,0,0,0,242,7,192,127,0,0,0,0,0,0,\n 0,0,0,0,0,0,242,31,64,63,0,0,0,0,0,0,0,0,0,3,0,0,160,2,\n 0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,\n 0,0,0,0,0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,\n 0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,28,0,\n 0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,143,32,0,0,0,0,\n 0,120,0,0,0,0,0,0,8,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,9,0,0,0,0,\n 0,0,64,127,229,31,248,159,0,0,0,0,128,0,255,255,1,0,0,0,0,0,0,0,\n 15,0,0,0,0,0,208,23,4,0,0,0,0,248,15,0,3,0,0,0,60,59,0,0,\n 0,0,0,0,64,163,3,0,0,0,0,0,0,240,207,0,0,0,0,0,0,0,0,63,\n 0,0,0,0,0,0,0,0,0,0,247,255,253,33,16,3,0,0,0,0,0,240,255,255,\n 255,255,255,255,255,7,0,1,0,0,0,248,255,255,255,255,255,255,255,255,255,255,255,251,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,\n 3,224,0,224,0,224,0,96,0,248,0,3,144,124,0,0,0,0,0,0,223,255,2,128,\n 0,0,255,31,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,128,0,0,0,0,0,0,0,0,\n 0,0,0,0,255,255,255,255,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,60,62,8,\n 0,0,0,0,0,0,0,0,0,0,0,126,0,0,0,0,0,0,0,0,0,0,0,112,\n 0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,16,0,0,0,0,0,0,\n 0,0,0,0,0,128,247,191,0,0,0,240,0,0,0,0,0,0,0,0,0,0,3,0,\n 255,255,255,255,3,0,0,0,0,0,0,0,0,0,1,0,0,7,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,3,68,8,0,0,96,16,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,\n 128,255,3,0,0,0,0,0,7,0,0,0,0,0,200,51,0,128,0,0,96,0,0,0,\n 0,0,0,0,0,126,102,0,8,16,0,0,0,0,1,16,0,0,0,0,0,0,157,193,\n 2,0,0,32,0,48,88,0,0,0,0,0,0,0,0,0,0,0,0,248,0,14,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,64,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,255,3,0,0,0,0,0,0,0,\n 255,255,8,0,255,255,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,128,128,64,0,4,0,0,0,64,1,0,0,0,0,0,1,0,\n 0,0,0,192,0,0,0,0,0,0,0,0,8,0,0,14,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,240,0,0,0,0,0,135,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,\n 0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 192,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 2,0,0,0,0,0,0,255,127,0,0,0,0,0,0,128,3,0,0,0,0,0,120,38,\n 0,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0,0,0,0,0,0,0,8,0,\n 3,0,0,0,0,0,192,127,0,158,0,0,0,0,0,0,0,0,0,0,0,128,211,64,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,\n 3,0,0,0,0,0,0,24,1,0,0,0,192,31,31,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,\n 0,0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,176,1,0,0,48,0,0,0,0,\n 0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,\n 0,0,0,0,0,0,0,0,0,0,0,224,188,15,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,6,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,88,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0,126,14,0,0,0,0,\n 0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,\n 0,0,0,0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,163,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,255,1,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,15,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,128,0,0,0,0,0,0,0,128,255,255,0,0,0,0,0,0,0,0,27,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,\n 231,15,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,\n 0,0,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,63,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 240,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,248\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const LOWER127 = memory.data([\n 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,\n 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,\n 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,\n 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,\n 64,\n 97,98,99,100,101,102,103,104,105,106,107,108,109,\n 110,111,112,113,114,115,116,117,118,119,120,121,122,\n 91,92,93,94,95,96,\n 97,98,99,100,101,102,103,104,105,106,107,108,109,\n 110,111,112,113,114,115,116,117,118,119,120,121,122,\n 123,124,125,126,127\n]);\n\n// @ts-ignore: decorator\n@lazy @inline const UPPER127 = memory.data([\n 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,\n 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,\n 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,\n 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,\n 64,\n 65,66,67,68,69,70,71,72,73,74,75,76,77,\n 78,79,80,81,82,83,84,85,86,87,88,89,90,\n 91,92,93,94,95,96,\n 65,66,67,68,69,70,71,72,73,74,75,76,77,\n 78,79,80,81,82,83,84,85,86,87,88,89,90,\n 123,124,125,126,127\n]);\n\n// 23 * 8 = 184 bytes\n// @ts-ignore: decorator\n@lazy @inline const POWERS10 = memory.data([\n 1e00, 1e01, 1e02, 1e03, 1e04, 1e05, 1e06, 1e07, 1e08, 1e09,\n 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,\n 1e20, 1e21, 1e22\n]);\n\n// @ts-ignore: decorator\n@inline\nexport const enum CharCode {\n PERCENT = 0x25,\n PLUS = 0x2B,\n MINUS = 0x2D,\n DOT = 0x2E,\n _0 = 0x30,\n _1 = 0x31,\n _2 = 0x32,\n _3 = 0x33,\n _4 = 0x34,\n _5 = 0x35,\n _6 = 0x36,\n _7 = 0x37,\n _8 = 0x38,\n _9 = 0x39,\n A = 0x41,\n B = 0x42,\n E = 0x45,\n I = 0x49,\n N = 0x4E,\n O = 0x4F,\n X = 0x58,\n Z = 0x5A,\n a = 0x61,\n b = 0x62,\n e = 0x65,\n n = 0x6E,\n o = 0x6F,\n u = 0x75,\n x = 0x78,\n z = 0x7A\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isAscii(c: u32): bool {\n return !(c >> 7);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isLower8(c: u32): bool {\n return c - CharCode.a < 26;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isUpper8(c: u32): bool {\n return c - CharCode.A < 26;\n}\n\nexport function isSpace(c: u32): bool {\n if (c < 0x1680) { // < (1)\n // , , , , , and \n // (c == 0x20 || c == 0xA0) was optimized to (c | 0x80) == 0xA0\n // @ts-ignore: cast\n return ((c | 0x80) == 0xA0) | (c - 0x09 <= 0x0D - 0x09);\n }\n if (c - 0x2000 <= 0x200A - 0x2000) return true;\n switch (c) {\n case 0x1680: // (1)\n case 0x2028: // (2)\n case 0x2029: // \n case 0x202F: // \n case 0x205F: // \n case 0x3000: // \n case 0xFEFF: return true; // \n }\n return false;\n}\n\nexport function isAlpha(c: u32): bool {\n if (isAscii(c)) return (c | 32) - CharCode.a < 26;\n if (c < 0x20000) {\n // @ts-ignore: cast\n return stagedBinaryLookup(ALPHA_TABLE, c);\n }\n return c < 0x2FFFE;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isCased(c: u32): bool {\n // @ts-ignore: cast\n return c < 0x1F18A && stagedBinaryLookup(CASED, c);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isCaseIgnorable(c: u32): bool {\n // @ts-ignore: cast\n return c < 0xE01F0 && stagedBinaryLookup(CASE_IGNORABLES, c);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function isFinalSigma(buffer: usize, index: isize, len: isize): bool {\n const lookaheadLimit = 30; // max lookahead limit\n var found = false;\n var pos = index;\n var minPos = max(0, pos - lookaheadLimit);\n while (pos > minPos) {\n let c = codePointBefore(buffer, pos);\n if (!isCaseIgnorable(c)) {\n if (isCased(c)) {\n found = true;\n } else {\n return false;\n }\n }\n pos -= isize(c >= 0x10000) + 1;\n }\n if (!found) return false;\n pos = index + 1;\n var maxPos = min(pos + lookaheadLimit, len);\n while (pos < maxPos) {\n let c = load(buffer + (pos << 1));\n if (u32((c & 0xFC00) == 0xD800) & u32(pos + 1 != len)) {\n let c1 = load(buffer + (pos << 1), 2);\n if ((c1 & 0xFC00) == 0xDC00) {\n c = (c - 0xD800 << 10) + (c1 - 0xDC00) + 0x10000;\n }\n }\n if (!isCaseIgnorable(c)) {\n return !isCased(c);\n }\n pos += isize(c >= 0x10000) + 1;\n }\n return true;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction codePointBefore(buffer: usize, index: isize): i32 {\n if (index <= 0) return -1;\n var c = load(buffer + (index - 1 << 1));\n if (u32((c & 0xFC00) == 0xDC00) & u32(index - 2 >= 0)) {\n let c1 = load(buffer + (index - 2 << 1));\n if ((c1 & 0xFC00) == 0xD800) {\n return ((c1 & 0x3FF) << 10) + (c & 0x3FF) + 0x10000;\n }\n }\n return (c & 0xF800) == 0xD800 ? 0xFFFD : c;\n}\n\n// Search routine for two-staged lookup tables\nfunction stagedBinaryLookup(table: usize, c: u32): bool {\n return ((load(table + (load(table + (c >>> 8)) << 5) + ((c & 255) >> 3)) >>> (c & 7)) & 1);\n}\n\nexport function compareImpl(str1: string, index1: usize, str2: string, index2: usize, len: usize): i32 {\n var ptr1 = changetype(str1) + (index1 << 1);\n var ptr2 = changetype(str2) + (index2 << 1);\n if (ASC_SHRINK_LEVEL < 2) {\n if (len >= 4 && !((ptr1 & 7) | (ptr2 & 7))) {\n do {\n if (load(ptr1) != load(ptr2)) break;\n ptr1 += 8;\n ptr2 += 8;\n len -= 4;\n } while (len >= 4);\n }\n }\n while (len--) {\n let a = load(ptr1);\n let b = load(ptr2);\n if (a != b) return a - b;\n ptr1 += 2;\n ptr2 += 2;\n }\n return 0;\n}\n\n// @ts-ignore: decorator\n@inline\nexport function toLower8(c: u32): u32 {\n if (ASC_SHRINK_LEVEL > 0) {\n return c | u32(isUpper8(c)) << 5;\n } else {\n return load(LOWER127 + c);\n }\n}\n\n// @ts-ignore: decorator\n@inline\nexport function toUpper8(c: u32): u32 {\n if (ASC_SHRINK_LEVEL > 0) {\n return c & ~(u32(isLower8(c)) << 5);\n } else {\n return load(UPPER127 + c);\n }\n}\n\n/** Parses a string to an integer (usually), using the specified radix. */\nexport function strtol(str: string, radix: i32 = 0): T {\n var len = str.length;\n if (!len) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n\n var ptr = changetype(str) /* + HEAD -> offset */;\n var code = load(ptr);\n\n // trim white spaces\n while (isSpace(code)) {\n code = load(ptr += 2);\n --len;\n }\n // determine sign\n // @ts-ignore\n var sign: T = 1;\n if (code == CharCode.MINUS || code == CharCode.PLUS) {\n if (!--len) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n if (code == CharCode.MINUS) {\n // @ts-ignore: type\n sign = -1;\n }\n code = load(ptr += 2);\n }\n\n // See https://tc39.es/ecma262/#sec-parseint-string-radix\n if (radix) {\n if (radix < 2 || radix > 36) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n // handle case as parseInt(\"0xFF\", 16) by spec\n if (radix == 16) {\n if (\n len > 2 &&\n code == CharCode._0 &&\n (load(ptr, 2) | 32) == CharCode.x\n ) {\n ptr += 4; len -= 2;\n }\n }\n } else {\n // determine radix by literal prefix\n if (code == CharCode._0 && len > 2) {\n switch (load(ptr, 2) | 32) {\n case CharCode.b: {\n ptr += 4; len -= 2;\n radix = 2;\n break;\n }\n case CharCode.o: {\n ptr += 4; len -= 2;\n radix = 8;\n break;\n }\n case CharCode.x: {\n ptr += 4; len -= 2;\n radix = 16;\n break;\n }\n }\n }\n if (!radix) radix = 10;\n }\n\n // calculate value\n // @ts-ignore: type\n var num: T = 0;\n while (len--) {\n code = load(ptr);\n if (code - CharCode._0 < 10) {\n code -= CharCode._0;\n } else if (code - CharCode.A <= (CharCode.Z - CharCode.A)) {\n code -= CharCode.A - 10;\n } else if (code - CharCode.a <= (CharCode.z - CharCode.a)) {\n code -= CharCode.a - 10;\n }\n if (code >= radix) {\n if (!num) {\n if (isFloat()) {\n // @ts-ignore: cast\n return NaN;\n } else {\n // @ts-ignore: cast\n return 0;\n }\n }\n break;\n }\n // @ts-ignore: type\n num = num * radix + code;\n ptr += 2;\n }\n // @ts-ignore: type\n return sign * num;\n}\n\nexport function strtod(str: string): f64 {\n var len = str.length;\n if (!len) return NaN;\n\n var ptr = changetype(str);\n var code = load(ptr);\n\n var sign = 1.0;\n // skip white spaces\n while (len && isSpace(code)) {\n code = load(ptr += 2);\n --len;\n }\n if (!len) return NaN;\n\n // try parse '-' or '+'\n if (code == CharCode.MINUS) {\n if (!--len) return NaN;\n code = load(ptr += 2);\n sign = -1;\n } else if (code == CharCode.PLUS) {\n if (!--len) return NaN;\n code = load(ptr += 2);\n }\n\n // try parse Infinity\n if (len >= 8 && code == CharCode.I) {\n if (\n load(ptr, 0) == 0x690066006E0049 && // ifnI\n load(ptr, 8) == 0x7900740069006E // ytin\n ) {\n return Infinity * sign;\n }\n return NaN;\n }\n // validate next symbol\n if (code != CharCode.DOT && (code - CharCode._0) >= 10) {\n return NaN;\n }\n var savedPtr = ptr;\n // skip zeros\n while (code == CharCode._0) {\n code = load(ptr += 2);\n --len;\n }\n if (len <= 0) return 0;\n const capacity = 19; // int(64 * 0.3010)\n var pointed = false;\n var consumed = 0;\n var position = 0;\n var x: u64 = 0;\n if (code == CharCode.DOT) {\n let noDigits = !(savedPtr - ptr);\n ptr += 2; --len;\n if (!len && noDigits) return NaN;\n for (pointed = true; (code = load(ptr)) == CharCode._0; --position, ptr += 2) --len;\n if (len <= 0) return 0;\n if (!position && noDigits && code - CharCode._0 >= 10) return NaN;\n }\n for (let digit = code - CharCode._0; digit < 10 || (code == CharCode.DOT && !pointed); digit = code - CharCode._0) {\n if (digit < 10) {\n x = consumed < capacity ? 10 * x + digit : x | u64(!!digit);\n ++consumed;\n } else {\n position = consumed;\n pointed = true;\n }\n if (!--len) break;\n code = load(ptr += 2);\n }\n\n if (!pointed) position = consumed;\n return copysign(scientific(x, position - min(capacity, consumed) + parseExp(ptr, len)), sign);\n}\n\nexport function joinBooleanArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) return select(\"true\", \"false\", load(dataStart));\n\n var sepLen = separator.length;\n var valueLen = 5; // max possible length of element len(\"false\")\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__new(estLen << 1, idof()));\n var offset = 0;\n var value: bool;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + i);\n valueLen = 4 + i32(!value);\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(select(\"true\", \"false\", value)),\n valueLen << 1\n );\n offset += valueLen;\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + lastIndex);\n valueLen = 4 + i32(!value);\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(select(\"true\", \"false\", value)),\n valueLen << 1\n );\n offset += valueLen;\n\n if (estLen > offset) return result.substring(0, offset);\n return result;\n}\n\nexport function joinIntegerArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) {\n let value = load(dataStart);\n if (isSigned()) {\n if (sizeof() <= 4) {\n // @ts-ignore: type\n return changetype(itoa32(value, 10));\n } else {\n // @ts-ignore: type\n return changetype(itoa64(value, 10));\n }\n } else {\n if (sizeof() <= 4) {\n // @ts-ignore: type\n return changetype(utoa32(value, 10));\n } else {\n // @ts-ignore: type\n return changetype(utoa64(value, 10));\n }\n }\n }\n\n var sepLen = separator.length;\n const valueLen = (sizeof() <= 4 ? 10 : 20) + i32(isSigned());\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__new(estLen << 1, idof()));\n var offset = 0;\n var value: T;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n offset += itoa_buffered(changetype(result) + (offset << 1), value);\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n // @ts-ignore: type\n offset += itoa_buffered(changetype(result) + (offset << 1), value);\n if (estLen > offset) return result.substring(0, offset);\n return result;\n}\n\nexport function joinFloatArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) {\n return changetype(dtoa(\n // @ts-ignore: type\n load(dataStart))\n );\n }\n\n const valueLen = MAX_DOUBLE_LENGTH;\n var sepLen = separator.length;\n var estLen = (valueLen + sepLen) * lastIndex + valueLen;\n var result = changetype(__new(estLen << 1, idof()));\n var offset = 0;\n var value: T;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n offset += dtoa_buffered(changetype(result) + (offset << 1), value);\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n // @ts-ignore: type\n offset += dtoa_buffered(changetype(result) + (offset << 1), value);\n if (estLen > offset) return result.substring(0, offset);\n return result;\n}\n\nexport function joinStringArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n if (!lastIndex) {\n // @ts-ignore: type\n return load(dataStart) || \"\";\n }\n var estLen = 0;\n var value: string;\n for (let i = 0; i < length; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n if (value !== null) estLen += value.length;\n }\n var offset = 0;\n var sepLen = separator.length;\n var result = changetype(__new((estLen + sepLen * lastIndex) << 1, idof()));\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n if (value !== null) {\n let valueLen = value.length;\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(value),\n valueLen << 1\n );\n offset += valueLen;\n }\n if (sepLen) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(separator),\n sepLen << 1\n );\n offset += sepLen;\n }\n }\n value = load(dataStart + (lastIndex << alignof()));\n if (value !== null) {\n memory.copy(\n changetype(result) + (offset << 1),\n changetype(value),\n value.length << 1\n );\n }\n return result;\n}\n\nexport function joinReferenceArray(dataStart: usize, length: i32, separator: string): string {\n var lastIndex = length - 1;\n if (lastIndex < 0) return \"\";\n var value: T;\n if (!lastIndex) {\n value = load(dataStart);\n // @ts-ignore: type\n return value !== null ? value.toString() : \"\";\n }\n var result = \"\";\n var sepLen = separator.length;\n for (let i = 0; i < lastIndex; ++i) {\n value = load(dataStart + (i << alignof()));\n // @ts-ignore: type\n if (value !== null) result += value.toString();\n if (sepLen) result += separator;\n }\n value = load(dataStart + (lastIndex << alignof()));\n // @ts-ignore: type\n if (value !== null) result += value.toString();\n return result;\n}\n\n// @ts-ignore: decorator\n@inline\nfunction scientific(significand: u64, exp: i32): f64 {\n if (!significand || exp < -342) return 0;\n if (exp > 308) return Infinity;\n // Try use fast path\n // Use fast path for string-to-double conversion if possible\n // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion\n // Simple integer\n var significandf = significand;\n if (!exp) return significandf;\n if (exp > 22 && exp <= 22 + 15) {\n significandf *= pow10(exp - 22);\n exp = 22;\n }\n if (significand <= 9007199254740991 && abs(exp) <= 22) {\n if (exp > 0) return significandf * pow10(exp);\n return significandf / pow10(-exp);\n } else if (exp < 0) {\n return scaledown(significand, exp);\n } else {\n return scaleup(significand, exp);\n }\n}\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction scaledown(significand: u64, exp: i32): f64 {\n const denom: u64 = 6103515625; // 1e14 * 0x1p-14\n const scale = reinterpret(0x3F06849B86A12B9B); // 1e-14 * 0x1p32\n\n var shift = clz(significand);\n significand <<= shift;\n shift = exp - shift;\n\n for (; exp <= -14; exp += 14) {\n let q = significand / denom;\n let r = significand % denom;\n let s = clz(q);\n significand = (q << s) + nearest(scale * (r << (s - 18)));\n shift -= s;\n }\n var b = ipow32(5, -exp);\n var q = significand / b;\n var r = significand % b;\n var s = clz(q);\n significand = (q << s) + (reinterpret(reinterpret(r) + (s << 52)) / b);\n shift -= s;\n\n return NativeMath.scalbn(significand, shift);\n}\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction scaleup(significand: u64, exp: i32): f64 {\n const coeff: u32 = 1220703125; // 1e13 * 0x1p-13;\n var shift = ctz(significand);\n significand >>= shift;\n shift += exp;\n\n __fixmulShift = shift;\n for (; exp >= 13; exp -= 13) {\n significand = fixmul(significand, coeff);\n }\n significand = fixmul(significand, ipow32(5, exp));\n shift = __fixmulShift;\n return NativeMath.scalbn(significand, shift);\n}\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction parseExp(ptr: usize, len: i32): i32 {\n var sign = 1, magnitude = 0;\n var code = load(ptr);\n // check code is 'e' or 'E'\n if ((code | 32) != CharCode.e) return 0;\n\n if (!--len) return 0;\n code = load(ptr += 2);\n if (code == CharCode.MINUS) {\n if (!--len) return 0;\n code = load(ptr += 2);\n sign = -1;\n } else if (code == CharCode.PLUS) {\n if (!--len) return 0;\n code = load(ptr += 2);\n }\n // skip zeros\n while (code == CharCode._0) {\n if (!--len) return 0;\n code = load(ptr += 2);\n }\n for (let digit: u32 = code - CharCode._0; len && digit < 10; digit = code - CharCode._0) {\n if (magnitude >= 3200) return sign * 3200;\n magnitude = 10 * magnitude + digit;\n code = load(ptr += 2);\n --len;\n }\n return sign * magnitude;\n}\n\n// @ts-ignore: decorator\n@lazy var __fixmulShift: u64 = 0;\n\n// Adopted from metallic lib:\n// https://github.com/jdh8/metallic/blob/master/src/stdlib/parse/scientific.h\n// @ts-ignore: decorator\n@inline\nfunction fixmul(a: u64, b: u32): u64 {\n var low = (a & 0xFFFFFFFF) * b;\n var high = (a >> 32) * b + (low >> 32);\n var overflow = (high >> 32);\n var space = clz(overflow);\n var revspace: u64 = 32 - space;\n __fixmulShift += revspace;\n return (high << space | (low & 0xFFFFFFFF) >> revspace) + (low << space >> 31 & 1);\n}\n\n// @ts-ignore: decorator\n@inline\nfunction pow10(n: i32): f64 {\n // argument `n` should bounds in [0, 22] range\n return load(POWERS10 + (n << alignof()));\n}\n","import { compareImpl } from \"./string\";\n\ntype Comparator = (a: T, b: T) => i32;\n\n// @ts-ignore: decorator\n@lazy @inline const EMPTY = u32.MAX_VALUE;\n// @ts-ignore: decorator\n@inline const INSERTION_SORT_THRESHOLD = 48;\n// @ts-ignore: decorator\n@inline const MIN_RUN_LENGTH = 32;\n\n// @ts-ignore: decorator\n@inline\nfunction log2u(n: u32): u32 {\n return 31 - clz(n);\n}\n\n// @ts-ignore: decorator\n@inline\nexport function COMPARATOR(): Comparator {\n if (isInteger()) {\n if (isSigned() && sizeof() <= 4) {\n return (a, b) => i32(a) - i32(b);\n } else {\n return (a, b) => i32(a > b) - i32(a < b);\n }\n } else if (isFloat()) {\n if (sizeof() == 4) {\n return (a, b) => {\n var ia = reinterpret(f32(a));\n var ib = reinterpret(f32(b));\n ia ^= ia >> 31 >>> 1;\n ib ^= ib >> 31 >>> 1;\n return i32(ia > ib) - i32(ia < ib);\n };\n } else {\n return (a, b) => {\n var ia = reinterpret(f64(a));\n var ib = reinterpret(f64(b));\n ia ^= ia >> 63 >>> 1;\n ib ^= ib >> 63 >>> 1;\n return i32(ia > ib) - i32(ia < ib);\n };\n }\n } else if (isString()) {\n return (a, b) => {\n if (a === b || a === null || b === null) return 0;\n var alen = changetype(a).length;\n var blen = changetype(b).length;\n if (!(alen | blen)) return 0;\n if (!alen) return -1;\n if (!blen) return 1;\n let res = compareImpl(\n changetype(a), 0,\n changetype(b), 0,\n min(alen, blen)\n );\n return res ? res : alen - blen;\n };\n } else {\n return (a, b) => i32(a > b) - i32(a < b);\n }\n}\n\n// Power Sort implementation (stable) from paper \"Nearly-Optimal Mergesorts\"\n// https://arxiv.org/pdf/1805.04154.pdf\n// This method usually outperform TimSort.\n// TODO: refactor c >>> 31 to c < 0 when binaryen will support this opt\nexport function SORT(\n ptr: usize,\n len: i32,\n comparator: Comparator\n): void {\n if (len <= INSERTION_SORT_THRESHOLD) {\n if (len <= 1) return;\n if (ASC_SHRINK_LEVEL < 1) {\n switch (len) {\n case 3: {\n let a = load(ptr, 0);\n let b = load(ptr, 1 << alignof());\n let c = comparator(a, b) > 0;\n store(ptr, select(b, a, c), 0);\n a = select(a, b, c);\n b = load(ptr, 2 << alignof());\n c = comparator(a, b) > 0;\n store(ptr, select(b, a, c), 1 << alignof());\n store(ptr, select(a, b, c), 2 << alignof());\n }\n case 2: {\n let a = load(ptr, 0);\n let b = load(ptr, 1 << alignof());\n let c = comparator(a, b) > 0;\n store(ptr, select(b, a, c), 0);\n store(ptr, select(a, b, c), 1 << alignof());\n return;\n }\n }\n }\n insertionSort(ptr, 0, len - 1, 0, comparator);\n return;\n }\n\n var lgPlus2 = log2u(len) + 2;\n var lgPlus2Size = lgPlus2 << alignof();\n var leftRunStartBuf = __alloc(lgPlus2Size << 1);\n var leftRunEndBuf = leftRunStartBuf + lgPlus2Size;\n\n for (let i: u32 = 0; i < lgPlus2; ++i) {\n store(leftRunStartBuf + (i << alignof()), EMPTY);\n }\n\n var buffer = __alloc(len << alignof());\n\n var hi = len - 1;\n var endA = extendRunRight(ptr, 0, hi, comparator);\n var lenA = endA + 1;\n\n if (lenA < MIN_RUN_LENGTH) {\n endA = min(hi, MIN_RUN_LENGTH - 1);\n insertionSort(ptr, 0, endA, lenA, comparator);\n }\n\n var top: u32 = 0, startA = 0;\n while (endA < hi) {\n let startB = endA + 1;\n let endB = extendRunRight(ptr, startB, hi, comparator);\n let lenB = endB - startB + 1;\n\n if (lenB < MIN_RUN_LENGTH) {\n endB = min(hi, startB + MIN_RUN_LENGTH - 1);\n insertionSort(ptr, startB, endB, lenB, comparator);\n }\n\n let k = nodePower(0, hi, startA, startB, endB);\n\n for (let i = top; i > k; --i) {\n let start = load(leftRunStartBuf + (i << alignof()));\n if (start != EMPTY) {\n mergeRuns(\n ptr,\n start,\n load(leftRunEndBuf + (i << alignof())) + 1,\n endA,\n buffer,\n comparator\n );\n startA = start;\n store(leftRunStartBuf + (i << alignof()), EMPTY);\n }\n }\n\n store(leftRunStartBuf + (k << alignof()), startA);\n store(leftRunEndBuf + (k << alignof()), endA);\n startA = startB;\n endA = endB;\n top = k;\n }\n\n for (let i = top; i != 0; --i) {\n let start = load(leftRunStartBuf + (i << alignof()));\n if (start != EMPTY) {\n mergeRuns(\n ptr,\n start,\n load(leftRunEndBuf + (i << alignof())) + 1,\n hi,\n buffer,\n comparator\n );\n }\n }\n // dealloc aux buffers\n __free(buffer);\n __free(leftRunStartBuf);\n}\n\nfunction insertionSort(\n ptr: usize,\n left: i32,\n right: i32,\n presorted: i32,\n comparator: Comparator\n): void {\n if (ASC_SHRINK_LEVEL >= 1) {\n // slightly improved original insertion sort\n for (let i = left + presorted; i <= right; ++i) {\n let j = i - 1;\n let a = load(ptr + (i << alignof()));\n while (j >= left) {\n let b = load(ptr + (j << alignof()));\n if (comparator(a, b) < 0) {\n store(ptr + (j << alignof()), b, 1 << alignof()); --j;\n } else break;\n }\n store(ptr + (j << alignof()), a, 1 << alignof());\n }\n } else {\n // even-odd two-way insertion sort which allow increase minRunLen\n let range = right - left + 1;\n let i = left + select(range & 1, presorted - ((range - presorted) & 1), presorted == 0);\n for (; i <= right; i += 2) {\n let a = load(ptr + (i << alignof()), 0);\n let b = load(ptr + (i << alignof()), 1 << alignof());\n let min = b, max = a;\n if (comparator(a, b) <= 0) {\n min = a, max = b;\n }\n let j = i - 1;\n while (j >= left) {\n a = load(ptr + (j << alignof()));\n if (comparator(a, max) > 0) {\n store(ptr + (j << alignof()), a, 2 << alignof()); --j;\n } else break;\n }\n store(ptr + (j << alignof()), max, 2 << alignof());\n while (j >= left) {\n a = load(ptr + (j << alignof()));\n if (comparator(a, min) > 0) {\n store(ptr + (j << alignof()), a, 1 << alignof()); --j;\n } else break;\n }\n store(ptr + (j << alignof()), min, 1 << alignof());\n }\n }\n}\n\nfunction nodePower(left: u32, right: u32, startA: u32, startB: u32, endB: u32): u32 {\n var n: u64 = right - left + 1;\n var s = startB - (left << 1);\n var l = startA + s;\n var r = endB + s + 1;\n var a = (l << 30) / n;\n var b = (r << 30) / n;\n return clz((a ^ b));\n}\n\nfunction extendRunRight(\n ptr: usize,\n i: i32,\n right: i32,\n comparator: Comparator\n): i32 {\n if (i == right) return i;\n var j = i;\n if (comparator(\n load(ptr + ( j << alignof())),\n load(ptr + (++j << alignof()))\n ) > 0) {\n while (\n j < right &&\n (comparator(\n load(ptr + (j << alignof()), 1 << alignof()),\n load(ptr + (j << alignof()))\n ) >>> 31) // < 0\n ) ++j;\n // reverse\n let k = j;\n while (i < k) {\n let tmp = load(ptr + (i << alignof()));\n store(ptr + (i << alignof()), load(ptr + (k << alignof()))); ++i;\n store(ptr + (k << alignof()), tmp); --k;\n }\n } else {\n while (\n j < right &&\n comparator(\n load(ptr + (j << alignof()), 1 << alignof()),\n load(ptr + (j << alignof()))\n ) >= 0\n ) ++j;\n }\n return j;\n}\n\n// Merges arr[l..m - 1] and arr[m..r]\nfunction mergeRuns(\n ptr: usize,\n l: i32,\n m: i32,\n r: i32,\n buffer: usize,\n comparator: Comparator\n): void {\n --m;\n var i: i32, j: i32, t = r + m;\n for (i = m + 1; i > l; --i) {\n store(\n buffer + ((i - 1) << alignof()),\n load(ptr + ((i - 1) << alignof()))\n );\n }\n for (j = m; j < r; ++j) {\n store(\n buffer + ((t - j) << alignof()),\n load(ptr + (j << alignof()), 1 << alignof())\n );\n }\n for (let k = l; k <= r; ++k) {\n let a = load(buffer + (j << alignof()));\n let b = load(buffer + (i << alignof()));\n if (comparator(a, b) < 0) {\n store(ptr + (k << alignof()), a);\n --j;\n } else {\n store(ptr + (k << alignof()), b);\n ++i;\n }\n }\n}\n","/// \n\nimport { BLOCK_MAXSIZE } from \"./rt/common\";\nimport { COMPARATOR, SORT } from \"./util/sort\";\nimport { REVERSE } from \"./util/bytes\";\nimport { joinBooleanArray, joinIntegerArray, joinFloatArray, joinStringArray, joinReferenceArray } from \"./util/string\";\nimport { idof, isArray as builtin_isArray } from \"./builtins\";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_ILLEGALGENTYPE, E_EMPTYARRAY, E_HOLEYARRAY } from \"./util/error\";\n\n// @ts-ignore: decorator\n@inline @lazy const MIN_SIZE: usize = 8;\n\n/** Ensures that the given array has _at least_ the specified backing size. */\nfunction ensureCapacity(array: usize, newSize: usize, alignLog2: u32, canGrow: bool = true): void {\n // Depends on the fact that Arrays mimic ArrayBufferView\n var oldCapacity = changetype(array).byteLength;\n if (newSize > oldCapacity >>> alignLog2) {\n if (newSize > BLOCK_MAXSIZE >>> alignLog2) throw new RangeError(E_INVALIDLENGTH);\n let oldData = changetype(changetype(array).buffer);\n // Grows old capacity by factor of two.\n // Make sure we don't reach BLOCK_MAXSIZE for new growed capacity.\n let newCapacity = max(newSize, MIN_SIZE) << alignLog2;\n if (canGrow) newCapacity = max(min(oldCapacity << 1, BLOCK_MAXSIZE), newCapacity);\n let newData = __renew(oldData, newCapacity);\n memory.fill(newData + oldCapacity, 0, newCapacity - oldCapacity);\n if (newData !== oldData) { // oldData has been free'd\n store(array, newData, offsetof(\"buffer\"));\n store(array, newData, offsetof(\"dataStart\"));\n __link(array, changetype(newData), false);\n }\n store(array, newCapacity, offsetof(\"byteLength\"));\n }\n}\n\nexport class Array {\n [key: number]: T;\n\n // Mimicking ArrayBufferView isn't strictly necessary here but is done to allow glue code\n // to work with typed and normal arrays interchangeably. Technically, normal arrays do not need\n // `dataStart` (equals `buffer`) and `byteLength` (equals computed `buffer.byteLength`), but the\n // block is 16 bytes anyway so it's fine to have a couple extra fields in there.\n\n private buffer: ArrayBuffer;\n @unsafe readonly dataStart: usize;\n private byteLength: i32; // Uses here as capacity\n\n // Also note that Array with non-nullable T must guard against uninitialized null values\n // whenever an element is accessed. Otherwise, the compiler wouldn't be able to guarantee\n // type-safety anymore. For lack of a better word, such an array is \"holey\".\n\n private length_: i32;\n\n static isArray(value: U): bool {\n return isReference() ? builtin_isArray(value) && value !== null : false;\n }\n\n static create(capacity: i32 = 0): Array {\n WARNING(\"'Array.create' is deprecated. Use 'new Array' instead, making sure initial elements are initialized.\");\n var array = new Array(capacity);\n array.length = 0;\n return array;\n }\n\n constructor(length: i32 = 0) {\n if (length > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH);\n // reserve capacity for at least MIN_SIZE elements\n var bufferSize = max(length, MIN_SIZE) << alignof();\n var buffer = changetype(__new(bufferSize, idof()));\n memory.fill(changetype(buffer), 0, bufferSize);\n this.buffer = buffer; // links\n this.dataStart = changetype(buffer);\n this.byteLength = bufferSize;\n this.length_ = length;\n }\n\n get length(): i32 {\n return this.length_;\n }\n\n set length(newLength: i32) {\n ensureCapacity(changetype(this), newLength, alignof(), false);\n this.length_ = newLength;\n }\n\n every(fn: (value: T, index: i32, array: Array) => bool): bool {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n if (!fn(load(this.dataStart + (i << alignof())), i, this)) return false;\n }\n return true;\n }\n\n findIndex(fn: (value: T, index: i32, array: Array) => bool): i32 {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n if (fn(load(this.dataStart + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n findLastIndex(fn: (value: T, index: i32, array: Array) => bool): i32 {\n for (let i = this.length_ - 1; i >= 0; --i) {\n if (fn(load(this.dataStart + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n @operator(\"[]\") private __get(index: i32): T {\n if (index >= this.length_) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(this.dataStart + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n @unsafe @operator(\"{}\") private __uget(index: i32): T {\n return load(this.dataStart + (index << alignof()));\n }\n\n @operator(\"[]=\") private __set(index: i32, value: T): void {\n if (index >= this.length_) {\n if (index < 0) throw new RangeError(E_INDEXOUTOFRANGE);\n ensureCapacity(changetype(this), index + 1, alignof());\n this.length_ = index + 1;\n }\n this.__uset(index, value);\n }\n\n @unsafe @operator(\"{}=\") private __uset(index: i32, value: T): void {\n store(this.dataStart + (index << alignof()), value);\n if (isManaged()) {\n __link(changetype(this), changetype(value), true);\n }\n }\n\n at(index: i32): T {\n var len = this.length_;\n index += select(0, len, index >= 0);\n if (index >= len) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(this.dataStart + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this {\n var ptr = this.dataStart;\n var len = this.length_;\n start = start < 0 ? max(len + start, 0) : min(start, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n if (isManaged()) {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), changetype(value));\n __link(changetype(this), changetype(value), true);\n }\n } else if (sizeof() == 1) {\n if (start < end) {\n memory.fill(\n ptr + start,\n u8(value),\n (end - start)\n );\n }\n } else {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), value);\n }\n }\n return this;\n }\n\n includes(value: T, fromIndex: i32 = 0): bool {\n if (isFloat()) {\n let len = this.length_;\n if (len == 0 || fromIndex >= len) return false;\n if (fromIndex < 0) fromIndex = max(len + fromIndex, 0);\n let ptr = this.dataStart;\n while (fromIndex < len) {\n let elem = load(ptr + (fromIndex << alignof()));\n // @ts-ignore\n if (elem == value || isNaN(elem) & isNaN(value)) return true;\n ++fromIndex;\n }\n return false;\n } else {\n return this.indexOf(value, fromIndex) >= 0;\n }\n }\n\n indexOf(value: T, fromIndex: i32 = 0): i32 {\n var len = this.length_;\n if (len == 0 || fromIndex >= len) return -1;\n if (fromIndex < 0) fromIndex = max(len + fromIndex, 0);\n var ptr = this.dataStart;\n while (fromIndex < len) {\n if (load(ptr + (fromIndex << alignof())) == value) return fromIndex;\n ++fromIndex;\n }\n return -1;\n }\n\n lastIndexOf(value: T, fromIndex: i32 = this.length_): i32 {\n var len = this.length_;\n if (len == 0) return -1;\n if (fromIndex < 0) fromIndex = len + fromIndex;\n else if (fromIndex >= len) fromIndex = len - 1;\n var ptr = this.dataStart;\n while (fromIndex >= 0) {\n if (load(ptr + (fromIndex << alignof())) == value) return fromIndex;\n --fromIndex;\n }\n return -1;\n }\n\n push(value: T): i32 {\n var oldLen = this.length_;\n var len = oldLen + 1;\n ensureCapacity(changetype(this), len, alignof());\n if (isManaged()) {\n store(this.dataStart + (oldLen << alignof()), changetype(value));\n __link(changetype(this), changetype(value), true);\n } else {\n store(this.dataStart + (oldLen << alignof()), value);\n }\n this.length_ = len;\n return len;\n }\n\n concat(other: Array): Array {\n var thisLen = this.length_;\n var otherLen = select(0, other.length_, other === null);\n var outLen = thisLen + otherLen;\n if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH);\n var out = changetype>(__newArray(outLen, alignof(), idof>()));\n var outStart = out.dataStart;\n var thisSize = thisLen << alignof();\n if (isManaged()) {\n let thisStart = this.dataStart;\n for (let offset: usize = 0; offset < thisSize; offset += sizeof()) {\n let ref = load(thisStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n outStart += thisSize;\n let otherStart = other.dataStart;\n let otherSize = otherLen << alignof();\n for (let offset: usize = 0; offset < otherSize; offset += sizeof()) {\n let ref = load(otherStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(outStart, this.dataStart, thisSize);\n memory.copy(outStart + thisSize, other.dataStart, otherLen << alignof());\n }\n return out;\n }\n\n copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this {\n var ptr = this.dataStart;\n var len = this.length_;\n\n end = min(end, len);\n\n var to = target < 0 ? max(len + target, 0) : min(target, len);\n var from = start < 0 ? max(len + start, 0) : min(start, len);\n var last = end < 0 ? max(len + end, 0) : min(end, len);\n var count = min(last - from, len - to);\n\n memory.copy( // is memmove\n ptr + (to << alignof()),\n ptr + (from << alignof()),\n count << alignof()\n );\n return this;\n }\n\n pop(): T {\n var len = this.length_;\n if (len < 1) throw new RangeError(E_EMPTYARRAY);\n var val = load(this.dataStart + ((--len) << alignof()));\n this.length_ = len;\n return val;\n }\n\n forEach(fn: (value: T, index: i32, array: Array) => void): void {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n fn(load(this.dataStart + (i << alignof())), i, this);\n }\n }\n\n map(fn: (value: T, index: i32, array: Array) => U): Array {\n var len = this.length_;\n var out = changetype>(__newArray(len, alignof(), idof>()));\n var outStart = out.dataStart;\n for (let i = 0; i < min(len, this.length_); ++i) {\n let result = fn(load(this.dataStart + (i << alignof())), i, this);\n store(outStart + (i << alignof()), result);\n if (isManaged()) {\n __link(changetype(out), changetype(result), true);\n }\n }\n return out;\n }\n\n filter(fn: (value: T, index: i32, array: Array) => bool): Array {\n var result = changetype>(__newArray(0, alignof(), idof>()));\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n let value = load(this.dataStart + (i << alignof()));\n if (fn(value, i, this)) result.push(value);\n }\n return result;\n }\n\n reduce(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n acc = fn(acc, load(this.dataStart + (i << alignof())), i, this);\n }\n return acc;\n }\n\n reduceRight(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = this.length_ - 1; i >= 0; --i) {\n acc = fn(acc, load(this.dataStart + (i << alignof())), i, this);\n }\n return acc;\n }\n\n shift(): T {\n var len = this.length_;\n if (len < 1) throw new RangeError(E_EMPTYARRAY);\n var base = this.dataStart;\n var element = load(base);\n var lastIndex = len - 1;\n memory.copy(\n base,\n base + sizeof(),\n lastIndex << alignof()\n );\n if (isReference()) {\n store(base + (lastIndex << alignof()), 0);\n } else {\n // @ts-ignore\n store(base + (lastIndex << alignof()), 0);\n }\n this.length_ = lastIndex;\n return element;\n }\n\n some(fn: (value: T, index: i32, array: Array) => bool): bool {\n for (let i = 0, len = this.length_; i < min(len, this.length_); ++i) {\n if (fn(load(this.dataStart + (i << alignof())), i, this)) return true;\n }\n return false;\n }\n\n unshift(value: T): i32 {\n var len = this.length_ + 1;\n ensureCapacity(changetype(this), len, alignof());\n var ptr = this.dataStart;\n memory.copy(\n ptr + sizeof(),\n ptr,\n (len - 1) << alignof()\n );\n store(ptr, value);\n if (isManaged()) {\n __link(changetype(this), changetype(value), true);\n }\n this.length_ = len;\n return len;\n }\n\n slice(start: i32 = 0, end: i32 = i32.MAX_VALUE): Array {\n var len = this.length_;\n start = start < 0 ? max(start + len, 0) : min(start, len);\n end = end < 0 ? max(end + len, 0) : min(end , len);\n len = max(end - start, 0);\n var slice = changetype>(__newArray(len, alignof(), idof>()));\n var sliceBase = slice.dataStart;\n var thisBase = this.dataStart + (start << alignof());\n if (isManaged()) {\n let off = 0;\n let end = len << alignof();\n while (off < end) {\n let ref = load(thisBase + off);\n store(sliceBase + off, ref);\n __link(changetype(slice), ref, true);\n off += sizeof();\n }\n } else {\n memory.copy(sliceBase, thisBase, len << alignof());\n }\n return slice;\n }\n\n splice(start: i32, deleteCount: i32 = i32.MAX_VALUE): Array {\n var len = this.length_;\n start = start < 0 ? max(len + start, 0) : min(start, len);\n deleteCount = max(min(deleteCount, len - start), 0);\n var result = changetype>(__newArray(deleteCount, alignof(), idof>()));\n var resultStart = result.dataStart;\n var thisStart = this.dataStart;\n var thisBase = thisStart + (start << alignof());\n memory.copy(\n resultStart,\n thisBase,\n deleteCount << alignof()\n );\n var offset = start + deleteCount;\n if (len != offset) {\n memory.copy(\n thisBase,\n thisStart + (offset << alignof()),\n (len - offset) << alignof()\n );\n }\n this.length_ = len - deleteCount;\n return result;\n }\n\n reverse(): this {\n REVERSE(this.dataStart, this.length_);\n return this;\n }\n\n sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this {\n SORT(this.dataStart, this.length_, comparator);\n return this;\n }\n\n join(separator: string = \",\"): string {\n var ptr = this.dataStart;\n var len = this.length_;\n if (isBoolean()) return joinBooleanArray(ptr, len, separator);\n if (isInteger()) return joinIntegerArray(ptr, len, separator);\n if (isFloat()) return joinFloatArray(ptr, len, separator);\n\n if (ASC_SHRINK_LEVEL < 1) {\n if (isString()) return joinStringArray(ptr, len, separator);\n }\n // For rest objects and arrays use general join routine\n if (isReference()) return joinReferenceArray(ptr, len, separator);\n ERROR(\"unspported element type\");\n return unreachable();\n }\n\n flat(): T {\n if (!isArray()) {\n throw new TypeError(E_ILLEGALGENTYPE);\n }\n // Get the length and data start values\n var ptr = this.dataStart;\n var len = this.length_;\n\n // calculate the end size with an initial pass\n var size = 0;\n for (let i = 0; i < len; ++i) {\n let child = load(ptr + (i << alignof()));\n size += child == 0 ? 0 : load(child, offsetof(\"length_\"));\n }\n\n // calculate the byteLength of the resulting backing ArrayBuffer\n const align = alignof>();\n var byteLength = size << align;\n var outBuffer = changetype(__new(byteLength, idof()));\n\n // create the return value and initialize it\n var outArray = changetype(__new(offsetof(), idof()));\n store(changetype(outArray), size, offsetof(\"length_\"));\n\n // byteLength, dataStart, and buffer are all readonly\n store(changetype(outArray), byteLength, offsetof(\"byteLength\"));\n store(changetype(outArray), changetype(outBuffer), offsetof(\"dataStart\"));\n store(changetype(outArray), changetype(outBuffer), offsetof(\"buffer\"));\n __link(changetype(outArray), changetype(outBuffer), false);\n\n // set the elements\n var resultOffset: usize = 0;\n for (let i = 0; i < len; ++i) { // for each child\n let child = load(ptr + (i << alignof()));\n\n // ignore null arrays\n if (!child) continue;\n\n // copy the underlying buffer data to the result buffer\n let childDataLength = load(child, offsetof(\"length_\")) << align;\n memory.copy(\n changetype(outBuffer) + resultOffset,\n load(child, offsetof(\"dataStart\")),\n childDataLength\n );\n\n // advance the result length\n resultOffset += childDataLength;\n }\n\n // if the `valueof` type is managed, we must link each reference\n if (isManaged>()) {\n for (let i = 0; i < size; ++i) {\n let ref = load(changetype(outBuffer) + (i << usize(alignof>())));\n __link(changetype(outBuffer), ref, true);\n }\n }\n\n return outArray;\n }\n\n toString(): string {\n return this.join();\n }\n\n // RT integration\n\n @unsafe private __visit(cookie: u32): void {\n if (isManaged()) {\n let cur = this.dataStart;\n let end = cur + (this.length_ << alignof());\n while (cur < end) {\n let val = load(cur);\n if (val) __visit(val, cookie);\n cur += sizeof();\n }\n }\n __visit(changetype(this.buffer), cookie);\n }\n}\n","/// \n\nimport { OBJECT, BLOCK_MAXSIZE, TOTAL_OVERHEAD } from \"./rt/common\";\nimport { compareImpl, strtol, strtod, isSpace, isAscii, isFinalSigma, toLower8, toUpper8 } from \"./util/string\";\nimport { SPECIALS_UPPER, casemap, bsearch } from \"./util/casemap\";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_UNPAIRED_SURROGATE } from \"./util/error\";\nimport { idof } from \"./builtins\";\nimport { Array } from \"./array\";\n\n@final export abstract class String {\n\n @lazy static readonly MAX_LENGTH: i32 = (BLOCK_MAXSIZE >>> alignof());\n\n static fromCharCode(unit: i32, surr: i32 = -1): String {\n var hasSur = surr > 0;\n var out = changetype(__new(2 << i32(hasSur), idof()));\n store(changetype(out), unit);\n if (hasSur) store(changetype(out), surr, 2);\n return out;\n }\n\n static fromCharCodes(units: Array): String {\n var length = units.length;\n var out = changetype(__new(length << 1, idof()));\n var ptr = units.dataStart;\n for (let i = 0; i < length; ++i) {\n store(changetype(out) + (i << 1), load(ptr + (i << 2)));\n }\n return out;\n }\n\n static fromCodePoint(code: i32): String {\n var hasSur = code > 0xFFFF;\n var out = changetype(__new(2 << i32(hasSur), idof()));\n if (!hasSur) {\n store(changetype(out), code);\n } else {\n // Checks valid code point range\n assert(code <= 0x10FFFF);\n code -= 0x10000;\n let hi = (code & 0x03FF) | 0xDC00;\n let lo = code >>> 10 | 0xD800;\n store(changetype(out), lo | hi << 16);\n }\n return out;\n }\n\n @builtin static raw(parts: TemplateStringsArray, ...args: unknown[]): string { return unreachable(); }\n\n get length(): i32 {\n return changetype(changetype(this) - TOTAL_OVERHEAD).rtSize >> 1;\n }\n\n at(pos: i32): String {\n var len = this.length;\n pos += select(0, len, pos >= 0);\n if (pos >= len) throw new RangeError(E_INDEXOUTOFRANGE);\n var out = __new(2, idof());\n store(out, load(changetype(this) + (pos << 1)));\n return changetype(out); // retains\n }\n\n @operator(\"[]\") charAt(pos: i32): String {\n if (pos >= this.length) return changetype(\"\");\n var out = changetype(__new(2, idof()));\n store(changetype(out), load(changetype(this) + (pos << 1)));\n return out;\n }\n\n charCodeAt(pos: i32): i32 {\n if (pos >= this.length) return -1; // (NaN)\n return load(changetype(this) + (pos << 1));\n }\n\n codePointAt(pos: i32): i32 {\n var len = this.length;\n if (pos >= len) return -1; // (undefined)\n var first = load(changetype(this) + (pos << 1));\n if ((first & 0xFC00) != 0xD800 || pos + 1 == len) return first;\n var second = load(changetype(this) + (pos << 1), 2);\n if ((second & 0xFC00) != 0xDC00) return first;\n return (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n }\n\n @operator(\"+\") private static __concat(left: String, right: String): String {\n return left.concat(right);\n }\n\n concat(other: String): String {\n var thisSize: isize = this.length << 1;\n var otherSize: isize = other.length << 1;\n var outSize: usize = thisSize + otherSize;\n if (outSize == 0) return changetype(\"\");\n var out = changetype(__new(outSize, idof()));\n memory.copy(changetype(out), changetype(this), thisSize);\n memory.copy(changetype(out) + thisSize, changetype(other), otherSize);\n return out;\n }\n\n endsWith(search: String, end: i32 = String.MAX_LENGTH): bool {\n end = min(max(end, 0), this.length);\n var searchLength = search.length;\n var searchStart = end - searchLength;\n if (searchStart < 0) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(this, searchStart, search, 0, searchLength);\n }\n\n @operator(\"==\") private static __eq(left: String | null, right: String | null): bool {\n if (left === right) return true;\n if (left === null || right === null) return false;\n var leftLength = left.length;\n if (leftLength != right.length) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(left, 0, right, 0, leftLength);\n }\n\n @operator.prefix(\"!\")\n private static __not(str: String | null): bool {\n return str === null || !str.length;\n }\n\n @operator(\"!=\")\n private static __ne(left: String | null, right: String | null): bool {\n return !this.__eq(left, right);\n }\n\n @operator(\">\") private static __gt(left: String, right: String): bool {\n if (left === right) return false;\n var leftLength = left.length;\n if (!leftLength) return false;\n var rightLength = right.length;\n if (!rightLength) return true;\n // @ts-ignore: string <-> String\n var res = compareImpl(left, 0, right, 0, min(leftLength, rightLength));\n return res ? res > 0 : leftLength > rightLength;\n }\n\n @operator(\">=\") private static __gte(left: String, right: String): bool {\n return !this.__lt(left, right);\n }\n\n @operator(\"<\") private static __lt(left: String, right: String): bool {\n if (left === right) return false;\n var rightLength = right.length;\n if (!rightLength) return false;\n var leftLength = left.length;\n if (!leftLength) return true;\n // @ts-ignore: string <-> String\n var res = compareImpl(left, 0, right, 0, min(leftLength, rightLength));\n return res ? res < 0 : leftLength < rightLength;\n }\n\n @operator(\"<=\") private static __lte(left: String, right: String): bool {\n return !this.__gt(left, right);\n }\n\n includes(search: String, start: i32 = 0): bool {\n return this.indexOf(search, start) != -1;\n }\n\n indexOf(search: String, start: i32 = 0): i32 {\n var searchLen = search.length;\n if (!searchLen) return 0;\n var len = this.length;\n if (!len) return -1;\n var searchStart = min(max(start, 0), len);\n for (len -= searchLen; searchStart <= len; ++searchStart) {\n // @ts-ignore: string <-> String\n if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart;\n }\n return -1;\n }\n\n lastIndexOf(search: String, start: i32 = i32.MAX_VALUE): i32 {\n var searchLen = search.length;\n if (!searchLen) return this.length;\n var len = this.length;\n if (!len) return -1;\n var searchStart = min(max(start, 0), len - searchLen);\n for (; searchStart >= 0; --searchStart) {\n // @ts-ignore: string <-> String\n if (!compareImpl(this, searchStart, search, 0, searchLen)) return searchStart;\n }\n return -1;\n }\n\n // TODO: implement full locale comparison with locales and Collator options\n localeCompare(other: String): i32 {\n if (other === this) return 0; // compare pointers\n var len: isize = this.length;\n var otherLen: isize = other.length;\n if (otherLen != len) return select(1, -1, len > otherLen);\n if (!otherLen) return 0; // \"\" == \"\"\n // @ts-ignore: string <-> String\n return compareImpl(this, 0, other, 0, otherLen);\n }\n\n startsWith(search: String, start: i32 = 0): bool {\n var len = this.length;\n var searchStart = min(max(start, 0), len);\n var searchLength = search.length;\n if (searchLength + searchStart > len) return false;\n // @ts-ignore: string <-> String\n return !compareImpl(this, searchStart, search, 0, searchLength);\n }\n\n substr(start: i32, length: i32 = i32.MAX_VALUE): String { // legacy\n var intStart: isize = start;\n var end: isize = length;\n var len: isize = this.length;\n if (intStart < 0) intStart = max(len + intStart, 0);\n var size = min(max(end, 0), len - intStart) << 1;\n if (size <= 0) return changetype(\"\");\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + (intStart << 1), size);\n return out;\n }\n\n substring(start: i32, end: i32 = i32.MAX_VALUE): String {\n var len: isize = this.length;\n var finalStart = min(max(start, 0), len);\n var finalEnd = min(max(end, 0), len);\n var fromPos = min(finalStart, finalEnd) << 1;\n var toPos = max(finalStart, finalEnd) << 1;\n var size = toPos - fromPos;\n if (!size) return changetype(\"\");\n if (!fromPos && toPos == len << 1) return this;\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + fromPos, size);\n return out;\n }\n\n trim(): String {\n var len = this.length;\n var size: usize = len << 1;\n while (size && isSpace(load(changetype(this) + size - 2))) {\n size -= 2;\n }\n var offset: usize = 0;\n while (offset < size && isSpace(load(changetype(this) + offset))) {\n offset += 2; size -= 2;\n }\n if (!size) return changetype(\"\");\n if (!offset && size == len << 1) return this;\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + offset, size);\n return out;\n }\n\n @inline\n trimLeft(): String {\n return this.trimStart();\n }\n\n @inline\n trimRight(): String {\n return this.trimEnd();\n }\n\n trimStart(): String {\n var size = this.length << 1;\n var offset: usize = 0;\n while (offset < size && isSpace(load(changetype(this) + offset))) {\n offset += 2;\n }\n if (!offset) return this;\n size -= offset;\n if (!size) return changetype(\"\");\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this) + offset, size);\n return out;\n }\n\n trimEnd(): String {\n var originalSize = this.length << 1;\n var size = originalSize;\n while (size && isSpace(load(changetype(this) + size - 2))) {\n size -= 2;\n }\n if (!size) return changetype(\"\");\n if (size == originalSize) return this;\n var out = changetype(__new(size, idof()));\n memory.copy(changetype(out), changetype(this), size);\n return out;\n }\n\n padStart(length: i32, pad: string = \" \"): String {\n var thisSize = this.length << 1;\n var targetSize = length << 1;\n var padSize = pad.length << 1;\n if (targetSize < thisSize || !padSize) return this;\n var prependSize = targetSize - thisSize;\n var out = changetype(__new(targetSize, idof()));\n if (prependSize > padSize) {\n let repeatCount = (prependSize - 2) / padSize;\n let restBase = repeatCount * padSize;\n let restSize = prependSize - restBase;\n memory.repeat(changetype(out), changetype(pad), padSize, repeatCount);\n memory.copy(changetype(out) + restBase, changetype(pad), restSize);\n } else {\n memory.copy(changetype(out), changetype(pad), prependSize);\n }\n memory.copy(changetype(out) + prependSize, changetype(this), thisSize);\n return out;\n }\n\n padEnd(length: i32, pad: string = \" \"): String {\n var thisSize = this.length << 1;\n var targetSize = length << 1;\n var padSize = pad.length << 1;\n if (targetSize < thisSize || !padSize) return this;\n var appendSize = targetSize - thisSize;\n var out = changetype(__new(targetSize, idof()));\n memory.copy(changetype(out), changetype(this), thisSize);\n if (appendSize > padSize) {\n let repeatCount = (appendSize - 2) / padSize;\n let restBase = repeatCount * padSize;\n let restSize = appendSize - restBase;\n memory.repeat(changetype(out) + thisSize, changetype(pad), padSize, repeatCount);\n memory.copy(changetype(out) + thisSize + restBase, changetype(pad), restSize);\n } else {\n memory.copy(changetype(out) + thisSize, changetype(pad), appendSize);\n }\n return out;\n }\n\n repeat(count: i32 = 0): String {\n var length = this.length;\n\n // Most browsers can't handle strings 1 << 28 chars or longer\n if (count < 0 || length * count > (1 << 28)) {\n throw new RangeError(E_INVALIDLENGTH);\n }\n\n if (count == 0 || !length) return changetype(\"\");\n if (count == 1) return this;\n var out = changetype(__new((length * count) << 1, idof()));\n memory.repeat(changetype(out), changetype(this), length << 1, count);\n return out;\n }\n\n replace(search: String, replacement: String): String {\n var len: usize = this.length;\n var slen: usize = search.length;\n if (len <= slen) {\n return len < slen ? this : select(replacement, this, search == this);\n }\n var index: isize = this.indexOf(search);\n if (~index) {\n let rlen: usize = replacement.length;\n len -= slen;\n let olen = len + rlen;\n if (olen) {\n let out = changetype(__new(olen << 1, idof()));\n memory.copy(changetype(out), changetype(this), index << 1);\n memory.copy(\n changetype(out) + (index << 1),\n changetype(replacement),\n rlen << 1\n );\n memory.copy(\n changetype(out) + ((index + rlen) << 1),\n changetype(this) + ((index + slen) << 1),\n (len - index) << 1\n );\n return out;\n }\n }\n return this;\n }\n\n replaceAll(search: String, replacement: String): String {\n var thisLen: usize = this.length;\n var searchLen: usize = search.length;\n if (thisLen <= searchLen) {\n return thisLen < searchLen\n ? this\n : select(replacement, this, search == this);\n }\n var replaceLen: usize = replacement.length;\n if (!searchLen) {\n if (!replaceLen) return this;\n // Special case: 'abc'.replaceAll('', '-') -> '-a-b-c-'\n let out = changetype(__new((thisLen + (thisLen + 1) * replaceLen) << 1, idof()));\n memory.copy(changetype(out), changetype(replacement), replaceLen << 1);\n let offset = replaceLen;\n for (let i: usize = 0; i < thisLen; ++i) {\n store(\n changetype(out) + (offset++ << 1),\n load(changetype(this) + (i << 1))\n );\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(replacement),\n replaceLen << 1\n );\n offset += replaceLen;\n }\n return out;\n }\n var prev: isize = 0, next: isize = 0;\n if (searchLen == replaceLen) {\n // Fast path when search and replacement have same length\n let outSize = thisLen << 1;\n let out = changetype(__new(outSize, idof()));\n memory.copy(changetype(out), changetype(this), outSize);\n while (~(next = this.indexOf(search, prev))) {\n memory.copy(changetype(out) + (next << 1), changetype(replacement), replaceLen << 1);\n prev = next + searchLen;\n }\n return out;\n }\n var out: String | null = null, offset: usize = 0, outSize = thisLen;\n while (~(next = this.indexOf(search, prev))) {\n if (!out) out = changetype(__new(thisLen << 1, idof()));\n let chunk = next - prev;\n if (offset + chunk + replaceLen > outSize) {\n outSize <<= 1;\n out = changetype(__renew(changetype(out), outSize << 1));\n }\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(this) + (prev << 1),\n chunk << 1\n );\n offset += chunk;\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(replacement),\n replaceLen << 1\n );\n offset += replaceLen;\n prev = next + searchLen;\n }\n if (out) {\n let rest = thisLen - prev;\n if (offset + rest > outSize) {\n outSize <<= 1;\n out = changetype(__renew(changetype(out), outSize << 1));\n }\n if (rest) {\n memory.copy(\n changetype(out) + (offset << 1),\n changetype(this) + (prev << 1),\n rest << 1\n );\n }\n rest += offset;\n if (outSize > rest) {\n out = changetype(__renew(changetype(out), rest << 1));\n }\n return out;\n }\n return this;\n }\n\n slice(start: i32, end: i32 = i32.MAX_VALUE): String {\n var len = this.length;\n start = start < 0 ? max(start + len, 0) : min(start, len);\n end = end < 0 ? max(end + len, 0) : min(end, len);\n len = end - start;\n if (len <= 0) return changetype(\"\");\n var out = changetype(__new(len << 1, idof()));\n memory.copy(changetype(out), changetype(this) + (start << 1), len << 1);\n return out;\n }\n\n split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] {\n if (!limit) return changetype(__newArray(0, alignof(), idof>()));\n if (separator === null) return [this];\n var length: isize = this.length;\n var sepLen = separator.length;\n if (limit < 0) limit = i32.MAX_VALUE;\n if (!sepLen) {\n if (!length) return changetype(__newArray(0, alignof(), idof>()));\n // split by chars\n length = min(length, limit);\n let result = changetype(__newArray(length, alignof(), idof>()));\n // @ts-ignore: cast\n let resultStart = result.dataStart as usize;\n for (let i: isize = 0; i < length; ++i) {\n let charStr = changetype(__new(2, idof()));\n store(changetype(charStr), load(changetype(this) + (i << 1)));\n store(resultStart + (i << alignof()), changetype(charStr)); // result[i] = charStr\n __link(changetype(result), changetype(charStr), true);\n }\n return result;\n } else if (!length) {\n let result = changetype(__newArray(1, alignof(), idof>()));\n // @ts-ignore: cast\n store(result.dataStart as usize, changetype(\"\")); // static \"\"\n return result;\n }\n var result = changetype(__newArray(0, alignof(), idof>()));\n var end = 0, start = 0, i = 0;\n while (~(end = this.indexOf(separator, start))) {\n let len = end - start;\n if (len > 0) {\n let out = changetype(__new(len << 1, idof()));\n memory.copy(changetype(out), changetype(this) + (start << 1), len << 1);\n result.push(out);\n } else {\n result.push(changetype(\"\"));\n }\n if (++i == limit) return result;\n start = end + sepLen;\n }\n if (!start) { // also means: loop above didn't do anything\n result.push(this);\n return result;\n }\n var len = length - start;\n if (len > 0) {\n let out = changetype(__new(len << 1, idof()));\n memory.copy(changetype(out), changetype(this) + (start << 1), len << 1);\n result.push(out);\n } else {\n result.push(changetype(\"\")); // static \"\"\n }\n return result;\n }\n\n toUpperCase(): String {\n var len = this.length;\n if (!len) return this;\n var codes = changetype(__new(len * 2 * 2, idof()));\n var j: usize = 0;\n for (let i: usize = 0; i < len; ++i, ++j) {\n let c = load(changetype(this) + (i << 1));\n if (isAscii(c)) {\n store(changetype(codes) + (j << 1), toLower8(c));\n } else {\n // check and read surrogate pair\n if ((c - 0xD7FF < 0xDC00 - 0xD7FF) && i < len - 1) {\n let c1 = load(changetype(this) + (i << 1), 2);\n if (c1 - 0xDBFF < 0xE000 - 0xDBFF) {\n let c0 = c;\n c = (((c & 0x03FF) << 10) | (c1 & 0x03FF)) + 0x10000;\n ++i;\n if (c >= 0x20000) {\n store(changetype(codes) + (j << 1), c0 | (c1 << 16));\n ++j;\n continue;\n }\n }\n }\n // check special casing for lower table. It has one ently so instead lookup we just inline this.\n if (c == 0x0130) {\n // 0x0130 -> [0x0069, 0x0307]\n store(changetype(codes) + (j << 1), (0x0307 << 16) | 0x0069);\n ++j;\n } else if (c == 0x03A3) { // 'Σ'\n // Σ maps to σ but except at the end of a word where it maps to ς\n let sigma = 0x03C3; // σ\n if (len > 1 && isFinalSigma(changetype(this), i, len)) {\n sigma = 0x03C2; // ς\n }\n store(changetype(codes) + (j << 1), sigma);\n } else if (c - 0x24B6 <= 0x24CF - 0x24B6) {\n // Range 0x24B6 <= c <= 0x24CF not covered by casemap and require special early handling\n store(changetype(codes) + (j << 1), c + 26);\n } else {\n let code = casemap(c, 0) & 0x1FFFFF;\n if (code < 0x10000) {\n store(changetype(codes) + (j << 1), code);\n } else {\n // store as surrogare pair\n code -= 0x10000;\n let lo = (code >>> 10) | 0xD800;\n let hi = (code & 0x03FF) | 0xDC00;\n store(changetype(codes) + (j << 1), lo | (hi << 16));\n ++j;\n }\n }\n }\n }\n return changetype(__renew(changetype(codes), j << 1));\n }\n\n toUpperCase(): String {\n var len = this.length;\n if (!len) return this;\n var codes = changetype(__new(len * 3 * 2, idof()));\n var specialsPtr = changetype(SPECIALS_UPPER);\n var specialsLen = SPECIALS_UPPER.length;\n var j: usize = 0;\n for (let i: usize = 0; i < len; ++i, ++j) {\n let c = load(changetype(this) + (i << 1));\n if (isAscii(c)) {\n store(changetype(codes) + (j << 1), toUpper8(c));\n } else {\n // check and read surrogate pair\n if ((c - 0xD7FF < 0xDC00 - 0xD7FF) && i < len - 1) {\n let c1 = load(changetype(this) + (i << 1), 2);\n if (c1 - 0xDBFF < 0xE000 - 0xDBFF) {\n let c0 = c;\n c = (((c & 0x03FF) << 10) | (c1 & 0x03FF)) + 0x10000;\n ++i;\n if (c >= 0x20000) {\n store(changetype(codes) + (j << 1), c0 | (c1 << 16));\n ++j;\n continue;\n }\n }\n }\n // Range 0x24D0 <= c <= 0x24E9 not covered by casemap and require special early handling\n if (c - 0x24D0 <= 0x24E9 - 0x24D0) {\n // monkey patch\n store(changetype(codes) + (j << 1), c - 26);\n } else {\n let index: usize = -1;\n // Fast range check. See first and last rows in specialsUpper table\n if (c - 0x00DF <= 0xFB17 - 0x00DF) {\n index = bsearch(c, specialsPtr, specialsLen);\n }\n if (~index) {\n // load next 3 code points from row with `index` offset for specialsUpper table\n let ab = load(specialsPtr + (index << 1), 2);\n let cc = load(specialsPtr + (index << 1), 6);\n store(changetype(codes) + (j << 1), ab, 0);\n store(changetype(codes) + (j << 1), cc, 4);\n j += 1 + usize(cc != 0);\n } else {\n let code = casemap(c, 1) & 0x1FFFFF;\n if (code < 0x10000) {\n store(changetype(codes) + (j << 1), code);\n } else {\n // store as surrogare pair\n code -= 0x10000;\n let lo = (code >>> 10) | 0xD800;\n let hi = (code & 0x03FF) | 0xDC00;\n store(changetype(codes) + (j << 1), lo | (hi << 16));\n ++j;\n }\n }\n }\n }\n }\n return changetype(__renew(changetype(codes), j << 1));\n }\n\n toString(): String {\n return this;\n }\n}\n\n// @ts-ignore: nolib\nexport type string = String;\n\nexport function parseInt(str: string, radix: i32 = 0): f64 {\n return strtol(str, radix);\n}\n\nexport function parseFloat(str: string): f64 {\n return strtod(str);\n}\n\n// Encoding helpers\nexport namespace String {\n\n export namespace UTF8 {\n\n export const enum ErrorMode {\n WTF8,\n REPLACE,\n ERROR\n }\n\n export function byteLength(str: string, nullTerminated: bool = false): i32 {\n var strOff = changetype(str);\n var strEnd = strOff + changetype(changetype(str) - TOTAL_OVERHEAD).rtSize;\n var bufLen = i32(nullTerminated);\n while (strOff < strEnd) {\n let c1 = load(strOff);\n if (c1 < 128) {\n // @ts-ignore: cast\n if (nullTerminated & !c1) break;\n bufLen += 1;\n } else if (c1 < 2048) {\n bufLen += 2;\n } else {\n if ((c1 & 0xFC00) == 0xD800 && strOff + 2 < strEnd) {\n if ((load(strOff, 2) & 0xFC00) == 0xDC00) {\n bufLen += 4; strOff += 4;\n continue;\n }\n }\n bufLen += 3;\n }\n strOff += 2;\n }\n return bufLen;\n }\n\n export function encode(str: string, nullTerminated: bool = false, errorMode: ErrorMode = ErrorMode.WTF8): ArrayBuffer {\n var buf = changetype(__new(byteLength(str, nullTerminated), idof()));\n encodeUnsafe(changetype(str), str.length, changetype(buf), nullTerminated, errorMode);\n return buf;\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function encodeUnsafe(str: usize, len: i32, buf: usize, nullTerminated: bool = false, errorMode: ErrorMode = ErrorMode.WTF8): usize {\n var strEnd = str + (len << 1);\n var bufOff = buf;\n while (str < strEnd) {\n let c1 = load(str);\n if (c1 < 128) {\n store(bufOff, c1);\n bufOff++;\n } else if (c1 < 2048) {\n let b0 = c1 >> 6 | 192;\n let b1 = c1 & 63 | 128;\n store(bufOff, b1 << 8 | b0);\n bufOff += 2;\n } else {\n // D800: 11011 0 0000000000 Lead\n // DBFF: 11011 0 1111111111\n // DC00: 11011 1 0000000000 Trail\n // DFFF: 11011 1 1111111111\n // F800: 11111 0 0000000000 Mask\n // FC00: 11111 1 0000000000\n if ((c1 & 0xF800) == 0xD800) {\n if (c1 < 0xDC00 && str + 2 < strEnd) {\n let c2 = load(str, 2);\n if ((c2 & 0xFC00) == 0xDC00) {\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) | (c2 & 0x03FF);\n let b0 = c1 >> 18 | 240;\n let b1 = c1 >> 12 & 63 | 128;\n let b2 = c1 >> 6 & 63 | 128;\n let b3 = c1 & 63 | 128;\n store(bufOff, b3 << 24 | b2 << 16 | b1 << 8 | b0);\n bufOff += 4; str += 4;\n continue;\n }\n }\n if (errorMode != ErrorMode.WTF8) { // unlikely\n if (errorMode == ErrorMode.ERROR) throw new Error(E_UNPAIRED_SURROGATE);\n c1 = 0xFFFD;\n }\n }\n let b0 = c1 >> 12 | 224;\n let b1 = c1 >> 6 & 63 | 128;\n let b2 = c1 & 63 | 128;\n store(bufOff, b1 << 8 | b0);\n store(bufOff, b2, 2);\n bufOff += 3;\n }\n str += 2;\n }\n if (nullTerminated) {\n store(bufOff++, 0);\n }\n return bufOff - buf;\n }\n\n export function decode(buf: ArrayBuffer, nullTerminated: bool = false): String {\n return decodeUnsafe(changetype(buf), buf.byteLength, nullTerminated);\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function decodeUnsafe(buf: usize, len: usize, nullTerminated: bool = false): String {\n var bufOff = buf;\n var bufEnd = buf + len;\n assert(bufEnd >= bufOff); // guard wraparound\n var str = changetype(__new(len << 1, idof())); // max is one u16 char per u8 byte\n var strOff = changetype(str);\n while (bufOff < bufEnd) {\n let u0 = load(bufOff); ++bufOff;\n if (!(u0 & 128)) {\n // @ts-ignore: cast\n if (nullTerminated & !u0) break;\n store(strOff, u0);\n } else {\n if (bufEnd == bufOff) break;\n let u1 = load(bufOff) & 63; ++bufOff;\n if ((u0 & 224) == 192) {\n store(strOff, (u0 & 31) << 6 | u1);\n } else {\n if (bufEnd == bufOff) break;\n let u2 = load(bufOff) & 63; ++bufOff;\n if ((u0 & 240) == 224) {\n u0 = (u0 & 15) << 12 | u1 << 6 | u2;\n } else {\n if (bufEnd == bufOff) break;\n u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | load(bufOff) & 63;\n ++bufOff;\n }\n if (u0 < 0x10000) {\n store(strOff, u0);\n } else {\n u0 -= 0x10000;\n let lo = u0 >> 10 | 0xD800;\n let hi = (u0 & 0x03FF) | 0xDC00;\n store(strOff, lo | (hi << 16));\n strOff += 2;\n }\n }\n }\n strOff += 2;\n }\n return changetype(__renew(changetype(str), strOff - changetype(str)));\n }\n }\n\n export namespace UTF16 {\n\n export function byteLength(str: string): i32 {\n return changetype(changetype(str) - TOTAL_OVERHEAD).rtSize;\n }\n\n export function encode(str: string): ArrayBuffer {\n var buf = changetype(__new(byteLength(str), idof()));\n encodeUnsafe(changetype(str), str.length, changetype(buf));\n return buf;\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function encodeUnsafe(str: usize, len: i32, buf: usize): usize {\n var size = len << 1;\n memory.copy(buf, changetype(str), size);\n return size;\n }\n\n export function decode(buf: ArrayBuffer): String {\n return decodeUnsafe(changetype(buf), buf.byteLength);\n }\n\n // @ts-ignore: decorator\n @unsafe\n export function decodeUnsafe(buf: usize, len: usize): String {\n var str = changetype(__new(len &= ~1, idof()));\n memory.copy(changetype(str), buf, len);\n return str;\n }\n }\n}\n\nexport class TemplateStringsArray extends Array {\n readonly raw: string[];\n}\n","import { E_INVALIDDATE } from \"util/error\";\nimport { now as Date_now } from \"./bindings/Date\";\n\n// @ts-ignore: decorator\n@inline const\n MILLIS_PER_DAY = 1000 * 60 * 60 * 24,\n MILLIS_PER_HOUR = 1000 * 60 * 60,\n MILLIS_PER_MINUTE = 1000 * 60,\n MILLIS_PER_SECOND = 1000;\n\n// ymdFromEpochDays returns values via globals to avoid allocations\n// @ts-ignore: decorator\n@lazy let _month: i32, _day: i32;\n\nexport class Date {\n private year: i32 = 0;\n private month: i32 = 0;\n private day: i32 = 0;\n\n @inline static UTC(\n year: i32,\n month: i32 = 0,\n day: i32 = 1,\n hour: i32 = 0,\n minute: i32 = 0,\n second: i32 = 0,\n millisecond: i32 = 0\n ): i64 {\n if (year >= 0 && year <= 99) year += 1900;\n var ms = epochMillis(year, month + 1, day, hour, minute, second, millisecond);\n if (invalidDate(ms)) throw new RangeError(E_INVALIDDATE);\n return ms;\n }\n\n @inline static now(): i64 {\n return Date_now();\n }\n\n // It can parse only ISO 8601 inputs like YYYY-MM-DDTHH:MM:SS.000Z\n @inline static parse(dateString: string): Date {\n return this.fromString(dateString);\n }\n\n static fromString(dateTimeString: string): Date {\n if (!dateTimeString.length) throw new RangeError(E_INVALIDDATE);\n var\n hour: i32 = 0,\n min: i32 = 0,\n sec: i32 = 0,\n ms: i32 = 0;\n\n var dateString = dateTimeString;\n var posT = dateTimeString.indexOf(\"T\");\n if (~posT) {\n // includes a time component\n let timeString: string;\n dateString = dateTimeString.substring(0, posT);\n timeString = dateTimeString.substring(posT + 1);\n // parse the HH-MM-SS component\n let timeParts = timeString.split(\":\");\n let len = timeParts.length;\n if (len <= 1) throw new RangeError(E_INVALIDDATE);\n\n hour = I32.parseInt(timeParts[0]);\n min = I32.parseInt(timeParts[1]);\n if (len >= 3) {\n let secAndMs = timeParts[2];\n let posDot = secAndMs.indexOf(\".\");\n if (~posDot) {\n // includes milliseconds\n sec = I32.parseInt(secAndMs.substring(0, posDot));\n ms = I32.parseInt(secAndMs.substring(posDot + 1));\n } else {\n sec = I32.parseInt(secAndMs);\n }\n }\n }\n // parse the YYYY-MM-DD component\n var parts = dateString.split(\"-\");\n var year = I32.parseInt(parts[0]);\n var month = 1, day = 1;\n var len = parts.length;\n if (len >= 2) {\n month = I32.parseInt(parts[1]);\n if (len >= 3) {\n day = I32.parseInt(parts[2]);\n }\n }\n return new Date(epochMillis(year, month, day, hour, min, sec, ms));\n }\n\n constructor(private epochMillis: i64) {\n // this differs from JavaScript which prefer return NaN or \"Invalid Date\" string\n // instead throwing exception.\n if (invalidDate(epochMillis)) throw new RangeError(E_INVALIDDATE);\n\n this.year = ymdFromEpochDays(i32(floorDiv(epochMillis, MILLIS_PER_DAY)));\n this.month = _month;\n this.day = _day;\n }\n\n @inline getTime(): i64 {\n return this.epochMillis;\n }\n\n setTime(time: i64): i64 {\n if (invalidDate(time)) throw new RangeError(E_INVALIDDATE);\n\n this.epochMillis = time;\n this.year = ymdFromEpochDays(i32(floorDiv(time, MILLIS_PER_DAY)));\n this.month = _month;\n this.day = _day;\n\n return time;\n }\n\n @inline getUTCFullYear(): i32 {\n return this.year;\n }\n\n @inline getUTCMonth(): i32 {\n return this.month - 1;\n }\n\n @inline getUTCDate(): i32 {\n return this.day;\n }\n\n @inline getUTCDay(): i32 {\n return dayOfWeek(this.year, this.month, this.day);\n }\n\n getUTCHours(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_DAY)) / MILLIS_PER_HOUR;\n }\n\n getUTCMinutes(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_HOUR)) / MILLIS_PER_MINUTE;\n }\n\n getUTCSeconds(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_MINUTE)) / MILLIS_PER_SECOND;\n }\n\n getUTCMilliseconds(): i32 {\n return i32(euclidRem(this.epochMillis, MILLIS_PER_SECOND));\n }\n\n setUTCMilliseconds(millis: i32): void {\n this.setTime(this.epochMillis + (millis - this.getUTCMilliseconds()));\n }\n\n setUTCSeconds(seconds: i32): void {\n this.setTime(this.epochMillis + (seconds - this.getUTCSeconds()) * MILLIS_PER_SECOND);\n }\n\n setUTCMinutes(minutes: i32): void {\n this.setTime(this.epochMillis + (minutes - this.getUTCMinutes()) * MILLIS_PER_MINUTE);\n }\n\n setUTCHours(hours: i32): void {\n this.setTime(this.epochMillis + (hours - this.getUTCHours()) * MILLIS_PER_HOUR);\n }\n\n setUTCDate(day: i32): void {\n if (this.day == day) return;\n var ms = euclidRem(this.epochMillis, MILLIS_PER_DAY);\n this.setTime(i64(daysSinceEpoch(this.year, this.month, day)) * MILLIS_PER_DAY + ms);\n }\n\n setUTCMonth(month: i32): void {\n if (this.month == month) return;\n var ms = euclidRem(this.epochMillis, MILLIS_PER_DAY);\n this.setTime(i64(daysSinceEpoch(this.year, month + 1, this.day)) * MILLIS_PER_DAY + ms);\n }\n\n setUTCFullYear(year: i32): void {\n if (this.year == year) return;\n var ms = euclidRem(this.epochMillis, MILLIS_PER_DAY);\n this.setTime(i64(daysSinceEpoch(year, this.month, this.day)) * MILLIS_PER_DAY + ms);\n }\n\n toISOString(): string {\n // TODO: add more low-level helper which combine toString and padStart without extra allocation\n var yearStr: string;\n var year = this.year;\n var isNeg = year < 0;\n if (isNeg || year >= 10000) {\n yearStr = (isNeg ? \"-\" : \"+\") + abs(year).toString().padStart(6, \"0\");\n } else {\n yearStr = year.toString().padStart(4, \"0\");\n }\n\n return (\n yearStr +\n \"-\" +\n this.month.toString().padStart(2, \"0\") +\n \"-\" +\n this.day.toString().padStart(2, \"0\") +\n \"T\" +\n this.getUTCHours().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCMinutes().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCSeconds().toString().padStart(2, \"0\") +\n \".\" +\n this.getUTCMilliseconds().toString().padStart(3, \"0\") +\n \"Z\"\n );\n }\n\n toISOString(): string {\n const weeks: StaticArray = [\n \"Sun, \", \"Mon, \", \"Tue, \", \"Wed, \", \"Thu, \", \"Fri, \", \"Sat, \"\n ];\n\n const months: StaticArray = [\n \" Jan \", \" Feb \", \" Mar \", \" Apr \", \" May \", \" Jun \",\n \" Jul \", \" Aug \", \" Sep \", \" Oct \", \" Nov \", \" Dec \"\n ];\n\n var mo = this.month;\n var da = this.day;\n var yr = this.year;\n var wd = dayOfWeek(yr, mo, da);\n var year = abs(yr).toString().padStart(4, \"0\");\n if (yr < 0) year = \"-\" + year;\n\n return (\n unchecked(weeks[wd]) +\n da.toString().padStart(2, \"0\") +\n unchecked(months[mo - 1]) +\n year +\n \" \" +\n this.getUTCHours().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCMinutes().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCSeconds().toString().padStart(2, \"0\") +\n \" GMT\"\n );\n }\n\n toDateString(): string {\n // TODO: use u64 static data instead 4 chars\n // also use stream itoa variants.\n const weeks: StaticArray = [\n \"Sun \", \"Mon \", \"Tue \", \"Wed \", \"Thu \", \"Fri \", \"Sat \"\n ];\n\n const months: StaticArray = [\n \"Jan \", \"Feb \", \"Mar \", \"Apr \", \"May \", \"Jun \",\n \"Jul \", \"Aug \", \"Sep \", \"Oct \", \"Nov \", \"Dec \"\n ];\n\n var mo = this.month;\n var da = this.day;\n var yr = this.year;\n var wd = dayOfWeek(yr, mo, da);\n var year = abs(yr).toString().padStart(4, \"0\");\n if (yr < 0) year = \"-\" + year;\n\n return (\n unchecked(weeks[wd]) +\n unchecked(months[mo - 1]) +\n da.toString().padStart(2, \"0\") +\n \" \" + year\n );\n }\n\n // Note: it uses UTC time instead local time (without timezone offset)\n toTimeString(): string {\n // TODO: add timezone\n return (\n this.getUTCHours().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCMinutes().toString().padStart(2, \"0\") +\n \":\" +\n this.getUTCSeconds().toString().padStart(2, \"0\")\n );\n }\n\n // Note: it uses UTC datetime instead local datetime (without timezone offset)\n toString(): string {\n return this.toDateString() + \" \" + this.toTimeString();\n }\n}\n\nfunction epochMillis(\n year: i32,\n month: i32,\n day: i32,\n hour: i32,\n minute: i32,\n second: i32,\n milliseconds: i32\n): i64 {\n return (\n i64(daysSinceEpoch(year, month, day)) * MILLIS_PER_DAY +\n hour * MILLIS_PER_HOUR +\n minute * MILLIS_PER_MINUTE +\n second * MILLIS_PER_SECOND +\n milliseconds\n );\n}\n\n// @ts-ignore: decorator\n@inline function floorDiv(a: T, b: T): T {\n return (a >= 0 ? a : a - b + 1) / b as T;\n}\n\n// @ts-ignore: decorator\n@inline function euclidRem(a: T, b: T): T {\n var m = a % b;\n return m + (m < 0 ? b : 0) as T;\n}\n\nfunction invalidDate(millis: i64): bool {\n // @ts-ignore\n return (millis < -8640000000000000) | (millis > 8640000000000000);\n}\n\n// see: http://howardhinnant.github.io/date_algorithms.html#civil_from_days\nfunction ymdFromEpochDays(z: i32): i32 {\n z += 719468;\n var era = floorDiv(z, 146097);\n var doe = z - era * 146097; // [0, 146096]\n var yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; // [0, 399]\n var year = yoe + era * 400;\n var doy = doe - (365 * yoe + yoe / 4 - yoe / 100); // [0, 365]\n var mo = (5 * doy + 2) / 153; // [0, 11]\n _day = doy - (153 * mo + 2) / 5 + 1; // [1, 31]\n mo += mo < 10 ? 3 : -9; // [1, 12]\n _month = mo;\n year += u32(mo <= 2);\n return year;\n}\n\n// http://howardhinnant.github.io/date_algorithms.html#days_from_civil\nfunction daysSinceEpoch(y: i32, m: i32, d: i32): i32 {\n y -= i32(m <= 2);\n var era = floorDiv(y, 400);\n var yoe = y - era * 400; // [0, 399]\n var doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1; // [0, 365]\n var doe = yoe * 365 + yoe / 4 - yoe / 100 + doy; // [0, 146096]\n return era * 146097 + doe - 719468;\n}\n\n// TomohikoSakamoto algorithm from https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week\nfunction dayOfWeek(year: i32, month: i32, day: i32): i32 {\n const tab = memory.data([0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]);\n\n year -= i32(month < 3);\n year += floorDiv(year, 4) - floorDiv(year, 100) + floorDiv(year, 400);\n month = load(tab + month - 1);\n return euclidRem(year + month + day, 7);\n}\n","import { itoa32, utoa32, itoa64, utoa64, dtoa } from \"./util/number\";\nimport { strtol } from \"./util/string\";\n\n// @ts-ignore: decorator\n@builtin @inline\nexport const NaN: f64 = 0 / 0;\n\n// @ts-ignore: decorator\n@builtin @inline\nexport const Infinity: f64 = 1 / 0;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isNaN(value: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFinite(value: T): bool;\n\n@final @unmanaged\nexport abstract class I8 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i8 = i8.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i8 = i8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i8 {\n return strtol(value, radix);\n }\n\n toString(this: i8, radix: i32 = 10): String {\n return itoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class I16 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i16 = i16.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i16 = i16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i16 {\n return strtol(value, radix);\n }\n\n toString(this: i16, radix: i32 = 10): String {\n return itoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class I32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i32 = i32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i32 = i32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i32 {\n return strtol(value, radix);\n }\n\n toString(this: i32, radix: i32 = 10): String {\n return itoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class I64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: i64 = i64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: i64 = i64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): i64 {\n return strtol(value, radix);\n }\n\n toString(this: i64, radix: i32 = 10): String {\n return itoa64(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class Isize {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: isize = isize.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: isize = isize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): isize {\n return strtol(value, radix);\n }\n\n toString(this: isize, radix: i32 = 10): String {\n if (sizeof() == 4) {\n return itoa32(this, radix);\n } else {\n return itoa64(this, radix);\n }\n }\n}\n\n@final @unmanaged\nexport abstract class U8 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u8 = u8.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u8 = u8.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u8 {\n return strtol(value, radix);\n }\n\n toString(this: u8, radix: i32 = 10): String {\n return utoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class U16 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u16 = u16.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u16 = u16.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u16 {\n return strtol(value, radix);\n }\n\n toString(this: u16, radix: i32 = 10): String {\n return utoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class U32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u32 = u32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u32 = u32.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u32 {\n return strtol(value, radix);\n }\n\n toString(this: u32, radix: i32 = 10): String {\n return utoa32(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class U64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: u64 = u64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: u64 = u64.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): u64 {\n return strtol(value, radix);\n }\n\n toString(this: u64, radix: i32 = 10): String {\n return utoa64(this, radix);\n }\n}\n\n@final @unmanaged\nexport abstract class Usize {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: usize = usize.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: usize = usize.MAX_VALUE;\n\n static parseInt(value: string, radix: i32 = 0): usize {\n return strtol(value, radix);\n }\n\n toString(this: usize, radix: i32 = 10): String {\n if (sizeof() == 4) {\n return utoa32(this, radix);\n } else {\n return utoa64(this, radix);\n }\n }\n}\n\n@final @unmanaged\nexport abstract class Bool {\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: bool = bool.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: bool = bool.MAX_VALUE;\n\n toString(this: bool, radix: i32 = 0): String {\n return this ? \"true\" : \"false\";\n }\n}\n\nexport { Bool as Boolean };\n\n@final @unmanaged\nexport abstract class F32 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly EPSILON: f32 = f32.EPSILON;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: f32 = f32.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: f32 = f32.MAX_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_SAFE_INTEGER: f32 = f32.MIN_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_SAFE_INTEGER: f32 = f32.MAX_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly POSITIVE_INFINITY: f32 = f32.POSITIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NEGATIVE_INFINITY: f32 = f32.NEGATIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NaN: f32 = f32.NaN;\n\n static isNaN(value: f32): bool {\n return isNaN(value);\n }\n\n static isFinite(value: f32): bool {\n return isFinite(value);\n }\n\n static isSafeInteger(value: f32): bool {\n return abs(value) <= f32.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f32): bool {\n return isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f32 {\n return strtol(value, radix);\n }\n\n static parseFloat(value: string): f32 {\n return parseFloat(value);\n }\n\n toString(this: f32, radix: i32 = 0): String {\n return dtoa(this);\n }\n}\n\n@final @unmanaged\nexport abstract class F64 {\n\n // @ts-ignore: decorator\n @lazy\n static readonly EPSILON: f64 = f64.EPSILON;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_VALUE: f64 = f64.MIN_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_VALUE: f64 = f64.MAX_VALUE;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MIN_SAFE_INTEGER: f64 = f64.MIN_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly MAX_SAFE_INTEGER: f64 = f64.MAX_SAFE_INTEGER;\n\n // @ts-ignore: decorator\n @lazy\n static readonly POSITIVE_INFINITY: f64 = f64.POSITIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NEGATIVE_INFINITY: f64 = f64.NEGATIVE_INFINITY;\n\n // @ts-ignore: decorator\n @lazy\n static readonly NaN: f64 = f64.NaN;\n\n static isNaN(value: f64): bool {\n return isNaN(value);\n }\n\n static isFinite(value: f64): bool {\n return isFinite(value);\n }\n\n static isSafeInteger(value: f64): bool {\n return abs(value) <= f64.MAX_SAFE_INTEGER && trunc(value) == value;\n }\n\n static isInteger(value: f64): bool {\n return isFinite(value) && trunc(value) == value;\n }\n\n static parseInt(value: string, radix: i32 = 0): f64 {\n return strtol(value, radix);\n }\n\n static parseFloat(value: string): f64 {\n return parseFloat(value);\n }\n\n toString(this: f64, radix: i32 = 0): String {\n return dtoa(this);\n }\n}\n\nexport { F64 as Number };\n","type auto = i32;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isInteger(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFloat(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isBoolean(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isSigned(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isReference(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isString(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isArray(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isArrayLike(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isFunction(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isNullable(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isDefined(expression: auto): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isConstant(expression: auto): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isManaged(value?: T): bool;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isVoid(): bool;\n\n// @ts-ignore\n@builtin\nexport declare function lengthof(func?: T): i32;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function clz(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function ctz(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function popcnt(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function rotl(value: T, shift: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function rotr(value: T, shift: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function abs(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function max(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function min(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function ceil(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function floor(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function copysign(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function nearest(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function reinterpret(value: number): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sqrt(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function trunc(value: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function add(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sub(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function mul(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function div(left: T, right: T): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function store(ptr: usize, value: auto, immOffset?: usize, immAlign?: usize): void;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function sizeof(): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function alignof(): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function offsetof(fieldName?: string): usize; // | u32 / u64\n\n// @ts-ignore: decorator\n@builtin\nexport declare function idof(): u32;\n\n// @ts-ignore\n@builtin\nexport declare function nameof(): string;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function select(ifTrue: T, ifFalse: T, condition: bool): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function unreachable(): auto;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function changetype(value: auto): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function assert(isTrueish: T, message?: string): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function unchecked(expr: T): T;\n\n// @ts-ignore: decorator\n@unsafe @builtin\nexport declare function call_indirect(index: u32, ...args: auto[]): T;\n\n// @ts-ignore: decorator\n@builtin\nexport declare function instantiate(...args: auto[]): T;\n\nexport namespace atomic {\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load(ptr: usize, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: T, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg(ptr: usize, value: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: T, timeout: i64): AtomicWaitResult;\n\n // @ts-ignore: decorator\n @builtin\n export declare function notify(ptr: usize, count: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function fence(): void;\n}\n\n// @ts-ignore: decorator\n@lazy\nexport const enum AtomicWaitResult {\n OK = 0,\n NOT_EQUAL = 1,\n TIMED_OUT = 2\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i8(value: auto): i8;\n\nexport namespace i8 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i8 = -128;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i8 = 127;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i16(value: auto): i16;\n\nexport namespace i16 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i16 = -32768;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i16 = 32767;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i32(value: auto): i32;\n\nexport namespace i32 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i32 = -2147483648;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i32 = 2147483647;\n\n // @ts-ignore: decorator\n @builtin\n export declare function clz(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ctz(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(value: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_s(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_u(left: i32, right:i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotl(value: i32, shift: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotr(value: i32, shift: i32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_f32(value: f32): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i32, immOffset?: usize, immAlign?: usize): void;\n\n export namespace atomic {\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i32, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: i32, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n\n export namespace rmw16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n\n export namespace rmw {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg(ptr: usize, value: i32, immOffset?: usize): i32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;\n }\n }\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i64(value: auto): i64;\n\nexport namespace i64 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: i64 = -9223372036854775808;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: i64 = 9223372036854775807;\n\n // @ts-ignore: decorator\n @builtin\n export declare function clz(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ctz(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_s(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div_u(left: i64, right:i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_s(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_u(ptr: usize, immOffset?: usize, immAlign?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(value: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotl(value: i64, shift: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function rotr(value: i64, shift: i64): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_f64(value: f64): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store32(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i64, immOffset?: usize, immAlign?: usize): void;\n\n export namespace atomic {\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8_u(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16_u(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32_u(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store32(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: i64, immOffset?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function wait(ptr: usize, expected: i64, timeout: i64): AtomicWaitResult;\n\n export namespace rmw8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw32 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n\n export namespace rmw {\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function xchg(ptr: usize, value: i64, immOffset?: usize): i64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function cmpxchg(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;\n }\n }\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function isize(value: auto): isize;\n\nexport namespace isize {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: isize = sizeof() == sizeof()\n ? -2147483648\n : -9223372036854775808;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: isize = sizeof() == sizeof()\n ? 2147483647\n : 9223372036854775807;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u8(value: auto): u8;\n\nexport namespace u8 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u8 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u8 = 255;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u16(value: auto): u16;\n\nexport namespace u16 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u16 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u16 = 65535;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u32(value: auto): u32;\n\nexport namespace u32 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u32 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u32 = 4294967295;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function u64(value: auto): u64;\n\nexport namespace u64 {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: u64 = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: u64 = 18446744073709551615;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function usize(value: auto): usize;\n\nexport namespace usize {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: usize = 0;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: usize = sizeof() == sizeof()\n ? 4294967295\n : 18446744073709551615;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function bool(value: auto): bool;\n\nexport namespace bool {\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE: bool = false;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE: bool = true;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f32(value: auto): f32;\n\nexport namespace f32 {\n\n // @ts-ignore: decorator\n @lazy\n export const EPSILON = reinterpret(0x34000000); // 0x1p-23f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE = reinterpret(0x00000001); // 0x0.000001p+0f\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE = reinterpret(0x7F7FFFFF); // 0x1.fffffep+127f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_NORMAL_VALUE = reinterpret(0x00800000); // 0x1p-126f\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_SAFE_INTEGER: f32 = -16777215;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_SAFE_INTEGER: f32 = 16777215;\n\n // @ts-ignore: decorator\n @lazy\n export const POSITIVE_INFINITY: f32 = Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NEGATIVE_INFINITY: f32 = -Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NaN: f32 = 0.0 / 0.0;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function copysign(x: f32, y: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_i32(value: i32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(value: f32): f32;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: f32, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(value: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: f32, right: f32): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(left: f32, right: f32): f32;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f64(value: auto): f64;\n\nexport namespace f64 {\n\n // @ts-ignore: decorator\n @lazy\n export const EPSILON = reinterpret(0x3CB0000000000000); // 0x1p-52\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_VALUE = reinterpret(0x0000000000000001); // 0x0.0000000000001p+0\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_VALUE = reinterpret(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_NORMAL_VALUE = reinterpret(0x0010000000000000); // 0x1p-1022\n\n // @ts-ignore: decorator\n @lazy\n export const MIN_SAFE_INTEGER: f64 = -9007199254740991;\n\n // @ts-ignore: decorator\n @lazy\n export const MAX_SAFE_INTEGER: f64 = 9007199254740991;\n\n // @ts-ignore: decorator\n @lazy\n export const POSITIVE_INFINITY: f64 = Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NEGATIVE_INFINITY: f64 = -Infinity;\n\n // @ts-ignore: decorator\n @lazy\n export const NaN: f64 = 0.0 / 0.0;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function copysign(x: f64, y: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function reinterpret_i64(value: i64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(value: f64): f64;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: f64, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(value: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(left: f64, right: f64): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(left: f64, right: f64): f64;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function v128(\n a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8,\n i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8\n): v128;\n\nexport namespace v128 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: T): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): T;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: T): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function swizzle(a: v128, s: v128): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_ext(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_zero(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8x8_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load8x8_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16x4_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load16x4_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32x2_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function load32x2_u(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load_splat(ptr: usize, immOffset?: usize, immAlign?: usize): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load8_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load16_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load32_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load64_splat(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load32_zero(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load64_zero(ptr: usize, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function load64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;\n\n // @ts-ignore: decorator\n @unsafe @builtin\n export declare function store(ptr: usize, value: v128, immOffset?: usize, immAlign?: usize): void;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function and(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function or(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function xor(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function andnot(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function not(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitselect(v1: v128, v2: v128, c: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function any_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmin(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmax(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function dot(a: v128, b: v128): v128; // i16 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function avgr(a: v128, b: v128): v128; // u8, u16 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(a: v128): v128; // f32, f64 only\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_low(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function demote_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function promote_low(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function q15mulr_sat(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i8x16(\n a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8,\n i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8\n): v128;\n\nexport namespace i8x16 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i8): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_s(x: v128, idx: u8): i8;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_u(x: v128, idx: u8): u8;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i8): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function avgr_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function popcnt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i16x8_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shuffle(\n a: v128, b: v128,\n l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8,\n l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8\n ): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function swizzle(a: v128, s: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128;\n\nexport namespace i16x8 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i16): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_s(x: v128, idx: u8): i16;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane_u(x: v128, idx: u8): u16;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i16): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function avgr_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub_sat_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i32x4_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function narrow_i32x4_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i8x16_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i8x16_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i8x16_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i8x16_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i8x16_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i8x16_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function q15mulr_sat_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i8x16_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i8x16_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i8x16_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i8x16_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;\n\nexport namespace i32x4 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function dot_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f64x2_s_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc_sat_f64x2_u_zero(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i16x8_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i16x8_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i16x8_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i16x8_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i16x8_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extadd_pairwise_i16x8_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i16x8_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i16x8_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i16x8_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function i64x2(a: i64, b: i64): v128;\n\nexport namespace i64x2 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: i64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): i64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: i64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shl(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_s(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function shr_u(a: v128, b: i32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function all_true(a: v128): bool;\n\n // @ts-ignore: decorator\n @builtin\n export declare function bitmask(a: v128): i32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_low_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extend_high_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i32x4_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_low_i32x4_u(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i32x4_s(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extmul_high_i32x4_u(a: v128, b: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;\n\nexport namespace f32x4 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: f32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): f32;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: f32): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmin(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmax(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function demote_f64x2_zero(a: v128): v128;\n}\n\n// @ts-ignore: decorator\n@builtin\nexport declare function f64x2(a: f64, b: f64): v128;\n\nexport namespace f64x2 {\n\n // @ts-ignore: decorator\n @builtin\n export declare function splat(x: f64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function extract_lane(x: v128, idx: u8): f64;\n\n // @ts-ignore: decorator\n @builtin\n export declare function replace_lane(x: v128, idx: u8, value: f64): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function add(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sub(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function mul(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function div(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function neg(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function min(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function max(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmin(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function pmax(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function abs(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function sqrt(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ceil(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function floor(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function trunc(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function nearest(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function eq(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ne(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function lt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function le(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function gt(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function ge(a: v128, b: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_low_i32x4_s(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function convert_low_i32x4_u(a: v128): v128;\n\n // @ts-ignore: decorator\n @builtin\n export declare function promote_low_f32x4(a: v128): v128;\n}\n\n@final\nexport abstract class i31 { // FIXME: usage of 'new' requires a class :(\n\n // @ts-ignore: decorator\n @builtin\n static new(value: i32): i31ref { return changetype(unreachable()); }\n\n // @ts-ignore: decorator\n @builtin\n static get(i31expr: i31ref): i32 { return unreachable(); }\n}\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n// @ts-ignore: decorator\n@external(\"env\", \"abort\")\ndeclare function abort(\n message?: string | null,\n fileName?: string | null,\n lineNumber?: u32,\n columnNumber?: u32\n): void;\n\n// @ts-ignore: decorator\n@external(\"env\", \"trace\")\ndeclare function trace(\n message: string,\n n?: i32,\n a0?: f64,\n a1?: f64,\n a2?: f64,\n a3?: f64,\n a4?: f64\n): void;\n\n// @ts-ignore: decorator\n@external(\"env\", \"seed\")\ndeclare function seed(): f64;\n\n/* eslint-enable @typescript-eslint/no-unused-vars */\n","/// \n\nimport { OBJECT, BLOCK_MAXSIZE, TOTAL_OVERHEAD } from \"./rt/common\";\nimport { COMPARATOR, SORT } from \"./util/sort\";\nimport { REVERSE } from \"./util/bytes\";\nimport { idof } from \"./builtins\";\nimport { Array } from \"./array\";\nimport { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_HOLEYARRAY } from \"./util/error\";\nimport { joinBooleanArray, joinIntegerArray, joinFloatArray, joinStringArray, joinReferenceArray } from \"./util/string\";\n\n@final\nexport class StaticArray {\n [key: number]: T;\n\n // Note that the interface of StaticArray instances must be a semantically\n // compatible subset of Array in order for syntax highlighting to work\n // properly, for instance when creating static arrays from array literals.\n // The additionally provided static methods take care of dealing with static\n // arrays exclusively, without having to convert to Array first.\n\n static fromArray(source: Array): StaticArray {\n var length = source.length;\n var outSize = length << alignof();\n var out = changetype>(__new(outSize, idof>()));\n if (isManaged()) {\n let sourcePtr = source.dataStart;\n for (let i = 0; i < length; ++i) {\n let off = i << alignof();\n let ref = load(sourcePtr + off);\n store(changetype(out) + off, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(changetype(out), source.dataStart, outSize);\n }\n return out;\n }\n\n static concat(source: StaticArray, other: StaticArray): StaticArray {\n var sourceLen = source.length;\n var otherLen = select(0, other.length, other === null);\n var outLen = sourceLen + otherLen;\n if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH);\n var out = changetype>(__new(outLen << alignof(), idof>()));\n var outStart = changetype(out);\n var sourceSize = sourceLen << alignof();\n if (isManaged()) {\n for (let offset: usize = 0; offset < sourceSize; offset += sizeof()) {\n let ref = load(changetype(source) + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n outStart += sourceSize;\n let otherSize = otherLen << alignof();\n for (let offset: usize = 0; offset < otherSize; offset += sizeof()) {\n let ref = load(changetype(other) + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(outStart, changetype(source), sourceSize);\n memory.copy(outStart + sourceSize, changetype(other), otherLen << alignof());\n }\n return out;\n }\n\n static slice(source: StaticArray, start: i32 = 0, end: i32 = i32.MAX_VALUE): StaticArray {\n var length = source.length;\n start = start < 0 ? max(start + length, 0) : min(start, length);\n end = end < 0 ? max(end + length, 0) : min(end , length);\n length = max(end - start, 0);\n var sliceSize = length << alignof();\n var slice = changetype>(__new(sliceSize, idof>()));\n var sourcePtr = changetype(source) + (start << alignof());\n if (isManaged()) {\n let off: usize = 0;\n while (off < sliceSize) {\n let ref = load(sourcePtr + off);\n store(changetype(slice) + off, ref);\n __link(changetype(slice), ref, true);\n off += sizeof();\n }\n } else {\n memory.copy(changetype(slice), sourcePtr, sliceSize);\n }\n return slice;\n }\n\n constructor(length: i32) {\n if (length > BLOCK_MAXSIZE >>> alignof()) throw new RangeError(E_INVALIDLENGTH);\n var outSize = length << alignof();\n var out = changetype>(__new(outSize, idof>()));\n memory.fill(changetype(out), 0, outSize);\n return out;\n }\n\n get length(): i32 {\n return changetype(changetype(this) - TOTAL_OVERHEAD).rtSize >>> alignof();\n }\n\n at(index: i32): T {\n var len = this.length;\n index += select(0, len, index >= 0);\n if (index >= len) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(changetype(this) + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n @operator(\"[]\") private __get(index: i32): T {\n if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE);\n var value = load(changetype(this) + (index << alignof()));\n if (isReference()) {\n if (!isNullable()) {\n if (!changetype(value)) throw new Error(E_HOLEYARRAY);\n }\n }\n return value;\n }\n\n @unsafe @operator(\"{}\") private __uget(index: i32): T {\n return load(changetype(this) + (index << alignof()));\n }\n\n @operator(\"[]=\") private __set(index: i32, value: T): void {\n if (index >= this.length) throw new RangeError(E_INDEXOUTOFRANGE);\n this.__uset(index, value);\n }\n\n @unsafe @operator(\"{}=\") private __uset(index: i32, value: T): void {\n store(changetype(this) + (index << alignof()), value);\n if (isManaged()) {\n __link(changetype(this), changetype(value), true);\n }\n }\n\n fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this {\n var ptr = changetype(this);\n var len = this.length;\n start = start < 0 ? max(len + start, 0) : min(start, len);\n end = end < 0 ? max(len + end, 0) : min(end, len);\n if (isManaged()) {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), changetype(value));\n __link(changetype(this), changetype(value), true);\n }\n } else if (sizeof() == 1) {\n if (start < end) {\n memory.fill(\n ptr + start,\n u8(value),\n (end - start)\n );\n }\n } else {\n for (; start < end; ++start) {\n store(ptr + (start << alignof()), value);\n }\n }\n return this;\n }\n\n copyWithin(target: i32, start: i32, end: i32 = i32.MAX_VALUE): this {\n var ptr = changetype(this);\n var len = this.length;\n\n end = min(end, len);\n\n var to = target < 0 ? max(len + target, 0) : min(target, len);\n var from = start < 0 ? max(len + start, 0) : min(start, len);\n var last = end < 0 ? max(len + end, 0) : min(end, len);\n var count = min(last - from, len - to);\n\n memory.copy( // is memmove\n ptr + (to << alignof()),\n ptr + (from << alignof()),\n count << alignof()\n );\n return this;\n }\n\n includes(value: T, fromIndex: i32 = 0): bool {\n if (isFloat()) {\n let length = this.length;\n if (length == 0 || fromIndex >= length) return false;\n if (fromIndex < 0) fromIndex = max(length + fromIndex, 0);\n while (fromIndex < length) {\n let elem = load(changetype(this) + (fromIndex << alignof()));\n // @ts-ignore\n if (elem == value || isNaN(elem) & isNaN(value)) return true;\n ++fromIndex;\n }\n return false;\n } else {\n return this.indexOf(value, fromIndex) >= 0;\n }\n }\n\n indexOf(value: T, fromIndex: i32 = 0): i32 {\n var length = this.length;\n if (length == 0 || fromIndex >= length) return -1;\n if (fromIndex < 0) fromIndex = max(length + fromIndex, 0);\n while (fromIndex < length) {\n if (load(changetype(this) + (fromIndex << alignof())) == value) return fromIndex;\n ++fromIndex;\n }\n return -1;\n }\n\n lastIndexOf(value: T, fromIndex: i32 = this.length): i32 {\n var length = this.length;\n if (length == 0) return -1;\n if (fromIndex < 0) fromIndex = length + fromIndex;\n else if (fromIndex >= length) fromIndex = length - 1;\n while (fromIndex >= 0) {\n if (load(changetype(this) + (fromIndex << alignof())) == value) return fromIndex;\n --fromIndex;\n }\n return -1;\n }\n\n concat(other: Array): Array {\n var thisLen = this.length;\n var otherLen = select(0, other.length, other === null);\n var outLen = thisLen + otherLen;\n if (outLen > BLOCK_MAXSIZE >>> alignof()) throw new Error(E_INVALIDLENGTH);\n var out = changetype>(__newArray(outLen, alignof(), idof>()));\n var outStart = out.dataStart;\n var thisSize = thisLen << alignof();\n if (isManaged()) {\n let thisStart = changetype(this);\n for (let offset: usize = 0; offset < thisSize; offset += sizeof()) {\n let ref = load(thisStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n outStart += thisSize;\n let otherStart = other.dataStart;\n let otherSize = otherLen << alignof();\n for (let offset: usize = 0; offset < otherSize; offset += sizeof()) {\n let ref = load(otherStart + offset);\n store(outStart + offset, ref);\n __link(changetype(out), ref, true);\n }\n } else {\n memory.copy(outStart, changetype(this), thisSize);\n memory.copy(outStart + thisSize, other.dataStart, otherLen << alignof());\n }\n return out;\n }\n\n slice(start: i32 = 0, end: i32 = i32.MAX_VALUE): Array {\n var length = this.length;\n start = start < 0 ? max(start + length, 0) : min(start, length);\n end = end < 0 ? max(end + length, 0) : min(end , length);\n length = max(end - start, 0);\n var slice = changetype>(__newArray(length, alignof(), idof>()));\n var sliceBase = slice.dataStart;\n var thisBase = changetype(this) + (start << alignof());\n if (isManaged()) {\n let off = 0;\n let end = length << alignof();\n while (off < end) {\n let ref = load(thisBase + off);\n store(sliceBase + off, ref);\n __link(changetype(slice), ref, true);\n off += sizeof();\n }\n } else {\n memory.copy(sliceBase, thisBase, length << alignof());\n }\n return slice;\n }\n\n findIndex(fn: (value: T, index: i32, array: StaticArray) => bool): i32 {\n for (let i = 0, len = this.length; i < len; ++i) {\n if (fn(load(changetype(this) + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n findLastIndex(fn: (value: T, index: i32, array: StaticArray) => bool): i32 {\n for (let i = this.length - 1; i >= 0; --i) {\n if (fn(load(changetype(this) + (i << alignof())), i, this)) return i;\n }\n return -1;\n }\n\n forEach(fn: (value: T, index: i32, array: StaticArray) => void): void {\n for (let i = 0, len = this.length; i < len; ++i) {\n fn(load(changetype(this) + (i << alignof())), i, this);\n }\n }\n\n map(fn: (value: T, index: i32, array: StaticArray) => U): Array {\n var len = this.length;\n var out = changetype>(__newArray(len, alignof(), idof>()));\n var outStart = out.dataStart;\n for (let i = 0; i < len; ++i) {\n let result = fn(load(changetype(this) + (i << alignof())), i, this);\n store(outStart + (i << alignof()), result);\n if (isManaged()) {\n __link(changetype(out), changetype(result), true);\n }\n }\n return out;\n }\n\n filter(fn: (value: T, index: i32, array: StaticArray) => bool): Array {\n var result = changetype>(__newArray(0, alignof(), idof>()));\n for (let i = 0, len = this.length; i < len; ++i) {\n let value = load(changetype(this) + (i << alignof()));\n if (fn(value, i, this)) result.push(value);\n }\n return result;\n }\n\n reduce(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: StaticArray) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = 0, len = this.length; i < len; ++i) {\n acc = fn(acc, load(changetype(this) + (i << alignof())), i, this);\n }\n return acc;\n }\n\n reduceRight(\n fn: (previousValue: U, currentValue: T, currentIndex: i32, array: StaticArray) => U,\n initialValue: U\n ): U {\n var acc = initialValue;\n for (let i = this.length - 1; i >= 0; --i) {\n acc = fn(acc, load(changetype(this) + (i << alignof())), i, this);\n }\n return acc;\n }\n\n every(fn: (value: T, index: i32, array: StaticArray) => bool): bool {\n for (let i = 0, len = this.length; i < len; ++i) {\n if (!fn(load(changetype(this) + (i << alignof())), i, this)) return false;\n }\n return true;\n }\n\n some(fn: (value: T, index: i32, array: StaticArray) => bool): bool {\n for (let i = 0, len = this.length; i < len; ++i) {\n if (fn(load(changetype(this) + (i << alignof())), i, this)) return true;\n }\n return false;\n }\n\n sort(comparator: (a: T, b: T) => i32 = COMPARATOR()): this {\n SORT(changetype(this), this.length, comparator);\n return this;\n }\n\n join(separator: string = \",\"): string {\n if (isBoolean()) return joinBooleanArray(changetype(this), this.length, separator);\n if (isInteger()) return joinIntegerArray(changetype(this), this.length, separator);\n if (isFloat()) return joinFloatArray(changetype(this), this.length, separator);\n if (ASC_SHRINK_LEVEL < 1) {\n if (isString()) return joinStringArray(changetype(this), this.length, separator);\n }\n if (isReference()) return joinReferenceArray(changetype(this), this.length, separator);\n ERROR(\"unspported element type\");\n return unreachable();\n }\n\n reverse(): this {\n REVERSE(changetype(this), this.length);\n return this;\n }\n\n toString(): string {\n return this.join();\n }\n\n // RT integration\n\n @unsafe private __visit(cookie: u32): void {\n if (isManaged()) {\n let cur = changetype(this);\n let end = cur + changetype(changetype(this) - TOTAL_OVERHEAD).rtSize;\n while (cur < end) {\n let val = load(cur);\n if (val) __visit(val, cookie);\n cur += sizeof();\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/oldwasm/wasm/build/untouched.wat b/oldwasm/wasm/build/untouched.wat deleted file mode 100644 index e1aded74..00000000 --- a/oldwasm/wasm/build/untouched.wat +++ /dev/null @@ -1,9566 +0,0 @@ -(module - (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_=>_none (func (param i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) - (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32))) - (type $none_=>_none (func)) - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i64_i32_=>_i32 (func (param i64 i32) (result i32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) - (type $i32_i64_i32_=>_none (func (param i32 i64 i32))) - (type $i32_i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32 i32) (result i32))) - (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $f64_=>_f64 (func (param f64) (result f64))) - (type $none_=>_f64 (func (result f64))) - (type $i32_i64_i32_i64_i32_i64_i32_=>_i32 (func (param i32 i64 i32 i64 i32 i64 i32) (result i32))) - (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) - (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) - (type $i32_i64_i32_i32_=>_none (func (param i32 i64 i32 i32))) - (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i64_=>_i32 (func (param i32 i64) (result i32))) - (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) - (import "aegis" "log" (func $assembly/aegis/log (param i32))) - (import "aegis" "addListener" (func $assembly/aegis/addListener (param i32 i32))) - (import "aegis" "fireEvent" (func $assembly/aegis/fireEvent (param i32 i32 f64))) - (import "env" "Date.now" (func $~lib/bindings/dom/Date.now (result f64))) - (global $assembly/neural-net/RegularizationFunction.L2 (mut i32) (i32.const 0)) - (global $assembly/index/key i32 (i32.const 0)) - (global $assembly/index/val i32 (i32.const 1)) - (global $assembly/index/ArrayOfStrings_ID i32 (i32.const 4)) - (global $~lib/rt/itcms/white (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/iter (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/toSpace (mut i32) (i32.const 0)) - (global $~lib/shared/runtime/Runtime.Stub i32 (i32.const 0)) - (global $~lib/shared/runtime/Runtime.Minimal i32 (i32.const 1)) - (global $~lib/shared/runtime/Runtime.Incremental i32 (i32.const 2)) - (global $~lib/rt/itcms/state (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/total (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/threshold (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/visitCount (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/pinSpace (mut i32) (i32.const 0)) - (global $~lib/rt/itcms/fromSpace (mut i32) (i32.const 0)) - (global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0)) - (global $~lib/native/ASC_LOW_MEMORY_LIMIT i32 (i32.const 0)) - (global $~lib/native/ASC_RUNTIME i32 (i32.const 2)) - (global $~lib/native/ASC_SHRINK_LEVEL i32 (i32.const 0)) - (global $~lib/util/number/_frc_plus (mut i64) (i64.const 0)) - (global $~lib/util/number/_frc_minus (mut i64) (i64.const 0)) - (global $~lib/util/number/_exp (mut i32) (i32.const 0)) - (global $~lib/util/number/_K (mut i32) (i32.const 0)) - (global $~lib/util/number/_frc_pow (mut i64) (i64.const 0)) - (global $~lib/util/number/_exp_pow (mut i32) (i32.const 0)) - (global $~lib/builtins/u32.MAX_VALUE i32 (i32.const -1)) - (global $~lib/date/_day (mut i32) (i32.const 0)) - (global $~lib/date/_month (mut i32) (i32.const 0)) - (global $~lib/rt/__rtti_base i32 (i32.const 8384)) - (global $~lib/memory/__data_end i32 (i32.const 8468)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 24852)) - (global $~lib/memory/__heap_base i32 (i32.const 24852)) - (memory $0 1) - (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00 \00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00t\00c\00m\00s\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 80) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 108) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00\00\00\00\00\00\00\00\00") - (data (i32.const 172) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00~\00l\00i\00b\00/\00r\00t\00.\00t\00s\00\00\00\00\00\00\00\00\00") - (data (i32.const 220) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") - (data (i32.const 288) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 320) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 348) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 412) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00w\00a\00s\00m\00\00\00\00\00") - (data (i32.const 444) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1c\00\00\00I\00n\00v\00a\00l\00i\00d\00 \00l\00e\00n\00g\00t\00h\00") - (data (i32.const 492) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00\00\00") - (data (i32.const 540) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00k\00e\00y\001\00\00\00\00\00") - (data (i32.const 572) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00E\00l\00e\00m\00e\00n\00t\00 \00t\00y\00p\00e\00 \00m\00u\00s\00t\00 \00b\00e\00 \00n\00u\00l\00l\00a\00b\00l\00e\00 \00i\00f\00 \00a\00r\00r\00a\00y\00 \00i\00s\00 \00h\00o\00l\00e\00y\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 700) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 732) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00k\00e\00y\002\00\00\00\00\00") - (data (i32.const 764) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00f\00i\00b\00o\00n\00a\00c\00c\00i\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 812) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00p\00o\00r\00t\001\00\00\00") - (data (i32.const 844) "|\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00^\00\00\00d\00F\00l\00o\00w\00,\00o\00u\00t\00b\00o\00u\00n\00d\00,\00d\00F\00l\00o\00w\00_\00s\00t\00a\00r\00t\00,\00p\00o\00r\00t\001\00_\00d\00o\00n\00e\00,\00p\00o\00r\00t\001\00C\00b\00,\001\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 972) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00@\03\00\00`\03\00\00\00\00\00\00") - (data (i32.const 1004) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00p\00o\00r\00t\002\00\00\00") - (data (i32.const 1036) "l\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\\\00\00\00d\00F\00l\00o\00w\00,\00o\00u\00t\00b\00o\00u\00n\00d\00,\00p\00o\00r\00t\001\00_\00d\00o\00n\00e\00,\00p\00o\00r\00t\002\00_\00d\00o\00n\00e\00,\00p\00o\00r\00t\002\00C\00b\00,\001\00") - (data (i32.const 1148) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\00\04\00\00 \04\00\00\00\00\00\00") - (data (i32.const 1180) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00p\00o\00r\00t\00\00\00\00\00") - (data (i32.const 1212) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\b0\04\00\00@\03\00\00\00\00\00\00") - (data (i32.const 1244) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00c\00a\00l\00l\00b\00a\00c\00k\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1292) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00p\00o\00r\00t\001\00C\00b\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1340) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\f0\04\00\00 \05\00\00\00\00\00\00") - (data (i32.const 1372) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00c\00o\00n\00s\00u\00m\00e\00s\00E\00v\00e\00n\00t\00\00\00") - (data (i32.const 1420) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\16\00\00\00d\00F\00l\00o\00w\00_\00s\00t\00a\00r\00t\00\00\00\00\00\00\00") - (data (i32.const 1468) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00p\05\00\00\a0\05\00\00\00\00\00\00") - (data (i32.const 1500) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00p\00r\00o\00d\00u\00c\00e\00s\00E\00v\00e\00n\00t\00\00\00") - (data (i32.const 1548) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00p\00o\00r\00t\001\00_\00d\00o\00n\00e\00\00\00\00\00\00\00\00\00") - (data (i32.const 1596) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\f0\05\00\00 \06\00\00\00\00\00\00") - (data (i32.const 1628) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00p\00o\00r\00f\00 \00i\00n\00v\00o\00k\00c\00e\00d\00\00\00") - (data (i32.const 1676) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00 \00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1708) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\b0\04\00\00\00\04\00\00\00\00\00\00") - (data (i32.const 1740) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00p\00o\00r\00t\002\00C\00b\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 1788) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\f0\04\00\00\e0\06\00\00\00\00\00\00") - (data (i32.const 1820) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00p\05\00\00 \06\00\00\00\00\00\00") - (data (i32.const 1852) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\14\00\00\00p\00o\00r\00t\002\00_\00d\00o\00n\00e\00\00\00\00\00\00\00\00\00") - (data (i32.const 1900) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\f0\05\00\00P\07\00\00\00\00\00\00") - (data (i32.const 1932) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00p\00o\00r\00f\00 \00i\00n\00v\00o\00k\00e\00d\00\00\00\00\00") - (data (i32.const 1980) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\"\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00L\00i\00s\00t\00e\00n\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2044) "\\\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00F\00\00\00t\00e\00l\00l\00 \00w\00a\00s\00m\00 \00m\00o\00d\00u\00l\00e\00 \00t\00o\00 \00b\00e\00g\00i\00n\00 \00l\00i\00s\00t\00e\00n\00i\00n\00g\00\00\00\00\00\00\00") - (data (i32.const 2140) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\d0\07\00\00\10\08\00\00\00\00\00\00") - (data (i32.const 2172) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\"\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00N\00o\00t\00i\00f\00y\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2236) "\\\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00D\00\00\00t\00e\00l\00l\00 \00w\00a\00s\00m\00 \00m\00o\00d\00u\00l\00e\00 \00t\00o\00 \00s\00e\00n\00d\00 \00b\00r\00o\00a\00d\00c\00a\00s\00t\00\00\00\00\00\00\00\00\00") - (data (i32.const 2332) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\90\08\00\00\d0\08\00\00\00\00\00\00") - (data (i32.const 2364) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00C\00a\00l\00l\00b\00a\00c\00k\00\00\00\00\00\00\00") - (data (i32.const 2428) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00,\00\00\00s\00u\00b\00s\00c\00r\00i\00b\00e\00d\00 \00e\00v\00e\00n\00t\00 \00f\00i\00r\00e\00d\00") - (data (i32.const 2492) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00P\t\00\00\90\t\00\00\00\00\00\00") - (data (i32.const 2524) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00r\00u\00n\00F\00i\00b\00o\00n\00a\00c\00c\00i\00\00\00\00\00") - (data (i32.const 2572) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\004\00\00\00r\00e\00m\00o\00t\00e\00 \00c\00a\00l\00c\00u\00l\00a\00t\00e\00 \00f\00i\00b\00o\00n\00a\00c\00c\00i\00\00\00\00\00\00\00\00\00") - (data (i32.const 2652) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\f0\t\00\00 \n\00\00\00\00\00\00") - (data (i32.const 2684) "\\\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00@\00\00\00c\00a\00l\00c\00u\00l\00a\00t\00e\00 \00f\00i\00b\00o\00n\00a\00c\00c\00i\00 \00f\00o\00r\00 \00a\00 \00n\00u\00m\00b\00e\00r\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 2780) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\10\03\00\00\90\n\00\00\00\00\00\00") - (data (i32.const 2812) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\18\00\00\00d\00e\00p\00l\00o\00y\00M\00o\00d\00u\00l\00e\00\00\00\00\00") - (data (i32.const 2860) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00<\00\00\00r\00e\00q\00u\00e\00s\00t\00 \00d\00e\00p\00l\00o\00y\00m\00e\00n\00t\00 \00o\00f\00 \00a\00 \00m\00o\00d\00u\00l\00e\00") - (data (i32.const 2940) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\10\0b\00\00@\0b\00\00\00\00\00\00") - (data (i32.const 2972) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00c\00o\00m\00m\00a\00n\00d\00E\00x\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3020) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1e\00\00\00c\00o\00m\00m\00a\00n\00d\00 \00e\00x\00a\00m\00p\00l\00e\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3084) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\b0\0b\00\00\e0\0b\00\00\00\00\00\00") - (data (i32.const 3116) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00$\00\00\00\n\00c\00o\00m\00m\00a\00n\00d\00E\00x\00 \00c\00a\00l\00l\00e\00d\00 \00\00\00\00\00\00\00\00\00") - (data (i32.const 3180) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00:\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3212) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\"\00\00\00c\00o\00m\00m\00a\00n\00d\00E\00x\00_\00u\00p\00d\00a\00t\00e\00!\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3276) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\000\02\00\00\a0\0c\00\00\00\00\00\00") - (data (i32.const 3308) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00&\00\00\00s\00e\00r\00v\00i\00c\00e\00M\00e\00s\00h\00L\00i\00s\00t\00e\00n\00:\00 \00\00\00\00\00\00\00") - (data (i32.const 3372) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00:\00 \00\00\00\00\00\00\00\00\00") - (data (i32.const 3404) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00e\00v\00e\00n\00t\00N\00a\00m\00e\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3452) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00m\00o\00d\00e\00l\00N\00a\00m\00e\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3500) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00m\00o\00d\00e\00l\00I\00d\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3548) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00<\00\00\00w\00a\00s\00m\00 \00n\00o\00t\00i\00f\00y\00 \00c\00a\00l\00l\00e\00d\00 \00w\00i\00t\00h\00 \00a\00r\00g\00s\00:\00 \00") - (data (i32.const 3628) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\1a\00\00\00w\00a\00s\00m\00W\00e\00b\00L\00i\00s\00t\00e\00n\00\00\00") - (data (i32.const 3676) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\004\00\00\00w\00e\00b\00s\00o\00c\00k\00e\00t\00 \00c\00a\00l\00l\00b\00a\00c\00k\00 \00f\00i\00r\00e\00d\00:\00 \00\00\00\00\00\00\00\00\00") - (data (i32.const 3756) "\1c\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\000\02\00\00P\t\00\00\00\00\00\00") - (data (i32.const 3788) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00r\00e\00s\00u\00l\00t\00") - (data (i32.const 3820) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\000\00.\000\00\00\00\00\00\00\00") - (data (i32.const 3852) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00N\00a\00N\00\00\00\00\00\00\00") - (data (i32.const 3884) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00-\00I\00n\00f\00i\00n\00i\00t\00y\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3932) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00I\00n\00f\00i\00n\00i\00t\00y\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 3984) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 4040) "\88\02\1c\08\a0\d5\8f\fav\bf>\a2\7f\e1\ae\bav\acU0 \fb\16\8b\ea5\ce]J\89B\cf-;eU\aa\b0k\9a\dfE\1a=\03\cf\1a\e6\ca\c6\9a\c7\17\fep\abO\dc\bc\be\fc\b1w\ff\0c\d6kA\ef\91V\be<\fc\7f\90\ad\1f\d0\8d\83\9aU1(\\Q\d3\b5\c9\a6\ad\8f\acq\9d\cb\8b\ee#w\"\9c\eamSx@\91I\cc\aeW\ce\b6]y\12<\827V\fbM6\94\10\c2O\98H8o\ea\96\90\c7:\82%\cb\85t\d7\f4\97\bf\97\cd\cf\86\a0\e5\ac*\17\98\n4\ef\8e\b25*\fbg8\b2;?\c6\d2\df\d4\c8\84\ba\cd\d3\1a\'D\dd\c5\96\c9%\bb\ce\9fk\93\84\a5b}$l\ac\db\f6\da_\0dXf\ab\a3&\f1\c3\de\93\f8\e2\f3\b8\80\ff\aa\a8\ad\b5\b5\8bJ|l\05_b\87S0\c14`\ff\bc\c9U&\ba\91\8c\85N\96\bd~)p$w\f9\df\8f\b8\e5\b8\9f\bd\df\a6\94}t\88\cf_\a9\f8\cf\9b\a8\8f\93pD\b9k\15\0f\bf\f8\f0\08\8a\b611eU%\b0\cd\ac\7f{\d0\c6\e2?\99\06;+*\c4\10\\\e4\d3\92si\99$$\aa\0e\ca\00\83\f2\b5\87\fd\eb\1a\11\92d\08\e5\bc\cc\88Po\t\cc\bc\8c,e\19\e2X\17\b7\d1\00\00\00\00\00\00@\9c\00\00\00\00\10\a5\d4\e8\00\00b\ac\c5\ebx\ad\84\t\94\f8x9?\81\b3\15\07\c9{\ce\97\c0p\\\ea{\ce2~\8fh\80\e9\ab\a48\d2\d5E\"\9a\17&\'O\9f\'\fb\c4\d41\a2c\ed\a8\ad\c8\8c8e\de\b0\dbe\ab\1a\8e\08\c7\83\9a\1dqB\f9\1d]\c4X\e7\1b\a6,iM\92\ea\8dp\1ad\ee\01\daJw\ef\9a\99\a3m\a2\85k}\b4{x\t\f2w\18\ddy\a1\e4T\b4\c2\c5\9b[\92\86[\86=]\96\c8\c5S5\c8\b3\a0\97\fa\\\b4*\95\e3_\a0\99\bd\9fF\de%\8c9\db4\c2\9b\a5\\\9f\98\a3r\9a\c6\f6\ce\be\e9TS\bf\dc\b7\e2A\"\f2\17\f3\fc\88\a5x\\\d3\9b\ce \cc\dfS!{\f3Z\16\98:0\1f\97\dc\b5\a0\e2\96\b3\e3\\S\d1\d9\a8>#set:buffer (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store - local.get $0 - local.get $1 - i32.const 0 - call $~lib/rt/itcms/__link - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:dataStart (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:byteLength (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=8 - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:length_ (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=12 - ) - (func $~lib/array/Array<~lib/string/String>#get:length (param $this i32) (result i32) - local.get $this - i32.load offset=12 - ) - (func $~lib/string/String#get:length (param $this i32) (result i32) - local.get $this - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - ) - (func $~lib/util/string/compareImpl (param $str1 i32) (param $index1 i32) (param $str2 i32) (param $index2 i32) (param $len i32) (result i32) - (local $ptr1 i32) - (local $ptr2 i32) - (local $var$7 i32) - (local $a i32) - (local $b i32) - local.get $str1 - local.get $index1 - i32.const 1 - i32.shl - i32.add - local.set $ptr1 - local.get $str2 - local.get $index2 - i32.const 1 - i32.shl - i32.add - local.set $ptr2 - i32.const 0 - i32.const 2 - i32.lt_s - drop - local.get $len - i32.const 4 - i32.ge_u - if (result i32) - local.get $ptr1 - i32.const 7 - i32.and - local.get $ptr2 - i32.const 7 - i32.and - i32.or - i32.eqz - else - i32.const 0 - end - if - block $do-break|0 - loop $do-loop|0 - local.get $ptr1 - i64.load - local.get $ptr2 - i64.load - i64.ne - if - br $do-break|0 - end - local.get $ptr1 - i32.const 8 - i32.add - local.set $ptr1 - local.get $ptr2 - i32.const 8 - i32.add - local.set $ptr2 - local.get $len - i32.const 4 - i32.sub - local.set $len - local.get $len - i32.const 4 - i32.ge_u - br_if $do-loop|0 - end - end - end - loop $while-continue|1 - local.get $len - local.tee $var$7 - i32.const 1 - i32.sub - local.set $len - local.get $var$7 - local.set $var$7 - local.get $var$7 - if - local.get $ptr1 - i32.load16_u - local.set $a - local.get $ptr2 - i32.load16_u - local.set $b - local.get $a - local.get $b - i32.ne - if - local.get $a - local.get $b - i32.sub - return - end - local.get $ptr1 - i32.const 2 - i32.add - local.set $ptr1 - local.get $ptr2 - i32.const 2 - i32.add - local.set $ptr2 - br $while-continue|1 - end - end - i32.const 0 - ) - (func $~lib/string/String.__eq (param $left i32) (param $right i32) (result i32) - (local $leftLength i32) - local.get $left - local.get $right - i32.eq - if - i32.const 1 - return - end - local.get $left - i32.const 0 - i32.eq - if (result i32) - i32.const 1 - else - local.get $right - i32.const 0 - i32.eq - end - if - i32.const 0 - return - end - local.get $left - call $~lib/string/String#get:length - local.set $leftLength - local.get $leftLength - local.get $right - call $~lib/string/String#get:length - i32.ne - if - i32.const 0 - return - end - local.get $left - i32.const 0 - local.get $right - i32.const 0 - local.get $leftLength - call $~lib/util/string/compareImpl - i32.eqz - ) - (func $~lib/string/String#toString (param $this i32) (result i32) - local.get $this - ) - (func $~lib/rt/__newBuffer (param $size i32) (param $id i32) (param $data i32) (result i32) - (local $buffer i32) - local.get $size - local.get $id - call $~lib/rt/itcms/__new - local.set $buffer - local.get $data - if - local.get $buffer - local.get $data - local.get $size - memory.copy - end - local.get $buffer - ) - (func $~lib/array/Array<~lib/string/String>#__uset (param $this i32) (param $index i32) (param $value i32) - local.get $this - i32.load offset=4 - local.get $index - i32.const 2 - i32.shl - i32.add - local.get $value - i32.store - i32.const 1 - drop - local.get $this - local.get $value - i32.const 1 - call $~lib/rt/itcms/__link - ) - (func $~lib/rt/itcms/__renew (param $oldPtr i32) (param $size i32) (result i32) - (local $oldObj i32) - (local $newPtr i32) - (local $var$4 i32) - (local $var$5 i32) - local.get $oldPtr - i32.const 20 - i32.sub - local.set $oldObj - local.get $size - local.get $oldObj - i32.load - i32.const 3 - i32.const -1 - i32.xor - i32.and - i32.const 16 - i32.sub - i32.le_u - if - local.get $oldObj - local.get $size - call $~lib/rt/itcms/Object#set:rtSize - local.get $oldPtr - return - end - local.get $size - local.get $oldObj - i32.load offset=12 - call $~lib/rt/itcms/__new - local.set $newPtr - local.get $newPtr - local.get $oldPtr - local.get $size - local.tee $var$4 - local.get $oldObj - i32.load offset=16 - local.tee $var$5 - local.get $var$4 - local.get $var$5 - i32.lt_u - select - memory.copy - local.get $newPtr - ) - (func $~lib/array/ensureCapacity (param $array i32) (param $newSize i32) (param $alignLog2 i32) (param $canGrow i32) - (local $oldCapacity i32) - (local $var$5 i32) - (local $var$6 i32) - (local $var$7 i32) - (local $var$8 i32) - local.get $array - i32.load offset=8 - local.set $oldCapacity - local.get $newSize - local.get $oldCapacity - local.get $alignLog2 - i32.shr_u - i32.gt_u - if - local.get $newSize - i32.const 1073741820 - local.get $alignLog2 - i32.shr_u - i32.gt_u - if - i32.const 464 - i32.const 512 - i32.const 19 - i32.const 48 - call $~lib/builtins/abort - unreachable - end - local.get $array - i32.load - local.set $var$5 - local.get $newSize - local.tee $var$6 - i32.const 8 - local.tee $var$7 - local.get $var$6 - local.get $var$7 - i32.gt_u - select - local.get $alignLog2 - i32.shl - local.set $var$6 - local.get $canGrow - if - local.get $oldCapacity - i32.const 1 - i32.shl - local.tee $var$7 - i32.const 1073741820 - local.tee $var$8 - local.get $var$7 - local.get $var$8 - i32.lt_u - select - local.tee $var$8 - local.get $var$6 - local.tee $var$7 - local.get $var$8 - local.get $var$7 - i32.gt_u - select - local.set $var$6 - end - local.get $var$5 - local.get $var$6 - call $~lib/rt/itcms/__renew - local.set $var$8 - i32.const 2 - global.get $~lib/shared/runtime/Runtime.Incremental - i32.ne - drop - local.get $var$8 - local.get $var$5 - i32.ne - if - local.get $array - local.get $var$8 - i32.store - local.get $array - local.get $var$8 - i32.store offset=4 - local.get $array - local.get $var$8 - i32.const 0 - call $~lib/rt/itcms/__link - end - local.get $array - local.get $var$6 - i32.store offset=8 - end - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset (param $this i32) (param $index i32) (param $value i32) - local.get $this - i32.load offset=4 - local.get $index - i32.const 2 - i32.shl - i32.add - local.get $value - i32.store - i32.const 1 - drop - local.get $this - local.get $value - i32.const 1 - call $~lib/rt/itcms/__link - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set (param $this i32) (param $index i32) (param $value i32) - local.get $index - local.get $this - i32.load offset=12 - i32.ge_u - if - local.get $index - i32.const 0 - i32.lt_s - if - i32.const 128 - i32.const 512 - i32.const 130 - i32.const 22 - call $~lib/builtins/abort - unreachable - end - local.get $this - local.get $index - i32.const 1 - i32.add - i32.const 2 - i32.const 1 - call $~lib/array/ensureCapacity - local.get $this - local.get $index - i32.const 1 - i32.add - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:length_ - end - local.get $this - local.get $index - local.get $value - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - ) - (func $~lib/string/String.__concat (param $left i32) (param $right i32) (result i32) - local.get $left - local.get $right - call $~lib/string/String#concat - ) - (func $assembly/index/fibonacci (param $x f64) (result f64) - local.get $x - f64.const 0 - f64.eq - if - f64.const 0 - return - end - local.get $x - f64.const 1 - f64.eq - if - f64.const 1 - return - end - local.get $x - f64.const 1 - f64.sub - call $assembly/index/fibonacci - local.get $x - f64.const 2 - f64.sub - call $assembly/index/fibonacci - f64.add - ) - (func $~lib/util/string/isSpace (param $c i32) (result i32) - (local $var$1 i32) - local.get $c - i32.const 5760 - i32.lt_u - if - local.get $c - i32.const 128 - i32.or - i32.const 160 - i32.eq - if (result i32) - i32.const 1 - else - local.get $c - i32.const 9 - i32.sub - i32.const 13 - i32.const 9 - i32.sub - i32.le_u - end - return - end - local.get $c - i32.const 8192 - i32.sub - i32.const 8202 - i32.const 8192 - i32.sub - i32.le_u - if - i32.const 1 - return - end - block $break|0 - block $case6|0 - block $case5|0 - block $case4|0 - block $case3|0 - block $case2|0 - block $case1|0 - block $case0|0 - local.get $c - local.set $var$1 - local.get $var$1 - i32.const 5760 - i32.eq - br_if $case0|0 - local.get $var$1 - i32.const 8232 - i32.eq - br_if $case1|0 - local.get $var$1 - i32.const 8233 - i32.eq - br_if $case2|0 - local.get $var$1 - i32.const 8239 - i32.eq - br_if $case3|0 - local.get $var$1 - i32.const 8287 - i32.eq - br_if $case4|0 - local.get $var$1 - i32.const 12288 - i32.eq - br_if $case5|0 - local.get $var$1 - i32.const 65279 - i32.eq - br_if $case6|0 - br $break|0 - end - end - end - end - end - end - end - i32.const 1 - return - end - i32.const 0 - ) - (func $~lib/util/string/strtol (param $str i32) (param $radix i32) (result f64) - (local $len i32) - (local $ptr i32) - (local $code i32) - (local $var$5 i32) - (local $sign f64) - (local $num f64) - (local $initial i32) - local.get $str - call $~lib/string/String#get:length - local.set $len - local.get $len - i32.eqz - if - i32.const 1 - drop - f64.const nan:0x8000000000000 - return - end - local.get $str - local.set $ptr - local.get $ptr - i32.load16_u - local.set $code - loop $while-continue|0 - local.get $code - call $~lib/util/string/isSpace - local.set $var$5 - local.get $var$5 - if - local.get $ptr - i32.const 2 - i32.add - local.tee $ptr - i32.load16_u - local.set $code - local.get $len - i32.const 1 - i32.sub - local.set $len - br $while-continue|0 - end - end - f64.const 1 - local.set $sign - local.get $code - i32.const 45 - i32.eq - if (result i32) - i32.const 1 - else - local.get $code - i32.const 43 - i32.eq - end - if - local.get $len - i32.const 1 - i32.sub - local.tee $len - i32.eqz - if - i32.const 1 - drop - f64.const nan:0x8000000000000 - return - end - local.get $code - i32.const 45 - i32.eq - if - f64.const -1 - local.set $sign - end - local.get $ptr - i32.const 2 - i32.add - local.tee $ptr - i32.load16_u - local.set $code - end - local.get $radix - if - local.get $radix - i32.const 2 - i32.lt_s - if (result i32) - i32.const 1 - else - local.get $radix - i32.const 36 - i32.gt_s - end - if - i32.const 1 - drop - f64.const nan:0x8000000000000 - return - end - local.get $radix - i32.const 16 - i32.eq - if - local.get $len - i32.const 2 - i32.gt_s - if (result i32) - local.get $code - i32.const 48 - i32.eq - else - i32.const 0 - end - if (result i32) - local.get $ptr - i32.load16_u offset=2 - i32.const 32 - i32.or - i32.const 120 - i32.eq - else - i32.const 0 - end - if - local.get $ptr - i32.const 4 - i32.add - local.set $ptr - local.get $len - i32.const 2 - i32.sub - local.set $len - end - end - else - local.get $code - i32.const 48 - i32.eq - if (result i32) - local.get $len - i32.const 2 - i32.gt_s - else - i32.const 0 - end - if - block $break|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $ptr - i32.load16_u offset=2 - i32.const 32 - i32.or - local.set $var$5 - local.get $var$5 - i32.const 98 - i32.eq - br_if $case0|1 - local.get $var$5 - i32.const 111 - i32.eq - br_if $case1|1 - local.get $var$5 - i32.const 120 - i32.eq - br_if $case2|1 - br $break|1 - end - local.get $ptr - i32.const 4 - i32.add - local.set $ptr - local.get $len - i32.const 2 - i32.sub - local.set $len - i32.const 2 - local.set $radix - br $break|1 - end - local.get $ptr - i32.const 4 - i32.add - local.set $ptr - local.get $len - i32.const 2 - i32.sub - local.set $len - i32.const 8 - local.set $radix - br $break|1 - end - local.get $ptr - i32.const 4 - i32.add - local.set $ptr - local.get $len - i32.const 2 - i32.sub - local.set $len - i32.const 16 - local.set $radix - br $break|1 - end - end - local.get $radix - i32.eqz - if - i32.const 10 - local.set $radix - end - end - f64.const 0 - local.set $num - local.get $len - i32.const 1 - i32.sub - local.set $initial - block $while-break|2 - loop $while-continue|2 - local.get $len - local.tee $var$5 - i32.const 1 - i32.sub - local.set $len - local.get $var$5 - local.set $var$5 - local.get $var$5 - if - local.get $ptr - i32.load16_u - local.set $code - local.get $code - i32.const 48 - i32.sub - i32.const 10 - i32.lt_u - if - local.get $code - i32.const 48 - i32.sub - local.set $code - else - local.get $code - i32.const 65 - i32.sub - i32.const 90 - i32.const 65 - i32.sub - i32.le_u - if - local.get $code - i32.const 65 - i32.const 10 - i32.sub - i32.sub - local.set $code - else - local.get $code - i32.const 97 - i32.sub - i32.const 122 - i32.const 97 - i32.sub - i32.le_u - if - local.get $code - i32.const 97 - i32.const 10 - i32.sub - i32.sub - local.set $code - end - end - end - local.get $code - local.get $radix - i32.ge_u - if - local.get $initial - local.get $len - i32.eq - if - i32.const 1 - drop - f64.const nan:0x8000000000000 - return - end - br $while-break|2 - end - local.get $num - local.get $radix - f64.convert_i32_s - f64.mul - local.get $code - f64.convert_i32_u - f64.add - local.set $num - local.get $ptr - i32.const 2 - i32.add - local.set $ptr - br $while-continue|2 - end - end - end - local.get $sign - local.get $num - f64.mul - ) - (func $~lib/string/parseInt (param $str i32) (param $radix i32) (result f64) - local.get $str - local.get $radix - call $~lib/util/string/strtol - ) - (func $~lib/util/number/decimalCount32 (param $value i32) (result i32) - local.get $value - i32.const 100000 - i32.lt_u - if - local.get $value - i32.const 100 - i32.lt_u - if - i32.const 1 - local.get $value - i32.const 10 - i32.ge_u - i32.add - return - else - i32.const 3 - local.get $value - i32.const 10000 - i32.ge_u - i32.add - local.get $value - i32.const 1000 - i32.ge_u - i32.add - return - end - unreachable - else - local.get $value - i32.const 10000000 - i32.lt_u - if - i32.const 6 - local.get $value - i32.const 1000000 - i32.ge_u - i32.add - return - else - i32.const 8 - local.get $value - i32.const 1000000000 - i32.ge_u - i32.add - local.get $value - i32.const 100000000 - i32.ge_u - i32.add - return - end - unreachable - end - unreachable - ) - (func $~lib/util/number/genDigits (param $buffer i32) (param $w_frc i64) (param $w_exp i32) (param $mp_frc i64) (param $mp_exp i32) (param $delta i64) (param $sign i32) (result i32) - (local $one_exp i32) - (local $one_frc i64) - (local $mask i64) - (local $wp_w_frc i64) - (local $p1 i32) - (local $p2 i64) - (local $kappa i32) - (local $len i32) - (local $var$15 i32) - (local $d i32) - (local $var$17 i32) - (local $tmp i64) - (local $var$19 i64) - (local $var$20 i64) - (local $var$21 i64) - (local $d_0 i64) - (local $var$23 i32) - (local $var$24 i32) - (local $var$25 i32) - (local $var$26 i32) - (local $var$27 i64) - i32.const 0 - local.get $mp_exp - i32.sub - local.set $one_exp - i64.const 1 - local.get $one_exp - i64.extend_i32_s - i64.shl - local.set $one_frc - local.get $one_frc - i64.const 1 - i64.sub - local.set $mask - local.get $mp_frc - local.get $w_frc - i64.sub - local.set $wp_w_frc - local.get $mp_frc - local.get $one_exp - i64.extend_i32_s - i64.shr_u - i32.wrap_i64 - local.set $p1 - local.get $mp_frc - local.get $mask - i64.and - local.set $p2 - local.get $p1 - call $~lib/util/number/decimalCount32 - local.set $kappa - local.get $sign - local.set $len - loop $while-continue|0 - local.get $kappa - i32.const 0 - i32.gt_s - local.set $var$15 - local.get $var$15 - if - block $break|1 - block $case10|1 - block $case9|1 - block $case8|1 - block $case7|1 - block $case6|1 - block $case5|1 - block $case4|1 - block $case3|1 - block $case2|1 - block $case1|1 - block $case0|1 - local.get $kappa - local.set $var$17 - local.get $var$17 - i32.const 10 - i32.eq - br_if $case0|1 - local.get $var$17 - i32.const 9 - i32.eq - br_if $case1|1 - local.get $var$17 - i32.const 8 - i32.eq - br_if $case2|1 - local.get $var$17 - i32.const 7 - i32.eq - br_if $case3|1 - local.get $var$17 - i32.const 6 - i32.eq - br_if $case4|1 - local.get $var$17 - i32.const 5 - i32.eq - br_if $case5|1 - local.get $var$17 - i32.const 4 - i32.eq - br_if $case6|1 - local.get $var$17 - i32.const 3 - i32.eq - br_if $case7|1 - local.get $var$17 - i32.const 2 - i32.eq - br_if $case8|1 - local.get $var$17 - i32.const 1 - i32.eq - br_if $case9|1 - br $case10|1 - end - local.get $p1 - i32.const 1000000000 - i32.div_u - local.set $d - local.get $p1 - i32.const 1000000000 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 100000000 - i32.div_u - local.set $d - local.get $p1 - i32.const 100000000 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 10000000 - i32.div_u - local.set $d - local.get $p1 - i32.const 10000000 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 1000000 - i32.div_u - local.set $d - local.get $p1 - i32.const 1000000 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 100000 - i32.div_u - local.set $d - local.get $p1 - i32.const 100000 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 10000 - i32.div_u - local.set $d - local.get $p1 - i32.const 10000 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 1000 - i32.div_u - local.set $d - local.get $p1 - i32.const 1000 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 100 - i32.div_u - local.set $d - local.get $p1 - i32.const 100 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - i32.const 10 - i32.div_u - local.set $d - local.get $p1 - i32.const 10 - i32.rem_u - local.set $p1 - br $break|1 - end - local.get $p1 - local.set $d - i32.const 0 - local.set $p1 - br $break|1 - end - i32.const 0 - local.set $d - br $break|1 - end - local.get $d - local.get $len - i32.or - if - local.get $buffer - local.get $len - local.tee $var$17 - i32.const 1 - i32.add - local.set $len - local.get $var$17 - i32.const 1 - i32.shl - i32.add - i32.const 48 - local.get $d - i32.const 65535 - i32.and - i32.add - i32.store16 - end - local.get $kappa - i32.const 1 - i32.sub - local.set $kappa - local.get $p1 - i64.extend_i32_u - local.get $one_exp - i64.extend_i32_s - i64.shl - local.get $p2 - i64.add - local.set $tmp - local.get $tmp - local.get $delta - i64.le_u - if - global.get $~lib/util/number/_K - local.get $kappa - i32.add - global.set $~lib/util/number/_K - local.get $buffer - local.set $var$23 - local.get $len - local.set $var$17 - local.get $delta - local.set $d_0 - local.get $tmp - local.set $var$21 - i32.const 4912 - local.get $kappa - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.get $one_exp - i64.extend_i32_s - i64.shl - local.set $var$20 - local.get $wp_w_frc - local.set $var$19 - local.get $var$23 - local.get $var$17 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $var$24 - local.get $var$24 - i32.load16_u - local.set $var$25 - loop $while-continue|3 - local.get $var$21 - local.get $var$19 - i64.lt_u - if (result i32) - local.get $d_0 - local.get $var$21 - i64.sub - local.get $var$20 - i64.ge_u - else - i32.const 0 - end - if (result i32) - local.get $var$21 - local.get $var$20 - i64.add - local.get $var$19 - i64.lt_u - if (result i32) - i32.const 1 - else - local.get $var$19 - local.get $var$21 - i64.sub - local.get $var$21 - local.get $var$20 - i64.add - local.get $var$19 - i64.sub - i64.gt_u - end - else - i32.const 0 - end - local.set $var$26 - local.get $var$26 - if - local.get $var$25 - i32.const 1 - i32.sub - local.set $var$25 - local.get $var$21 - local.get $var$20 - i64.add - local.set $var$21 - br $while-continue|3 - end - end - local.get $var$24 - local.get $var$25 - i32.store16 - local.get $len - return - end - br $while-continue|0 - end - end - loop $while-continue|4 - i32.const 1 - local.set $var$15 - local.get $var$15 - if - local.get $p2 - i64.const 10 - i64.mul - local.set $p2 - local.get $delta - i64.const 10 - i64.mul - local.set $delta - local.get $p2 - local.get $one_exp - i64.extend_i32_s - i64.shr_u - local.set $d_0 - local.get $d_0 - local.get $len - i64.extend_i32_s - i64.or - i64.const 0 - i64.ne - if - local.get $buffer - local.get $len - local.tee $var$25 - i32.const 1 - i32.add - local.set $len - local.get $var$25 - i32.const 1 - i32.shl - i32.add - i32.const 48 - local.get $d_0 - i32.wrap_i64 - i32.const 65535 - i32.and - i32.add - i32.store16 - end - local.get $p2 - local.get $mask - i64.and - local.set $p2 - local.get $kappa - i32.const 1 - i32.sub - local.set $kappa - local.get $p2 - local.get $delta - i64.lt_u - if - global.get $~lib/util/number/_K - local.get $kappa - i32.add - global.set $~lib/util/number/_K - local.get $wp_w_frc - i32.const 4912 - i32.const 0 - local.get $kappa - i32.sub - i32.const 2 - i32.shl - i32.add - i64.load32_u - i64.mul - local.set $wp_w_frc - local.get $buffer - local.set $var$17 - local.get $len - local.set $var$26 - local.get $delta - local.set $var$27 - local.get $p2 - local.set $var$21 - local.get $one_frc - local.set $var$20 - local.get $wp_w_frc - local.set $var$19 - local.get $var$17 - local.get $var$26 - i32.const 1 - i32.sub - i32.const 1 - i32.shl - i32.add - local.set $var$25 - local.get $var$25 - i32.load16_u - local.set $var$24 - loop $while-continue|6 - local.get $var$21 - local.get $var$19 - i64.lt_u - if (result i32) - local.get $var$27 - local.get $var$21 - i64.sub - local.get $var$20 - i64.ge_u - else - i32.const 0 - end - if (result i32) - local.get $var$21 - local.get $var$20 - i64.add - local.get $var$19 - i64.lt_u - if (result i32) - i32.const 1 - else - local.get $var$19 - local.get $var$21 - i64.sub - local.get $var$21 - local.get $var$20 - i64.add - local.get $var$19 - i64.sub - i64.gt_u - end - else - i32.const 0 - end - local.set $var$23 - local.get $var$23 - if - local.get $var$24 - i32.const 1 - i32.sub - local.set $var$24 - local.get $var$21 - local.get $var$20 - i64.add - local.set $var$21 - br $while-continue|6 - end - end - local.get $var$25 - local.get $var$24 - i32.store16 - local.get $len - return - end - br $while-continue|4 - end - end - unreachable - ) - (func $~lib/util/number/utoa32_dec_lut (param $buffer i32) (param $num i32) (param $offset i32) - (local $var$3 i32) - (local $t i32) - (local $r i32) - (local $d1 i32) - (local $d2 i32) - (local $digits1 i64) - (local $digits2 i64) - (local $var$10 i32) - (local $var$11 i32) - loop $while-continue|0 - local.get $num - i32.const 10000 - i32.ge_u - local.set $var$3 - local.get $var$3 - if - local.get $num - i32.const 10000 - i32.div_u - local.set $t - local.get $num - i32.const 10000 - i32.rem_u - local.set $r - local.get $t - local.set $num - local.get $r - i32.const 100 - i32.div_u - local.set $d1 - local.get $r - i32.const 100 - i32.rem_u - local.set $d2 - i32.const 4952 - local.get $d1 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $digits1 - i32.const 4952 - local.get $d2 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $digits2 - local.get $offset - i32.const 4 - i32.sub - local.set $offset - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - local.get $digits1 - local.get $digits2 - i64.const 32 - i64.shl - i64.or - i64.store - br $while-continue|0 - end - end - local.get $num - i32.const 100 - i32.ge_u - if - local.get $num - i32.const 100 - i32.div_u - local.set $var$3 - local.get $num - i32.const 100 - i32.rem_u - local.set $var$10 - local.get $var$3 - local.set $num - local.get $offset - i32.const 2 - i32.sub - local.set $offset - i32.const 4952 - local.get $var$10 - i32.const 2 - i32.shl - i32.add - i32.load - local.set $var$11 - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - local.get $var$11 - i32.store - end - local.get $num - i32.const 10 - i32.ge_u - if - local.get $offset - i32.const 2 - i32.sub - local.set $offset - i32.const 4952 - local.get $num - i32.const 2 - i32.shl - i32.add - i32.load - local.set $var$11 - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - local.get $var$11 - i32.store - else - local.get $offset - i32.const 1 - i32.sub - local.set $offset - i32.const 48 - local.get $num - i32.add - local.set $var$11 - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - local.get $var$11 - i32.store16 - end - ) - (func $~lib/util/number/prettify (param $buffer i32) (param $length i32) (param $k i32) (result i32) - (local $kk i32) - (local $var$4 i32) - (local $var$5 i32) - (local $var$6 i32) - (local $var$7 i32) - (local $var$8 i32) - (local $var$9 i32) - (local $var$10 i32) - (local $var$11 i32) - local.get $k - i32.eqz - if - local.get $buffer - local.get $length - i32.const 1 - i32.shl - i32.add - i32.const 46 - i32.const 48 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $length - i32.const 2 - i32.add - return - end - local.get $length - local.get $k - i32.add - local.set $kk - local.get $length - local.get $kk - i32.le_s - if (result i32) - local.get $kk - i32.const 21 - i32.le_s - else - i32.const 0 - end - if - local.get $length - local.set $var$4 - loop $for-loop|0 - local.get $var$4 - local.get $kk - i32.lt_s - local.set $var$5 - local.get $var$5 - if - local.get $buffer - local.get $var$4 - i32.const 1 - i32.shl - i32.add - i32.const 48 - i32.store16 - local.get $var$4 - i32.const 1 - i32.add - local.set $var$4 - br $for-loop|0 - end - end - local.get $buffer - local.get $kk - i32.const 1 - i32.shl - i32.add - i32.const 46 - i32.const 48 - i32.const 16 - i32.shl - i32.or - i32.store - local.get $kk - i32.const 2 - i32.add - return - else - local.get $kk - i32.const 0 - i32.gt_s - if (result i32) - local.get $kk - i32.const 21 - i32.le_s - else - i32.const 0 - end - if - local.get $buffer - local.get $kk - i32.const 1 - i32.shl - i32.add - local.set $var$4 - local.get $var$4 - i32.const 2 - i32.add - local.get $var$4 - i32.const 0 - local.get $k - i32.sub - i32.const 1 - i32.shl - memory.copy - local.get $buffer - local.get $kk - i32.const 1 - i32.shl - i32.add - i32.const 46 - i32.store16 - local.get $length - i32.const 1 - i32.add - return - else - i32.const -6 - local.get $kk - i32.lt_s - if (result i32) - local.get $kk - i32.const 0 - i32.le_s - else - i32.const 0 - end - if - i32.const 2 - local.get $kk - i32.sub - local.set $var$4 - local.get $buffer - local.get $var$4 - i32.const 1 - i32.shl - i32.add - local.get $buffer - local.get $length - i32.const 1 - i32.shl - memory.copy - local.get $buffer - i32.const 48 - i32.const 46 - i32.const 16 - i32.shl - i32.or - i32.store - i32.const 2 - local.set $var$5 - loop $for-loop|1 - local.get $var$5 - local.get $var$4 - i32.lt_s - local.set $var$6 - local.get $var$6 - if - local.get $buffer - local.get $var$5 - i32.const 1 - i32.shl - i32.add - i32.const 48 - i32.store16 - local.get $var$5 - i32.const 1 - i32.add - local.set $var$5 - br $for-loop|1 - end - end - local.get $length - local.get $var$4 - i32.add - return - else - local.get $length - i32.const 1 - i32.eq - if - local.get $buffer - i32.const 101 - i32.store16 offset=2 - local.get $buffer - i32.const 4 - i32.add - local.set $var$5 - local.get $kk - i32.const 1 - i32.sub - local.set $var$6 - local.get $var$6 - i32.const 0 - i32.lt_s - local.set $var$4 - local.get $var$4 - if - i32.const 0 - local.get $var$6 - i32.sub - local.set $var$6 - end - local.get $var$6 - call $~lib/util/number/decimalCount32 - i32.const 1 - i32.add - local.set $var$7 - local.get $var$5 - local.set $var$10 - local.get $var$6 - local.set $var$9 - local.get $var$7 - local.set $var$8 - i32.const 0 - i32.const 1 - i32.ge_s - drop - local.get $var$10 - local.get $var$9 - local.get $var$8 - call $~lib/util/number/utoa32_dec_lut - local.get $var$5 - i32.const 45 - i32.const 43 - local.get $var$4 - select - i32.store16 - local.get $var$7 - local.set $length - local.get $length - i32.const 2 - i32.add - return - else - local.get $length - i32.const 1 - i32.shl - local.set $var$7 - local.get $buffer - i32.const 4 - i32.add - local.get $buffer - i32.const 2 - i32.add - local.get $var$7 - i32.const 2 - i32.sub - memory.copy - local.get $buffer - i32.const 46 - i32.store16 offset=2 - local.get $buffer - local.get $var$7 - i32.add - i32.const 101 - i32.store16 offset=2 - local.get $length - local.get $buffer - local.get $var$7 - i32.add - i32.const 4 - i32.add - local.set $var$9 - local.get $kk - i32.const 1 - i32.sub - local.set $var$8 - local.get $var$8 - i32.const 0 - i32.lt_s - local.set $var$4 - local.get $var$4 - if - i32.const 0 - local.get $var$8 - i32.sub - local.set $var$8 - end - local.get $var$8 - call $~lib/util/number/decimalCount32 - i32.const 1 - i32.add - local.set $var$5 - local.get $var$9 - local.set $var$11 - local.get $var$8 - local.set $var$6 - local.get $var$5 - local.set $var$10 - i32.const 0 - i32.const 1 - i32.ge_s - drop - local.get $var$11 - local.get $var$6 - local.get $var$10 - call $~lib/util/number/utoa32_dec_lut - local.get $var$9 - i32.const 45 - i32.const 43 - local.get $var$4 - select - i32.store16 - local.get $var$5 - i32.add - local.set $length - local.get $length - i32.const 2 - i32.add - return - end - unreachable - end - unreachable - end - unreachable - end - unreachable - ) - (func $~lib/util/number/dtoa_core (param $buffer i32) (param $value f64) (result i32) - (local $sign i32) - (local $var$3 i32) - (local $var$4 i32) - (local $var$5 f64) - (local $var$6 i64) - (local $var$7 i32) - (local $var$8 i64) - (local $var$9 i64) - (local $var$10 i32) - (local $var$11 i64) - (local $var$12 i64) - (local $var$13 i32) - (local $var$14 i32) - (local $var$15 i32) - (local $var$16 f64) - (local $var$17 i64) - (local $var$18 i64) - (local $var$19 i64) - (local $var$20 i64) - (local $var$21 i64) - (local $var$22 i64) - (local $var$23 i64) - (local $var$24 i64) - (local $var$25 i64) - (local $var$26 i32) - (local $var$27 i64) - (local $len i32) - local.get $value - f64.const 0 - f64.lt - local.set $sign - local.get $sign - if - local.get $value - f64.neg - local.set $value - local.get $buffer - i32.const 45 - i32.store16 - end - local.get $value - local.set $var$5 - local.get $buffer - local.set $var$4 - local.get $sign - local.set $var$3 - local.get $var$5 - i64.reinterpret_f64 - local.set $var$6 - local.get $var$6 - i64.const 9218868437227405312 - i64.and - i64.const 52 - i64.shr_u - i32.wrap_i64 - local.set $var$7 - local.get $var$6 - i64.const 4503599627370495 - i64.and - local.set $var$8 - local.get $var$7 - i32.const 0 - i32.ne - i64.extend_i32_u - i64.const 52 - i64.shl - local.get $var$8 - i64.add - local.set $var$9 - local.get $var$7 - i32.const 1 - local.get $var$7 - select - i32.const 1023 - i32.const 52 - i32.add - i32.sub - local.set $var$7 - local.get $var$9 - local.set $var$11 - local.get $var$7 - local.set $var$10 - local.get $var$11 - i64.const 1 - i64.shl - i64.const 1 - i64.add - local.set $var$12 - local.get $var$10 - i32.const 1 - i32.sub - local.set $var$13 - local.get $var$12 - i64.clz - i32.wrap_i64 - local.set $var$14 - local.get $var$12 - local.get $var$14 - i64.extend_i32_s - i64.shl - local.set $var$12 - local.get $var$13 - local.get $var$14 - i32.sub - local.set $var$13 - i32.const 1 - local.get $var$11 - i64.const 4503599627370496 - i64.eq - i32.add - local.set $var$15 - local.get $var$12 - global.set $~lib/util/number/_frc_plus - local.get $var$11 - local.get $var$15 - i64.extend_i32_s - i64.shl - i64.const 1 - i64.sub - local.get $var$10 - local.get $var$15 - i32.sub - local.get $var$13 - i32.sub - i64.extend_i32_s - i64.shl - global.set $~lib/util/number/_frc_minus - local.get $var$13 - global.set $~lib/util/number/_exp - global.get $~lib/util/number/_exp - local.set $var$10 - i32.const -61 - local.get $var$10 - i32.sub - f64.convert_i32_s - f64.const 0.30102999566398114 - f64.mul - f64.const 347 - f64.add - local.set $var$16 - local.get $var$16 - i32.trunc_sat_f64_s - local.set $var$15 - local.get $var$15 - local.get $var$15 - f64.convert_i32_s - local.get $var$16 - f64.ne - i32.add - local.set $var$15 - local.get $var$15 - i32.const 3 - i32.shr_s - i32.const 1 - i32.add - local.set $var$14 - i32.const 348 - local.get $var$14 - i32.const 3 - i32.shl - i32.sub - global.set $~lib/util/number/_K - i32.const 4040 - local.get $var$14 - i32.const 3 - i32.shl - i32.add - i64.load - global.set $~lib/util/number/_frc_pow - i32.const 4736 - local.get $var$14 - i32.const 1 - i32.shl - i32.add - i32.load16_s - global.set $~lib/util/number/_exp_pow - local.get $var$9 - i64.clz - i32.wrap_i64 - local.set $var$14 - local.get $var$9 - local.get $var$14 - i64.extend_i32_s - i64.shl - local.set $var$9 - local.get $var$7 - local.get $var$14 - i32.sub - local.set $var$7 - global.get $~lib/util/number/_frc_pow - local.set $var$12 - global.get $~lib/util/number/_exp_pow - local.set $var$15 - local.get $var$9 - local.set $var$17 - local.get $var$12 - local.set $var$11 - local.get $var$17 - i64.const 4294967295 - i64.and - local.set $var$18 - local.get $var$11 - i64.const 4294967295 - i64.and - local.set $var$19 - local.get $var$17 - i64.const 32 - i64.shr_u - local.set $var$20 - local.get $var$11 - i64.const 32 - i64.shr_u - local.set $var$21 - local.get $var$18 - local.get $var$19 - i64.mul - local.set $var$22 - local.get $var$20 - local.get $var$19 - i64.mul - local.get $var$22 - i64.const 32 - i64.shr_u - i64.add - local.set $var$23 - local.get $var$18 - local.get $var$21 - i64.mul - local.get $var$23 - i64.const 4294967295 - i64.and - i64.add - local.set $var$24 - local.get $var$24 - i64.const 2147483647 - i64.add - local.set $var$24 - local.get $var$23 - i64.const 32 - i64.shr_u - local.set $var$23 - local.get $var$24 - i64.const 32 - i64.shr_u - local.set $var$24 - local.get $var$20 - local.get $var$21 - i64.mul - local.get $var$23 - i64.add - local.get $var$24 - i64.add - local.set $var$24 - local.get $var$7 - local.set $var$10 - local.get $var$15 - local.set $var$13 - local.get $var$10 - local.get $var$13 - i32.add - i32.const 64 - i32.add - local.set $var$10 - global.get $~lib/util/number/_frc_plus - local.set $var$17 - local.get $var$12 - local.set $var$11 - local.get $var$17 - i64.const 4294967295 - i64.and - local.set $var$23 - local.get $var$11 - i64.const 4294967295 - i64.and - local.set $var$22 - local.get $var$17 - i64.const 32 - i64.shr_u - local.set $var$21 - local.get $var$11 - i64.const 32 - i64.shr_u - local.set $var$20 - local.get $var$23 - local.get $var$22 - i64.mul - local.set $var$19 - local.get $var$21 - local.get $var$22 - i64.mul - local.get $var$19 - i64.const 32 - i64.shr_u - i64.add - local.set $var$18 - local.get $var$23 - local.get $var$20 - i64.mul - local.get $var$18 - i64.const 4294967295 - i64.and - i64.add - local.set $var$25 - local.get $var$25 - i64.const 2147483647 - i64.add - local.set $var$25 - local.get $var$18 - i64.const 32 - i64.shr_u - local.set $var$18 - local.get $var$25 - i64.const 32 - i64.shr_u - local.set $var$25 - local.get $var$21 - local.get $var$20 - i64.mul - local.get $var$18 - i64.add - local.get $var$25 - i64.add - i64.const 1 - i64.sub - local.set $var$25 - global.get $~lib/util/number/_exp - local.set $var$26 - local.get $var$15 - local.set $var$13 - local.get $var$26 - local.get $var$13 - i32.add - i32.const 64 - i32.add - local.set $var$26 - global.get $~lib/util/number/_frc_minus - local.set $var$17 - local.get $var$12 - local.set $var$11 - local.get $var$17 - i64.const 4294967295 - i64.and - local.set $var$18 - local.get $var$11 - i64.const 4294967295 - i64.and - local.set $var$19 - local.get $var$17 - i64.const 32 - i64.shr_u - local.set $var$20 - local.get $var$11 - i64.const 32 - i64.shr_u - local.set $var$21 - local.get $var$18 - local.get $var$19 - i64.mul - local.set $var$22 - local.get $var$20 - local.get $var$19 - i64.mul - local.get $var$22 - i64.const 32 - i64.shr_u - i64.add - local.set $var$23 - local.get $var$18 - local.get $var$21 - i64.mul - local.get $var$23 - i64.const 4294967295 - i64.and - i64.add - local.set $var$27 - local.get $var$27 - i64.const 2147483647 - i64.add - local.set $var$27 - local.get $var$23 - i64.const 32 - i64.shr_u - local.set $var$23 - local.get $var$27 - i64.const 32 - i64.shr_u - local.set $var$27 - local.get $var$20 - local.get $var$21 - i64.mul - local.get $var$23 - i64.add - local.get $var$27 - i64.add - i64.const 1 - i64.add - local.set $var$27 - local.get $var$25 - local.get $var$27 - i64.sub - local.set $var$23 - local.get $var$4 - local.get $var$24 - local.get $var$10 - local.get $var$25 - local.get $var$26 - local.get $var$23 - local.get $var$3 - call $~lib/util/number/genDigits - local.set $len - local.get $buffer - local.get $sign - i32.const 1 - i32.shl - i32.add - local.get $len - local.get $sign - i32.sub - global.get $~lib/util/number/_K - call $~lib/util/number/prettify - local.set $len - local.get $len - local.get $sign - i32.add - ) - (func $~lib/number/F64#toString (param $this f64) (param $radix i32) (result i32) - local.get $this - call $~lib/util/number/dtoa - ) - (func $~lib/util/number/decimalCount64High (param $value i64) (result i32) - local.get $value - i64.const 1000000000000000 - i64.lt_u - if - local.get $value - i64.const 1000000000000 - i64.lt_u - if - i32.const 10 - local.get $value - i64.const 100000000000 - i64.ge_u - i32.add - local.get $value - i64.const 10000000000 - i64.ge_u - i32.add - return - else - i32.const 13 - local.get $value - i64.const 100000000000000 - i64.ge_u - i32.add - local.get $value - i64.const 10000000000000 - i64.ge_u - i32.add - return - end - unreachable - else - local.get $value - i64.const 100000000000000000 - i64.lt_u - if - i32.const 16 - local.get $value - i64.const 10000000000000000 - i64.ge_u - i32.add - return - else - i32.const 18 - local.get $value - i64.const -8446744073709551616 - i64.ge_u - i32.add - local.get $value - i64.const 1000000000000000000 - i64.ge_u - i32.add - return - end - unreachable - end - unreachable - ) - (func $~lib/util/number/utoa64_dec_lut (param $buffer i32) (param $num i64) (param $offset i32) - (local $var$3 i32) - (local $t i64) - (local $r i32) - (local $b i32) - (local $c i32) - (local $b1 i32) - (local $b2 i32) - (local $c1 i32) - (local $c2 i32) - (local $digits1 i64) - (local $digits2 i64) - loop $while-continue|0 - local.get $num - i64.const 100000000 - i64.ge_u - local.set $var$3 - local.get $var$3 - if - local.get $num - i64.const 100000000 - i64.div_u - local.set $t - local.get $num - local.get $t - i64.const 100000000 - i64.mul - i64.sub - i32.wrap_i64 - local.set $r - local.get $t - local.set $num - local.get $r - i32.const 10000 - i32.div_u - local.set $b - local.get $r - i32.const 10000 - i32.rem_u - local.set $c - local.get $b - i32.const 100 - i32.div_u - local.set $b1 - local.get $b - i32.const 100 - i32.rem_u - local.set $b2 - local.get $c - i32.const 100 - i32.div_u - local.set $c1 - local.get $c - i32.const 100 - i32.rem_u - local.set $c2 - i32.const 4952 - local.get $c1 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $digits1 - i32.const 4952 - local.get $c2 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $digits2 - local.get $offset - i32.const 4 - i32.sub - local.set $offset - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - local.get $digits1 - local.get $digits2 - i64.const 32 - i64.shl - i64.or - i64.store - i32.const 4952 - local.get $b1 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $digits1 - i32.const 4952 - local.get $b2 - i32.const 2 - i32.shl - i32.add - i64.load32_u - local.set $digits2 - local.get $offset - i32.const 4 - i32.sub - local.set $offset - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - local.get $digits1 - local.get $digits2 - i64.const 32 - i64.shl - i64.or - i64.store - br $while-continue|0 - end - end - local.get $buffer - local.get $num - i32.wrap_i64 - local.get $offset - call $~lib/util/number/utoa32_dec_lut - ) - (func $~lib/util/number/utoa_hex_lut (param $buffer i32) (param $num i64) (param $offset i32) - (local $var$3 i32) - loop $while-continue|0 - local.get $offset - i32.const 2 - i32.ge_u - local.set $var$3 - local.get $var$3 - if - local.get $offset - i32.const 2 - i32.sub - local.set $offset - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - i32.const 5632 - local.get $num - i32.wrap_i64 - i32.const 255 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - i32.store - local.get $num - i64.const 8 - i64.shr_u - local.set $num - br $while-continue|0 - end - end - local.get $offset - i32.const 1 - i32.and - if - local.get $buffer - i32.const 5632 - local.get $num - i32.wrap_i64 - i32.const 6 - i32.shl - i32.add - i32.load16_u - i32.store16 - end - ) - (func $~lib/util/number/ulog_base (param $num i64) (param $base i32) (result i32) - (local $var$2 i32) - (local $b64 i64) - (local $b i64) - (local $e i32) - local.get $base - local.set $var$2 - local.get $var$2 - i32.popcnt - i32.const 1 - i32.eq - if - i32.const 63 - local.get $num - i64.clz - i32.wrap_i64 - i32.sub - i32.const 31 - local.get $base - i32.clz - i32.sub - i32.div_u - i32.const 1 - i32.add - return - end - local.get $base - i64.extend_i32_s - local.set $b64 - local.get $b64 - local.set $b - i32.const 1 - local.set $e - loop $while-continue|0 - local.get $num - local.get $b - i64.ge_u - local.set $var$2 - local.get $var$2 - if - local.get $num - local.get $b - i64.div_u - local.set $num - local.get $b - local.get $b - i64.mul - local.set $b - local.get $e - i32.const 1 - i32.shl - local.set $e - br $while-continue|0 - end - end - loop $while-continue|1 - local.get $num - i64.const 1 - i64.ge_u - local.set $var$2 - local.get $var$2 - if - local.get $num - local.get $b64 - i64.div_u - local.set $num - local.get $e - i32.const 1 - i32.add - local.set $e - br $while-continue|1 - end - end - local.get $e - i32.const 1 - i32.sub - ) - (func $~lib/util/number/utoa64_any_core (param $buffer i32) (param $num i64) (param $offset i32) (param $radix i32) - (local $base i64) - (local $var$5 i64) - (local $q i64) - local.get $radix - i64.extend_i32_s - local.set $base - local.get $radix - local.get $radix - i32.const 1 - i32.sub - i32.and - i32.const 0 - i32.eq - if - local.get $radix - i32.ctz - i32.const 7 - i32.and - i64.extend_i32_s - local.set $var$5 - local.get $base - i64.const 1 - i64.sub - local.set $q - loop $do-loop|0 - local.get $offset - i32.const 1 - i32.sub - local.set $offset - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - i32.const 6688 - local.get $num - local.get $q - i64.and - i32.wrap_i64 - i32.const 1 - i32.shl - i32.add - i32.load16_u - i32.store16 - local.get $num - local.get $var$5 - i64.shr_u - local.set $num - local.get $num - i64.const 0 - i64.ne - br_if $do-loop|0 - end - else - loop $do-loop|1 - local.get $offset - i32.const 1 - i32.sub - local.set $offset - local.get $num - local.get $base - i64.div_u - local.set $q - local.get $buffer - local.get $offset - i32.const 1 - i32.shl - i32.add - i32.const 6688 - local.get $num - local.get $q - local.get $base - i64.mul - i64.sub - i32.wrap_i64 - i32.const 1 - i32.shl - i32.add - i32.load16_u - i32.store16 - local.get $q - local.set $num - local.get $num - i64.const 0 - i64.ne - br_if $do-loop|1 - end - end - ) - (func $~lib/number/I64#toString (param $this i64) (param $radix i32) (result i32) - local.get $this - local.get $radix - call $~lib/util/number/itoa64 - ) - (func $~lib/date/invalidDate (param $millis i64) (result i32) - local.get $millis - i64.const 0 - i64.const 8640000000000000 - i64.sub - i64.lt_s - local.get $millis - i64.const 8640000000000000 - i64.gt_s - i32.or - ) - (func $~lib/date/dateFromEpoch (param $ms i64) (result i32) - (local $var$1 i64) - (local $var$2 i64) - (local $da i32) - (local $var$4 i32) - (local $var$5 i32) - (local $q0 i32) - (local $r1 i32) - (local $u1 i64) - (local $dm1 i32) - (local $n1 i32) - (local $year i32) - (local $mo i32) - local.get $ms - local.set $var$2 - i32.const 86400000 - i64.extend_i32_s - local.set $var$1 - local.get $var$2 - local.get $var$2 - i64.const 0 - i64.lt_s - if (result i64) - local.get $var$1 - i64.const 1 - i64.sub - else - i64.const 0 - end - i64.sub - local.get $var$1 - i64.div_s - i32.wrap_i64 - i32.const 4 - i32.mul - i32.const 719468 - i32.const 4 - i32.mul - i32.add - i32.const 3 - i32.or - local.set $da - local.get $da - local.set $var$5 - i32.const 146097 - local.set $var$4 - local.get $var$5 - local.get $var$5 - i32.const 0 - i32.lt_s - if (result i32) - local.get $var$4 - i32.const 1 - i32.sub - else - i32.const 0 - end - i32.sub - local.get $var$4 - i32.div_s - local.set $q0 - local.get $da - local.get $q0 - i32.const 146097 - i32.mul - i32.sub - local.set $r1 - local.get $r1 - i32.const 3 - i32.or - i64.extend_i32_u - i64.const 2939745 - i64.mul - local.set $u1 - local.get $u1 - i32.wrap_i64 - i32.const 11758980 - i32.div_u - local.set $dm1 - i32.const 2141 - local.get $dm1 - i32.mul - i32.const 197913 - i32.add - local.set $n1 - i32.const 100 - local.get $q0 - i32.mul - local.get $u1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.add - local.set $year - local.get $n1 - i32.const 16 - i32.shr_u - local.set $mo - local.get $n1 - i32.const 65535 - i32.and - i32.const 2141 - i32.div_s - i32.const 1 - i32.add - global.set $~lib/date/_day - local.get $dm1 - i32.const 306 - i32.ge_u - if - local.get $mo - i32.const 12 - i32.sub - local.set $mo - local.get $year - i32.const 1 - i32.add - local.set $year - end - local.get $mo - global.set $~lib/date/_month - local.get $year - ) - (func $~lib/date/Date#set:year (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store - ) - (func $~lib/date/Date#set:month (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=4 - ) - (func $~lib/date/Date#set:day (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - i32.store offset=8 - ) - (func $~lib/date/Date#set:epochMillis (param $0 i32) (param $1 i64) - local.get $0 - local.get $1 - i64.store offset=16 - ) - (func $~lib/date/dayOfWeek (param $year i32) (param $month i32) (param $day i32) (result i32) - (local $var$3 i32) - (local $var$4 i32) - (local $var$5 i32) - local.get $year - local.get $month - i32.const 3 - i32.lt_s - i32.sub - local.set $year - local.get $year - local.get $year - local.set $var$4 - i32.const 4 - local.set $var$3 - local.get $var$4 - local.get $var$4 - i32.const 0 - i32.lt_s - if (result i32) - local.get $var$3 - i32.const 1 - i32.sub - else - i32.const 0 - end - i32.sub - local.get $var$3 - i32.div_s - local.get $year - local.set $var$4 - i32.const 100 - local.set $var$3 - local.get $var$4 - local.get $var$4 - i32.const 0 - i32.lt_s - if (result i32) - local.get $var$3 - i32.const 1 - i32.sub - else - i32.const 0 - end - i32.sub - local.get $var$3 - i32.div_s - i32.sub - local.get $year - local.set $var$4 - i32.const 400 - local.set $var$3 - local.get $var$4 - local.get $var$4 - i32.const 0 - i32.lt_s - if (result i32) - local.get $var$3 - i32.const 1 - i32.sub - else - i32.const 0 - end - i32.sub - local.get $var$3 - i32.div_s - i32.add - i32.add - local.set $year - i32.const 7740 - local.get $month - i32.add - i32.const 1 - i32.sub - i32.load8_u - local.set $month - local.get $year - local.get $month - i32.add - local.get $day - i32.add - local.set $var$4 - i32.const 7 - local.set $var$3 - local.get $var$4 - local.get $var$3 - i32.rem_s - local.set $var$5 - local.get $var$5 - local.get $var$5 - i32.const 0 - i32.lt_s - if (result i32) - local.get $var$3 - else - i32.const 0 - end - i32.add - ) - (func $~lib/number/I32#toString (param $this i32) (param $radix i32) (result i32) - local.get $this - local.get $radix - call $~lib/util/number/itoa32 - ) - (func $~lib/memory/memory.repeat (param $dst i32) (param $src i32) (param $srcLength i32) (param $count i32) - (local $index i32) - (local $total i32) - (local $var$6 i32) - i32.const 0 - local.set $index - local.get $srcLength - local.get $count - i32.mul - local.set $total - loop $while-continue|0 - local.get $index - local.get $total - i32.lt_u - local.set $var$6 - local.get $var$6 - if - local.get $dst - local.get $index - i32.add - local.get $src - local.get $srcLength - memory.copy - local.get $index - local.get $srcLength - i32.add - local.set $index - br $while-continue|0 - end - end - ) - (func $~lib/staticarray/StaticArray<~lib/string/String>#__uget (param $this i32) (param $index i32) (result i32) - local.get $this - local.get $index - i32.const 2 - i32.shl - i32.add - i32.load - ) - (func $~lib/date/Date#getUTCHours (param $this i32) (result i32) - (local $var$1 i64) - (local $var$2 i64) - (local $var$3 i64) - local.get $this - i64.load offset=16 - local.set $var$2 - i32.const 86400000 - i64.extend_i32_s - local.set $var$1 - local.get $var$2 - local.get $var$1 - i64.rem_s - local.set $var$3 - local.get $var$3 - local.get $var$3 - i64.const 0 - i64.lt_s - if (result i64) - local.get $var$1 - else - i64.const 0 - end - i64.add - i32.wrap_i64 - i32.const 3600000 - i32.div_s - ) - (func $~lib/date/Date#getUTCMinutes (param $this i32) (result i32) - (local $var$1 i64) - (local $var$2 i64) - (local $var$3 i64) - local.get $this - i64.load offset=16 - local.set $var$2 - i32.const 3600000 - i64.extend_i32_s - local.set $var$1 - local.get $var$2 - local.get $var$1 - i64.rem_s - local.set $var$3 - local.get $var$3 - local.get $var$3 - i64.const 0 - i64.lt_s - if (result i64) - local.get $var$1 - else - i64.const 0 - end - i64.add - i32.wrap_i64 - i32.const 60000 - i32.div_s - ) - (func $~lib/date/Date#getUTCSeconds (param $this i32) (result i32) - (local $var$1 i64) - (local $var$2 i64) - (local $var$3 i64) - local.get $this - i64.load offset=16 - local.set $var$2 - i32.const 60000 - i64.extend_i32_s - local.set $var$1 - local.get $var$2 - local.get $var$1 - i64.rem_s - local.set $var$3 - local.get $var$3 - local.get $var$3 - i64.const 0 - i64.lt_s - if (result i64) - local.get $var$1 - else - i64.const 0 - end - i64.add - i32.wrap_i64 - i32.const 1000 - i32.div_s - ) - (func $~lib/staticarray/StaticArray<~lib/string/String>#__uset (param $this i32) (param $index i32) (param $value i32) - local.get $this - local.get $index - i32.const 2 - i32.shl - i32.add - local.get $value - i32.store - i32.const 1 - drop - local.get $this - local.get $value - i32.const 1 - call $~lib/rt/itcms/__link - ) - (func $~lib/staticarray/StaticArray<~lib/string/String>#get:length (param $this i32) (result i32) - local.get $this - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 2 - i32.shr_u - ) - (func $~lib/staticarray/StaticArray<~lib/string/String>#join (param $this i32) (param $separator i32) (result i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - i32.const 1 - i32.lt_s - drop - i32.const 1 - drop - local.get $this - local.get $this - call $~lib/staticarray/StaticArray<~lib/string/String>#get:length - local.get $separator - call $~lib/util/string/joinStringArray - return - ) - (func $~lib/rt/itcms/__pin (param $ptr i32) (result i32) - (local $var$1 i32) - local.get $ptr - if - local.get $ptr - i32.const 20 - i32.sub - local.set $var$1 - local.get $var$1 - call $~lib/rt/itcms/Object#get:color - i32.const 3 - i32.eq - if - i32.const 8272 - i32.const 32 - i32.const 337 - i32.const 7 - call $~lib/builtins/abort - unreachable - end - local.get $var$1 - call $~lib/rt/itcms/Object#unlink - local.get $var$1 - global.get $~lib/rt/itcms/pinSpace - i32.const 3 - call $~lib/rt/itcms/Object#linkTo - end - local.get $ptr - ) - (func $~lib/rt/itcms/__unpin (param $ptr i32) - (local $obj i32) - local.get $ptr - i32.eqz - if - return - end - local.get $ptr - i32.const 20 - i32.sub - local.set $obj - local.get $obj - call $~lib/rt/itcms/Object#get:color - i32.const 3 - i32.ne - if - i32.const 8336 - i32.const 32 - i32.const 351 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/rt/itcms/state - i32.const 1 - i32.eq - if - local.get $obj - call $~lib/rt/itcms/Object#makeGray - else - local.get $obj - call $~lib/rt/itcms/Object#unlink - local.get $obj - global.get $~lib/rt/itcms/fromSpace - global.get $~lib/rt/itcms/white - call $~lib/rt/itcms/Object#linkTo - end - ) - (func $~lib/rt/itcms/__collect - (local $var$0 i32) - i32.const 0 - drop - global.get $~lib/rt/itcms/state - i32.const 0 - i32.gt_s - if - loop $while-continue|0 - global.get $~lib/rt/itcms/state - i32.const 0 - i32.ne - local.set $var$0 - local.get $var$0 - if - call $~lib/rt/itcms/step - drop - br $while-continue|0 - end - end - end - call $~lib/rt/itcms/step - drop - loop $while-continue|1 - global.get $~lib/rt/itcms/state - i32.const 0 - i32.ne - local.set $var$0 - local.get $var$0 - if - call $~lib/rt/itcms/step - drop - br $while-continue|1 - end - end - global.get $~lib/rt/itcms/total - i64.extend_i32_u - i32.const 200 - i64.extend_i32_u - i64.mul - i64.const 100 - i64.div_u - i32.wrap_i64 - i32.const 1024 - i32.add - global.set $~lib/rt/itcms/threshold - i32.const 0 - drop - i32.const 0 - drop - ) - (func $~lib/rt/__visit_globals (param $0 i32) - (local $1 i32) - i32.const 128 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 464 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 592 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 240 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 8272 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 8336 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 6928 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 5632 - local.get $0 - call $~lib/rt/itcms/__visit - i32.const 6688 - local.get $0 - call $~lib/rt/itcms/__visit - global.get $assembly/neural-net/RegularizationFunction.L2 - local.tee $1 - if - local.get $1 - local.get $0 - call $~lib/rt/itcms/__visit - end - ) - (func $~lib/arraybuffer/ArrayBufferView~visit (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/itcms/__visit - end - ) - (func $~lib/array/Array<~lib/string/String>#__visit (param $this i32) (param $cookie i32) - (local $var$2 i32) - (local $var$3 i32) - (local $var$4 i32) - (local $val i32) - i32.const 1 - drop - local.get $this - i32.load offset=4 - local.set $var$2 - local.get $var$2 - local.get $this - i32.load offset=12 - i32.const 2 - i32.shl - i32.add - local.set $var$3 - loop $while-continue|0 - local.get $var$2 - local.get $var$3 - i32.lt_u - local.set $var$4 - local.get $var$4 - if - local.get $var$2 - i32.load - local.set $val - local.get $val - if - local.get $val - local.get $cookie - call $~lib/rt/itcms/__visit - end - local.get $var$2 - i32.const 4 - i32.add - local.set $var$2 - br $while-continue|0 - end - end - local.get $this - i32.load - local.get $cookie - call $~lib/rt/itcms/__visit - ) - (func $~lib/array/Array<~lib/string/String>~visit (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/string/String>#__visit - ) - (func $assembly/index/ModelSpec~visit (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - i32.load - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/itcms/__visit - end - local.get $0 - i32.load offset=4 - local.tee $2 - if - local.get $2 - local.get $1 - call $~lib/rt/itcms/__visit - end - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__visit (param $this i32) (param $cookie i32) - (local $var$2 i32) - (local $var$3 i32) - (local $var$4 i32) - (local $val i32) - i32.const 1 - drop - local.get $this - i32.load offset=4 - local.set $var$2 - local.get $var$2 - local.get $this - i32.load offset=12 - i32.const 2 - i32.shl - i32.add - local.set $var$3 - loop $while-continue|0 - local.get $var$2 - local.get $var$3 - i32.lt_u - local.set $var$4 - local.get $var$4 - if - local.get $var$2 - i32.load - local.set $val - local.get $val - if - local.get $val - local.get $cookie - call $~lib/rt/itcms/__visit - end - local.get $var$2 - i32.const 4 - i32.add - local.set $var$2 - br $while-continue|0 - end - end - local.get $this - i32.load - local.get $cookie - call $~lib/rt/itcms/__visit - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>~visit (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__visit - ) - (func $~lib/array/Array#__visit (param $this i32) (param $cookie i32) - i32.const 0 - drop - local.get $this - i32.load - local.get $cookie - call $~lib/rt/itcms/__visit - ) - (func $~lib/array/Array~visit (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/array/Array#__visit - ) - (func $~lib/staticarray/StaticArray<~lib/string/String>#__visit (param $this i32) (param $cookie i32) - (local $var$2 i32) - (local $var$3 i32) - (local $var$4 i32) - (local $val i32) - i32.const 1 - drop - local.get $this - local.set $var$2 - local.get $var$2 - local.get $this - i32.const 20 - i32.sub - i32.load offset=16 - i32.add - local.set $var$3 - loop $while-continue|0 - local.get $var$2 - local.get $var$3 - i32.lt_u - local.set $var$4 - local.get $var$4 - if - local.get $var$2 - i32.load - local.set $val - local.get $val - if - local.get $val - local.get $cookie - call $~lib/rt/itcms/__visit - end - local.get $var$2 - i32.const 4 - i32.add - local.set $var$2 - br $while-continue|0 - end - end - ) - (func $~lib/staticarray/StaticArray<~lib/string/String>~visit (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/staticarray/StaticArray<~lib/string/String>#__visit - ) - (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) - block $invalid - block $~lib/staticarray/StaticArray<~lib/string/String> - block $~lib/date/Date - block $~lib/array/Array - block $~lib/array/Array<~lib/array/Array<~lib/string/String>> - block $assembly/index/ModelSpec - block $~lib/array/Array<~lib/string/String> - block $assembly/neural-net/IRegularizationFunction - block $~lib/arraybuffer/ArrayBufferView - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $assembly/neural-net/IRegularizationFunction $~lib/array/Array<~lib/string/String> $assembly/index/ModelSpec $~lib/array/Array<~lib/array/Array<~lib/string/String>> $~lib/array/Array $~lib/date/Date $~lib/staticarray/StaticArray<~lib/string/String> $invalid - end - return - end - return - end - local.get $0 - local.get $1 - call $~lib/arraybuffer/ArrayBufferView~visit - return - end - return - end - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/string/String>~visit - return - end - local.get $0 - local.get $1 - call $assembly/index/ModelSpec~visit - return - end - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>~visit - return - end - local.get $0 - local.get $1 - call $~lib/array/Array~visit - return - end - return - end - local.get $0 - local.get $1 - call $~lib/staticarray/StaticArray<~lib/string/String>~visit - return - end - unreachable - ) - (func $~start - i32.const 80 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/toSpace - memory.size - i32.const 16 - i32.shl - global.get $~lib/memory/__heap_base - i32.sub - i32.const 1 - i32.shr_u - global.set $~lib/rt/itcms/threshold - i32.const 288 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/pinSpace - i32.const 320 - call $~lib/rt/itcms/initLazy - global.set $~lib/rt/itcms/fromSpace - ) - (func $~stack_check - global.get $~lib/memory/__stack_pointer - global.get $~lib/memory/__data_end - i32.lt_s - if - i32.const 24880 - i32.const 24928 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - ) - (func $assembly/index/getModelSpec (result i32) - (local $0 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - i32.const 0 - i32.const 432 - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - i32.const 432 - local.set $0 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - call $assembly/index/ModelSpec#constructor - local.set $0 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $0 - ) - (func $assembly/index/findVal (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - i32.const 0 - local.set $3 - loop $for-loop|0 - local.get $3 - local.get $1 - call $~lib/array/Array<~lib/string/String>#get:length - i32.lt_s - local.set $4 - local.get $4 - if - local.get $1 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - local.get $0 - call $~lib/string/String.__eq - if - local.get $2 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - call $~lib/string/String#toString - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - return - end - local.get $3 - i32.const 1 - i32.add - local.set $3 - br $for-loop|0 - end - end - i32.const 720 - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - ) - (func $assembly/index/modelFactory (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 20 - memory.fill - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $2 - i32.store - local.get $2 - i32.const 0 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - local.tee $4 - i32.store offset=12 - local.get $3 - i32.const 0 - i32.const 560 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $3 - i32.const 1 - i32.const 560 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=16 - local.get $5 - local.get $0 - local.get $1 - call $assembly/index/findVal - call $~lib/array/Array<~lib/string/String>#__uset - local.get $3 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $2 - i32.const 1 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $4 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.load offset=4 - local.tee $3 - i32.store offset=8 - local.get $4 - i32.const 0 - i32.const 752 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - i32.const 1 - i32.const 752 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=16 - local.get $5 - local.get $0 - local.get $1 - call $assembly/index/findVal - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $2 - i32.const 2 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $3 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.load offset=4 - local.tee $4 - i32.store offset=12 - local.get $3 - i32.const 0 - i32.const 784 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $3 - i32.const 1 - i32.const 784 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=16 - local.get $5 - local.get $0 - local.get $1 - call $assembly/index/findVal - call $~lib/array/Array<~lib/string/String>#__uset - local.get $3 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $2 - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - ) - (func $assembly/index/getPorts (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 2 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $2 - i32.store - local.get $2 - i32.const 0 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 992 - call $~lib/rt/__newArray - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $2 - i32.const 1 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1168 - call $~lib/rt/__newArray - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $2 - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - ) - (func $assembly/index/port1Cb (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 64 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 64 - memory.fill - global.get $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.const 2 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $2 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.load offset=4 - local.tee $3 - i32.store offset=4 - local.get $2 - i32.const 0 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1232 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - i32.const 1 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1360 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - i32.const 2 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1488 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - i32.const 3 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1616 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - local.tee $3 - i32.store offset=4 - i32.const 1648 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=52 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=60 - local.get $6 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=56 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=44 - local.get $6 - i32.const 1696 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=48 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=36 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=44 - local.get $6 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=40 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=28 - local.get $6 - i32.const 1696 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=32 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=20 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=28 - local.get $6 - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=24 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=12 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=20 - local.get $6 - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=16 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=8 - local.get $6 - call $assembly/aegis/log - local.get $3 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 64 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $assembly/index/port2Cb (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 64 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 64 - memory.fill - global.get $~lib/memory/__stack_pointer - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.const 2 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $2 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.load offset=4 - local.tee $3 - i32.store offset=4 - local.get $2 - i32.const 0 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1728 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - i32.const 1 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1808 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - i32.const 2 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1840 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - i32.const 3 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 1920 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - local.tee $3 - i32.store offset=4 - i32.const 1952 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=52 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=60 - local.get $6 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=56 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=44 - local.get $6 - i32.const 1696 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=48 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=36 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=44 - local.get $6 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=40 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=28 - local.get $6 - i32.const 1696 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=32 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=20 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=28 - local.get $6 - i32.const 2 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=24 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=12 - local.get $6 - local.get $3 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=20 - local.get $6 - i32.const 3 - call $~lib/array/Array<~lib/string/String>#__get - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=16 - local.get $6 - call $~lib/string/String.__concat - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=8 - local.get $6 - call $assembly/aegis/log - local.get $3 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 64 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $assembly/index/getCommands (result i32) - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 7 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $0 - i32.store - local.get $0 - i32.const 0 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2160 - call $~lib/rt/__newArray - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $0 - i32.const 1 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2352 - call $~lib/rt/__newArray - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $0 - i32.const 2 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2512 - call $~lib/rt/__newArray - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $0 - i32.const 3 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2672 - call $~lib/rt/__newArray - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $0 - i32.const 4 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2800 - call $~lib/rt/__newArray - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $0 - i32.const 5 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 2960 - call $~lib/rt/__newArray - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $0 - i32.const 6 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 3104 - call $~lib/rt/__newArray - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $assembly/index/commandEx (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 32 - memory.fill - i32.const 3136 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=20 - local.get $5 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=24 - local.get $5 - call $~lib/string/String.__concat - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=12 - local.get $5 - i32.const 3200 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=16 - local.get $5 - call $~lib/string/String.__concat - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=8 - local.get $5 - call $~lib/string/String.__concat - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $2 - i32.store offset=28 - local.get $2 - i32.const 0 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 3296 - call $~lib/rt/__newArray - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=8 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $2 - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - ) - (func $assembly/index/serviceMeshListen (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 32 - memory.fill - i32.const 3328 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=20 - local.get $3 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=24 - local.get $3 - call $~lib/string/String.__concat - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=12 - local.get $3 - i32.const 3392 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=16 - local.get $3 - call $~lib/string/String.__concat - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=8 - local.get $3 - call $~lib/string/String.__concat - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 3424 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $2 - i32.store offset=28 - local.get $2 - i32.const 2384 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - call $assembly/aegis/addListener - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $assembly/index/serviceMeshNotify (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - global.get $~lib/memory/__stack_pointer - i32.const 44 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 44 - memory.fill - global.get $~lib/memory/__stack_pointer - i32.const 3472 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $2 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 3520 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $3 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 3424 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $4 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $5 - i32.store offset=16 - i32.const 3568 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=32 - local.get $8 - local.get $2 - call $~lib/string/String.__concat - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=24 - local.get $8 - i32.const 3392 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=28 - local.get $8 - call $~lib/string/String.__concat - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=20 - local.get $8 - local.get $3 - call $~lib/string/String.__concat - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - call $assembly/aegis/log - local.get $5 - i32.const 0 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $6 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.load offset=4 - local.tee $7 - i32.store offset=40 - local.get $6 - i32.const 0 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $6 - i32.const 1 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $6 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=24 - local.get $8 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $5 - i32.const 1 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $7 - i32.store offset=40 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.load offset=4 - local.tee $6 - i32.store offset=36 - local.get $7 - i32.const 0 - i32.const 3472 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $7 - i32.const 1 - local.get $2 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $7 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=24 - local.get $8 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $5 - i32.const 2 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $6 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.load offset=4 - local.tee $7 - i32.store offset=40 - local.get $6 - i32.const 0 - i32.const 3520 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $6 - i32.const 1 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $6 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=24 - local.get $8 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $4 - if (result i32) - local.get $4 - else - i32.const 3648 - end - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - local.get $5 - f64.const 1 - call $assembly/aegis/fireEvent - global.get $~lib/memory/__stack_pointer - i32.const 44 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $assembly/index/serviceMeshCallback (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - global.get $~lib/memory/__stack_pointer - i32.const 44 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 44 - memory.fill - i32.const 3696 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=20 - local.get $8 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=24 - local.get $8 - call $~lib/string/String.__concat - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=12 - local.get $8 - i32.const 3392 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=16 - local.get $8 - call $~lib/string/String.__concat - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=8 - local.get $8 - call $~lib/string/String.__concat - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 3424 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - local.get $0 - local.get $1 - call $assembly/index/findVal - local.tee $2 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 2 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $3 - i32.store offset=32 - local.get $3 - i32.const 0 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $4 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.load offset=4 - local.tee $5 - i32.store offset=40 - local.get $4 - i32.const 0 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - i32.const 1 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=8 - local.get $8 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $3 - i32.const 1 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $5 - i32.store offset=40 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.load offset=4 - local.tee $4 - i32.store offset=36 - local.get $5 - i32.const 0 - local.get $0 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $5 - i32.const 1 - local.get $1 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - call $~lib/array/Array<~lib/string/String>#__uset - local.get $5 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=8 - local.get $8 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $2 - i32.const 1264 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=8 - local.get $8 - call $~lib/string/String.__concat - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - local.get $3 - f64.const 1 - call $assembly/aegis/fireEvent - global.get $~lib/memory/__stack_pointer - i32.const 1 - i32.const 2 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $4 - i32.store offset=36 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.load offset=4 - local.tee $5 - i32.store offset=40 - local.get $4 - i32.const 0 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 3776 - call $~lib/rt/__newArray - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $4 - local.set $8 - global.get $~lib/memory/__stack_pointer - i32.const 44 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $8 - ) - (func $assembly/index/runFibonacci (param $0 i32) (param $1 i32) (result i32) - (local $2 f64) - (local $3 i64) - (local $4 i32) - (local $5 i32) - (local $6 f64) - (local $7 i32) - (local $8 i32) - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 24 - memory.fill - f64.const 0 - local.set $2 - call $~lib/bindings/dom/Date.now - i64.trunc_sat_f64_s - local.set $3 - i32.const 0 - local.set $4 - block $for-break0 - loop $for-loop|0 - local.get $4 - local.get $0 - call $~lib/array/Array<~lib/string/String>#get:length - i32.lt_s - local.set $5 - local.get $5 - if - i32.const 784 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - local.get $0 - local.get $4 - call $~lib/array/Array<~lib/string/String>#__get - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=4 - local.get $8 - call $~lib/string/String.__eq - if - local.get $1 - local.get $4 - call $~lib/array/Array<~lib/string/String>#__get - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store - local.get $8 - i32.const 0 - call $~lib/string/parseInt - local.set $2 - br $for-break0 - end - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $for-loop|0 - end - end - end - local.get $2 - call $assembly/index/fibonacci - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 2 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $4 - i32.store offset=8 - local.get $4 - i32.const 0 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $5 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.load offset=4 - local.tee $7 - i32.store offset=20 - local.get $5 - i32.const 0 - i32.const 3808 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $5 - i32.const 1 - local.get $6 - i32.const 0 - call $~lib/number/F64#toString - call $~lib/array/Array<~lib/string/String>#__uset - local.get $5 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=12 - local.get $8 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $4 - i32.const 1 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $7 - i32.store offset=20 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.load offset=4 - local.tee $5 - i32.store offset=16 - local.get $7 - i32.const 0 - i32.const 5376 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $7 - i32.const 1 - call $~lib/bindings/dom/Date.now - i64.trunc_sat_f64_s - local.get $3 - i64.sub - i32.const 10 - call $~lib/number/I64#toString - call $~lib/array/Array<~lib/string/String>#__uset - local.get $7 - local.set $8 - global.get $~lib/memory/__stack_pointer - local.get $8 - i32.store offset=12 - local.get $8 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $4 - local.set $8 - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $8 - ) - (func $assembly/index/portEx (param $0 i32) (param $1 i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 28 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 28 - memory.fill - i32.const 6784 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=20 - local.get $2 - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=24 - local.get $2 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=12 - local.get $2 - i32.const 3200 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=16 - local.get $2 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=8 - local.get $2 - call $~lib/string/String.__concat - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 28 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/date/stringify (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - local.get $0 - i32.const 10 - call $~lib/number/I32#toString - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - local.get $1 - i32.const 5600 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store offset=4 - local.get $2 - call $~lib/string/String#padStart - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $~lib/date/Date#toISOString (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - (local $15 i32) - (local $16 i32) - (local $17 i32) - (local $18 i32) - (local $19 i32) - (local $20 i32) - (local $21 i32) - (local $22 i32) - global.get $~lib/memory/__stack_pointer - i32.const 48 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 48 - memory.fill - global.get $~lib/memory/__stack_pointer - i32.const 28 - i32.const 9 - i32.const 7248 - call $~lib/rt/__newBuffer - local.tee $1 - i32.store - global.get $~lib/memory/__stack_pointer - i32.const 48 - i32.const 9 - i32.const 7680 - call $~lib/rt/__newBuffer - local.tee $2 - i32.store offset=4 - local.get $0 - i32.load offset=4 - local.set $3 - local.get $0 - i32.load offset=8 - local.set $4 - local.get $0 - i32.load - local.set $5 - local.get $5 - local.get $3 - local.get $4 - call $~lib/date/dayOfWeek - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $5 - local.tee $7 - i32.const 31 - i32.shr_s - local.tee $8 - local.get $7 - i32.add - local.get $8 - i32.xor - i32.const 4 - call $~lib/date/stringify - local.tee $9 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $2 - local.get $3 - i32.const 1 - i32.sub - call $~lib/staticarray/StaticArray<~lib/string/String>#__uget - local.tee $10 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - local.get $1 - local.get $6 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uget - local.tee $11 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 2 - call $~lib/date/stringify - local.tee $12 - i32.store offset=20 - global.get $~lib/memory/__stack_pointer - local.get $0 - call $~lib/date/Date#getUTCHours - i32.const 2 - call $~lib/date/stringify - local.tee $13 - i32.store offset=24 - global.get $~lib/memory/__stack_pointer - local.get $0 - call $~lib/date/Date#getUTCMinutes - i32.const 2 - call $~lib/date/stringify - local.tee $14 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - local.get $0 - call $~lib/date/Date#getUTCSeconds - i32.const 2 - call $~lib/date/stringify - local.tee $15 - i32.store offset=32 - local.get $11 - local.set $7 - local.get $12 - local.set $8 - local.get $10 - local.set $16 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.const 0 - i32.lt_s - if (result i32) - i32.const 7888 - else - i32.const 720 - end - local.tee $17 - i32.store offset=36 - local.get $9 - local.set $18 - local.get $13 - local.set $19 - local.get $14 - local.set $20 - local.get $15 - local.set $21 - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 0 - local.get $7 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 1 - local.get $8 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 2 - local.get $16 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 3 - local.get $17 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 4 - local.get $18 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 6 - local.get $19 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 8 - local.get $20 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 10 - local.get $21 - call $~lib/staticarray/StaticArray<~lib/string/String>#__uset - i32.const 7808 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=40 - local.get $22 - i32.const 720 - local.set $22 - global.get $~lib/memory/__stack_pointer - local.get $22 - i32.store offset=44 - local.get $22 - call $~lib/staticarray/StaticArray<~lib/string/String>#join - local.set $22 - global.get $~lib/memory/__stack_pointer - i32.const 48 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $22 - ) - (func $assembly/index/onUpdate (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 20 - memory.fill - global.get $~lib/memory/__stack_pointer - i32.const 1 - i32.const 2 - i32.const 6 - i32.const 0 - call $~lib/rt/__newArray - local.tee $2 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.load offset=4 - local.tee $3 - i32.store offset=4 - local.get $2 - i32.const 0 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $4 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.load offset=4 - local.tee $5 - i32.store offset=12 - local.get $4 - i32.const 0 - i32.const 6880 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - i32.const 1 - i32.const 0 - call $~lib/bindings/dom/Date.now - i64.trunc_sat_f64_s - call $~lib/date/Date#constructor - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=16 - local.get $6 - call $~lib/date/Date#toISOString - call $~lib/array/Array<~lib/string/String>#__uset - local.get $4 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__uset - local.get $2 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $assembly/index/onDelete (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - i32.const 7920 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $assembly/aegis/log - i32.const -1 - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $assembly/index/validate (param $0 i32) (param $1 i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - i32.const 7984 - local.set $2 - global.get $~lib/memory/__stack_pointer - local.get $2 - i32.store - local.get $2 - call $assembly/aegis/log - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $assembly/index/test (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 32 - memory.fill - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - i32.const 560 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store offset=4 - local.get $7 - call $~lib/string/String.__eq - if (result i32) - local.get $1 - i32.const 0 - call $~lib/array/Array<~lib/string/String>#__get - else - i32.const 8048 - end - local.tee $2 - i32.store offset=8 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - i32.const 752 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store offset=4 - local.get $7 - call $~lib/string/String.__eq - if (result i32) - local.get $1 - i32.const 1 - call $~lib/array/Array<~lib/string/String>#__get - else - i32.const 8048 - end - local.tee $3 - i32.store offset=12 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.const 3 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor - local.tee $4 - i32.store offset=16 - local.get $4 - i32.const 0 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $5 - i32.store offset=24 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.load offset=4 - local.tee $6 - i32.store offset=28 - local.get $5 - i32.const 0 - i32.const 560 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $5 - i32.const 1 - local.get $2 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $5 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store offset=20 - local.get $7 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $4 - i32.const 1 - global.get $~lib/memory/__stack_pointer - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 0 - call $~lib/rt/__newArray - local.tee $6 - i32.store offset=28 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.load offset=4 - local.tee $5 - i32.store offset=24 - local.get $6 - i32.const 0 - i32.const 752 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $6 - i32.const 1 - local.get $3 - call $~lib/array/Array<~lib/string/String>#__uset - local.get $6 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store offset=20 - local.get $7 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - local.get $4 - i32.const 2 - i32.const 2 - i32.const 2 - i32.const 4 - i32.const 8192 - call $~lib/rt/__newArray - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store offset=20 - local.get $7 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__set - i32.const 8224 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - call $assembly/aegis/log - local.get $4 - local.set $7 - global.get $~lib/memory/__stack_pointer - i32.const 32 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $7 - ) - (func $assembly/index/ModelSpec#constructor (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.const 5 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - i32.const 0 - call $assembly/index/ModelSpec#set:modelName - local.get $0 - i32.const 0 - call $assembly/index/ModelSpec#set:endpoint - local.get $0 - local.get $1 - call $assembly/index/ModelSpec#set:modelName - local.get $0 - local.get $2 - call $assembly/index/ModelSpec#set:endpoint - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 16 - i32.const 6 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:buffer - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:dataStart - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:byteLength - local.get $0 - i32.const 0 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:length_ - local.get $1 - i32.const 1073741820 - i32.const 2 - i32.shr_u - i32.gt_u - if - i32.const 464 - i32.const 512 - i32.const 70 - i32.const 60 - call $~lib/builtins/abort - unreachable - end - local.get $1 - local.tee $2 - i32.const 8 - local.tee $3 - local.get $2 - local.get $3 - i32.gt_u - select - i32.const 2 - i32.shl - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 0 - call $~lib/rt/itcms/__new - local.tee $5 - i32.store offset=4 - i32.const 2 - global.get $~lib/shared/runtime/Runtime.Incremental - i32.ne - drop - local.get $0 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:buffer - local.get $0 - local.get $5 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:dataStart - local.get $0 - local.get $4 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:byteLength - local.get $0 - local.get $1 - call $~lib/array/Array<~lib/array/Array<~lib/string/String>>#set:length_ - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $~lib/array/Array<~lib/string/String>#__get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 128 - i32.const 512 - i32.const 114 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load offset=4 - local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $2 - i32.store - i32.const 1 - drop - i32.const 0 - i32.eqz - drop - local.get $2 - i32.eqz - if - i32.const 592 - i32.const 512 - i32.const 118 - i32.const 40 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $~lib/rt/__newArray (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - local.get $1 - i32.shl - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 0 - local.get $3 - call $~lib/rt/__newBuffer - local.tee $5 - i32.store - i32.const 16 - local.get $2 - call $~lib/rt/itcms/__new - local.set $6 - local.get $6 - local.get $5 - i32.store - local.get $6 - local.get $5 - i32.const 0 - call $~lib/rt/itcms/__link - local.get $6 - local.get $5 - i32.store offset=4 - local.get $6 - local.get $4 - i32.store offset=8 - local.get $6 - local.get $0 - i32.store offset=12 - local.get $6 - local.set $7 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $7 - ) - (func $~lib/array/Array<~lib/array/Array<~lib/string/String>>#__get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 128 - i32.const 512 - i32.const 114 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load offset=4 - local.get $1 - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $2 - i32.store - i32.const 1 - drop - i32.const 0 - i32.eqz - drop - local.get $2 - i32.eqz - if - i32.const 592 - i32.const 512 - i32.const 118 - i32.const 40 - call $~lib/builtins/abort - unreachable - end - local.get $2 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $~lib/string/String#concat (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $2 - local.get $1 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $3 - local.get $2 - local.get $3 - i32.add - local.set $4 - local.get $4 - i32.const 0 - i32.eq - if - i32.const 720 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - return - end - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $5 - i32.store - local.get $5 - local.get $0 - local.get $2 - memory.copy - local.get $5 - local.get $2 - i32.add - local.get $1 - local.get $3 - memory.copy - local.get $5 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $~lib/util/number/dtoa (param $0 f64) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - f64.const 0 - f64.eq - if - i32.const 3840 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - return - end - local.get $0 - local.get $0 - f64.sub - f64.const 0 - f64.eq - i32.eqz - if - local.get $0 - local.get $0 - f64.ne - if - i32.const 3872 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - return - end - i32.const 3904 - i32.const 3952 - local.get $0 - f64.const 0 - f64.lt - select - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - return - end - i32.const 3984 - local.get $0 - call $~lib/util/number/dtoa_core - i32.const 1 - i32.shl - local.set $1 - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $2 - i32.store - local.get $2 - i32.const 3984 - local.get $1 - memory.copy - local.get $2 - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $~lib/util/number/itoa64 (param $0 i64) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i64) - (local $10 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 - i32.const 2 - i32.lt_s - if (result i32) - i32.const 1 - else - local.get $1 - i32.const 36 - i32.gt_s - end - if - i32.const 5408 - i32.const 5536 - i32.const 431 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i64.const 0 - i64.ne - i32.eqz - if - i32.const 5600 - local.set $10 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $10 - return - end - local.get $0 - i64.const 63 - i64.shr_u - i32.wrap_i64 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - if - i64.const 0 - local.get $0 - i64.sub - local.set $0 - end - local.get $1 - i32.const 10 - i32.eq - if - local.get $0 - global.get $~lib/builtins/u32.MAX_VALUE - i64.extend_i32_u - i64.le_u - if - local.get $0 - i32.wrap_i64 - local.set $4 - local.get $4 - call $~lib/util/number/decimalCount32 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $3 - local.get $2 - i32.add - local.set $8 - local.get $4 - local.set $7 - local.get $5 - local.set $6 - i32.const 0 - i32.const 1 - i32.ge_s - drop - local.get $8 - local.get $7 - local.get $6 - call $~lib/util/number/utoa32_dec_lut - else - local.get $0 - call $~lib/util/number/decimalCount64High - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $3 - local.get $2 - i32.add - local.set $7 - local.get $0 - local.set $9 - local.get $5 - local.set $6 - i32.const 0 - i32.const 1 - i32.ge_s - drop - local.get $7 - local.get $9 - local.get $6 - call $~lib/util/number/utoa64_dec_lut - end - else - local.get $1 - i32.const 16 - i32.eq - if - i32.const 63 - local.get $0 - i64.clz - i32.wrap_i64 - i32.sub - i32.const 2 - i32.shr_s - i32.const 1 - i32.add - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $3 - local.get $2 - i32.add - local.set $4 - local.get $0 - local.set $9 - local.get $5 - local.set $8 - i32.const 0 - i32.const 1 - i32.ge_s - drop - local.get $4 - local.get $9 - local.get $8 - call $~lib/util/number/utoa_hex_lut - else - local.get $0 - local.get $1 - call $~lib/util/number/ulog_base - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $3 - local.get $2 - i32.add - local.get $0 - local.get $5 - local.get $1 - call $~lib/util/number/utoa64_any_core - end - end - local.get $2 - if - local.get $3 - i32.const 45 - i32.store16 - end - local.get $3 - local.set $10 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $10 - ) - (func $~lib/date/Date#constructor (param $0 i32) (param $1 i64) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.const 8 - call $~lib/rt/itcms/__new - local.tee $0 - i32.store - end - local.get $0 - local.get $1 - call $~lib/date/Date#set:epochMillis - local.get $0 - i32.const 0 - call $~lib/date/Date#set:year - local.get $0 - i32.const 0 - call $~lib/date/Date#set:month - local.get $0 - i32.const 0 - call $~lib/date/Date#set:day - local.get $1 - call $~lib/date/invalidDate - if - i32.const 6928 - i32.const 6976 - i32.const 100 - i32.const 35 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/date/dateFromEpoch - call $~lib/date/Date#set:year - local.get $0 - global.get $~lib/date/_month - call $~lib/date/Date#set:month - local.get $0 - global.get $~lib/date/_day - call $~lib/date/Date#set:day - local.get $0 - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $~lib/util/number/itoa32 (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 - i32.const 2 - i32.lt_s - if (result i32) - i32.const 1 - else - local.get $1 - i32.const 36 - i32.gt_s - end - if - i32.const 5408 - i32.const 5536 - i32.const 373 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.eqz - if - i32.const 5600 - local.set $8 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $8 - return - end - local.get $0 - i32.const 31 - i32.shr_u - i32.const 1 - i32.shl - local.set $2 - local.get $2 - if - i32.const 0 - local.get $0 - i32.sub - local.set $0 - end - local.get $1 - i32.const 10 - i32.eq - if - local.get $0 - call $~lib/util/number/decimalCount32 - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $3 - local.get $2 - i32.add - local.set $7 - local.get $0 - local.set $6 - local.get $4 - local.set $5 - i32.const 0 - i32.const 1 - i32.ge_s - drop - local.get $7 - local.get $6 - local.get $5 - call $~lib/util/number/utoa32_dec_lut - else - local.get $1 - i32.const 16 - i32.eq - if - i32.const 31 - local.get $0 - i32.clz - i32.sub - i32.const 2 - i32.shr_s - i32.const 1 - i32.add - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $3 - local.get $2 - i32.add - local.set $7 - local.get $0 - local.set $6 - local.get $4 - local.set $5 - i32.const 0 - i32.const 1 - i32.ge_s - drop - local.get $7 - local.get $6 - i64.extend_i32_u - local.get $5 - call $~lib/util/number/utoa_hex_lut - else - local.get $0 - local.set $4 - local.get $4 - i64.extend_i32_u - local.get $1 - call $~lib/util/number/ulog_base - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.const 1 - i32.shl - local.get $2 - i32.add - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $3 - i32.store - local.get $3 - local.get $2 - i32.add - local.get $4 - i64.extend_i32_u - local.get $7 - local.get $1 - call $~lib/util/number/utoa64_any_core - end - end - local.get $2 - if - local.get $3 - i32.const 45 - i32.store16 - end - local.get $3 - local.set $8 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $8 - ) - (func $~lib/string/String#padStart (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $3 - local.get $1 - i32.const 1 - i32.shl - local.set $4 - local.get $2 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $5 - local.get $4 - local.get $3 - i32.lt_u - if (result i32) - i32.const 1 - else - local.get $5 - i32.eqz - end - if - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $11 - return - end - local.get $4 - local.get $3 - i32.sub - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $7 - i32.store - local.get $6 - local.get $5 - i32.gt_u - if - local.get $6 - i32.const 2 - i32.sub - local.get $5 - i32.div_u - local.set $8 - local.get $8 - local.get $5 - i32.mul - local.set $9 - local.get $6 - local.get $9 - i32.sub - local.set $10 - local.get $7 - local.get $2 - local.get $5 - local.get $8 - call $~lib/memory/memory.repeat - local.get $7 - local.get $9 - i32.add - local.get $2 - local.get $10 - memory.copy - else - local.get $7 - local.get $2 - local.get $6 - memory.copy - end - local.get $7 - local.get $6 - i32.add - local.get $0 - local.get $3 - memory.copy - local.get $7 - local.set $11 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $11 - ) - (func $~lib/util/string/joinStringArray (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store offset=8 - local.get $1 - i32.const 1 - i32.sub - local.set $3 - local.get $3 - i32.const 0 - i32.lt_s - if - i32.const 720 - local.set $12 - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $12 - return - end - local.get $3 - i32.eqz - if - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.load - local.tee $4 - i32.store - local.get $4 - if (result i32) - local.get $4 - else - i32.const 720 - end - local.set $12 - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $12 - return - end - i32.const 0 - local.set $5 - i32.const 0 - local.set $4 - loop $for-loop|0 - local.get $4 - local.get $1 - i32.lt_s - local.set $7 - local.get $7 - if - global.get $~lib/memory/__stack_pointer - local.get $0 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $6 - i32.store offset=4 - local.get $6 - i32.const 0 - i32.ne - if - local.get $5 - local.get $6 - call $~lib/string/String#get:length - i32.add - local.set $5 - end - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $for-loop|0 - end - end - i32.const 0 - local.set $8 - local.get $2 - call $~lib/string/String#get:length - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $5 - local.get $9 - local.get $3 - i32.mul - i32.add - i32.const 1 - i32.shl - i32.const 1 - call $~lib/rt/itcms/__new - local.tee $10 - i32.store offset=8 - i32.const 0 - local.set $4 - loop $for-loop|1 - local.get $4 - local.get $3 - i32.lt_s - local.set $7 - local.get $7 - if - global.get $~lib/memory/__stack_pointer - local.get $0 - local.get $4 - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $6 - i32.store offset=4 - local.get $6 - i32.const 0 - i32.ne - if - local.get $6 - call $~lib/string/String#get:length - local.set $11 - local.get $10 - local.get $8 - i32.const 1 - i32.shl - i32.add - local.get $6 - local.get $11 - i32.const 1 - i32.shl - memory.copy - local.get $8 - local.get $11 - i32.add - local.set $8 - end - local.get $9 - if - local.get $10 - local.get $8 - i32.const 1 - i32.shl - i32.add - local.get $2 - local.get $9 - i32.const 1 - i32.shl - memory.copy - local.get $8 - local.get $9 - i32.add - local.set $8 - end - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $for-loop|1 - end - end - global.get $~lib/memory/__stack_pointer - local.get $0 - local.get $3 - i32.const 2 - i32.shl - i32.add - i32.load - local.tee $6 - i32.store offset=4 - local.get $6 - i32.const 0 - i32.ne - if - local.get $10 - local.get $8 - i32.const 1 - i32.shl - i32.add - local.get $6 - local.get $6 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - memory.copy - end - local.get $10 - local.set $12 - global.get $~lib/memory/__stack_pointer - i32.const 12 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $12 - ) - (func $export:assembly/index/modelFactory (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/modelFactory - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/getPorts (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/getPorts - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/port1Cb (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/port1Cb - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/port2Cb (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/port2Cb - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/commandEx (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/commandEx - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/serviceMeshListen (param $0 i32) (param $1 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/serviceMeshListen - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $export:assembly/index/serviceMeshNotify (param $0 i32) (param $1 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/serviceMeshNotify - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $export:assembly/index/serviceMeshCallback (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/serviceMeshCallback - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/runFibonacci (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/runFibonacci - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/portEx (param $0 i32) (param $1 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/portEx - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $export:assembly/index/onUpdate (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/onUpdate - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/onDelete (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/onDelete - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) - (func $export:assembly/index/validate (param $0 i32) (param $1 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/validate - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $export:assembly/index/test (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $1 - i32.store offset=4 - local.get $0 - local.get $1 - call $assembly/index/test - local.set $2 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $2 - ) -) diff --git a/oldwasm/wasm/index.js b/oldwasm/wasm/index.js deleted file mode 100644 index 6ca9f799..00000000 --- a/oldwasm/wasm/index.js +++ /dev/null @@ -1,111 +0,0 @@ -'use strict' - -const fs = require('fs') -const loader = require('@assemblyscript/loader') -// const { default: BrokerSingleton } = require('../src/domain/broker') -// const broker = BrokerSingleton.getInstance() - -async function importWebAssembly() { - const startTime = Date.now() - - // Check if we support streaming instantiation - if (WebAssembly.instantiateStreaming) console.log('we can stream-compile now') - - //const response = await fetchWasm(remoteEntry) - const wasm = await loader.instantiate( - fs.readFileSync(__dirname + '/break-to-return.wasm'), //'/build/optimized.wasm'), - { - aegis: { - log: ptr => console.log(wasm.exports.__getString(ptr)), - - /** - * invoke a port on the model instance - * @param {string} portName - name of the port - * @param {string} portConsumerEvent - value of `port.consumesEvent` - * @param {string} portData - data to send through the port - */ - invokePort(portName, portConsumerEvent, portData, cb, undo) { - console.log( - 'js invokePort called by wasm', - wasm.exports.__getString(portName), - wasm.exports.__getString(portConsumerEvent), - wasm.exports.__getString(portData), - wasm.exports.__getString(cb), - wasm.exports.__getString(undo) - ) - }, - - /** - * invoke a method on the model instance - * @param {string} methodName - * @param {string} methodData - * @param {string} moduleName - */ - invokeMethod(methodName, methodData, moduleName) { - console.log( - 'js invokeMethod called by wasm', - wasm.exports.__getString(methodName), - wasm.exports.__getString(methodData), - wasm.exports.__getString(moduleName) - ) - }, - - /** - * listen for event `eventName` and call a wasm exported - * function by the name of `callbackName`. - * - * @param {string} eventName - name of event - * @param {string} callbackName - name of exported function to run when event fires - */ - addListener(eventName, callbackName, options) { - const { allowMultiple = true, once = true } = options - console.debug('websocket listen invoked') - const adapter = WasmInterop(wasm) - const fn = adapter.findWasmFunction( - wasm.exports.__getString(callbackName) - ) - - if (typeof fn === 'function') { - broker.on(eventName, eventData => { - adapter.callWasmFunction(fn, eventData) - return - }) - console.log('no command found') - } - }, - - /** - * - * @param {string} eventName - * @param {string} eventData - */ - fireEvent(eventName, eventData) { - const adapter = WasmInterop(wasm) - const name = adapter.__getString(eventName) - const data = adapter.constructObject(eventData) - console.log('wasm called js to emit an event + ', name, ': ', data) - broker.notify(name, data, { worker: true }) - }, - - /** - * - * @param {string} remoteEntry - name of remote entry - */ - requestDeployment: remoteEntry => - console.log('deploy', wasm.exports.__getString(remoteEntry)), - }, - } - ) - console.info('wasm modules took %dms', Date.now() - startTime) - - // if (type === 'model') return wrapWasmModelSpec(wasm) - // if (type === 'adapter') return wrapWasmAdapter(wasm) - // if (type === 'service') return wrapWasmService(wasm) - - return wasm -} - -module.exports = importWebAssembly().then(instance => { - //instance.exports._start() // allow imports access to memory before starting - return instance -}) diff --git a/oldwasm/wasm/package.json b/oldwasm/wasm/package.json deleted file mode 100644 index 3c9cbbcd..00000000 --- a/oldwasm/wasm/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "scripts": { - "asbuild:untouched": "asc assembly/index.ts --exportRuntime --explicitStart --target debug", - "asbuild:optimized": "asc assembly/index.ts --exportRuntime --explicitStart --target release", - "asbuild": "npm run asbuild:untouched && npm run asbuild:optimized", - "test": "node tests" - }, - "devDependencies": { - "@assemblyscript/loader": "0.21.1", - "as-bind": "0.8.2", - "assemblyscript": "0.21.1" - } -} diff --git a/oldwasm/wasm/tests/index.js b/oldwasm/wasm/tests/index.js deleted file mode 100644 index f86acb1e..00000000 --- a/oldwasm/wasm/tests/index.js +++ /dev/null @@ -1,23 +0,0 @@ -const assert = require('assert') -const WasmInterop = - require('../../src/adapters/webassembly/wasm-interop').WasmInterop -const wrapper = require('../../src/adapters/webassembly/wasm-decorators') - -require('..').then(async wasmInstance => { - const { onUpdate, serviceMeshNotify, runFibonacci } = wasmInstance.exports - - console.log(Object.entries(wasmInstance.exports)) - - const adapter = WasmInterop(wasmInstance) - - const spec = wrapper.wrapWasmModelSpec(wasmInstance) - const model = await spec.factory({})({ - key1: '1', - key2: '2', - fibonacci: '45', - }) - console.log(model) - adapter.callWasmFunction(onUpdate, model) - adapter.callWasmFunction(serviceMeshNotify, 'testing') - console.log(adapter.callWasmFunction(runFibonacci, model)) -})