From b2263b1feb5bac29d31b345fb2882a3e0916c9b3 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Mon, 9 Nov 2020 19:38:52 +0700 Subject: [PATCH] Implement basic f64-arithmetic compiler for MST --- kmath-ast/build.gradle.kts | 7 + kmath-ast/src/jsMain/kotlin/Base64/base64.kt | 67 + kmath-ast/src/jsMain/kotlin/base64.d.ts | 135 + .../jsMain/kotlin/binaryen/index.binaryen.kt | 2216 ++++++ .../src/jsMain/kotlin/binaryen/typealises.kt | 11 + kmath-ast/src/jsMain/kotlin/index.d.ts | 1787 +++++ .../kotlin/kscience/kmath/ast/Initial.kt | 5986 +++++++++++++++++ .../kscience/kmath/ast/RealWasmBuilder.kt | 61 + .../kotlin/tsstdlib/lib.es2015.iterable.kt | 31 + .../src/jsMain/kotlin/tsstdlib/lib.es5.kt | 37 + kmath-ast/src/jsMain/kotlin/wasm.d.ts | 2 + kmath-ast/src/jsMain/resources/main.wasm | Bin 0 -> 17961 bytes kmath-ast/src/jsTest/kotlin/Test.kt | 12 + 13 files changed, 10352 insertions(+) create mode 100644 kmath-ast/src/jsMain/kotlin/Base64/base64.kt create mode 100644 kmath-ast/src/jsMain/kotlin/base64.d.ts create mode 100644 kmath-ast/src/jsMain/kotlin/binaryen/index.binaryen.kt create mode 100644 kmath-ast/src/jsMain/kotlin/binaryen/typealises.kt create mode 100644 kmath-ast/src/jsMain/kotlin/index.d.ts create mode 100644 kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/Initial.kt create mode 100644 kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt create mode 100644 kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es2015.iterable.kt create mode 100644 kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es5.kt create mode 100644 kmath-ast/src/jsMain/kotlin/wasm.d.ts create mode 100644 kmath-ast/src/jsMain/resources/main.wasm create mode 100644 kmath-ast/src/jsTest/kotlin/Test.kt diff --git a/kmath-ast/build.gradle.kts b/kmath-ast/build.gradle.kts index 2f95d427d..ca6937172 100644 --- a/kmath-ast/build.gradle.kts +++ b/kmath-ast/build.gradle.kts @@ -16,4 +16,11 @@ kotlin.sourceSets { implementation("org.ow2.asm:asm-commons:8.0.1") } } + + jsMain { + dependencies { + implementation(npm("binaryen", "98.0.0")) + implementation(npm("js-base64", "3.6.0")) + } + } } diff --git a/kmath-ast/src/jsMain/kotlin/Base64/base64.kt b/kmath-ast/src/jsMain/kotlin/Base64/base64.kt new file mode 100644 index 000000000..540cf9299 --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/Base64/base64.kt @@ -0,0 +1,67 @@ +@file:Suppress( + "INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", + "CONFLICTING_OVERLOADS", "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", "ClassName", + "SpellCheckingInspection", "PackageName" +) +@file:JsModule("js-base64") +@file:JsNonModule +package Base64 + +import org.khronos.webgl.Uint8Array + +external var version: Any + +external var VERSION: Any + +external var btoaPolyfill: (bin: String) -> String + +external var _btoa: (bin: String) -> String + +external var fromUint8Array: (u8a: Uint8Array, urlsafe: Boolean) -> String + +external var utob: (u: String) -> String + +external var encode: (src: String, urlsafe: Boolean) -> String + +external var encodeURI: (src: String) -> String + +external var btou: (b: String) -> String + +external var atobPolyfill: (asc: String) -> String + +external var _atob: (asc: String) -> String + +external var toUint8Array: (a: String) -> Uint8Array + +external var decode: (src: String) -> String + +external var isValid: (src: Any) -> Boolean + +external var extendString: () -> Unit + +external var extendUint8Array: () -> Unit + +external var extendBuiltins: () -> Unit + +external object gBase64 { + var version: String + var VERSION: String + var atob: (asc: String) -> String + var atobPolyfill: (asc: String) -> String + var btoa: (bin: String) -> String + var btoaPolyfill: (bin: String) -> String + var fromBase64: (src: String) -> String + var toBase64: (src: String, urlsafe: Boolean) -> String + var encode: (src: String, urlsafe: Boolean) -> String + var encodeURI: (src: String) -> String + var encodeURL: (src: String) -> String + var utob: (u: String) -> String + var btou: (b: String) -> String + var decode: (src: String) -> String + var isValid: (src: Any) -> Boolean + var fromUint8Array: (u8a: Uint8Array, urlsafe: Boolean) -> String + var toUint8Array: (a: String) -> Uint8Array + var extendString: () -> Unit + var extendUint8Array: () -> Unit + var extendBuiltins: () -> Unit +} \ No newline at end of file diff --git a/kmath-ast/src/jsMain/kotlin/base64.d.ts b/kmath-ast/src/jsMain/kotlin/base64.d.ts new file mode 100644 index 000000000..cb26dace9 --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/base64.d.ts @@ -0,0 +1,135 @@ +/** + * base64.ts + * + * Licensed under the BSD 3-Clause License. + * http://opensource.org/licenses/BSD-3-Clause + * + * References: + * http://en.wikipedia.org/wiki/Base64 + * + * @author Dan Kogai (https://github.com/dankogai) + */ +declare const version = "3.6.0"; +/** + * @deprecated use lowercase `version`. + */ +declare const VERSION = "3.6.0"; +/** + * polyfill version of `btoa` + */ +declare const btoaPolyfill: (bin: string) => string; +/** + * does what `window.btoa` of web browsers do. + * @param {String} bin binary string + * @returns {string} Base64-encoded string + */ +declare const _btoa: (bin: string) => string; +/** + * converts a Uint8Array to a Base64 string. + * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5 + * @returns {string} Base64 string + */ +declare const fromUint8Array: (u8a: Uint8Array, urlsafe?: boolean) => string; +/** + * @deprecated should have been internal use only. + * @param {string} src UTF-8 string + * @returns {string} UTF-16 string + */ +declare const utob: (u: string) => string; +/** + * converts a UTF-8-encoded string to a Base64 string. + * @param {boolean} [urlsafe] if `true` make the result URL-safe + * @returns {string} Base64 string + */ +declare const encode: (src: string, urlsafe?: boolean) => string; +/** + * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5. + * @returns {string} Base64 string + */ +declare const encodeURI: (src: string) => string; +/** + * @deprecated should have been internal use only. + * @param {string} src UTF-16 string + * @returns {string} UTF-8 string + */ +declare const btou: (b: string) => string; +/** + * polyfill version of `atob` + */ +declare const atobPolyfill: (asc: string) => string; +/** + * does what `window.atob` of web browsers do. + * @param {String} asc Base64-encoded string + * @returns {string} binary string + */ +declare const _atob: (asc: string) => string; +/** + * converts a Base64 string to a Uint8Array. + */ +declare const toUint8Array: (a: string) => Uint8Array; +/** + * converts a Base64 string to a UTF-8 string. + * @param {String} src Base64 string. Both normal and URL-safe are supported + * @returns {string} UTF-8 string + */ +declare const decode: (src: string) => string; +/** + * check if a value is a valid Base64 string + * @param {String} src a value to check + */ +declare const isValid: (src: any) => boolean; +/** + * extend String.prototype with relevant methods + */ +declare const extendString: () => void; +/** + * extend Uint8Array.prototype with relevant methods + */ +declare const extendUint8Array: () => void; +/** + * extend Builtin prototypes with relevant methods + */ +declare const extendBuiltins: () => void; +declare const gBase64: { + version: string; + VERSION: string; + atob: (asc: string) => string; + atobPolyfill: (asc: string) => string; + btoa: (bin: string) => string; + btoaPolyfill: (bin: string) => string; + fromBase64: (src: string) => string; + toBase64: (src: string, urlsafe?: boolean) => string; + encode: (src: string, urlsafe?: boolean) => string; + encodeURI: (src: string) => string; + encodeURL: (src: string) => string; + utob: (u: string) => string; + btou: (b: string) => string; + decode: (src: string) => string; + isValid: (src: any) => boolean; + fromUint8Array: (u8a: Uint8Array, urlsafe?: boolean) => string; + toUint8Array: (a: string) => Uint8Array; + extendString: () => void; + extendUint8Array: () => void; + extendBuiltins: () => void; +}; +export { version }; +export { VERSION }; +export { _atob as atob }; +export { atobPolyfill }; +export { _btoa as btoa }; +export { btoaPolyfill }; +export { decode as fromBase64 }; +export { encode as toBase64 }; +export { utob }; +export { encode }; +export { encodeURI }; +export { encodeURI as encodeURL }; +export { btou }; +export { decode }; +export { isValid }; +export { fromUint8Array }; +export { toUint8Array }; +export { extendString }; +export { extendUint8Array }; +export { extendBuiltins }; +export { gBase64 as Base64 }; \ No newline at end of file diff --git a/kmath-ast/src/jsMain/kotlin/binaryen/index.binaryen.kt b/kmath-ast/src/jsMain/kotlin/binaryen/index.binaryen.kt new file mode 100644 index 000000000..227f4e25f --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/binaryen/index.binaryen.kt @@ -0,0 +1,2216 @@ +@file:Suppress( + "INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", + "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", "SortModifiers", "SpellCheckingInspection", + "ClassName" +) + +@file:JsModule("binaryen") +@file:JsNonModule +package binaryen + +import org.khronos.webgl.Uint8Array +import kotlin.js.Promise + +external var isReady: Boolean +external var ready: Promise +external var none: Type +external var i32: Type +external var i64: Type +external var f32: Type +external var f64: Type +external var v128: Type +external var funcref: Type +external var anyref: Type +external var nullref: Type +external var exnref: Type +external var unreachable: Type +external var auto: Type + +external fun createType(types: Array): Type +external fun expandType(type: Type): Array + +external enum class ExpressionIds { + Invalid, + Block, + If, + Loop, + Break, + Switch, + Call, + CallIndirect, + LocalGet, + LocalSet, + GlobalGet, + GlobalSet, + Load, + Store, + Const, + Unary, + Binary, + Select, + Drop, + Return, + Host, + Nop, + Unreachable, + AtomicCmpxchg, + AtomicRMW, + AtomicWait, + AtomicNotify, + AtomicFence, + SIMDExtract, + SIMDReplace, + SIMDShuffle, + SIMDTernary, + SIMDShift, + SIMDLoad, + MemoryInit, + DataDrop, + MemoryCopy, + MemoryFill, + RefNull, + RefIsNull, + RefFunc, + Try, + Throw, + Rethrow, + BrOnExn, + TupleMake, + TupleExtract, + Push, + Pop +} + +external var InvalidId: ExpressionIds + +external var BlockId: ExpressionIds + +external var IfId: ExpressionIds + +external var LoopId: ExpressionIds + +external var BreakId: ExpressionIds + +external var SwitchId: ExpressionIds + +external var CallId: ExpressionIds + +external var CallIndirectId: ExpressionIds + +external var LocalGetId: ExpressionIds + +external var LocalSetId: ExpressionIds + +external var GlobalGetId: ExpressionIds + +external var GlobalSetId: ExpressionIds + +external var LoadId: ExpressionIds + +external var StoreId: ExpressionIds + +external var ConstId: ExpressionIds + +external var UnaryId: ExpressionIds + +external var BinaryId: ExpressionIds + +external var SelectId: ExpressionIds + +external var DropId: ExpressionIds + +external var ReturnId: ExpressionIds + +external var HostId: ExpressionIds + +external var NopId: ExpressionIds + +external var UnreachableId: ExpressionIds + +external var AtomicCmpxchgId: ExpressionIds + +external var AtomicRMWId: ExpressionIds + +external var AtomicWaitId: ExpressionIds + +external var AtomicNotifyId: ExpressionIds + +external var AtomicFenceId: ExpressionIds + +external var SIMDExtractId: ExpressionIds + +external var SIMDReplaceId: ExpressionIds + +external var SIMDShuffleId: ExpressionIds + +external var SIMDTernaryId: ExpressionIds + +external var SIMDShiftId: ExpressionIds + +external var SIMDLoadId: ExpressionIds + +external var MemoryInitId: ExpressionIds + +external var DataDropId: ExpressionIds + +external var MemoryCopyId: ExpressionIds + +external var MemoryFillId: ExpressionIds + +external var RefNullId: ExpressionIds + +external var RefIsNullId: ExpressionIds + +external var RefFuncId: ExpressionIds + +external var TryId: ExpressionIds + +external var ThrowId: ExpressionIds + +external var RethrowId: ExpressionIds + +external var BrOnExnId: ExpressionIds + +external var TupleMakeId: ExpressionIds + +external var TupleExtractId: ExpressionIds + +external var PushId: ExpressionIds + +external var PopId: ExpressionIds + +external enum class ExternalKinds { + Function, + Table, + Memory, + Global, + Event +} + +external var ExternalFunction: ExternalKinds + +external var ExternalTable: ExternalKinds + +external var ExternalMemory: ExternalKinds + +external var ExternalGlobal: ExternalKinds + +external var ExternalEvent: ExternalKinds + +external enum class Features { + MVP, + Atomics, + MutableGlobals, + TruncSat, + SIMD, + BulkMemory, + SignExt, + ExceptionHandling, + TailCall, + ReferenceTypes, + Multivalue, + GC, + Memory64, + All +} + +external enum class Operations { + ClzInt32, + CtzInt32, + PopcntInt32, + NegFloat32, + AbsFloat32, + CeilFloat32, + FloorFloat32, + TruncFloat32, + NearestFloat32, + SqrtFloat32, + EqZInt32, + ClzInt64, + CtzInt64, + PopcntInt64, + NegFloat64, + AbsFloat64, + CeilFloat64, + FloorFloat64, + TruncFloat64, + NearestFloat64, + SqrtFloat64, + EqZInt64, + ExtendSInt32, + ExtendUInt32, + WrapInt64, + TruncSFloat32ToInt32, + TruncSFloat32ToInt64, + TruncUFloat32ToInt32, + TruncUFloat32ToInt64, + TruncSFloat64ToInt32, + TruncSFloat64ToInt64, + TruncUFloat64ToInt32, + TruncUFloat64ToInt64, + TruncSatSFloat32ToInt32, + TruncSatSFloat32ToInt64, + TruncSatUFloat32ToInt32, + TruncSatUFloat32ToInt64, + TruncSatSFloat64ToInt32, + TruncSatSFloat64ToInt64, + TruncSatUFloat64ToInt32, + TruncSatUFloat64ToInt64, + ReinterpretFloat32, + ReinterpretFloat64, + ConvertSInt32ToFloat32, + ConvertSInt32ToFloat64, + ConvertUInt32ToFloat32, + ConvertUInt32ToFloat64, + ConvertSInt64ToFloat32, + ConvertSInt64ToFloat64, + ConvertUInt64ToFloat32, + ConvertUInt64ToFloat64, + PromoteFloat32, + DemoteFloat64, + ReinterpretInt32, + ReinterpretInt64, + ExtendS8Int32, + ExtendS16Int32, + ExtendS8Int64, + ExtendS16Int64, + ExtendS32Int64, + AddInt32, + SubInt32, + MulInt32, + DivSInt32, + DivUInt32, + RemSInt32, + RemUInt32, + AndInt32, + OrInt32, + XorInt32, + ShlInt32, + ShrUInt32, + ShrSInt32, + RotLInt32, + RotRInt32, + EqInt32, + NeInt32, + LtSInt32, + LtUInt32, + LeSInt32, + LeUInt32, + GtSInt32, + GtUInt32, + GeSInt32, + GeUInt32, + AddInt64, + SubInt64, + MulInt64, + DivSInt64, + DivUInt64, + RemSInt64, + RemUInt64, + AndInt64, + OrInt64, + XorInt64, + ShlInt64, + ShrUInt64, + ShrSInt64, + RotLInt64, + RotRInt64, + EqInt64, + NeInt64, + LtSInt64, + LtUInt64, + LeSInt64, + LeUInt64, + GtSInt64, + GtUInt64, + GeSInt64, + GeUInt64, + AddFloat32, + SubFloat32, + MulFloat32, + DivFloat32, + CopySignFloat32, + MinFloat32, + MaxFloat32, + EqFloat32, + NeFloat32, + LtFloat32, + LeFloat32, + GtFloat32, + GeFloat32, + AddFloat64, + SubFloat64, + MulFloat64, + DivFloat64, + CopySignFloat64, + MinFloat64, + MaxFloat64, + EqFloat64, + NeFloat64, + LtFloat64, + LeFloat64, + GtFloat64, + GeFloat64, + MemorySize, + MemoryGrow, + AtomicRMWAdd, + AtomicRMWSub, + AtomicRMWAnd, + AtomicRMWOr, + AtomicRMWXor, + AtomicRMWXchg, + SplatVecI8x16, + ExtractLaneSVecI8x16, + ExtractLaneUVecI8x16, + ReplaceLaneVecI8x16, + SplatVecI16x8, + ExtractLaneSVecI16x8, + ExtractLaneUVecI16x8, + ReplaceLaneVecI16x8, + SplatVecI32x4, + ExtractLaneVecI32x4, + ReplaceLaneVecI32x4, + SplatVecI64x2, + ExtractLaneVecI64x2, + ReplaceLaneVecI64x2, + SplatVecF32x4, + ExtractLaneVecF32x4, + ReplaceLaneVecF32x4, + SplatVecF64x2, + ExtractLaneVecF64x2, + ReplaceLaneVecF64x2, + EqVecI8x16, + NeVecI8x16, + LtSVecI8x16, + LtUVecI8x16, + GtSVecI8x16, + GtUVecI8x16, + LeSVecI8x16, + LeUVecI8x16, + GeSVecI8x16, + GeUVecI8x16, + EqVecI16x8, + NeVecI16x8, + LtSVecI16x8, + LtUVecI16x8, + GtSVecI16x8, + GtUVecI16x8, + LeSVecI16x8, + LeUVecI16x8, + GeSVecI16x8, + GeUVecI16x8, + EqVecI32x4, + NeVecI32x4, + LtSVecI32x4, + LtUVecI32x4, + GtSVecI32x4, + GtUVecI32x4, + LeSVecI32x4, + LeUVecI32x4, + GeSVecI32x4, + GeUVecI32x4, + EqVecF32x4, + NeVecF32x4, + LtVecF32x4, + GtVecF32x4, + LeVecF32x4, + GeVecF32x4, + EqVecF64x2, + NeVecF64x2, + LtVecF64x2, + GtVecF64x2, + LeVecF64x2, + GeVecF64x2, + NotVec128, + AndVec128, + OrVec128, + XorVec128, + AndNotVec128, + BitselectVec128, + NegVecI8x16, + AnyTrueVecI8x16, + AllTrueVecI8x16, + ShlVecI8x16, + ShrSVecI8x16, + ShrUVecI8x16, + AddVecI8x16, + AddSatSVecI8x16, + AddSatUVecI8x16, + SubVecI8x16, + SubSatSVecI8x16, + SubSatUVecI8x16, + MulVecI8x16, + MinSVecI8x16, + MinUVecI8x16, + MaxSVecI8x16, + MaxUVecI8x16, + NegVecI16x8, + AnyTrueVecI16x8, + AllTrueVecI16x8, + ShlVecI16x8, + ShrSVecI16x8, + ShrUVecI16x8, + AddVecI16x8, + AddSatSVecI16x8, + AddSatUVecI16x8, + SubVecI16x8, + SubSatSVecI16x8, + SubSatUVecI16x8, + MulVecI16x8, + MinSVecI16x8, + MinUVecI16x8, + MaxSVecI16x8, + MaxUVecI16x8, + DotSVecI16x8ToVecI32x4, + NegVecI32x4, + AnyTrueVecI32x4, + AllTrueVecI32x4, + ShlVecI32x4, + ShrSVecI32x4, + ShrUVecI32x4, + AddVecI32x4, + SubVecI32x4, + MulVecI32x4, + MinSVecI32x4, + MinUVecI32x4, + MaxSVecI32x4, + MaxUVecI32x4, + NegVecI64x2, + AnyTrueVecI64x2, + AllTrueVecI64x2, + ShlVecI64x2, + ShrSVecI64x2, + ShrUVecI64x2, + AddVecI64x2, + SubVecI64x2, + AbsVecF32x4, + NegVecF32x4, + SqrtVecF32x4, + QFMAVecF32x4, + QFMSVecF32x4, + AddVecF32x4, + SubVecF32x4, + MulVecF32x4, + DivVecF32x4, + MinVecF32x4, + MaxVecF32x4, + AbsVecF64x2, + NegVecF64x2, + SqrtVecF64x2, + QFMAVecF64x2, + QFMSVecF64x2, + AddVecF64x2, + SubVecF64x2, + MulVecF64x2, + DivVecF64x2, + MinVecF64x2, + MaxVecF64x2, + TruncSatSVecF32x4ToVecI32x4, + TruncSatUVecF32x4ToVecI32x4, + TruncSatSVecF64x2ToVecI64x2, + TruncSatUVecF64x2ToVecI64x2, + ConvertSVecI32x4ToVecF32x4, + ConvertUVecI32x4ToVecF32x4, + ConvertSVecI64x2ToVecF64x2, + ConvertUVecI64x2ToVecF64x2, + LoadSplatVec8x16, + LoadSplatVec16x8, + LoadSplatVec32x4, + LoadSplatVec64x2, + LoadExtSVec8x8ToVecI16x8, + LoadExtUVec8x8ToVecI16x8, + LoadExtSVec16x4ToVecI32x4, + LoadExtUVec16x4ToVecI32x4, + LoadExtSVec32x2ToVecI64x2, + LoadExtUVec32x2ToVecI64x2, + NarrowSVecI16x8ToVecI8x16, + NarrowUVecI16x8ToVecI8x16, + NarrowSVecI32x4ToVecI16x8, + NarrowUVecI32x4ToVecI16x8, + WidenLowSVecI8x16ToVecI16x8, + WidenHighSVecI8x16ToVecI16x8, + WidenLowUVecI8x16ToVecI16x8, + WidenHighUVecI8x16ToVecI16x8, + WidenLowSVecI16x8ToVecI32x4, + WidenHighSVecI16x8ToVecI32x4, + WidenLowUVecI16x8ToVecI32x4, + WidenHighUVecI16x8ToVecI32x4, + SwizzleVec8x16 +} + +external var ClzInt32: Operations + +external var CtzInt32: Operations + +external var PopcntInt32: Operations + +external var NegFloat32: Operations + +external var AbsFloat32: Operations + +external var CeilFloat32: Operations + +external var FloorFloat32: Operations + +external var TruncFloat32: Operations + +external var NearestFloat32: Operations + +external var SqrtFloat32: Operations + +external var EqZInt32: Operations + +external var ClzInt64: Operations + +external var CtzInt64: Operations + +external var PopcntInt64: Operations + +external var NegFloat64: Operations + +external var AbsFloat64: Operations + +external var CeilFloat64: Operations + +external var FloorFloat64: Operations + +external var TruncFloat64: Operations + +external var NearestFloat64: Operations + +external var SqrtFloat64: Operations + +external var EqZInt64: Operations + +external var ExtendSInt32: Operations + +external var ExtendUInt32: Operations + +external var WrapInt64: Operations + +external var TruncSFloat32ToInt32: Operations + +external var TruncSFloat32ToInt64: Operations + +external var TruncUFloat32ToInt32: Operations + +external var TruncUFloat32ToInt64: Operations + +external var TruncSFloat64ToInt32: Operations + +external var TruncSFloat64ToInt64: Operations + +external var TruncUFloat64ToInt32: Operations + +external var TruncUFloat64ToInt64: Operations + +external var TruncSatSFloat32ToInt32: Operations + +external var TruncSatSFloat32ToInt64: Operations + +external var TruncSatUFloat32ToInt32: Operations + +external var TruncSatUFloat32ToInt64: Operations + +external var TruncSatSFloat64ToInt32: Operations + +external var TruncSatSFloat64ToInt64: Operations + +external var TruncSatUFloat64ToInt32: Operations + +external var TruncSatUFloat64ToInt64: Operations + +external var ReinterpretFloat32: Operations + +external var ReinterpretFloat64: Operations + +external var ConvertSInt32ToFloat32: Operations + +external var ConvertSInt32ToFloat64: Operations + +external var ConvertUInt32ToFloat32: Operations + +external var ConvertUInt32ToFloat64: Operations + +external var ConvertSInt64ToFloat32: Operations + +external var ConvertSInt64ToFloat64: Operations + +external var ConvertUInt64ToFloat32: Operations + +external var ConvertUInt64ToFloat64: Operations + +external var PromoteFloat32: Operations + +external var DemoteFloat64: Operations + +external var ReinterpretInt32: Operations + +external var ReinterpretInt64: Operations + +external var ExtendS8Int32: Operations + +external var ExtendS16Int32: Operations + +external var ExtendS8Int64: Operations + +external var ExtendS16Int64: Operations + +external var ExtendS32Int64: Operations + +external var AddInt32: Operations + +external var SubInt32: Operations + +external var MulInt32: Operations + +external var DivSInt32: Operations + +external var DivUInt32: Operations + +external var RemSInt32: Operations + +external var RemUInt32: Operations + +external var AndInt32: Operations + +external var OrInt32: Operations + +external var XorInt32: Operations + +external var ShlInt32: Operations + +external var ShrUInt32: Operations + +external var ShrSInt32: Operations + +external var RotLInt32: Operations + +external var RotRInt32: Operations + +external var EqInt32: Operations + +external var NeInt32: Operations + +external var LtSInt32: Operations + +external var LtUInt32: Operations + +external var LeSInt32: Operations + +external var LeUInt32: Operations + +external var GtSInt32: Operations + +external var GtUInt32: Operations + +external var GeSInt32: Operations + +external var GeUInt32: Operations + +external var AddInt64: Operations + +external var SubInt64: Operations + +external var MulInt64: Operations + +external var DivSInt64: Operations + +external var DivUInt64: Operations + +external var RemSInt64: Operations + +external var RemUInt64: Operations + +external var AndInt64: Operations + +external var OrInt64: Operations + +external var XorInt64: Operations + +external var ShlInt64: Operations + +external var ShrUInt64: Operations + +external var ShrSInt64: Operations + +external var RotLInt64: Operations + +external var RotRInt64: Operations + +external var EqInt64: Operations + +external var NeInt64: Operations + +external var LtSInt64: Operations + +external var LtUInt64: Operations + +external var LeSInt64: Operations + +external var LeUInt64: Operations + +external var GtSInt64: Operations + +external var GtUInt64: Operations + +external var GeSInt64: Operations + +external var GeUInt64: Operations + +external var AddFloat32: Operations + +external var SubFloat32: Operations + +external var MulFloat32: Operations + +external var DivFloat32: Operations + +external var CopySignFloat32: Operations + +external var MinFloat32: Operations + +external var MaxFloat32: Operations + +external var EqFloat32: Operations + +external var NeFloat32: Operations + +external var LtFloat32: Operations + +external var LeFloat32: Operations + +external var GtFloat32: Operations + +external var GeFloat32: Operations + +external var AddFloat64: Operations + +external var SubFloat64: Operations + +external var MulFloat64: Operations + +external var DivFloat64: Operations + +external var CopySignFloat64: Operations + +external var MinFloat64: Operations + +external var MaxFloat64: Operations + +external var EqFloat64: Operations + +external var NeFloat64: Operations + +external var LtFloat64: Operations + +external var LeFloat64: Operations + +external var GtFloat64: Operations + +external var GeFloat64: Operations + +external var MemorySize: Operations + +external var MemoryGrow: Operations + +external var AtomicRMWAdd: Operations + +external var AtomicRMWSub: Operations + +external var AtomicRMWAnd: Operations + +external var AtomicRMWOr: Operations + +external var AtomicRMWXor: Operations + +external var AtomicRMWXchg: Operations + +external var SplatVecI8x16: Operations + +external var ExtractLaneSVecI8x16: Operations + +external var ExtractLaneUVecI8x16: Operations + +external var ReplaceLaneVecI8x16: Operations + +external var SplatVecI16x8: Operations + +external var ExtractLaneSVecI16x8: Operations + +external var ExtractLaneUVecI16x8: Operations + +external var ReplaceLaneVecI16x8: Operations + +external var SplatVecI32x4: Operations + +external var ExtractLaneVecI32x4: Operations + +external var ReplaceLaneVecI32x4: Operations + +external var SplatVecI64x2: Operations + +external var ExtractLaneVecI64x2: Operations + +external var ReplaceLaneVecI64x2: Operations + +external var SplatVecF32x4: Operations + +external var ExtractLaneVecF32x4: Operations + +external var ReplaceLaneVecF32x4: Operations + +external var SplatVecF64x2: Operations + +external var ExtractLaneVecF64x2: Operations + +external var ReplaceLaneVecF64x2: Operations + +external var EqVecI8x16: Operations + +external var NeVecI8x16: Operations + +external var LtSVecI8x16: Operations + +external var LtUVecI8x16: Operations + +external var GtSVecI8x16: Operations + +external var GtUVecI8x16: Operations + +external var LeSVecI8x16: Operations + +external var LeUVecI8x16: Operations + +external var GeSVecI8x16: Operations + +external var GeUVecI8x16: Operations + +external var EqVecI16x8: Operations + +external var NeVecI16x8: Operations + +external var LtSVecI16x8: Operations + +external var LtUVecI16x8: Operations + +external var GtSVecI16x8: Operations + +external var GtUVecI16x8: Operations + +external var LeSVecI16x8: Operations + +external var LeUVecI16x8: Operations + +external var GeSVecI16x8: Operations + +external var GeUVecI16x8: Operations + +external var EqVecI32x4: Operations + +external var NeVecI32x4: Operations + +external var LtSVecI32x4: Operations + +external var LtUVecI32x4: Operations + +external var GtSVecI32x4: Operations + +external var GtUVecI32x4: Operations + +external var LeSVecI32x4: Operations + +external var LeUVecI32x4: Operations + +external var GeSVecI32x4: Operations + +external var GeUVecI32x4: Operations + +external var EqVecF32x4: Operations + +external var NeVecF32x4: Operations + +external var LtVecF32x4: Operations + +external var GtVecF32x4: Operations + +external var LeVecF32x4: Operations + +external var GeVecF32x4: Operations + +external var EqVecF64x2: Operations + +external var NeVecF64x2: Operations + +external var LtVecF64x2: Operations + +external var GtVecF64x2: Operations + +external var LeVecF64x2: Operations + +external var GeVecF64x2: Operations + +external var NotVec128: Operations + +external var AndVec128: Operations + +external var OrVec128: Operations + +external var XorVec128: Operations + +external var AndNotVec128: Operations + +external var BitselectVec128: Operations + +external var NegVecI8x16: Operations + +external var AnyTrueVecI8x16: Operations + +external var AllTrueVecI8x16: Operations + +external var ShlVecI8x16: Operations + +external var ShrSVecI8x16: Operations + +external var ShrUVecI8x16: Operations + +external var AddVecI8x16: Operations + +external var AddSatSVecI8x16: Operations + +external var AddSatUVecI8x16: Operations + +external var SubVecI8x16: Operations + +external var SubSatSVecI8x16: Operations + +external var SubSatUVecI8x16: Operations + +external var MulVecI8x16: Operations + +external var MinSVecI8x16: Operations + +external var MinUVecI8x16: Operations + +external var MaxSVecI8x16: Operations + +external var MaxUVecI8x16: Operations + +external var NegVecI16x8: Operations + +external var AnyTrueVecI16x8: Operations + +external var AllTrueVecI16x8: Operations + +external var ShlVecI16x8: Operations + +external var ShrSVecI16x8: Operations + +external var ShrUVecI16x8: Operations + +external var AddVecI16x8: Operations + +external var AddSatSVecI16x8: Operations + +external var AddSatUVecI16x8: Operations + +external var SubVecI16x8: Operations + +external var SubSatSVecI16x8: Operations + +external var SubSatUVecI16x8: Operations + +external var MulVecI16x8: Operations + +external var MinSVecI16x8: Operations + +external var MinUVecI16x8: Operations + +external var MaxSVecI16x8: Operations + +external var MaxUVecI16x8: Operations + +external var DotSVecI16x8ToVecI32x4: Operations + +external var NegVecI32x4: Operations + +external var AnyTrueVecI32x4: Operations + +external var AllTrueVecI32x4: Operations + +external var ShlVecI32x4: Operations + +external var ShrSVecI32x4: Operations + +external var ShrUVecI32x4: Operations + +external var AddVecI32x4: Operations + +external var SubVecI32x4: Operations + +external var MulVecI32x4: Operations + +external var MinSVecI32x4: Operations + +external var MinUVecI32x4: Operations + +external var MaxSVecI32x4: Operations + +external var MaxUVecI32x4: Operations + +external var NegVecI64x2: Operations + +external var AnyTrueVecI64x2: Operations + +external var AllTrueVecI64x2: Operations + +external var ShlVecI64x2: Operations + +external var ShrSVecI64x2: Operations + +external var ShrUVecI64x2: Operations + +external var AddVecI64x2: Operations + +external var SubVecI64x2: Operations + +external var AbsVecF32x4: Operations + +external var NegVecF32x4: Operations + +external var SqrtVecF32x4: Operations + +external var QFMAVecF32x4: Operations + +external var QFMSVecF32x4: Operations + +external var AddVecF32x4: Operations + +external var SubVecF32x4: Operations + +external var MulVecF32x4: Operations + +external var DivVecF32x4: Operations + +external var MinVecF32x4: Operations + +external var MaxVecF32x4: Operations + +external var AbsVecF64x2: Operations + +external var NegVecF64x2: Operations + +external var SqrtVecF64x2: Operations + +external var QFMAVecF64x2: Operations + +external var QFMSVecF64x2: Operations + +external var AddVecF64x2: Operations + +external var SubVecF64x2: Operations + +external var MulVecF64x2: Operations + +external var DivVecF64x2: Operations + +external var MinVecF64x2: Operations + +external var MaxVecF64x2: Operations + +external var TruncSatSVecF32x4ToVecI32x4: Operations + +external var TruncSatUVecF32x4ToVecI32x4: Operations + +external var TruncSatSVecF64x2ToVecI64x2: Operations + +external var TruncSatUVecF64x2ToVecI64x2: Operations + +external var ConvertSVecI32x4ToVecF32x4: Operations + +external var ConvertUVecI32x4ToVecF32x4: Operations + +external var ConvertSVecI64x2ToVecF64x2: Operations + +external var ConvertUVecI64x2ToVecF64x2: Operations + +external var LoadSplatVec8x16: Operations + +external var LoadSplatVec16x8: Operations + +external var LoadSplatVec32x4: Operations + +external var LoadSplatVec64x2: Operations + +external var LoadExtSVec8x8ToVecI16x8: Operations + +external var LoadExtUVec8x8ToVecI16x8: Operations + +external var LoadExtSVec16x4ToVecI32x4: Operations + +external var LoadExtUVec16x4ToVecI32x4: Operations + +external var LoadExtSVec32x2ToVecI64x2: Operations + +external var LoadExtUVec32x2ToVecI64x2: Operations + +external var NarrowSVecI16x8ToVecI8x16: Operations + +external var NarrowUVecI16x8ToVecI8x16: Operations + +external var NarrowSVecI32x4ToVecI16x8: Operations + +external var NarrowUVecI32x4ToVecI16x8: Operations + +external var WidenLowSVecI8x16ToVecI16x8: Operations + +external var WidenHighSVecI8x16ToVecI16x8: Operations + +external var WidenLowUVecI8x16ToVecI16x8: Operations + +external var WidenHighUVecI8x16ToVecI16x8: Operations + +external var WidenLowSVecI16x8ToVecI32x4: Operations + +external var WidenHighSVecI16x8ToVecI32x4: Operations + +external var WidenLowUVecI16x8ToVecI32x4: Operations + +external var WidenHighUVecI16x8ToVecI32x4: Operations + +external var SwizzleVec8x16: Operations + + +external interface `T$0` { + fun get(index: Number, type: Type): ExpressionRef + fun set(index: Number, value: ExpressionRef): ExpressionRef + fun tee(index: Number, value: ExpressionRef, type: Type): ExpressionRef +} + +external interface `T$1` { + fun get(name: String, type: Type): ExpressionRef + fun set(name: String, value: ExpressionRef): ExpressionRef +} + +external interface `T$2` { + fun size(): ExpressionRef + fun grow(value: ExpressionRef): ExpressionRef + fun init(segment: Number, dest: ExpressionRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef + fun copy(dest: ExpressionRef, source: ExpressionRef, size: ExpressionRef): ExpressionRef + fun fill(dest: ExpressionRef, value: ExpressionRef, size: ExpressionRef): ExpressionRef +} + +external interface `T$3` { + fun drop(segment: Number): ExpressionRef +} + +external interface `T$4` { + fun f32(value: ExpressionRef): ExpressionRef + fun f64(value: ExpressionRef): ExpressionRef +} + +external interface `T$5` { + fun add(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun sub(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun and(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun or(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun xor(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun xchg(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun cmpxchg(offset: Number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef +} + +external interface `T$6` { + fun load(offset: Number, ptr: ExpressionRef): ExpressionRef + fun load8_u(offset: Number, ptr: ExpressionRef): ExpressionRef + fun load16_u(offset: Number, ptr: ExpressionRef): ExpressionRef + fun store(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store8(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store16(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + var rmw: `T$5` + var rmw8_u: `T$5` + var rmw16_u: `T$5` + fun wait(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef +} + +external interface `T$7` { + fun load(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load8_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load8_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load16_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load16_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun store(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store8(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store16(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun const(value: Number): ExpressionRef + fun clz(value: ExpressionRef): ExpressionRef + fun ctz(value: ExpressionRef): ExpressionRef + fun popcnt(value: ExpressionRef): ExpressionRef + fun eqz(value: ExpressionRef): ExpressionRef + var trunc_s: `T$4` + var trunc_u: `T$4` + var trunc_s_sat: `T$4` + var trunc_u_sat: `T$4` + fun reinterpret(value: ExpressionRef): ExpressionRef + fun extend8_s(value: ExpressionRef): ExpressionRef + fun extend16_s(value: ExpressionRef): ExpressionRef + fun wrap(value: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun div_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun div_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rem_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rem_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun and(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun or(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun shl(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun shr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun shr_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rotl(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rotr(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + var atomic: `T$6` + fun pop(): ExpressionRef +} + +external interface `T$8` { + fun load(offset: Number, ptr: ExpressionRef): ExpressionRef + fun load8_u(offset: Number, ptr: ExpressionRef): ExpressionRef + fun load16_u(offset: Number, ptr: ExpressionRef): ExpressionRef + fun load32_u(offset: Number, ptr: ExpressionRef): ExpressionRef + fun store(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store8(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store16(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store32(offset: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + var rmw: `T$5` + var rmw8_u: `T$5` + var rmw16_u: `T$5` + var rmw32_u: `T$5` + fun wait(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef +} + +external interface `T$9` { + fun load(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load8_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load8_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load16_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load16_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load32_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load32_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun store(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store8(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store16(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun store32(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun const(low: Number, high: Number): ExpressionRef + fun clz(value: ExpressionRef): ExpressionRef + fun ctz(value: ExpressionRef): ExpressionRef + fun popcnt(value: ExpressionRef): ExpressionRef + fun eqz(value: ExpressionRef): ExpressionRef + var trunc_s: `T$4` + var trunc_u: `T$4` + var trunc_s_sat: `T$4` + var trunc_u_sat: `T$4` + fun reinterpret(value: ExpressionRef): ExpressionRef + fun extend8_s(value: ExpressionRef): ExpressionRef + fun extend16_s(value: ExpressionRef): ExpressionRef + fun extend32_s(value: ExpressionRef): ExpressionRef + fun extend_s(value: ExpressionRef): ExpressionRef + fun extend_u(value: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun div_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun div_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rem_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rem_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun and(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun or(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun shl(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun shr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun shr_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rotl(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun rotr(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + var atomic: `T$8` + fun pop(): ExpressionRef +} + +external interface `T$10` { + fun load(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun store(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun const(value: Number): ExpressionRef + fun const_bits(value: Number): ExpressionRef + fun neg(value: ExpressionRef): ExpressionRef + fun abs(value: ExpressionRef): ExpressionRef + fun ceil(value: ExpressionRef): ExpressionRef + fun floor(value: ExpressionRef): ExpressionRef + fun trunc(value: ExpressionRef): ExpressionRef + fun nearest(value: ExpressionRef): ExpressionRef + fun sqrt(value: ExpressionRef): ExpressionRef + fun reinterpret(value: ExpressionRef): ExpressionRef + var convert_s: `T$4` + var convert_u: `T$4` + fun demote(value: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun div(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun copysign(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun min(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun max(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun pop(): ExpressionRef +} + +external interface `T$11` { + fun load(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun store(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun const(value: Number): ExpressionRef + fun const_bits(low: Number, high: Number): ExpressionRef + fun neg(value: ExpressionRef): ExpressionRef + fun abs(value: ExpressionRef): ExpressionRef + fun ceil(value: ExpressionRef): ExpressionRef + fun floor(value: ExpressionRef): ExpressionRef + fun trunc(value: ExpressionRef): ExpressionRef + fun nearest(value: ExpressionRef): ExpressionRef + fun sqrt(value: ExpressionRef): ExpressionRef + fun reinterpret(value: ExpressionRef): ExpressionRef + var convert_s: `T$4` + var convert_u: `T$4` + fun promote(value: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun div(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun copysign(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun min(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun max(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun pop(): ExpressionRef +} + +external interface `T$12` { + fun load(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun store(offset: Number, align: Number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef + fun const(value: Number): ExpressionRef + fun not(value: ExpressionRef): ExpressionRef + fun and(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun or(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun andnot(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun bitselect(left: ExpressionRef, right: ExpressionRef, cond: ExpressionRef): ExpressionRef + fun pop(): ExpressionRef +} + +external interface `T$13` { + fun splat(value: ExpressionRef): ExpressionRef + fun extract_lane_s(vec: ExpressionRef, index: ExpressionRef): ExpressionRef + fun extract_lane_u(vec: ExpressionRef, index: ExpressionRef): ExpressionRef + fun replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun neg(value: ExpressionRef): ExpressionRef + fun any_true(value: ExpressionRef): ExpressionRef + fun all_true(value: ExpressionRef): ExpressionRef + fun shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun add_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun add_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun min_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun min_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun max_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun max_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun avgr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun narrow_i16x8_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun narrow_i16x8_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef +} + +external interface `T$14` { + fun splat(value: ExpressionRef): ExpressionRef + fun extract_lane_s(vec: ExpressionRef, index: ExpressionRef): ExpressionRef + fun extract_lane_u(vec: ExpressionRef, index: ExpressionRef): ExpressionRef + fun replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun neg(value: ExpressionRef): ExpressionRef + fun any_true(value: ExpressionRef): ExpressionRef + fun all_true(value: ExpressionRef): ExpressionRef + fun shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun add_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun add_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun min_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun min_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun max_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun max_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun avgr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun narrow_i32x4_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun narrow_i32x4_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun widen_low_i8x16_s(value: ExpressionRef): ExpressionRef + fun widen_high_i8x16_s(value: ExpressionRef): ExpressionRef + fun widen_low_i8x16_u(value: ExpressionRef): ExpressionRef + fun widen_high_i8x16_u(value: ExpressionRef): ExpressionRef + fun load8x8_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load8x8_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef +} + +external interface `T$15` { + fun splat(value: ExpressionRef): ExpressionRef + fun extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef + fun replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun neg(value: ExpressionRef): ExpressionRef + fun any_true(value: ExpressionRef): ExpressionRef + fun all_true(value: ExpressionRef): ExpressionRef + fun shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun trunc_sat_f32x4_s(value: ExpressionRef): ExpressionRef + fun trunc_sat_f32x4_u(value: ExpressionRef): ExpressionRef + fun widen_low_i16x8_s(value: ExpressionRef): ExpressionRef + fun widen_high_i16x8_s(value: ExpressionRef): ExpressionRef + fun widen_low_i16x8_u(value: ExpressionRef): ExpressionRef + fun widen_high_i16x8_u(value: ExpressionRef): ExpressionRef + fun load16x4_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load16x4_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef +} + +external interface `T$16` { + fun splat(value: ExpressionRef): ExpressionRef + fun extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef + fun replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef + fun neg(value: ExpressionRef): ExpressionRef + fun any_true(value: ExpressionRef): ExpressionRef + fun all_true(value: ExpressionRef): ExpressionRef + fun shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun trunc_sat_f64x2_s(value: ExpressionRef): ExpressionRef + fun trunc_sat_f64x2_u(value: ExpressionRef): ExpressionRef + fun load32x2_s(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef + fun load32x2_u(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef +} + +external interface `T$17` { + fun splat(value: ExpressionRef): ExpressionRef + fun extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef + fun replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef + fun eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun le(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun abs(value: ExpressionRef): ExpressionRef + fun neg(value: ExpressionRef): ExpressionRef + fun sqrt(value: ExpressionRef): ExpressionRef + fun qfma(a: ExpressionRef, b: ExpressionRef, c: ExpressionRef): ExpressionRef + fun qfms(a: ExpressionRef, b: ExpressionRef, c: ExpressionRef): ExpressionRef + fun add(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun div(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun min(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun max(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun convert_i32x4_s(value: ExpressionRef): ExpressionRef + fun convert_i32x4_u(value: ExpressionRef): ExpressionRef +} + +external interface `T$18` { + fun shuffle(left: ExpressionRef, right: ExpressionRef, mask: Array): ExpressionRef + fun swizzle(left: ExpressionRef, right: ExpressionRef): ExpressionRef + fun load_splat(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef +} + +external interface `T$19` { + fun load_splat(offset: Number, align: Number, ptr: ExpressionRef): ExpressionRef +} + +external interface `T$20` { + fun pop(): ExpressionRef +} + +external interface `T$21` { + fun `null`(): ExpressionRef + fun is_null(value: ExpressionRef): ExpressionRef + fun func(name: String): ExpressionRef +} + +external interface `T$22` { + fun notify(ptr: ExpressionRef, notifyCount: ExpressionRef): ExpressionRef + fun fence(): ExpressionRef +} + +external interface `T$23` { + fun make(elements: Array): ExpressionRef + fun extract(tuple: ExpressionRef, index: Number): ExpressionRef +} + +external interface `T$24` { + var imported: Boolean + var segments: Array +} + +external interface `T$25` { + var binary: Uint8Array + var sourceMap: String? +} + +external open class Module { + open var ptr: Number + open fun block(label: String, children: Array, resultType: Type = definedExternally): ExpressionRef + open fun `if`( + condition: ExpressionRef, + ifTrue: ExpressionRef, + ifFalse: ExpressionRef = definedExternally + ): ExpressionRef + + open fun loop(label: String, body: ExpressionRef): ExpressionRef + open fun br( + label: String, + condition: ExpressionRef = definedExternally, + value: ExpressionRef = definedExternally + ): ExpressionRef + + open fun br_if( + label: String, + condition: ExpressionRef = definedExternally, + value: ExpressionRef = definedExternally + ): ExpressionRef + + open fun switch( + labels: Array, + defaultLabel: String, + condition: ExpressionRef, + value: ExpressionRef = definedExternally + ): ExpressionRef + + open fun call(name: String, operands: Array, returnType: Type): ExpressionRef + open fun return_call(name: String, operands: Array, returnType: Type): ExpressionRef + open fun call_indirect( + target: ExpressionRef, + operands: Array, + params: Type, + results: Type + ): ExpressionRef + + open fun return_call_indirect( + target: ExpressionRef, + operands: Array, + params: Type, + results: Type + ): ExpressionRef + + open var local: `T$0` + open var global: `T$1` + open var memory: `T$2` + open var data: `T$3` + open var i32: `T$7` + open var i64: `T$9` + open var f32: `T$10` + open var f64: `T$11` + open var v128: `T$12` + open var i8x16: `T$13` + open var i16x8: `T$14` + open var i32x4: `T$15` + open var i64x2: `T$16` + open var f32x4: `T$17` + open var f64x2: `T$17` + open var v8x16: `T$18` + open var v16x8: `T$19` + open var v32x4: `T$19` + open var v64x2: `T$19` + open var funcref: `T$20` + open var anyref: `T$20` + open var nullref: `T$20` + open var exnref: `T$20` + open var ref: `T$21` + open var atomic: `T$22` + open var tuple: `T$23` + open fun `try`(body: ExpressionRef, catchBody: ExpressionRef): ExpressionRef + open fun `throw`(event: String, operands: Array): ExpressionRef + open fun rethrow(exnref: ExpressionRef): ExpressionRef + open fun br_on_exn(label: String, event: String, exnref: ExpressionRef): ExpressionRef + open fun push(value: ExpressionRef): ExpressionRef + open fun select( + condition: ExpressionRef, + ifTrue: ExpressionRef, + ifFalse: ExpressionRef, + type: Type = definedExternally + ): ExpressionRef + + open fun drop(value: ExpressionRef): ExpressionRef + open fun `return`(value: ExpressionRef = definedExternally): ExpressionRef + open fun host(op: Operations, name: String, operands: Array): ExpressionRef + open fun nop(): ExpressionRef + open fun unreachable(): ExpressionRef + open fun addFunction(name: String, params: Type, results: Type, vars: Array, body: ExpressionRef): FunctionRef + open fun getFunction(name: String): FunctionRef + open fun removeFunction(name: String) + open fun getNumFunctions(): Number + open fun getFunctionByIndex(index: Number): FunctionRef + open fun addGlobal(name: String, type: Type, mutable: Boolean, init: ExpressionRef): GlobalRef + open fun getGlobal(name: String): GlobalRef + open fun removeGlobal(name: String) + open fun addEvent(name: String, attribute: Number, params: Type, results: Type): EventRef + open fun getEvent(name: String): EventRef + open fun removeEvent(name: String) + open fun addFunctionImport( + internalName: String, + externalModuleName: String, + externalBaseName: String, + params: Type, + results: Type + ) + + open fun addTableImport(internalName: String, externalModuleName: String, externalBaseName: String) + open fun addMemoryImport(internalName: String, externalModuleName: String, externalBaseName: String) + open fun addGlobalImport( + internalName: String, + externalModuleName: String, + externalBaseName: String, + globalType: Type + ) + + open fun addEventImport( + internalName: String, + externalModuleName: String, + externalBaseName: String, + attribute: Number, + params: Type, + results: Type + ) + + open fun addFunctionExport(internalName: String, externalName: String): ExportRef + open fun addTableExport(internalName: String, externalName: String): ExportRef + open fun addMemoryExport(internalName: String, externalName: String): ExportRef + open fun addGlobalExport(internalName: String, externalName: String): ExportRef + open fun removeExport(externalName: String) + open fun getNumExports(): Number + open fun getExportByIndex(index: Number): ExportRef + open fun setFunctionTable( + initial: Number, + maximum: Number, + funcNames: Array, + offset: ExpressionRef = definedExternally + ) + + open fun getFunctionTable(): `T$24` + open fun setMemory( + initial: Number, + maximum: Number, + exportName: String? = definedExternally, + segments: Array? = definedExternally, + flags: Array? = definedExternally, + shared: Boolean = definedExternally + ) + + open fun getNumMemorySegments(): Number + open fun getMemorySegmentInfoByIndex(index: Number): MemorySegmentInfo + open fun setStart(start: FunctionRef) + open fun getFeatures(): Features + open fun setFeatures(features: Features) + open fun addCustomSection(name: String, contents: Uint8Array) + open fun emitText(): String + open fun emitStackIR(optimize: Boolean = definedExternally): String + open fun emitAsmjs(): String + open fun validate(): Number + open fun optimize() + open fun optimizeFunction(func: String) + open fun optimizeFunction(func: FunctionRef) + open fun runPasses(passes: Array) + open fun runPassesOnFunction(func: String, passes: Array) + open fun runPassesOnFunction(func: FunctionRef, passes: Array) + open fun autoDrop() + open fun dispose() + open fun emitBinary(): Uint8Array + open fun emitBinary(sourceMapUrl: String?): `T$25` + open fun interpret() + open fun addDebugInfoFileName(filename: String): Number + open fun getDebugInfoFileName(index: Number): String? + open fun setDebugLocation( + func: FunctionRef, + expr: ExpressionRef, + fileIndex: Number, + lineNumber: Number, + columnNumber: Number + ) + + open fun copyExpression(expr: ExpressionRef): ExpressionRef +} + +external interface MemorySegment { + var offset: ExpressionRef + var data: Uint8Array + var passive: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface TableElement { + var offset: ExpressionRef + var names: Array +} + +external fun wrapModule(ptr: Number): Module + +external fun getExpressionId(expression: ExpressionRef): Number + +external fun getExpressionType(expression: ExpressionRef): Type + +external fun getExpressionInfo(expression: ExpressionRef): ExpressionInfo + +external interface MemorySegmentInfo { + var offset: ExpressionRef + var data: Uint8Array + var passive: Boolean +} + +external interface ExpressionInfo { + var id: ExpressionIds + var type: Type +} + +external interface BlockInfo : ExpressionInfo { + var name: String + var children: Array +} + +external interface IfInfo : ExpressionInfo { + var condition: ExpressionRef + var ifTrue: ExpressionRef + var ifFalse: ExpressionRef +} + +external interface LoopInfo : ExpressionInfo { + var name: String + var body: ExpressionRef +} + +external interface BreakInfo : ExpressionInfo { + var name: String + var condition: ExpressionRef + var value: ExpressionRef +} + +external interface SwitchInfo : ExpressionInfo { + var names: Array + var defaultName: String? + var condition: ExpressionRef + var value: ExpressionRef +} + +external interface CallInfo : ExpressionInfo { + var isReturn: Boolean + var target: String + var operands: Array +} + +external interface CallIndirectInfo : ExpressionInfo { + var isReturn: Boolean + var target: ExpressionRef + var operands: Array +} + +external interface LocalGetInfo : ExpressionInfo { + var index: Number +} + +external interface LocalSetInfo : ExpressionInfo { + var isTee: Boolean + var index: Number + var value: ExpressionRef +} + +external interface GlobalGetInfo : ExpressionInfo { + var name: String +} + +external interface GlobalSetInfo : ExpressionInfo { + var name: String + var value: ExpressionRef +} + +external interface LoadInfo : ExpressionInfo { + var isAtomic: Boolean + var isSigned: Boolean + var offset: Number + var bytes: Number + var align: Number + var ptr: ExpressionRef +} + +external interface StoreInfo : ExpressionInfo { + var isAtomic: Boolean + var offset: Number + var bytes: Number + var align: Number + var ptr: ExpressionRef + var value: ExpressionRef +} + +external interface `T$26` { + var low: Number + var high: Number +} + +external interface ConstInfo : ExpressionInfo { + var value: dynamic /* Number | `T$26` */ + get() = definedExternally + set(value) = definedExternally +} + +external interface UnaryInfo : ExpressionInfo { + var op: Operations + var value: ExpressionRef +} + +external interface BinaryInfo : ExpressionInfo { + var op: Operations + var left: ExpressionRef + var right: ExpressionRef +} + +external interface SelectInfo : ExpressionInfo { + var ifTrue: ExpressionRef + var ifFalse: ExpressionRef + var condition: ExpressionRef +} + +external interface DropInfo : ExpressionInfo { + var value: ExpressionRef +} + +external interface ReturnInfo : ExpressionInfo { + var value: ExpressionRef +} + +external interface NopInfo : ExpressionInfo + +external interface UnreachableInfo : ExpressionInfo + +external interface HostInfo : ExpressionInfo { + var op: Operations + var nameOperand: String? + var operands: Array +} + +external interface AtomicRMWInfo : ExpressionInfo { + var op: Operations + var bytes: Number + var offset: Number + var ptr: ExpressionRef + var value: ExpressionRef +} + +external interface AtomicCmpxchgInfo : ExpressionInfo { + var bytes: Number + var offset: Number + var ptr: ExpressionRef + var expected: ExpressionRef + var replacement: ExpressionRef +} + +external interface AtomicWaitInfo : ExpressionInfo { + var ptr: ExpressionRef + var expected: ExpressionRef + var timeout: ExpressionRef + var expectedType: Type +} + +external interface AtomicNotifyInfo : ExpressionInfo { + var ptr: ExpressionRef + var notifyCount: ExpressionRef +} + +external interface AtomicFenceInfo : ExpressionInfo { + var order: Number +} + +external interface SIMDExtractInfo : ExpressionInfo { + var op: Operations + var vec: ExpressionRef + var index: ExpressionRef +} + +external interface SIMDReplaceInfo : ExpressionInfo { + var op: Operations + var vec: ExpressionRef + var index: ExpressionRef + var value: ExpressionRef +} + +external interface SIMDShuffleInfo : ExpressionInfo { + var left: ExpressionRef + var right: ExpressionRef + var mask: Array +} + +external interface SIMDTernaryInfo : ExpressionInfo { + var op: Operations + var a: ExpressionRef + var b: ExpressionRef + var c: ExpressionRef +} + +external interface SIMDShiftInfo : ExpressionInfo { + var op: Operations + var vec: ExpressionRef + var shift: ExpressionRef +} + +external interface SIMDLoadInfo : ExpressionInfo { + var op: Operations + var offset: Number + var align: Number + var ptr: ExpressionRef +} + +external interface MemoryInitInfo : ExpressionInfo { + var segment: Number + var dest: ExpressionRef + var offset: ExpressionRef + var size: ExpressionRef +} + +external interface MemoryDropInfo : ExpressionInfo { + var segment: Number +} + +external interface MemoryCopyInfo : ExpressionInfo { + var dest: ExpressionRef + var source: ExpressionRef + var size: ExpressionRef +} + +external interface MemoryFillInfo : ExpressionInfo { + var dest: ExpressionRef + var value: ExpressionRef + var size: ExpressionRef +} + +external interface RefNullInfo : ExpressionInfo + +external interface RefIsNullInfo : ExpressionInfo { + var value: ExpressionRef +} + +external interface RefFuncInfo : ExpressionInfo { + var func: String +} + +external interface TryInfo : ExpressionInfo { + var body: ExpressionRef + var catchBody: ExpressionRef +} + +external interface ThrowInfo : ExpressionInfo { + var event: String + var operands: Array +} + +external interface RethrowInfo : ExpressionInfo { + var exnref: ExpressionRef +} + +external interface BrOnExnInfo : ExpressionInfo { + var name: String + var event: String + var exnref: ExpressionRef +} + +external interface PopInfo : ExpressionInfo + +external interface PushInfo : ExpressionInfo { + var value: ExpressionRef +} + +external fun getFunctionInfo(func: FunctionRef): FunctionInfo + +external interface FunctionInfo { + var name: String + var module: String? + var base: String? + var params: Type + var results: Type + var vars: Array + var body: ExpressionRef +} + +external fun getGlobalInfo(global: GlobalRef): GlobalInfo + +external interface GlobalInfo { + var name: String + var module: String? + var base: String? + var type: Type + var mutable: Boolean + var init: ExpressionRef +} + +external fun getExportInfo(export_: ExportRef): ExportInfo + +external interface ExportInfo { + var kind: ExternalKinds + var name: String + var value: String +} + +external fun getEventInfo(event: EventRef): EventInfo + +external interface EventInfo { + var name: String + var module: String? + var base: String? + var attribute: Number + var params: Type + var results: Type +} + +external fun getSideEffects(expr: ExpressionRef, features: Features): SideEffects + +external enum class SideEffects { + None, + Branches, + Calls, + ReadsLocal, + WritesLocal, + ReadsGlobal, + WritesGlobal, + ReadsMemory, + WritesMemory, + ImplicitTrap, + IsAtomic, + Throws, + Any +} + +external fun emitText(expression: ExpressionRef): String + +external fun emitText(expression: Module): String + +external fun readBinary(data: Uint8Array): Module + +external fun parseText(text: String): Module + +external fun getOptimizeLevel(): Number + +external fun setOptimizeLevel(level: Number): Number + +external fun getShrinkLevel(): Number + +external fun setShrinkLevel(level: Number): Number + +external fun getDebugInfo(): Boolean + +external fun setDebugInfo(on: Boolean) + +external fun getLowMemoryUnused(): Boolean + +external fun setLowMemoryUnused(on: Boolean) + +external fun getPassArgument(key: String): String? + +external fun setPassArgument(key: String, value: String?) + +external fun clearPassArguments() + +external fun getAlwaysInlineMaxSize(): Number + +external fun setAlwaysInlineMaxSize(size: Number) + +external fun getFlexibleInlineMaxSize(): Number + +external fun setFlexibleInlineMaxSize(size: Number) + +external fun getOneCallerInlineMaxSize(): Number + +external fun setOneCallerInlineMaxSize(size: Number) + +external fun exit(status: Number) + +external open class Relooper(module: Module) { + open fun addBlock(expression: ExpressionRef): RelooperBlockRef + open fun addBranch(from: RelooperBlockRef, to: RelooperBlockRef, condition: ExpressionRef, code: ExpressionRef) + open fun addBlockWithSwitch(code: ExpressionRef, condition: ExpressionRef): RelooperBlockRef + open fun addBranchForSwitch( + from: RelooperBlockRef, + to: RelooperBlockRef, + indexes: Array, + code: ExpressionRef + ) + + open fun renderAndDispose(entry: RelooperBlockRef, labelHelper: Number): ExpressionRef +} \ No newline at end of file diff --git a/kmath-ast/src/jsMain/kotlin/binaryen/typealises.kt b/kmath-ast/src/jsMain/kotlin/binaryen/typealises.kt new file mode 100644 index 000000000..e15851209 --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/binaryen/typealises.kt @@ -0,0 +1,11 @@ +@file:Suppress("NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation") + +package binaryen + +typealias Type = Number +typealias RelooperBlockRef = Number +typealias ExpressionRef = Number +typealias FunctionRef = Number +typealias GlobalRef = Number +typealias ExportRef = Number +typealias EventRef = Number diff --git a/kmath-ast/src/jsMain/kotlin/index.d.ts b/kmath-ast/src/jsMain/kotlin/index.d.ts new file mode 100644 index 000000000..77117fffb --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/index.d.ts @@ -0,0 +1,1787 @@ +declare module binaryen { + + const isReady: boolean; + const ready: Promise; + + type Type = number; + + const none: Type; + const i32: Type; + const i64: Type; + const f32: Type; + const f64: Type; + const v128: Type; + const funcref: Type; + const anyref: Type; + const nullref: Type; + const exnref: Type; + const unreachable: Type; + const auto: Type; + + function createType(types: Type[]): Type; + function expandType(type: Type): Type[]; + + const enum ExpressionIds { + Invalid, + Block, + If, + Loop, + Break, + Switch, + Call, + CallIndirect, + LocalGet, + LocalSet, + GlobalGet, + GlobalSet, + Load, + Store, + Const, + Unary, + Binary, + Select, + Drop, + Return, + Host, + Nop, + Unreachable, + AtomicCmpxchg, + AtomicRMW, + AtomicWait, + AtomicNotify, + AtomicFence, + SIMDExtract, + SIMDReplace, + SIMDShuffle, + SIMDTernary, + SIMDShift, + SIMDLoad, + MemoryInit, + DataDrop, + MemoryCopy, + MemoryFill, + RefNull, + RefIsNull, + RefFunc, + Try, + Throw, + Rethrow, + BrOnExn, + TupleMake, + TupleExtract, + Push, + Pop + } + + const InvalidId: ExpressionIds; + const BlockId: ExpressionIds; + const IfId: ExpressionIds; + const LoopId: ExpressionIds; + const BreakId: ExpressionIds; + const SwitchId: ExpressionIds; + const CallId: ExpressionIds; + const CallIndirectId: ExpressionIds; + const LocalGetId: ExpressionIds; + const LocalSetId: ExpressionIds; + const GlobalGetId: ExpressionIds; + const GlobalSetId: ExpressionIds; + const LoadId: ExpressionIds; + const StoreId: ExpressionIds; + const ConstId: ExpressionIds; + const UnaryId: ExpressionIds; + const BinaryId: ExpressionIds; + const SelectId: ExpressionIds; + const DropId: ExpressionIds; + const ReturnId: ExpressionIds; + const HostId: ExpressionIds; + const NopId: ExpressionIds; + const UnreachableId: ExpressionIds; + const AtomicCmpxchgId: ExpressionIds; + const AtomicRMWId: ExpressionIds; + const AtomicWaitId: ExpressionIds; + const AtomicNotifyId: ExpressionIds; + const AtomicFenceId: ExpressionIds; + const SIMDExtractId: ExpressionIds; + const SIMDReplaceId: ExpressionIds; + const SIMDShuffleId: ExpressionIds; + const SIMDTernaryId: ExpressionIds; + const SIMDShiftId: ExpressionIds; + const SIMDLoadId: ExpressionIds; + const MemoryInitId: ExpressionIds; + const DataDropId: ExpressionIds; + const MemoryCopyId: ExpressionIds; + const MemoryFillId: ExpressionIds; + const RefNullId: ExpressionIds; + const RefIsNullId: ExpressionIds; + const RefFuncId: ExpressionIds; + const TryId: ExpressionIds; + const ThrowId: ExpressionIds; + const RethrowId: ExpressionIds; + const BrOnExnId: ExpressionIds; + const TupleMakeId: ExpressionIds; + const TupleExtractId: ExpressionIds; + const PushId: ExpressionIds; + const PopId: ExpressionIds; + + const enum ExternalKinds { + Function, + Table, + Memory, + Global, + Event + } + + const ExternalFunction: ExternalKinds; + const ExternalTable: ExternalKinds; + const ExternalMemory: ExternalKinds; + const ExternalGlobal: ExternalKinds; + const ExternalEvent: ExternalKinds; + + enum Features { + MVP, + Atomics, + MutableGlobals, + TruncSat, + SIMD, + BulkMemory, + SignExt, + ExceptionHandling, + TailCall, + ReferenceTypes, + Multivalue, + GC, + Memory64, + All + } + + const enum Operations { + ClzInt32, + CtzInt32, + PopcntInt32, + NegFloat32, + AbsFloat32, + CeilFloat32, + FloorFloat32, + TruncFloat32, + NearestFloat32, + SqrtFloat32, + EqZInt32, + ClzInt64, + CtzInt64, + PopcntInt64, + NegFloat64, + AbsFloat64, + CeilFloat64, + FloorFloat64, + TruncFloat64, + NearestFloat64, + SqrtFloat64, + EqZInt64, + ExtendSInt32, + ExtendUInt32, + WrapInt64, + TruncSFloat32ToInt32, + TruncSFloat32ToInt64, + TruncUFloat32ToInt32, + TruncUFloat32ToInt64, + TruncSFloat64ToInt32, + TruncSFloat64ToInt64, + TruncUFloat64ToInt32, + TruncUFloat64ToInt64, + TruncSatSFloat32ToInt32, + TruncSatSFloat32ToInt64, + TruncSatUFloat32ToInt32, + TruncSatUFloat32ToInt64, + TruncSatSFloat64ToInt32, + TruncSatSFloat64ToInt64, + TruncSatUFloat64ToInt32, + TruncSatUFloat64ToInt64, + ReinterpretFloat32, + ReinterpretFloat64, + ConvertSInt32ToFloat32, + ConvertSInt32ToFloat64, + ConvertUInt32ToFloat32, + ConvertUInt32ToFloat64, + ConvertSInt64ToFloat32, + ConvertSInt64ToFloat64, + ConvertUInt64ToFloat32, + ConvertUInt64ToFloat64, + PromoteFloat32, + DemoteFloat64, + ReinterpretInt32, + ReinterpretInt64, + ExtendS8Int32, + ExtendS16Int32, + ExtendS8Int64, + ExtendS16Int64, + ExtendS32Int64, + AddInt32, + SubInt32, + MulInt32, + DivSInt32, + DivUInt32, + RemSInt32, + RemUInt32, + AndInt32, + OrInt32, + XorInt32, + ShlInt32, + ShrUInt32, + ShrSInt32, + RotLInt32, + RotRInt32, + EqInt32, + NeInt32, + LtSInt32, + LtUInt32, + LeSInt32, + LeUInt32, + GtSInt32, + GtUInt32, + GeSInt32, + GeUInt32, + AddInt64, + SubInt64, + MulInt64, + DivSInt64, + DivUInt64, + RemSInt64, + RemUInt64, + AndInt64, + OrInt64, + XorInt64, + ShlInt64, + ShrUInt64, + ShrSInt64, + RotLInt64, + RotRInt64, + EqInt64, + NeInt64, + LtSInt64, + LtUInt64, + LeSInt64, + LeUInt64, + GtSInt64, + GtUInt64, + GeSInt64, + GeUInt64, + AddFloat32, + SubFloat32, + MulFloat32, + DivFloat32, + CopySignFloat32, + MinFloat32, + MaxFloat32, + EqFloat32, + NeFloat32, + LtFloat32, + LeFloat32, + GtFloat32, + GeFloat32, + AddFloat64, + SubFloat64, + MulFloat64, + DivFloat64, + CopySignFloat64, + MinFloat64, + MaxFloat64, + EqFloat64, + NeFloat64, + LtFloat64, + LeFloat64, + GtFloat64, + GeFloat64, + MemorySize, + MemoryGrow, + AtomicRMWAdd, + AtomicRMWSub, + AtomicRMWAnd, + AtomicRMWOr, + AtomicRMWXor, + AtomicRMWXchg, + SplatVecI8x16, + ExtractLaneSVecI8x16, + ExtractLaneUVecI8x16, + ReplaceLaneVecI8x16, + SplatVecI16x8, + ExtractLaneSVecI16x8, + ExtractLaneUVecI16x8, + ReplaceLaneVecI16x8, + SplatVecI32x4, + ExtractLaneVecI32x4, + ReplaceLaneVecI32x4, + SplatVecI64x2, + ExtractLaneVecI64x2, + ReplaceLaneVecI64x2, + SplatVecF32x4, + ExtractLaneVecF32x4, + ReplaceLaneVecF32x4, + SplatVecF64x2, + ExtractLaneVecF64x2, + ReplaceLaneVecF64x2, + EqVecI8x16, + NeVecI8x16, + LtSVecI8x16, + LtUVecI8x16, + GtSVecI8x16, + GtUVecI8x16, + LeSVecI8x16, + LeUVecI8x16, + GeSVecI8x16, + GeUVecI8x16, + EqVecI16x8, + NeVecI16x8, + LtSVecI16x8, + LtUVecI16x8, + GtSVecI16x8, + GtUVecI16x8, + LeSVecI16x8, + LeUVecI16x8, + GeSVecI16x8, + GeUVecI16x8, + EqVecI32x4, + NeVecI32x4, + LtSVecI32x4, + LtUVecI32x4, + GtSVecI32x4, + GtUVecI32x4, + LeSVecI32x4, + LeUVecI32x4, + GeSVecI32x4, + GeUVecI32x4, + EqVecF32x4, + NeVecF32x4, + LtVecF32x4, + GtVecF32x4, + LeVecF32x4, + GeVecF32x4, + EqVecF64x2, + NeVecF64x2, + LtVecF64x2, + GtVecF64x2, + LeVecF64x2, + GeVecF64x2, + NotVec128, + AndVec128, + OrVec128, + XorVec128, + AndNotVec128, + BitselectVec128, + NegVecI8x16, + AnyTrueVecI8x16, + AllTrueVecI8x16, + ShlVecI8x16, + ShrSVecI8x16, + ShrUVecI8x16, + AddVecI8x16, + AddSatSVecI8x16, + AddSatUVecI8x16, + SubVecI8x16, + SubSatSVecI8x16, + SubSatUVecI8x16, + MulVecI8x16, + MinSVecI8x16, + MinUVecI8x16, + MaxSVecI8x16, + MaxUVecI8x16, + NegVecI16x8, + AnyTrueVecI16x8, + AllTrueVecI16x8, + ShlVecI16x8, + ShrSVecI16x8, + ShrUVecI16x8, + AddVecI16x8, + AddSatSVecI16x8, + AddSatUVecI16x8, + SubVecI16x8, + SubSatSVecI16x8, + SubSatUVecI16x8, + MulVecI16x8, + MinSVecI16x8, + MinUVecI16x8, + MaxSVecI16x8, + MaxUVecI16x8, + DotSVecI16x8ToVecI32x4, + NegVecI32x4, + AnyTrueVecI32x4, + AllTrueVecI32x4, + ShlVecI32x4, + ShrSVecI32x4, + ShrUVecI32x4, + AddVecI32x4, + SubVecI32x4, + MulVecI32x4, + MinSVecI32x4, + MinUVecI32x4, + MaxSVecI32x4, + MaxUVecI32x4, + NegVecI64x2, + AnyTrueVecI64x2, + AllTrueVecI64x2, + ShlVecI64x2, + ShrSVecI64x2, + ShrUVecI64x2, + AddVecI64x2, + SubVecI64x2, + AbsVecF32x4, + NegVecF32x4, + SqrtVecF32x4, + QFMAVecF32x4, + QFMSVecF32x4, + AddVecF32x4, + SubVecF32x4, + MulVecF32x4, + DivVecF32x4, + MinVecF32x4, + MaxVecF32x4, + AbsVecF64x2, + NegVecF64x2, + SqrtVecF64x2, + QFMAVecF64x2, + QFMSVecF64x2, + AddVecF64x2, + SubVecF64x2, + MulVecF64x2, + DivVecF64x2, + MinVecF64x2, + MaxVecF64x2, + TruncSatSVecF32x4ToVecI32x4, + TruncSatUVecF32x4ToVecI32x4, + TruncSatSVecF64x2ToVecI64x2, + TruncSatUVecF64x2ToVecI64x2, + ConvertSVecI32x4ToVecF32x4, + ConvertUVecI32x4ToVecF32x4, + ConvertSVecI64x2ToVecF64x2, + ConvertUVecI64x2ToVecF64x2, + LoadSplatVec8x16, + LoadSplatVec16x8, + LoadSplatVec32x4, + LoadSplatVec64x2, + LoadExtSVec8x8ToVecI16x8, + LoadExtUVec8x8ToVecI16x8, + LoadExtSVec16x4ToVecI32x4, + LoadExtUVec16x4ToVecI32x4, + LoadExtSVec32x2ToVecI64x2, + LoadExtUVec32x2ToVecI64x2, + NarrowSVecI16x8ToVecI8x16, + NarrowUVecI16x8ToVecI8x16, + NarrowSVecI32x4ToVecI16x8, + NarrowUVecI32x4ToVecI16x8, + WidenLowSVecI8x16ToVecI16x8, + WidenHighSVecI8x16ToVecI16x8, + WidenLowUVecI8x16ToVecI16x8, + WidenHighUVecI8x16ToVecI16x8, + WidenLowSVecI16x8ToVecI32x4, + WidenHighSVecI16x8ToVecI32x4, + WidenLowUVecI16x8ToVecI32x4, + WidenHighUVecI16x8ToVecI32x4, + SwizzleVec8x16 + } + + const ClzInt32: Operations; + const CtzInt32: Operations; + const PopcntInt32: Operations; + const NegFloat32: Operations; + const AbsFloat32: Operations; + const CeilFloat32: Operations; + const FloorFloat32: Operations; + const TruncFloat32: Operations; + const NearestFloat32: Operations; + const SqrtFloat32: Operations; + const EqZInt32: Operations; + const ClzInt64: Operations; + const CtzInt64: Operations; + const PopcntInt64: Operations; + const NegFloat64: Operations; + const AbsFloat64: Operations; + const CeilFloat64: Operations; + const FloorFloat64: Operations; + const TruncFloat64: Operations; + const NearestFloat64: Operations; + const SqrtFloat64: Operations; + const EqZInt64: Operations; + const ExtendSInt32: Operations; + const ExtendUInt32: Operations; + const WrapInt64: Operations; + const TruncSFloat32ToInt32: Operations; + const TruncSFloat32ToInt64: Operations; + const TruncUFloat32ToInt32: Operations; + const TruncUFloat32ToInt64: Operations; + const TruncSFloat64ToInt32: Operations; + const TruncSFloat64ToInt64: Operations; + const TruncUFloat64ToInt32: Operations; + const TruncUFloat64ToInt64: Operations; + const TruncSatSFloat32ToInt32: Operations; + const TruncSatSFloat32ToInt64: Operations; + const TruncSatUFloat32ToInt32: Operations; + const TruncSatUFloat32ToInt64: Operations; + const TruncSatSFloat64ToInt32: Operations; + const TruncSatSFloat64ToInt64: Operations; + const TruncSatUFloat64ToInt32: Operations; + const TruncSatUFloat64ToInt64: Operations; + const ReinterpretFloat32: Operations; + const ReinterpretFloat64: Operations; + const ConvertSInt32ToFloat32: Operations; + const ConvertSInt32ToFloat64: Operations; + const ConvertUInt32ToFloat32: Operations; + const ConvertUInt32ToFloat64: Operations; + const ConvertSInt64ToFloat32: Operations; + const ConvertSInt64ToFloat64: Operations; + const ConvertUInt64ToFloat32: Operations; + const ConvertUInt64ToFloat64: Operations; + const PromoteFloat32: Operations; + const DemoteFloat64: Operations; + const ReinterpretInt32: Operations; + const ReinterpretInt64: Operations; + const ExtendS8Int32: Operations; + const ExtendS16Int32: Operations; + const ExtendS8Int64: Operations; + const ExtendS16Int64: Operations; + const ExtendS32Int64: Operations; + const AddInt32: Operations; + const SubInt32: Operations; + const MulInt32: Operations; + const DivSInt32: Operations; + const DivUInt32: Operations; + const RemSInt32: Operations; + const RemUInt32: Operations; + const AndInt32: Operations; + const OrInt32: Operations; + const XorInt32: Operations; + const ShlInt32: Operations; + const ShrUInt32: Operations; + const ShrSInt32: Operations; + const RotLInt32: Operations; + const RotRInt32: Operations; + const EqInt32: Operations; + const NeInt32: Operations; + const LtSInt32: Operations; + const LtUInt32: Operations; + const LeSInt32: Operations; + const LeUInt32: Operations; + const GtSInt32: Operations; + const GtUInt32: Operations; + const GeSInt32: Operations; + const GeUInt32: Operations; + const AddInt64: Operations; + const SubInt64: Operations; + const MulInt64: Operations; + const DivSInt64: Operations; + const DivUInt64: Operations; + const RemSInt64: Operations; + const RemUInt64: Operations; + const AndInt64: Operations; + const OrInt64: Operations; + const XorInt64: Operations; + const ShlInt64: Operations; + const ShrUInt64: Operations; + const ShrSInt64: Operations; + const RotLInt64: Operations; + const RotRInt64: Operations; + const EqInt64: Operations; + const NeInt64: Operations; + const LtSInt64: Operations; + const LtUInt64: Operations; + const LeSInt64: Operations; + const LeUInt64: Operations; + const GtSInt64: Operations; + const GtUInt64: Operations; + const GeSInt64: Operations; + const GeUInt64: Operations; + const AddFloat32: Operations; + const SubFloat32: Operations; + const MulFloat32: Operations; + const DivFloat32: Operations; + const CopySignFloat32: Operations; + const MinFloat32: Operations; + const MaxFloat32: Operations; + const EqFloat32: Operations; + const NeFloat32: Operations; + const LtFloat32: Operations; + const LeFloat32: Operations; + const GtFloat32: Operations; + const GeFloat32: Operations; + const AddFloat64: Operations; + const SubFloat64: Operations; + const MulFloat64: Operations; + const DivFloat64: Operations; + const CopySignFloat64: Operations; + const MinFloat64: Operations; + const MaxFloat64: Operations; + const EqFloat64: Operations; + const NeFloat64: Operations; + const LtFloat64: Operations; + const LeFloat64: Operations; + const GtFloat64: Operations; + const GeFloat64: Operations; + const MemorySize: Operations; + const MemoryGrow: Operations; + const AtomicRMWAdd: Operations; + const AtomicRMWSub: Operations; + const AtomicRMWAnd: Operations; + const AtomicRMWOr: Operations; + const AtomicRMWXor: Operations; + const AtomicRMWXchg: Operations; + const SplatVecI8x16: Operations; + const ExtractLaneSVecI8x16: Operations; + const ExtractLaneUVecI8x16: Operations; + const ReplaceLaneVecI8x16: Operations; + const SplatVecI16x8: Operations; + const ExtractLaneSVecI16x8: Operations; + const ExtractLaneUVecI16x8: Operations; + const ReplaceLaneVecI16x8: Operations; + const SplatVecI32x4: Operations; + const ExtractLaneVecI32x4: Operations; + const ReplaceLaneVecI32x4: Operations; + const SplatVecI64x2: Operations; + const ExtractLaneVecI64x2: Operations; + const ReplaceLaneVecI64x2: Operations; + const SplatVecF32x4: Operations; + const ExtractLaneVecF32x4: Operations; + const ReplaceLaneVecF32x4: Operations; + const SplatVecF64x2: Operations; + const ExtractLaneVecF64x2: Operations; + const ReplaceLaneVecF64x2: Operations; + const EqVecI8x16: Operations; + const NeVecI8x16: Operations; + const LtSVecI8x16: Operations; + const LtUVecI8x16: Operations; + const GtSVecI8x16: Operations; + const GtUVecI8x16: Operations; + const LeSVecI8x16: Operations; + const LeUVecI8x16: Operations; + const GeSVecI8x16: Operations; + const GeUVecI8x16: Operations; + const EqVecI16x8: Operations; + const NeVecI16x8: Operations; + const LtSVecI16x8: Operations; + const LtUVecI16x8: Operations; + const GtSVecI16x8: Operations; + const GtUVecI16x8: Operations; + const LeSVecI16x8: Operations; + const LeUVecI16x8: Operations; + const GeSVecI16x8: Operations; + const GeUVecI16x8: Operations; + const EqVecI32x4: Operations; + const NeVecI32x4: Operations; + const LtSVecI32x4: Operations; + const LtUVecI32x4: Operations; + const GtSVecI32x4: Operations; + const GtUVecI32x4: Operations; + const LeSVecI32x4: Operations; + const LeUVecI32x4: Operations; + const GeSVecI32x4: Operations; + const GeUVecI32x4: Operations; + const EqVecF32x4: Operations; + const NeVecF32x4: Operations; + const LtVecF32x4: Operations; + const GtVecF32x4: Operations; + const LeVecF32x4: Operations; + const GeVecF32x4: Operations; + const EqVecF64x2: Operations; + const NeVecF64x2: Operations; + const LtVecF64x2: Operations; + const GtVecF64x2: Operations; + const LeVecF64x2: Operations; + const GeVecF64x2: Operations; + const NotVec128: Operations; + const AndVec128: Operations; + const OrVec128: Operations; + const XorVec128: Operations; + const AndNotVec128: Operations; + const BitselectVec128: Operations; + const NegVecI8x16: Operations; + const AnyTrueVecI8x16: Operations; + const AllTrueVecI8x16: Operations; + const ShlVecI8x16: Operations; + const ShrSVecI8x16: Operations; + const ShrUVecI8x16: Operations; + const AddVecI8x16: Operations; + const AddSatSVecI8x16: Operations; + const AddSatUVecI8x16: Operations; + const SubVecI8x16: Operations; + const SubSatSVecI8x16: Operations; + const SubSatUVecI8x16: Operations; + const MulVecI8x16: Operations; + const MinSVecI8x16: Operations; + const MinUVecI8x16: Operations; + const MaxSVecI8x16: Operations; + const MaxUVecI8x16: Operations; + const NegVecI16x8: Operations; + const AnyTrueVecI16x8: Operations; + const AllTrueVecI16x8: Operations; + const ShlVecI16x8: Operations; + const ShrSVecI16x8: Operations; + const ShrUVecI16x8: Operations; + const AddVecI16x8: Operations; + const AddSatSVecI16x8: Operations; + const AddSatUVecI16x8: Operations; + const SubVecI16x8: Operations; + const SubSatSVecI16x8: Operations; + const SubSatUVecI16x8: Operations; + const MulVecI16x8: Operations; + const MinSVecI16x8: Operations; + const MinUVecI16x8: Operations; + const MaxSVecI16x8: Operations; + const MaxUVecI16x8: Operations; + const DotSVecI16x8ToVecI32x4: Operations; + const NegVecI32x4: Operations; + const AnyTrueVecI32x4: Operations; + const AllTrueVecI32x4: Operations; + const ShlVecI32x4: Operations; + const ShrSVecI32x4: Operations; + const ShrUVecI32x4: Operations; + const AddVecI32x4: Operations; + const SubVecI32x4: Operations; + const MulVecI32x4: Operations; + const MinSVecI32x4: Operations; + const MinUVecI32x4: Operations; + const MaxSVecI32x4: Operations; + const MaxUVecI32x4: Operations; + const NegVecI64x2: Operations; + const AnyTrueVecI64x2: Operations; + const AllTrueVecI64x2: Operations; + const ShlVecI64x2: Operations; + const ShrSVecI64x2: Operations; + const ShrUVecI64x2: Operations; + const AddVecI64x2: Operations; + const SubVecI64x2: Operations; + const AbsVecF32x4: Operations; + const NegVecF32x4: Operations; + const SqrtVecF32x4: Operations; + const QFMAVecF32x4: Operations; + const QFMSVecF32x4: Operations; + const AddVecF32x4: Operations; + const SubVecF32x4: Operations; + const MulVecF32x4: Operations; + const DivVecF32x4: Operations; + const MinVecF32x4: Operations; + const MaxVecF32x4: Operations; + const AbsVecF64x2: Operations; + const NegVecF64x2: Operations; + const SqrtVecF64x2: Operations; + const QFMAVecF64x2: Operations; + const QFMSVecF64x2: Operations; + const AddVecF64x2: Operations; + const SubVecF64x2: Operations; + const MulVecF64x2: Operations; + const DivVecF64x2: Operations; + const MinVecF64x2: Operations; + const MaxVecF64x2: Operations; + const TruncSatSVecF32x4ToVecI32x4: Operations; + const TruncSatUVecF32x4ToVecI32x4: Operations; + const TruncSatSVecF64x2ToVecI64x2: Operations; + const TruncSatUVecF64x2ToVecI64x2: Operations; + const ConvertSVecI32x4ToVecF32x4: Operations; + const ConvertUVecI32x4ToVecF32x4: Operations; + const ConvertSVecI64x2ToVecF64x2: Operations; + const ConvertUVecI64x2ToVecF64x2: Operations; + const LoadSplatVec8x16: Operations; + const LoadSplatVec16x8: Operations; + const LoadSplatVec32x4: Operations; + const LoadSplatVec64x2: Operations; + const LoadExtSVec8x8ToVecI16x8: Operations; + const LoadExtUVec8x8ToVecI16x8: Operations; + const LoadExtSVec16x4ToVecI32x4: Operations; + const LoadExtUVec16x4ToVecI32x4: Operations; + const LoadExtSVec32x2ToVecI64x2: Operations; + const LoadExtUVec32x2ToVecI64x2: Operations; + const NarrowSVecI16x8ToVecI8x16: Operations; + const NarrowUVecI16x8ToVecI8x16: Operations; + const NarrowSVecI32x4ToVecI16x8: Operations; + const NarrowUVecI32x4ToVecI16x8: Operations; + const WidenLowSVecI8x16ToVecI16x8: Operations; + const WidenHighSVecI8x16ToVecI16x8: Operations; + const WidenLowUVecI8x16ToVecI16x8: Operations; + const WidenHighUVecI8x16ToVecI16x8: Operations; + const WidenLowSVecI16x8ToVecI32x4: Operations; + const WidenHighSVecI16x8ToVecI32x4: Operations; + const WidenLowUVecI16x8ToVecI32x4: Operations; + const WidenHighUVecI16x8ToVecI32x4: Operations; + const SwizzleVec8x16: Operations; + + type ExpressionRef = number; + type FunctionRef = number; + type GlobalRef = number; + type ExportRef = number; + type EventRef = number; + + class Module { + constructor(); + readonly ptr: number; + block(label: string, children: ExpressionRef[], resultType?: Type): ExpressionRef; + if(condition: ExpressionRef, ifTrue: ExpressionRef, ifFalse?: ExpressionRef): ExpressionRef; + loop(label: string, body: ExpressionRef): ExpressionRef; + br(label: string, condition?: ExpressionRef, value?: ExpressionRef): ExpressionRef; + br_if(label: string, condition?: ExpressionRef, value?: ExpressionRef): ExpressionRef; + switch(labels: string[], defaultLabel: string, condition: ExpressionRef, value?: ExpressionRef): ExpressionRef; + call(name: string, operands: ExpressionRef[], returnType: Type): ExpressionRef; + return_call(name: string, operands: ExpressionRef[], returnType: Type): ExpressionRef; + call_indirect(target: ExpressionRef, operands: ExpressionRef[], params: Type, results: Type): ExpressionRef; + return_call_indirect(target: ExpressionRef, operands: ExpressionRef[], params: Type, results: Type): ExpressionRef; + local: { + get(index: number, type: Type): ExpressionRef; + set(index: number, value: ExpressionRef): ExpressionRef; + tee(index: number, value: ExpressionRef, type: Type): ExpressionRef; + }; + global: { + get(name: string, type: Type): ExpressionRef; + set(name: string, value: ExpressionRef): ExpressionRef; + }; + memory: { + size(): ExpressionRef; + grow(value: ExpressionRef): ExpressionRef; + init(segment: number, dest: ExpressionRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef; + copy(dest: ExpressionRef, source: ExpressionRef, size: ExpressionRef): ExpressionRef; + fill(dest: ExpressionRef, value: ExpressionRef, size: ExpressionRef): ExpressionRef; + }; + data: { + drop(segment: number): ExpressionRef; + }; + i32: { + load(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load8_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load8_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load16_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load16_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store8(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store16(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + const(value: number): ExpressionRef; + clz(value: ExpressionRef): ExpressionRef; + ctz(value: ExpressionRef): ExpressionRef; + popcnt(value: ExpressionRef): ExpressionRef; + eqz(value: ExpressionRef): ExpressionRef; + trunc_s: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + trunc_u: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + trunc_s_sat: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + trunc_u_sat: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + reinterpret(value: ExpressionRef): ExpressionRef; + extend8_s(value: ExpressionRef): ExpressionRef; + extend16_s(value: ExpressionRef): ExpressionRef; + wrap(value: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rem_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rem_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + and(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + or(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + shl(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + shr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + shr_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rotl(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rotr(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + atomic: { + load(offset: number, ptr: ExpressionRef): ExpressionRef; + load8_u(offset: number, ptr: ExpressionRef): ExpressionRef; + load16_u(offset: number, ptr: ExpressionRef): ExpressionRef; + store(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store8(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store16(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + rmw: { + add(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + sub(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + and(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + or(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xor(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef; + }, + rmw8_u: { + add(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + sub(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + and(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + or(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xor(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef; + }, + rmw16_u: { + add(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + sub(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + and(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + or(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xor(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef; + }, + wait(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef; + }, + pop(): ExpressionRef; + }; + i64: { + load(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load8_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load8_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load16_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load16_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load32_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load32_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store8(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store16(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store32(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + const(low: number, high: number): ExpressionRef; + clz(value: ExpressionRef): ExpressionRef; + ctz(value: ExpressionRef): ExpressionRef; + popcnt(value: ExpressionRef): ExpressionRef; + eqz(value: ExpressionRef): ExpressionRef; + trunc_s: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + trunc_u: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + trunc_s_sat: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + trunc_u_sat: { + f32(value: ExpressionRef): ExpressionRef; + f64(value: ExpressionRef): ExpressionRef; + }; + reinterpret(value: ExpressionRef): ExpressionRef; + extend8_s(value: ExpressionRef): ExpressionRef; + extend16_s(value: ExpressionRef): ExpressionRef; + extend32_s(value: ExpressionRef): ExpressionRef; + extend_s(value: ExpressionRef): ExpressionRef; + extend_u(value: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rem_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rem_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + and(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + or(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + shl(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + shr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + shr_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rotl(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + rotr(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + atomic: { + load(offset: number, ptr: ExpressionRef): ExpressionRef; + load8_u(offset: number, ptr: ExpressionRef): ExpressionRef; + load16_u(offset: number, ptr: ExpressionRef): ExpressionRef; + load32_u(offset: number, ptr: ExpressionRef): ExpressionRef; + store(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store8(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store16(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + store32(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + rmw: { + add(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + sub(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + and(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + or(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xor(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef; + }, + rmw8_u: { + add(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + sub(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + and(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + or(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xor(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef; + }, + rmw16_u: { + add(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + sub(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + and(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + or(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xor(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef; + }, + rmw32_u: { + add(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + sub(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + and(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + or(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xor(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef; + }, + wait(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef; + }, + pop(): ExpressionRef; + }; + f32: { + load(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + const(value: number): ExpressionRef; + const_bits(value: number): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + abs(value: ExpressionRef): ExpressionRef; + ceil(value: ExpressionRef): ExpressionRef; + floor(value: ExpressionRef): ExpressionRef; + trunc(value: ExpressionRef): ExpressionRef; + nearest(value: ExpressionRef): ExpressionRef; + sqrt(value: ExpressionRef): ExpressionRef; + reinterpret(value: ExpressionRef): ExpressionRef; + convert_s: { + i32(value: ExpressionRef): ExpressionRef; + i64(value: ExpressionRef): ExpressionRef; + }; + convert_u: { + i32(value: ExpressionRef): ExpressionRef; + i64(value: ExpressionRef): ExpressionRef; + }; + demote(value: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + copysign(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + pop(): ExpressionRef; + }; + f64: { + load(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + const(value: number): ExpressionRef; + const_bits(low: number, high: number): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + abs(value: ExpressionRef): ExpressionRef; + ceil(value: ExpressionRef): ExpressionRef; + floor(value: ExpressionRef): ExpressionRef; + trunc(value: ExpressionRef): ExpressionRef; + nearest(value: ExpressionRef): ExpressionRef; + sqrt(value: ExpressionRef): ExpressionRef; + reinterpret(value: ExpressionRef): ExpressionRef; + convert_s: { + i32(value: ExpressionRef): ExpressionRef; + i64(value: ExpressionRef): ExpressionRef; + }; + convert_u: { + i32(value: ExpressionRef): ExpressionRef; + i64(value: ExpressionRef): ExpressionRef; + }; + promote(value: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + copysign(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + pop(): ExpressionRef; + }; + v128: { + load(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef; + const(value: number): ExpressionRef; + not(value: ExpressionRef): ExpressionRef; + and(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + or(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + andnot(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + bitselect(left: ExpressionRef, right: ExpressionRef, cond: ExpressionRef): ExpressionRef; + pop(): ExpressionRef; + }; + i8x16: { + splat(value: ExpressionRef): ExpressionRef; + extract_lane_s(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + extract_lane_u(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + any_true(value: ExpressionRef): ExpressionRef; + all_true(value: ExpressionRef): ExpressionRef; + shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + add_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + add_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + avgr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + narrow_i16x8_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + narrow_i16x8_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + }; + i16x8: { + splat(value: ExpressionRef): ExpressionRef; + extract_lane_s(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + extract_lane_u(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + any_true(value: ExpressionRef): ExpressionRef; + all_true(value: ExpressionRef): ExpressionRef; + shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + add_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + add_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + avgr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + narrow_i32x4_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + narrow_i32x4_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + widen_low_i8x16_s(value: ExpressionRef): ExpressionRef; + widen_high_i8x16_s(value: ExpressionRef): ExpressionRef; + widen_low_i8x16_u(value: ExpressionRef): ExpressionRef; + widen_high_i8x16_u(value: ExpressionRef): ExpressionRef; + load8x8_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load8x8_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + }; + i32x4: { + splat(value: ExpressionRef): ExpressionRef; + extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + any_true(value: ExpressionRef): ExpressionRef; + all_true(value: ExpressionRef): ExpressionRef; + shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + trunc_sat_f32x4_s(value: ExpressionRef): ExpressionRef; + trunc_sat_f32x4_u(value: ExpressionRef): ExpressionRef; + widen_low_i16x8_s(value: ExpressionRef): ExpressionRef; + widen_high_i16x8_s(value: ExpressionRef): ExpressionRef; + widen_low_i16x8_u(value: ExpressionRef): ExpressionRef; + widen_high_i16x8_u(value: ExpressionRef): ExpressionRef; + load16x4_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load16x4_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + }; + i64x2: { + splat(value: ExpressionRef): ExpressionRef; + extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + any_true(value: ExpressionRef): ExpressionRef; + all_true(value: ExpressionRef): ExpressionRef; + shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + trunc_sat_f64x2_s(value: ExpressionRef): ExpressionRef; + trunc_sat_f64x2_u(value: ExpressionRef): ExpressionRef; + load32x2_s(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + load32x2_u(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + }; + f32x4: { + splat(value: ExpressionRef): ExpressionRef; + extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + abs(value: ExpressionRef): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + sqrt(value: ExpressionRef): ExpressionRef; + qfma(a: ExpressionRef, b: ExpressionRef, c: ExpressionRef): ExpressionRef; + qfms(a: ExpressionRef, b: ExpressionRef, c: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + convert_i32x4_s(value: ExpressionRef): ExpressionRef; + convert_i32x4_u(value: ExpressionRef): ExpressionRef; + }; + f64x2: { + splat(value: ExpressionRef): ExpressionRef; + extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef; + replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef; + eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + le(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + abs(value: ExpressionRef): ExpressionRef; + neg(value: ExpressionRef): ExpressionRef; + sqrt(value: ExpressionRef): ExpressionRef; + qfma(a: ExpressionRef, b: ExpressionRef, c: ExpressionRef): ExpressionRef; + qfms(a: ExpressionRef, b: ExpressionRef, c: ExpressionRef): ExpressionRef; + add(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + div(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + min(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + max(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + convert_i64x2_s(value: ExpressionRef): ExpressionRef; + convert_i64x2_u(value: ExpressionRef): ExpressionRef; + }; + v8x16: { + shuffle(left: ExpressionRef, right: ExpressionRef, mask: number[]): ExpressionRef; + swizzle(left: ExpressionRef, right: ExpressionRef): ExpressionRef; + load_splat(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + }; + v16x8: { + load_splat(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + }; + v32x4: { + load_splat(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + }; + v64x2: { + load_splat(offset: number, align: number, ptr: ExpressionRef): ExpressionRef; + }; + funcref: { + pop(): ExpressionRef; + }; + anyref: { + pop(): ExpressionRef; + }; + nullref: { + pop(): ExpressionRef; + }; + exnref: { + pop(): ExpressionRef; + }; + ref: { + null(): ExpressionRef; + is_null(value: ExpressionRef): ExpressionRef; + func(name: string): ExpressionRef; + }; + atomic: { + notify(ptr: ExpressionRef, notifyCount: ExpressionRef): ExpressionRef; + fence(): ExpressionRef; + }; + tuple: { + make(elements: ExportRef[]): ExpressionRef; + extract(tuple: ExpressionRef, index: number): ExpressionRef; + }; + try(body: ExpressionRef, catchBody: ExpressionRef): ExpressionRef; + throw(event: string, operands: ExpressionRef[]): ExpressionRef; + rethrow(exnref: ExpressionRef): ExpressionRef; + br_on_exn(label: string, event: string, exnref: ExpressionRef): ExpressionRef; + push(value: ExpressionRef): ExpressionRef; + select(condition: ExpressionRef, ifTrue: ExpressionRef, ifFalse: ExpressionRef, type?: Type): ExpressionRef; + drop(value: ExpressionRef): ExpressionRef; + return(value?: ExpressionRef): ExpressionRef; + host(op: Operations, name: string, operands: ExpressionRef[]): ExpressionRef; + nop(): ExpressionRef; + unreachable(): ExpressionRef; + addFunction(name: string, params: Type, results: Type, vars: Type[], body: ExpressionRef): FunctionRef; + getFunction(name: string): FunctionRef; + removeFunction(name: string): void; + getNumFunctions(): number; + getFunctionByIndex(index: number): FunctionRef; + addGlobal(name: string, type: Type, mutable: boolean, init: ExpressionRef): GlobalRef; + getGlobal(name: string): GlobalRef; + removeGlobal(name: string): void; + addEvent(name: string, attribute: number, params: Type, results: Type): EventRef; + getEvent(name: string): EventRef; + removeEvent(name: string): void; + addFunctionImport(internalName: string, externalModuleName: string, externalBaseName: string, params: Type, results: Type): void; + addTableImport(internalName: string, externalModuleName: string, externalBaseName: string): void; + addMemoryImport(internalName: string, externalModuleName: string, externalBaseName: string): void; + addGlobalImport(internalName: string, externalModuleName: string, externalBaseName: string, globalType: Type): void; + addEventImport(internalName: string, externalModuleName: string, externalBaseName: string, attribute: number, params: Type, results: Type): void; + addFunctionExport(internalName: string, externalName: string): ExportRef; + addTableExport(internalName: string, externalName: string): ExportRef; + addMemoryExport(internalName: string, externalName: string): ExportRef; + addGlobalExport(internalName: string, externalName: string): ExportRef; + removeExport(externalName: string): void; + getNumExports(): number; + getExportByIndex(index: number): ExportRef; + setFunctionTable(initial: number, maximum: number, funcNames: number[], offset?: ExpressionRef): void; + getFunctionTable(): { imported: boolean, segments: TableElement[] }; + setMemory(initial: number, maximum: number, exportName?: string | null, segments?: MemorySegment[] | null, flags?: number[] | null, shared?: boolean): void; + getNumMemorySegments(): number; + getMemorySegmentInfoByIndex(index: number): MemorySegmentInfo; + setStart(start: FunctionRef): void; + getFeatures(): Features; + setFeatures(features: Features): void; + addCustomSection(name: string, contents: Uint8Array): void; + emitText(): string; + emitStackIR(optimize?: boolean): string; + emitAsmjs(): string; + validate(): number; + optimize(): void; + optimizeFunction(func: string | FunctionRef): void; + runPasses(passes: string[]): void; + runPassesOnFunction(func: string | FunctionRef, passes: string[]): void; + autoDrop(): void; + dispose(): void; + emitBinary(): Uint8Array; + emitBinary(sourceMapUrl: string | null): { binary: Uint8Array; sourceMap: string | null; }; + interpret(): void; + addDebugInfoFileName(filename: string): number; + getDebugInfoFileName(index: number): string | null; + setDebugLocation(func: FunctionRef, expr: ExpressionRef, fileIndex: number, lineNumber: number, columnNumber: number): void; + copyExpression(expr: ExpressionRef): ExpressionRef; + } + + interface MemorySegment { + offset: ExpressionRef; + data: Uint8Array; + passive?: boolean; + } + + interface TableElement { + offset: ExpressionRef; + names: string[]; + } + + function wrapModule(ptr: number): Module; + + function getExpressionId(expression: ExpressionRef): number; + function getExpressionType(expression: ExpressionRef): Type; + function getExpressionInfo(expression: ExpressionRef): ExpressionInfo; + + interface MemorySegmentInfo { + offset: ExpressionRef; + data: Uint8Array; + passive: boolean; + } + + interface ExpressionInfo { + id: ExpressionIds; + type: Type; + } + + interface BlockInfo extends ExpressionInfo { + name: string; + children: ExpressionRef[]; + } + + interface IfInfo extends ExpressionInfo { + condition: ExpressionRef; + ifTrue: ExpressionRef; + ifFalse: ExpressionRef; + } + + interface LoopInfo extends ExpressionInfo { + name: string; + body: ExpressionRef; + } + + interface BreakInfo extends ExpressionInfo { + name: string; + condition: ExpressionRef; + value: ExpressionRef; + } + + interface SwitchInfo extends ExpressionInfo { + names: string[]; + defaultName: string | null; + condition: ExpressionRef; + value: ExpressionRef; + } + + interface CallInfo extends ExpressionInfo { + isReturn: boolean; + target: string; + operands: ExpressionRef[]; + } + + interface CallIndirectInfo extends ExpressionInfo { + isReturn: boolean; + target: ExpressionRef; + operands: ExpressionRef[]; + } + + interface LocalGetInfo extends ExpressionInfo { + index: number; + } + + interface LocalSetInfo extends ExpressionInfo { + isTee: boolean; + index: number; + value: ExpressionRef; + } + + interface GlobalGetInfo extends ExpressionInfo { + name: string; + } + + interface GlobalSetInfo extends ExpressionInfo { + name: string; + value: ExpressionRef; + } + + interface LoadInfo extends ExpressionInfo { + isAtomic: boolean; + isSigned: boolean; + offset: number; + bytes: number; + align: number; + ptr: ExpressionRef; + } + + interface StoreInfo extends ExpressionInfo { + isAtomic: boolean; + offset: number; + bytes: number; + align: number; + ptr: ExpressionRef; + value: ExpressionRef; + } + + interface ConstInfo extends ExpressionInfo { + value: number | { low: number, high: number }; + } + + interface UnaryInfo extends ExpressionInfo { + op: Operations; + value: ExpressionRef; + } + + interface BinaryInfo extends ExpressionInfo { + op: Operations; + left: ExpressionRef; + right: ExpressionRef; + } + + interface SelectInfo extends ExpressionInfo { + ifTrue: ExpressionRef; + ifFalse: ExpressionRef; + condition: ExpressionRef; + } + + interface DropInfo extends ExpressionInfo { + value: ExpressionRef; + } + + interface ReturnInfo extends ExpressionInfo { + value: ExpressionRef; + } + + interface NopInfo extends ExpressionInfo { + } + + interface UnreachableInfo extends ExpressionInfo { + } + + interface HostInfo extends ExpressionInfo { + op: Operations; + nameOperand: string | null; + operands: ExpressionRef[]; + } + + interface AtomicRMWInfo extends ExpressionInfo { + op: Operations; + bytes: number; + offset: number; + ptr: ExpressionRef; + value: ExpressionRef; + } + + interface AtomicCmpxchgInfo extends ExpressionInfo { + bytes: number; + offset: number; + ptr: ExpressionRef; + expected: ExpressionRef; + replacement: ExpressionRef; + } + + interface AtomicWaitInfo extends ExpressionInfo { + ptr: ExpressionRef; + expected: ExpressionRef; + timeout: ExpressionRef; + expectedType: Type; + } + + interface AtomicNotifyInfo extends ExpressionInfo { + ptr: ExpressionRef; + notifyCount: ExpressionRef; + } + + interface AtomicFenceInfo extends ExpressionInfo { + order: number; + } + + interface SIMDExtractInfo extends ExpressionInfo { + op: Operations; + vec: ExpressionRef; + index: ExpressionRef; + } + + interface SIMDReplaceInfo extends ExpressionInfo { + op: Operations; + vec: ExpressionRef; + index: ExpressionRef; + value: ExpressionRef; + } + + interface SIMDShuffleInfo extends ExpressionInfo { + left: ExpressionRef; + right: ExpressionRef; + mask: number[]; + } + + interface SIMDTernaryInfo extends ExpressionInfo { + op: Operations; + a: ExpressionRef; + b: ExpressionRef; + c: ExpressionRef; + } + + interface SIMDShiftInfo extends ExpressionInfo { + op: Operations; + vec: ExpressionRef; + shift: ExpressionRef; + } + + interface SIMDLoadInfo extends ExpressionInfo { + op: Operations; + offset: number; + align: number; + ptr: ExpressionRef; + } + + interface MemoryInitInfo extends ExpressionInfo { + segment: number; + dest: ExpressionRef; + offset: ExpressionRef; + size: ExpressionRef; + } + + interface MemoryDropInfo extends ExpressionInfo { + segment: number; + } + + interface MemoryCopyInfo extends ExpressionInfo { + dest: ExpressionRef; + source: ExpressionRef; + size: ExpressionRef; + } + + interface MemoryFillInfo extends ExpressionInfo { + dest: ExpressionRef; + value: ExpressionRef; + size: ExpressionRef; + } + + interface RefNullInfo extends ExpressionInfo { + } + + interface RefIsNullInfo extends ExpressionInfo { + value: ExpressionRef; + } + + interface RefFuncInfo extends ExpressionInfo { + func: string; + } + + interface TryInfo extends ExpressionInfo { + body: ExpressionRef; + catchBody: ExpressionRef; + } + + interface ThrowInfo extends ExpressionInfo { + event: string; + operands: ExpressionRef[]; + } + + interface RethrowInfo extends ExpressionInfo { + exnref: ExpressionRef; + } + + interface BrOnExnInfo extends ExpressionInfo { + name: string; + event: string; + exnref: ExpressionRef; + } + + interface PopInfo extends ExpressionInfo { + } + + interface PushInfo extends ExpressionInfo { + type: never; // ? + value: ExpressionRef; + } + + function getFunctionInfo(func: FunctionRef): FunctionInfo; + + interface FunctionInfo { + name: string; + module: string | null; + base: string | null; + params: Type; + results: Type; + vars: Type[]; + body: ExpressionRef; + } + + function getGlobalInfo(global: GlobalRef): GlobalInfo; + + interface GlobalInfo { + name: string; + module: string | null; + base: string | null; + type: Type; + mutable: boolean; + init: ExpressionRef; + } + + function getExportInfo(export_: ExportRef): ExportInfo; + + interface ExportInfo { + kind: ExternalKinds; + name: string; + value: string; + } + + function getEventInfo(event: EventRef): EventInfo; + + interface EventInfo { + name: string; + module: string | null; + base: string | null; + attribute: number; + params: Type; + results: Type; + } + + function getSideEffects(expr: ExpressionRef, features: Features): SideEffects; + + const enum SideEffects { + None, + Branches, + Calls, + ReadsLocal, + WritesLocal, + ReadsGlobal, + WritesGlobal, + ReadsMemory, + WritesMemory, + ImplicitTrap, + IsAtomic, + Throws, + Any + } + + function emitText(expression: ExpressionRef | Module): string; + function readBinary(data: Uint8Array): Module; + function parseText(text: string): Module; + function getOptimizeLevel(): number; + function setOptimizeLevel(level: number): number; + function getShrinkLevel(): number; + function setShrinkLevel(level: number): number; + function getDebugInfo(): boolean; + function setDebugInfo(on: boolean): void; + function getLowMemoryUnused(): boolean; + function setLowMemoryUnused(on: boolean): void; + function getPassArgument(key: string): string | null; + function setPassArgument(key: string, value: string | null): void; + function clearPassArguments(): void; + function getAlwaysInlineMaxSize(): number; + function setAlwaysInlineMaxSize(size: number): void; + function getFlexibleInlineMaxSize(): number; + function setFlexibleInlineMaxSize(size: number): void; + function getOneCallerInlineMaxSize(): number; + function setOneCallerInlineMaxSize(size: number): void; + function exit(status: number): void; + + type RelooperBlockRef = number; + + class Relooper { + constructor(module: Module); + addBlock(expression: ExpressionRef): RelooperBlockRef; + addBranch(from: RelooperBlockRef, to: RelooperBlockRef, condition: ExpressionRef, code: ExpressionRef): void; + addBlockWithSwitch(code: ExpressionRef, condition: ExpressionRef): RelooperBlockRef; + addBranchForSwitch(from: RelooperBlockRef, to: RelooperBlockRef, indexes: number[], code: ExpressionRef): void; + renderAndDispose(entry: RelooperBlockRef, labelHelper: number): ExpressionRef; + } +} + +export = binaryen; diff --git a/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/Initial.kt b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/Initial.kt new file mode 100644 index 000000000..6a2151f85 --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/Initial.kt @@ -0,0 +1,5986 @@ +package kscience.kmath.ast + +internal const val INITIAL = """(module + (type $t0 (func)) + (type $t1 (func (param f64) (result f64))) + (type $t2 (func (param f64 f64) (result f64))) + (type $t3 (func (param i32 i32 i32 i32 i32) (result i32))) + (type $t4 (func (param f64 i32) (result i32))) + (type $t5 (func (param f64 f64 i32) (result f64))) + (type $t6 (func (param f64 i32) (result f64))) + (type $t7 (func (param i32 i32 i32) (result i32))) + (func $__wasm_call_ctors (type $t0)) + (func $acos (type $t1) (param $p0 f64) (result f64) + (local $l0 i64) (local $l1 i32) (local $l2 f64) (local $l3 f64) + block $B0 + block $B1 + block $B2 + get_local $p0 + i64.reinterpret/f64 + tee_local $l0 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l1 + i32.const 1072693248 + i32.lt_u + br_if $B2 + get_local $l1 + i32.const -1072693248 + i32.add + get_local $l0 + i32.wrap/i64 + i32.or + i32.eqz + br_if $B1 + f64.const 0x0p+0 (;=0;) + get_local $p0 + get_local $p0 + f64.sub + f64.div + return + end + block $B3 + block $B4 + get_local $l1 + i32.const 1071644671 + i32.gt_u + br_if $B4 + f64.const 0x1.921fb54442d18p+0 (;=1.5708;) + set_local $l2 + get_local $l1 + i32.const 1012924417 + i32.lt_u + br_if $B3 + f64.const 0x1.1a62633145c07p-54 (;=6.12323e-17;) + get_local $p0 + get_local $p0 + f64.mul + tee_local $l2 + get_local $l2 + get_local $l2 + get_local $l2 + get_local $l2 + get_local $l2 + f64.const 0x1.23de10dfdf709p-15 (;=3.47933e-05;) + f64.mul + f64.const 0x1.9efe07501b288p-11 (;=0.000791535;) + f64.add + f64.mul + f64.const -0x1.48228b5688f3bp-5 (;=-0.0400555;) + f64.add + f64.mul + f64.const 0x1.9c1550e884455p-3 (;=0.201213;) + f64.add + f64.mul + f64.const -0x1.4d61203eb6f7dp-2 (;=-0.325566;) + f64.add + f64.mul + f64.const 0x1.5555555555555p-3 (;=0.166667;) + f64.add + f64.mul + get_local $l2 + get_local $l2 + get_local $l2 + get_local $l2 + f64.const 0x1.3b8c5b12e9282p-4 (;=0.0770382;) + f64.mul + f64.const -0x1.6066c1b8d0159p-1 (;=-0.688284;) + f64.add + f64.mul + f64.const 0x1.02ae59c598ac8p+1 (;=2.02095;) + f64.add + f64.mul + f64.const -0x1.33a271c8a2d4bp+1 (;=-2.40339;) + f64.add + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + get_local $p0 + f64.mul + f64.sub + get_local $p0 + f64.sub + f64.const 0x1.921fb54442d18p+0 (;=1.5708;) + f64.add + return + end + get_local $l0 + i64.const -1 + i64.le_s + br_if $B0 + f64.const 0x1p+0 (;=1;) + get_local $p0 + f64.sub + f64.const 0x1p-1 (;=0.5;) + f64.mul + tee_local $p0 + get_local $p0 + f64.sqrt + tee_local $l3 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $l2 + get_local $l2 + f64.mul + f64.sub + get_local $l3 + get_local $l2 + f64.add + f64.div + get_local $l3 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.23de10dfdf709p-15 (;=3.47933e-05;) + f64.mul + f64.const 0x1.9efe07501b288p-11 (;=0.000791535;) + f64.add + f64.mul + f64.const -0x1.48228b5688f3bp-5 (;=-0.0400555;) + f64.add + f64.mul + f64.const 0x1.9c1550e884455p-3 (;=0.201213;) + f64.add + f64.mul + f64.const -0x1.4d61203eb6f7dp-2 (;=-0.325566;) + f64.add + f64.mul + f64.const 0x1.5555555555555p-3 (;=0.166667;) + f64.add + f64.mul + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.3b8c5b12e9282p-4 (;=0.0770382;) + f64.mul + f64.const -0x1.6066c1b8d0159p-1 (;=-0.688284;) + f64.add + f64.mul + f64.const 0x1.02ae59c598ac8p+1 (;=2.02095;) + f64.add + f64.mul + f64.const -0x1.33a271c8a2d4bp+1 (;=-2.40339;) + f64.add + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + f64.mul + f64.add + get_local $l2 + f64.add + tee_local $p0 + get_local $p0 + f64.add + set_local $l2 + end + get_local $l2 + return + end + f64.const 0x1.921fb54442d18p+1 (;=3.14159;) + f64.const 0x0p+0 (;=0;) + get_local $l0 + i64.const 0 + i64.lt_s + select + return + end + f64.const 0x1.921fb54442d18p+0 (;=1.5708;) + get_local $p0 + f64.const 0x1p+0 (;=1;) + f64.add + f64.const 0x1p-1 (;=0.5;) + f64.mul + tee_local $p0 + f64.sqrt + tee_local $l2 + get_local $l2 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.23de10dfdf709p-15 (;=3.47933e-05;) + f64.mul + f64.const 0x1.9efe07501b288p-11 (;=0.000791535;) + f64.add + f64.mul + f64.const -0x1.48228b5688f3bp-5 (;=-0.0400555;) + f64.add + f64.mul + f64.const 0x1.9c1550e884455p-3 (;=0.201213;) + f64.add + f64.mul + f64.const -0x1.4d61203eb6f7dp-2 (;=-0.325566;) + f64.add + f64.mul + f64.const 0x1.5555555555555p-3 (;=0.166667;) + f64.add + f64.mul + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.3b8c5b12e9282p-4 (;=0.0770382;) + f64.mul + f64.const -0x1.6066c1b8d0159p-1 (;=-0.688284;) + f64.add + f64.mul + f64.const 0x1.02ae59c598ac8p+1 (;=2.02095;) + f64.add + f64.mul + f64.const -0x1.33a271c8a2d4bp+1 (;=-2.40339;) + f64.add + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + f64.mul + f64.const -0x1.1a62633145c07p-54 (;=-6.12323e-17;) + f64.add + f64.add + f64.sub + tee_local $p0 + get_local $p0 + f64.add) + (func $acosh (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) + block $B0 + get_local $p0 + i64.reinterpret/f64 + i64.const 52 + i64.shr_u + i32.wrap/i64 + i32.const 2047 + i32.and + tee_local $l0 + i32.const 1023 + i32.gt_u + br_if $B0 + get_local $p0 + f64.const -0x1p+0 (;=-1;) + f64.add + tee_local $p0 + get_local $p0 + get_local $p0 + f64.mul + get_local $p0 + get_local $p0 + f64.add + f64.add + f64.sqrt + f64.add + call $log1p + return + end + block $B1 + get_local $l0 + i32.const 1048 + i32.gt_u + br_if $B1 + get_local $p0 + get_local $p0 + f64.add + f64.const -0x1p+0 (;=-1;) + get_local $p0 + get_local $p0 + f64.mul + f64.const -0x1p+0 (;=-1;) + f64.add + f64.sqrt + get_local $p0 + f64.add + f64.div + f64.add + call $log + return + end + get_local $p0 + call $log + f64.const 0x1.62e42fefa39efp-1 (;=0.693147;) + f64.add) + (func $asin (type $t1) (param $p0 f64) (result f64) + (local $l0 i64) (local $l1 i32) (local $l2 f64) (local $l3 f64) (local $l4 f64) + block $B0 + block $B1 + block $B2 + block $B3 + block $B4 + get_local $p0 + i64.reinterpret/f64 + tee_local $l0 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l1 + i32.const 1072693248 + i32.lt_u + br_if $B4 + get_local $l1 + i32.const -1072693248 + i32.add + get_local $l0 + i32.wrap/i64 + i32.or + i32.eqz + br_if $B3 + f64.const 0x0p+0 (;=0;) + get_local $p0 + get_local $p0 + f64.sub + f64.div + return + end + block $B5 + get_local $l1 + i32.const 1071644671 + i32.gt_u + br_if $B5 + get_local $l1 + i32.const -1048576 + i32.add + i32.const 1044381696 + i32.ge_u + br_if $B2 + get_local $p0 + return + end + f64.const 0x1p+0 (;=1;) + get_local $p0 + f64.abs + f64.sub + f64.const 0x1p-1 (;=0.5;) + f64.mul + tee_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.23de10dfdf709p-15 (;=3.47933e-05;) + f64.mul + f64.const 0x1.9efe07501b288p-11 (;=0.000791535;) + f64.add + f64.mul + f64.const -0x1.48228b5688f3bp-5 (;=-0.0400555;) + f64.add + f64.mul + f64.const 0x1.9c1550e884455p-3 (;=0.201213;) + f64.add + f64.mul + f64.const -0x1.4d61203eb6f7dp-2 (;=-0.325566;) + f64.add + f64.mul + f64.const 0x1.5555555555555p-3 (;=0.166667;) + f64.add + f64.mul + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.3b8c5b12e9282p-4 (;=0.0770382;) + f64.mul + f64.const -0x1.6066c1b8d0159p-1 (;=-0.688284;) + f64.add + f64.mul + f64.const 0x1.02ae59c598ac8p+1 (;=2.02095;) + f64.add + f64.mul + f64.const -0x1.33a271c8a2d4bp+1 (;=-2.40339;) + f64.add + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + set_local $l2 + get_local $p0 + f64.sqrt + set_local $l3 + get_local $l1 + i32.const 1072640819 + i32.lt_u + br_if $B1 + f64.const 0x1.921fb54442d18p+0 (;=1.5708;) + get_local $l3 + get_local $l3 + get_local $l2 + f64.mul + f64.add + tee_local $p0 + get_local $p0 + f64.add + f64.const -0x1.1a62633145c07p-54 (;=-6.12323e-17;) + f64.add + f64.sub + set_local $p0 + br $B0 + end + get_local $p0 + f64.const 0x1.921fb54442d18p+0 (;=1.5708;) + f64.mul + f64.const 0x1p-120 (;=7.52316e-37;) + f64.add + return + end + get_local $p0 + get_local $p0 + f64.mul + tee_local $l3 + get_local $l3 + get_local $l3 + get_local $l3 + get_local $l3 + get_local $l3 + f64.const 0x1.23de10dfdf709p-15 (;=3.47933e-05;) + f64.mul + f64.const 0x1.9efe07501b288p-11 (;=0.000791535;) + f64.add + f64.mul + f64.const -0x1.48228b5688f3bp-5 (;=-0.0400555;) + f64.add + f64.mul + f64.const 0x1.9c1550e884455p-3 (;=0.201213;) + f64.add + f64.mul + f64.const -0x1.4d61203eb6f7dp-2 (;=-0.325566;) + f64.add + f64.mul + f64.const 0x1.5555555555555p-3 (;=0.166667;) + f64.add + f64.mul + get_local $l3 + get_local $l3 + get_local $l3 + get_local $l3 + f64.const 0x1.3b8c5b12e9282p-4 (;=0.0770382;) + f64.mul + f64.const -0x1.6066c1b8d0159p-1 (;=-0.688284;) + f64.add + f64.mul + f64.const 0x1.02ae59c598ac8p+1 (;=2.02095;) + f64.add + f64.mul + f64.const -0x1.33a271c8a2d4bp+1 (;=-2.40339;) + f64.add + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + get_local $p0 + f64.mul + get_local $p0 + f64.add + return + end + f64.const 0x1.921fb54442d18p-1 (;=0.785398;) + get_local $l3 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $l4 + get_local $l4 + f64.add + f64.sub + get_local $l3 + get_local $l3 + f64.add + get_local $l2 + f64.mul + f64.const 0x1.1a62633145c07p-54 (;=6.12323e-17;) + get_local $p0 + get_local $l4 + get_local $l4 + f64.mul + f64.sub + get_local $l3 + get_local $l4 + f64.add + f64.div + tee_local $p0 + get_local $p0 + f64.add + f64.sub + f64.sub + f64.sub + f64.const 0x1.921fb54442d18p-1 (;=0.785398;) + f64.add + set_local $p0 + end + get_local $p0 + f64.neg + get_local $p0 + get_local $l0 + i64.const 0 + i64.lt_s + select) + (func $asinh (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i32) (local $l3 f64) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 9223372036854775807 + i64.and + f64.reinterpret/i64 + set_local $p0 + block $B0 + block $B1 + get_local $l1 + i64.const 52 + i64.shr_u + i32.wrap/i64 + i32.const 2047 + i32.and + tee_local $l2 + i32.const 1049 + i32.lt_u + br_if $B1 + get_local $p0 + call $log + f64.const 0x1.62e42fefa39efp-1 (;=0.693147;) + f64.add + set_local $p0 + br $B0 + end + block $B2 + get_local $l2 + i32.const 1024 + i32.lt_u + br_if $B2 + get_local $p0 + get_local $p0 + f64.add + f64.const 0x1p+0 (;=1;) + get_local $p0 + get_local $p0 + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + f64.sqrt + get_local $p0 + f64.add + f64.div + f64.add + call $log + set_local $p0 + br $B0 + end + block $B3 + get_local $l2 + i32.const 997 + i32.lt_u + br_if $B3 + get_local $p0 + get_local $p0 + f64.mul + tee_local $l3 + get_local $l3 + f64.const 0x1p+0 (;=1;) + f64.add + f64.sqrt + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + get_local $p0 + f64.add + call $log1p + set_local $p0 + br $B0 + end + get_local $l0 + get_local $p0 + f64.const 0x1p+120 (;=1.32923e+36;) + f64.add + f64.store offset=8 + end + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.neg + get_local $p0 + get_local $l1 + i64.const 0 + i64.lt_s + select) + (func $atan (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 f64) (local $l6 f64) + get_global $g0 + i32.const 16 + i32.sub + set_local $l0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 63 + i64.shr_u + i32.wrap/i64 + set_local $l2 + block $B0 + block $B1 + block $B2 + get_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l3 + i32.const 1141899264 + i32.lt_u + br_if $B2 + get_local $l1 + i64.const 9223372036854775807 + i64.and + i64.const 9218868437227405312 + i64.gt_u + br_if $B1 + f64.const -0x1.921fb54442d18p+0 (;=-1.5708;) + f64.const 0x1.921fb54442d18p+0 (;=1.5708;) + get_local $l2 + select + return + end + block $B3 + block $B4 + get_local $l3 + i32.const 1071382527 + i32.gt_u + br_if $B4 + i32.const -1 + set_local $l4 + get_local $l3 + i32.const 1044381695 + i32.gt_u + br_if $B3 + get_local $l3 + i32.const 1048575 + i32.gt_u + br_if $B1 + get_local $l0 + get_local $p0 + f32.demote/f64 + f32.store offset=12 + get_local $p0 + return + end + get_local $p0 + f64.abs + set_local $p0 + block $B5 + block $B6 + block $B7 + get_local $l3 + i32.const 1072889855 + i32.gt_u + br_if $B7 + get_local $l3 + i32.const 1072037887 + i32.gt_u + br_if $B6 + get_local $p0 + get_local $p0 + f64.add + f64.const -0x1p+0 (;=-1;) + f64.add + get_local $p0 + f64.const 0x1p+1 (;=2;) + f64.add + f64.div + set_local $p0 + i32.const 0 + set_local $l4 + br $B3 + end + get_local $l3 + i32.const 1073971199 + i32.gt_u + br_if $B5 + get_local $p0 + f64.const -0x1.8p+0 (;=-1.5;) + f64.add + get_local $p0 + f64.const 0x1.8p+0 (;=1.5;) + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + set_local $p0 + i32.const 2 + set_local $l4 + br $B3 + end + get_local $p0 + f64.const -0x1p+0 (;=-1;) + f64.add + get_local $p0 + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + set_local $p0 + i32.const 1 + set_local $l4 + br $B3 + end + f64.const -0x1p+0 (;=-1;) + get_local $p0 + f64.div + set_local $p0 + i32.const 3 + set_local $l4 + end + get_local $p0 + get_local $p0 + get_local $p0 + f64.mul + tee_local $l5 + get_local $l5 + f64.mul + tee_local $l6 + get_local $l6 + get_local $l6 + get_local $l6 + get_local $l6 + f64.const -0x1.2b4442c6a6c2fp-5 (;=-0.0365316;) + f64.mul + f64.const -0x1.dde2d52defd9ap-5 (;=-0.0583357;) + f64.add + f64.mul + f64.const -0x1.3b0f2af749a6dp-4 (;=-0.0769188;) + f64.add + f64.mul + f64.const -0x1.c71c6fe231671p-4 (;=-0.111111;) + f64.add + f64.mul + f64.const -0x1.999999998ebc4p-3 (;=-0.2;) + f64.add + f64.mul + get_local $l5 + get_local $l6 + get_local $l6 + get_local $l6 + get_local $l6 + get_local $l6 + f64.const 0x1.0ad3ae322da11p-6 (;=0.0162858;) + f64.mul + f64.const 0x1.97b4b24760debp-5 (;=0.0497688;) + f64.add + f64.mul + f64.const 0x1.10d66a0d03d51p-4 (;=0.0666107;) + f64.add + f64.mul + f64.const 0x1.745cdc54c206ep-4 (;=0.0909089;) + f64.add + f64.mul + f64.const 0x1.24924920083ffp-3 (;=0.142857;) + f64.add + f64.mul + f64.const 0x1.555555555550dp-2 (;=0.333333;) + f64.add + f64.mul + f64.add + f64.mul + set_local $l6 + get_local $l4 + i32.const -1 + i32.le_s + br_if $B0 + get_local $l4 + i32.const 3 + i32.shl + tee_local $l3 + i32.const 1024 + i32.add + f64.load + get_local $l6 + get_local $l3 + i32.const 1056 + i32.add + f64.load + f64.sub + get_local $p0 + f64.sub + f64.sub + tee_local $p0 + f64.neg + get_local $p0 + get_local $l2 + select + set_local $p0 + end + get_local $p0 + return + end + get_local $p0 + get_local $l6 + f64.sub) + (func $atanh (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i32) (local $l3 f64) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 9223372036854775807 + i64.and + f64.reinterpret/i64 + set_local $p0 + block $B0 + block $B1 + block $B2 + get_local $l1 + i64.const 52 + i64.shr_u + i32.wrap/i64 + i32.const 2047 + i32.and + tee_local $l2 + i32.const 1021 + i32.gt_u + br_if $B2 + get_local $l2 + i32.const 990 + i32.gt_u + br_if $B1 + get_local $l2 + br_if $B0 + get_local $l0 + get_local $p0 + f32.demote/f64 + f32.store offset=12 + br $B0 + end + get_local $p0 + f64.const 0x1p+0 (;=1;) + get_local $p0 + f64.sub + f64.div + tee_local $p0 + get_local $p0 + f64.add + call $log1p + f64.const 0x1p-1 (;=0.5;) + f64.mul + set_local $p0 + br $B0 + end + get_local $p0 + get_local $p0 + f64.add + tee_local $l3 + get_local $l3 + get_local $p0 + f64.mul + f64.const 0x1p+0 (;=1;) + get_local $p0 + f64.sub + f64.div + f64.add + call $log1p + f64.const 0x1p-1 (;=0.5;) + f64.mul + set_local $p0 + end + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.neg + get_local $p0 + get_local $l1 + i64.const 0 + i64.lt_s + select) + (func $__cos (type $t2) (param $p0 f64) (param $p1 f64) (result f64) + (local $l0 f64) (local $l1 f64) (local $l2 f64) + f64.const 0x1p+0 (;=1;) + get_local $p0 + get_local $p0 + f64.mul + tee_local $l0 + f64.const 0x1p-1 (;=0.5;) + f64.mul + tee_local $l1 + f64.sub + tee_local $l2 + f64.const 0x1p+0 (;=1;) + get_local $l2 + f64.sub + get_local $l1 + f64.sub + get_local $l0 + get_local $l0 + get_local $l0 + get_local $l0 + f64.const 0x1.a01a019cb159p-16 (;=2.48016e-05;) + f64.mul + f64.const -0x1.6c16c16c15177p-10 (;=-0.00138889;) + f64.add + f64.mul + f64.const 0x1.555555555554cp-5 (;=0.0416667;) + f64.add + f64.mul + get_local $l0 + get_local $l0 + f64.mul + tee_local $l1 + get_local $l1 + f64.mul + get_local $l0 + get_local $l0 + f64.const -0x1.8fae9be8838d4p-37 (;=-1.13596e-11;) + f64.mul + f64.const 0x1.1ee9ebdb4b1c4p-29 (;=2.08757e-09;) + f64.add + f64.mul + f64.const -0x1.27e4f809c52adp-22 (;=-2.75573e-07;) + f64.add + f64.mul + f64.add + f64.mul + get_local $p0 + get_local $p1 + f64.mul + f64.sub + f64.add + f64.add) + (func $__rem_pio2_large (type $t3) (param $p0 i32) (param $p1 i32) (param $p2 i32) (param $p3 i32) (param $p4 i32) (result i32) + (local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 i32) (local $l6 i32) (local $l7 f64) (local $l8 i32) (local $l9 i32) (local $l10 i32) (local $l11 i32) (local $l12 i32) (local $l13 i32) (local $l14 i32) (local $l15 i32) (local $l16 i32) (local $l17 i32) (local $l18 f64) (local $l19 i32) (local $l20 i32) (local $l21 i32) (local $l22 f64) (local $l23 f64) + get_global $g0 + i32.const 560 + i32.sub + tee_local $l0 + set_global $g0 + get_local $p2 + get_local $p2 + i32.const -3 + i32.add + i32.const 24 + i32.div_s + tee_local $l1 + i32.const 0 + get_local $l1 + i32.const 0 + i32.gt_s + select + tee_local $l2 + i32.const -24 + i32.mul + i32.add + set_local $l3 + block $B0 + get_local $p4 + i32.const 2 + i32.shl + i32.const 1088 + i32.add + i32.load + tee_local $l4 + get_local $p3 + i32.const -1 + i32.add + tee_local $p2 + i32.add + i32.const 0 + i32.lt_s + br_if $B0 + get_local $l4 + get_local $p3 + i32.add + set_local $l5 + get_local $l2 + get_local $p2 + i32.sub + set_local $p2 + get_local $l2 + i32.const 1 + i32.add + get_local $p3 + i32.sub + i32.const 2 + i32.shl + i32.const 1104 + i32.add + set_local $l6 + get_local $l0 + i32.const 320 + i32.add + set_local $l1 + loop $L1 + block $B2 + block $B3 + get_local $p2 + i32.const 0 + i32.lt_s + br_if $B3 + get_local $l6 + i32.load + f64.convert_s/i32 + set_local $l7 + br $B2 + end + f64.const 0x0p+0 (;=0;) + set_local $l7 + end + get_local $l1 + get_local $l7 + f64.store + get_local $l1 + i32.const 8 + i32.add + set_local $l1 + get_local $l6 + i32.const 4 + i32.add + set_local $l6 + get_local $p2 + i32.const 1 + i32.add + set_local $p2 + get_local $l5 + i32.const -1 + i32.add + tee_local $l5 + br_if $L1 + end + end + get_local $l3 + i32.const -24 + i32.add + set_local $l8 + block $B4 + block $B5 + get_local $p3 + i32.const 1 + i32.lt_s + br_if $B5 + get_local $l0 + i32.const 320 + i32.add + get_local $p3 + i32.const 3 + i32.shl + i32.add + i32.const -8 + i32.add + set_local $l9 + i32.const 0 + set_local $l5 + loop $L6 + f64.const 0x0p+0 (;=0;) + set_local $l7 + get_local $p0 + set_local $p2 + get_local $p3 + set_local $l6 + get_local $l9 + set_local $l1 + loop $L7 + get_local $l7 + get_local $p2 + f64.load + get_local $l1 + f64.load + f64.mul + f64.add + set_local $l7 + get_local $p2 + i32.const 8 + i32.add + set_local $p2 + get_local $l1 + i32.const -8 + i32.add + set_local $l1 + get_local $l6 + i32.const -1 + i32.add + tee_local $l6 + br_if $L7 + end + get_local $l0 + get_local $l5 + i32.const 3 + i32.shl + i32.add + get_local $l7 + f64.store + get_local $l9 + i32.const 8 + i32.add + set_local $l9 + get_local $l5 + get_local $l4 + i32.lt_s + set_local $p2 + get_local $l5 + i32.const 1 + i32.add + set_local $l5 + get_local $p2 + br_if $L6 + br $B4 + end + end + get_local $l0 + i32.const 0 + get_local $l4 + i32.const 0 + get_local $l4 + i32.const 0 + i32.gt_s + select + i32.const 3 + i32.shl + i32.const 8 + i32.add + call $memset + drop + end + i32.const 23 + get_local $l8 + i32.sub + set_local $l10 + i32.const 24 + get_local $l8 + i32.sub + set_local $l11 + get_local $l0 + i32.const 480 + i32.add + get_local $l4 + i32.const 2 + i32.shl + i32.add + i32.const -4 + i32.add + set_local $l12 + get_local $l0 + i32.const 480 + i32.add + i32.const -4 + i32.add + set_local $l13 + get_local $l0 + i32.const -8 + i32.add + set_local $l14 + get_local $l0 + i32.const 8 + i32.or + set_local $l15 + get_local $l4 + set_local $l1 + loop $L8 (result i32) + get_local $l0 + get_local $l1 + i32.const 3 + i32.shl + tee_local $l16 + i32.add + f64.load + set_local $l7 + block $B9 + get_local $l1 + i32.const 1 + i32.lt_s + tee_local $l17 + br_if $B9 + get_local $l14 + get_local $l16 + i32.add + set_local $p2 + get_local $l0 + i32.const 480 + i32.add + set_local $l6 + get_local $l1 + set_local $l5 + loop $L10 + block $B11 + block $B12 + get_local $l7 + f64.const 0x1p-24 (;=5.96046e-08;) + f64.mul + tee_local $l18 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B12 + i32.const -2147483648 + set_local $l9 + br $B11 + end + get_local $l18 + i32.trunc_s/f64 + set_local $l9 + end + block $B13 + block $B14 + get_local $l7 + get_local $l9 + f64.convert_s/i32 + tee_local $l18 + f64.const -0x1p+24 (;=-1.67772e+07;) + f64.mul + f64.add + tee_local $l7 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B14 + i32.const -2147483648 + set_local $l9 + br $B13 + end + get_local $l7 + i32.trunc_s/f64 + set_local $l9 + end + get_local $l6 + get_local $l9 + i32.store + get_local $l6 + i32.const 4 + i32.add + set_local $l6 + get_local $p2 + f64.load + get_local $l18 + f64.add + set_local $l7 + get_local $p2 + i32.const -8 + i32.add + set_local $p2 + get_local $l5 + i32.const -1 + i32.add + tee_local $l5 + br_if $L10 + end + end + block $B15 + block $B16 + block $B17 + block $B18 + block $B19 + block $B20 + block $B21 + block $B22 + block $B23 + block $B24 + block $B25 + block $B26 + block $B27 + block $B28 + block $B29 + block $B30 + get_local $l7 + get_local $l8 + call $scalbn + tee_local $l7 + get_local $l7 + f64.const 0x1p-3 (;=0.125;) + f64.mul + f64.floor + f64.const -0x1p+3 (;=-8;) + f64.mul + f64.add + tee_local $l7 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B30 + i32.const -2147483648 + set_local $l19 + get_local $l7 + i32.const -2147483648 + f64.convert_s/i32 + f64.sub + set_local $l7 + get_local $l8 + i32.const 1 + i32.lt_s + tee_local $l20 + i32.eqz + br_if $B29 + br $B28 + end + get_local $l7 + get_local $l7 + i32.trunc_s/f64 + tee_local $l19 + f64.convert_s/i32 + f64.sub + set_local $l7 + get_local $l8 + i32.const 1 + i32.lt_s + tee_local $l20 + br_if $B28 + end + get_local $l0 + i32.const 480 + i32.add + get_local $l1 + i32.const 2 + i32.shl + i32.add + i32.const -4 + i32.add + tee_local $p2 + get_local $p2 + i32.load + tee_local $p2 + get_local $p2 + get_local $l11 + i32.shr_s + tee_local $p2 + get_local $l11 + i32.shl + i32.sub + tee_local $l6 + i32.store + get_local $p2 + get_local $l19 + i32.add + set_local $l19 + get_local $l6 + get_local $l10 + i32.shr_s + tee_local $l21 + i32.const 1 + i32.lt_s + br_if $B26 + br $B27 + end + block $B31 + get_local $l8 + i32.eqz + br_if $B31 + i32.const 2 + set_local $l21 + get_local $l7 + f64.const 0x1p-1 (;=0.5;) + f64.ge + i32.const 1 + i32.xor + i32.eqz + br_if $B27 + i32.const 0 + set_local $l21 + get_local $l7 + f64.const 0x0p+0 (;=0;) + f64.eq + br_if $B25 + br $B24 + end + get_local $l0 + i32.const 480 + i32.add + get_local $l1 + i32.const 2 + i32.shl + i32.add + i32.const -4 + i32.add + i32.load + i32.const 23 + i32.shr_s + tee_local $l21 + i32.const 1 + i32.lt_s + br_if $B26 + end + block $B32 + block $B33 + get_local $l17 + br_if $B33 + i32.const 0 + set_local $l17 + get_local $l0 + i32.const 480 + i32.add + set_local $p2 + get_local $l1 + set_local $l9 + loop $L34 + get_local $p2 + i32.load + set_local $l6 + i32.const 16777215 + set_local $l5 + block $B35 + block $B36 + get_local $l17 + br_if $B36 + get_local $l6 + i32.eqz + br_if $B35 + i32.const 1 + set_local $l17 + i32.const 16777216 + set_local $l5 + end + get_local $p2 + get_local $l5 + get_local $l6 + i32.sub + i32.store + get_local $p2 + i32.const 4 + i32.add + set_local $p2 + get_local $l9 + i32.const -1 + i32.add + tee_local $l9 + br_if $L34 + br $B32 + end + i32.const 0 + set_local $l17 + get_local $p2 + i32.const 4 + i32.add + set_local $p2 + get_local $l9 + i32.const -1 + i32.add + tee_local $l9 + br_if $L34 + br $B32 + end + end + i32.const 0 + set_local $l17 + end + block $B37 + block $B38 + block $B39 + get_local $l20 + br_if $B39 + get_local $l8 + i32.const 2 + i32.eq + br_if $B38 + get_local $l8 + i32.const 1 + i32.ne + br_if $B39 + get_local $l0 + i32.const 480 + i32.add + get_local $l1 + i32.const 2 + i32.shl + i32.add + i32.const -4 + i32.add + tee_local $p2 + get_local $p2 + i32.load + i32.const 8388607 + i32.and + i32.store + end + get_local $l19 + i32.const 1 + i32.add + set_local $l19 + get_local $l21 + i32.const 2 + i32.ne + br_if $B26 + br $B37 + end + get_local $l0 + i32.const 480 + i32.add + get_local $l1 + i32.const 2 + i32.shl + i32.add + i32.const -4 + i32.add + tee_local $p2 + get_local $p2 + i32.load + i32.const 4194303 + i32.and + i32.store + get_local $l19 + i32.const 1 + i32.add + set_local $l19 + get_local $l21 + i32.const 2 + i32.ne + br_if $B26 + end + f64.const 0x1p+0 (;=1;) + get_local $l7 + f64.sub + set_local $l7 + i32.const 2 + set_local $l21 + get_local $l17 + i32.eqz + br_if $B26 + get_local $l7 + f64.const 0x1p+0 (;=1;) + get_local $l8 + call $scalbn + f64.sub + tee_local $l7 + f64.const 0x0p+0 (;=0;) + f64.eq + br_if $B25 + br $B24 + end + get_local $l7 + f64.const 0x0p+0 (;=0;) + f64.ne + br_if $B24 + end + block $B40 + get_local $l1 + get_local $l4 + i32.le_s + br_if $B40 + get_local $l13 + get_local $l1 + i32.const 2 + i32.shl + i32.add + set_local $p2 + i32.const 0 + set_local $l6 + get_local $l1 + set_local $l5 + loop $L41 + get_local $p2 + i32.load + get_local $l6 + i32.or + set_local $l6 + get_local $p2 + i32.const -4 + i32.add + set_local $p2 + get_local $l5 + i32.const -1 + i32.add + tee_local $l5 + get_local $l4 + i32.gt_s + br_if $L41 + end + get_local $l6 + br_if $B23 + end + get_local $l12 + set_local $p2 + get_local $l1 + set_local $l9 + loop $L42 + get_local $l9 + i32.const 1 + i32.add + set_local $l9 + get_local $p2 + i32.load + set_local $l6 + get_local $p2 + i32.const -4 + i32.add + set_local $p2 + get_local $l6 + i32.eqz + br_if $L42 + end + get_local $l1 + i32.const 1 + i32.add + set_local $p2 + block $B43 + get_local $p3 + i32.const 1 + i32.lt_s + br_if $B43 + get_local $l0 + i32.const 320 + i32.add + get_local $p3 + get_local $l1 + i32.add + i32.const 3 + i32.shl + i32.add + set_local $l17 + loop $L44 + get_local $l0 + i32.const 320 + i32.add + get_local $l1 + get_local $p3 + i32.add + i32.const 3 + i32.shl + i32.add + get_local $p2 + tee_local $l5 + get_local $l2 + i32.add + i32.const 2 + i32.shl + i32.const 1104 + i32.add + i32.load + f64.convert_s/i32 + f64.store + f64.const 0x0p+0 (;=0;) + set_local $l7 + get_local $p0 + set_local $p2 + get_local $l17 + set_local $l1 + get_local $p3 + set_local $l6 + loop $L45 + get_local $l7 + get_local $p2 + f64.load + get_local $l1 + f64.load + f64.mul + f64.add + set_local $l7 + get_local $p2 + i32.const 8 + i32.add + set_local $p2 + get_local $l1 + i32.const -8 + i32.add + set_local $l1 + get_local $l6 + i32.const -1 + i32.add + tee_local $l6 + br_if $L45 + end + get_local $l0 + get_local $l5 + i32.const 3 + i32.shl + i32.add + get_local $l7 + f64.store + get_local $l17 + i32.const 8 + i32.add + set_local $l17 + get_local $l5 + i32.const 1 + i32.add + set_local $p2 + get_local $l5 + set_local $l1 + get_local $l5 + get_local $l9 + i32.lt_s + br_if $L44 + br $B15 + end + end + get_local $l15 + get_local $l16 + i32.add + i32.const 0 + get_local $l9 + get_local $p2 + get_local $l9 + get_local $p2 + i32.gt_s + select + get_local $l1 + i32.sub + i32.const 3 + i32.shl + call $memset + drop + get_local $l2 + get_local $l1 + i32.add + i32.const 2 + i32.shl + i32.const 1108 + i32.add + set_local $p2 + get_local $l0 + i32.const 320 + i32.add + get_local $p3 + get_local $l1 + i32.add + i32.const 3 + i32.shl + i32.add + set_local $l6 + loop $L46 + get_local $l6 + get_local $p2 + i32.load + f64.convert_s/i32 + f64.store + get_local $p2 + i32.const 4 + i32.add + set_local $p2 + get_local $l6 + i32.const 8 + i32.add + set_local $l6 + get_local $l1 + i32.const 1 + i32.add + tee_local $l1 + get_local $l9 + i32.lt_s + br_if $L46 + end + get_local $l9 + set_local $l1 + br $L8 + end + block $B47 + get_local $l7 + i32.const 0 + get_local $l8 + i32.sub + call $scalbn + tee_local $l7 + f64.const 0x1p+24 (;=1.67772e+07;) + f64.ge + i32.const 1 + i32.xor + i32.eqz + br_if $B47 + get_local $l7 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B22 + i32.const -2147483648 + set_local $p2 + br $B21 + end + get_local $l1 + i32.const 2 + i32.shl + set_local $l6 + get_local $l7 + f64.const 0x1p-24 (;=5.96046e-08;) + f64.mul + tee_local $l18 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B20 + i32.const -2147483648 + set_local $p2 + br $B19 + end + get_local $l0 + i32.const 480 + i32.add + get_local $l1 + i32.const 2 + i32.shl + i32.add + i32.const -4 + i32.add + set_local $p2 + get_local $l8 + set_local $l3 + loop $L48 + get_local $l1 + i32.const -1 + i32.add + set_local $l1 + get_local $l3 + i32.const -24 + i32.add + set_local $l3 + get_local $p2 + i32.load + set_local $l6 + get_local $p2 + i32.const -4 + i32.add + set_local $p2 + get_local $l6 + i32.eqz + br_if $L48 + end + i32.const 0 + set_local $l9 + get_local $l1 + i32.const 0 + i32.ge_s + br_if $B17 + br $B16 + end + get_local $l7 + i32.trunc_s/f64 + set_local $p2 + end + get_local $l8 + set_local $l3 + br $B18 + end + get_local $l18 + i32.trunc_s/f64 + set_local $p2 + end + get_local $l0 + i32.const 480 + i32.add + get_local $l6 + i32.add + set_local $l6 + block $B49 + block $B50 + get_local $l7 + get_local $p2 + f64.convert_s/i32 + f64.const -0x1p+24 (;=-1.67772e+07;) + f64.mul + f64.add + tee_local $l7 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B50 + i32.const -2147483648 + set_local $l5 + br $B49 + end + get_local $l7 + i32.trunc_s/f64 + set_local $l5 + end + get_local $l6 + get_local $l5 + i32.store + get_local $l1 + i32.const 1 + i32.add + set_local $l1 + end + get_local $l0 + i32.const 480 + i32.add + get_local $l1 + i32.const 2 + i32.shl + i32.add + get_local $p2 + i32.store + i32.const 0 + set_local $l9 + get_local $l1 + i32.const 0 + i32.lt_s + br_if $B16 + end + get_local $l1 + i32.const 1 + i32.add + set_local $l5 + f64.const 0x1p+0 (;=1;) + get_local $l3 + call $scalbn + set_local $l7 + get_local $l0 + i32.const 480 + i32.add + get_local $l1 + i32.const 2 + i32.shl + i32.add + set_local $p2 + get_local $l0 + get_local $l1 + i32.const 3 + i32.shl + i32.add + set_local $l6 + loop $L51 + get_local $l6 + get_local $l7 + get_local $p2 + i32.load + f64.convert_s/i32 + f64.mul + f64.store + get_local $p2 + i32.const -4 + i32.add + set_local $p2 + get_local $l6 + i32.const -8 + i32.add + set_local $l6 + get_local $l7 + f64.const 0x1p-24 (;=5.96046e-08;) + f64.mul + set_local $l7 + get_local $l5 + i32.const -1 + i32.add + tee_local $l5 + get_local $l9 + i32.gt_s + br_if $L51 + end + get_local $l1 + i32.const 0 + i32.lt_s + br_if $B16 + get_local $l0 + get_local $l1 + i32.const 3 + i32.shl + i32.add + set_local $l9 + get_local $l1 + set_local $p2 + loop $L52 + get_local $l1 + get_local $p2 + tee_local $p3 + i32.sub + set_local $l17 + f64.const 0x0p+0 (;=0;) + set_local $l7 + i32.const 0 + set_local $p2 + i32.const 0 + set_local $l6 + block $B53 + loop $L54 + get_local $l7 + get_local $p2 + i32.const 3872 + i32.add + f64.load + get_local $l9 + get_local $p2 + i32.add + f64.load + f64.mul + f64.add + set_local $l7 + get_local $l6 + get_local $l4 + i32.ge_s + br_if $B53 + get_local $p2 + i32.const 8 + i32.add + set_local $p2 + get_local $l6 + get_local $l17 + i32.lt_u + set_local $l5 + get_local $l6 + i32.const 1 + i32.add + set_local $l6 + get_local $l5 + br_if $L54 + end + end + get_local $l0 + i32.const 160 + i32.add + get_local $l17 + i32.const 3 + i32.shl + i32.add + get_local $l7 + f64.store + get_local $l9 + i32.const -8 + i32.add + set_local $l9 + get_local $p3 + i32.const -1 + i32.add + set_local $p2 + get_local $p3 + i32.const 0 + i32.gt_s + br_if $L52 + end + end + block $B55 + block $B56 + block $B57 + block $B58 + block $B59 + block $B60 + block $B61 + block $B62 + get_local $p4 + i32.const -1 + i32.add + i32.const 2 + i32.lt_u + br_if $B62 + get_local $p4 + i32.eqz + br_if $B61 + get_local $p4 + i32.const 3 + i32.ne + br_if $B55 + f64.const 0x0p+0 (;=0;) + set_local $l22 + block $B63 + get_local $l1 + i32.const 1 + i32.lt_s + br_if $B63 + get_local $l0 + i32.const 160 + i32.add + get_local $l1 + i32.const 3 + i32.shl + i32.add + tee_local $l6 + i32.const -8 + i32.add + set_local $p2 + get_local $l6 + f64.load + set_local $l7 + get_local $l1 + set_local $l6 + loop $L64 + get_local $p2 + get_local $p2 + f64.load + tee_local $l23 + get_local $l7 + f64.add + tee_local $l18 + f64.store + get_local $p2 + i32.const 8 + i32.add + get_local $l7 + get_local $l23 + get_local $l18 + f64.sub + f64.add + f64.store + get_local $p2 + i32.const -8 + i32.add + set_local $p2 + get_local $l18 + set_local $l7 + get_local $l6 + i32.const -1 + i32.add + tee_local $l6 + i32.const 0 + i32.gt_s + br_if $L64 + end + get_local $l1 + i32.const 2 + i32.lt_s + br_if $B63 + get_local $l0 + i32.const 160 + i32.add + get_local $l1 + i32.const 3 + i32.shl + i32.add + tee_local $l6 + i32.const -8 + i32.add + set_local $p2 + get_local $l6 + f64.load + set_local $l7 + get_local $l1 + set_local $l6 + loop $L65 + get_local $p2 + get_local $p2 + f64.load + tee_local $l23 + get_local $l7 + f64.add + tee_local $l18 + f64.store + get_local $p2 + i32.const 8 + i32.add + get_local $l7 + get_local $l23 + get_local $l18 + f64.sub + f64.add + f64.store + get_local $p2 + i32.const -8 + i32.add + set_local $p2 + get_local $l18 + set_local $l7 + get_local $l6 + i32.const -1 + i32.add + tee_local $l6 + i32.const 1 + i32.gt_s + br_if $L65 + end + get_local $l1 + i32.const 2 + i32.lt_s + br_if $B63 + get_local $l0 + i32.const 160 + i32.add + get_local $l1 + i32.const 3 + i32.shl + i32.add + set_local $p2 + f64.const 0x0p+0 (;=0;) + set_local $l22 + loop $L66 + get_local $l22 + get_local $p2 + f64.load + f64.add + set_local $l22 + get_local $p2 + i32.const -8 + i32.add + set_local $p2 + get_local $l1 + i32.const -1 + i32.add + tee_local $l1 + i32.const 1 + i32.gt_s + br_if $L66 + end + end + get_local $l0 + f64.load offset=160 + set_local $l7 + get_local $l21 + i32.eqz + br_if $B58 + get_local $p1 + get_local $l7 + f64.neg + f64.store + get_local $p1 + get_local $l0 + f64.load offset=168 + f64.neg + f64.store offset=8 + get_local $p1 + get_local $l22 + f64.neg + f64.store offset=16 + br $B55 + end + get_local $l1 + i32.const 0 + i32.lt_s + br_if $B60 + get_local $l1 + i32.const 1 + i32.add + set_local $l6 + get_local $l0 + i32.const 160 + i32.add + get_local $l1 + i32.const 3 + i32.shl + i32.add + set_local $p2 + f64.const 0x0p+0 (;=0;) + set_local $l7 + loop $L67 + get_local $l7 + get_local $p2 + f64.load + f64.add + set_local $l7 + get_local $p2 + i32.const -8 + i32.add + set_local $p2 + get_local $l6 + i32.const -1 + i32.add + tee_local $l6 + i32.const 0 + i32.gt_s + br_if $L67 + br $B59 + end + end + get_local $l1 + i32.const 0 + i32.lt_s + br_if $B57 + get_local $l1 + i32.const 1 + i32.add + set_local $l6 + get_local $l0 + i32.const 160 + i32.add + get_local $l1 + i32.const 3 + i32.shl + i32.add + set_local $p2 + f64.const 0x0p+0 (;=0;) + set_local $l7 + loop $L68 + get_local $l7 + get_local $p2 + f64.load + f64.add + set_local $l7 + get_local $p2 + i32.const -8 + i32.add + set_local $p2 + get_local $l6 + i32.const -1 + i32.add + tee_local $l6 + i32.const 0 + i32.gt_s + br_if $L68 + br $B56 + end + end + f64.const 0x0p+0 (;=0;) + set_local $l7 + end + get_local $p1 + get_local $l7 + f64.neg + get_local $l7 + get_local $l21 + select + f64.store + get_local $l0 + f64.load offset=160 + get_local $l7 + f64.sub + set_local $l7 + block $B69 + get_local $l1 + i32.const 1 + i32.lt_s + br_if $B69 + get_local $l0 + i32.const 160 + i32.add + i32.const 8 + i32.or + set_local $p2 + loop $L70 + get_local $l7 + get_local $p2 + f64.load + f64.add + set_local $l7 + get_local $p2 + i32.const 8 + i32.add + set_local $p2 + get_local $l1 + i32.const -1 + i32.add + tee_local $l1 + br_if $L70 + end + end + get_local $p1 + get_local $l7 + f64.neg + get_local $l7 + get_local $l21 + select + f64.store offset=8 + br $B55 + end + get_local $p1 + get_local $l7 + f64.store + get_local $p1 + get_local $l0 + i64.load offset=168 + i64.store offset=8 + get_local $p1 + get_local $l22 + f64.store offset=16 + br $B55 + end + f64.const 0x0p+0 (;=0;) + set_local $l7 + end + get_local $p1 + get_local $l7 + f64.neg + get_local $l7 + get_local $l21 + select + f64.store + end + get_local $l0 + i32.const 560 + i32.add + set_global $g0 + get_local $l19 + i32.const 7 + i32.and + return + end + get_local $l9 + set_local $l1 + br $L8 + end) + (func $__rem_pio2 (type $t4) (param $p0 f64) (param $p1 i32) (result i32) + (local $l0 i32) (local $l1 i64) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 f64) (local $l6 f64) (local $l7 f64) (local $l8 i32) (local $l9 f64) + get_global $g0 + i32.const 48 + i32.sub + tee_local $l0 + set_global $g0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 63 + i64.shr_u + i32.wrap/i64 + set_local $l2 + block $B0 + block $B1 + block $B2 + block $B3 + block $B4 + block $B5 + block $B6 + block $B7 + block $B8 + block $B9 + block $B10 + block $B11 + block $B12 + block $B13 + get_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $l3 + i32.const 2147483647 + i32.and + tee_local $l4 + i32.const 1074752122 + i32.gt_u + br_if $B13 + get_local $l3 + i32.const 1048575 + i32.and + i32.const 598523 + i32.eq + br_if $B10 + get_local $l4 + i32.const 1073928572 + i32.gt_u + br_if $B12 + get_local $l2 + i32.eqz + br_if $B7 + get_local $p1 + get_local $p0 + f64.const 0x1.921fb544p+0 (;=1.5708;) + f64.add + tee_local $p0 + f64.const 0x1.0b4611a626331p-34 (;=6.0771e-11;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const 0x1.0b4611a626331p-34 (;=6.0771e-11;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const -1 + return + end + block $B14 + get_local $l4 + i32.const 1075594811 + i32.gt_u + br_if $B14 + get_local $l4 + i32.const 1075183036 + i32.gt_u + br_if $B11 + get_local $l4 + i32.const 1074977148 + i32.eq + br_if $B10 + get_local $l2 + i32.eqz + br_if $B3 + get_local $p1 + get_local $p0 + f64.const 0x1.2d97c7f3p+2 (;=4.71239;) + f64.add + tee_local $p0 + f64.const 0x1.90e91a79394cap-33 (;=1.82313e-10;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const 0x1.90e91a79394cap-33 (;=1.82313e-10;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const -3 + return + end + get_local $l4 + i32.const 1094263290 + i32.le_u + br_if $B10 + get_local $l4 + i32.const 2146435072 + i32.lt_u + br_if $B9 + get_local $p1 + get_local $p0 + get_local $p0 + f64.sub + tee_local $p0 + f64.store + get_local $p1 + get_local $p0 + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const 0 + return + end + get_local $l2 + i32.eqz + br_if $B6 + get_local $p1 + get_local $p0 + f64.const 0x1.921fb544p+1 (;=3.14159;) + f64.add + tee_local $p0 + f64.const 0x1.0b4611a626331p-33 (;=1.21542e-10;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const 0x1.0b4611a626331p-33 (;=1.21542e-10;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const -2 + return + end + get_local $l4 + i32.const 1075388923 + i32.ne + br_if $B8 + end + get_local $p1 + get_local $p0 + get_local $p0 + f64.const 0x1.45f306dc9c883p-1 (;=0.63662;) + f64.mul + f64.const 0x1.8p+52 (;=6.7554e+15;) + f64.add + f64.const -0x1.8p+52 (;=-6.7554e+15;) + f64.add + tee_local $l5 + f64.const -0x1.921fb544p+0 (;=-1.5708;) + f64.mul + f64.add + tee_local $l6 + get_local $l5 + f64.const 0x1.0b4611a626331p-34 (;=6.0771e-11;) + f64.mul + tee_local $l7 + f64.sub + tee_local $p0 + f64.store + get_local $l4 + i32.const 20 + i32.shr_u + tee_local $l8 + get_local $p0 + i64.reinterpret/f64 + i64.const 52 + i64.shr_u + i32.wrap/i64 + i32.const 2047 + i32.and + i32.sub + i32.const 17 + i32.lt_s + set_local $l3 + block $B15 + block $B16 + block $B17 + get_local $l5 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B17 + i32.const -2147483648 + set_local $l4 + get_local $l3 + i32.eqz + br_if $B16 + br $B15 + end + get_local $l5 + i32.trunc_s/f64 + set_local $l4 + get_local $l3 + br_if $B15 + end + get_local $p1 + get_local $l6 + get_local $l5 + f64.const 0x1.0b4611a6p-34 (;=6.0771e-11;) + f64.mul + tee_local $p0 + f64.sub + tee_local $l9 + get_local $l5 + f64.const 0x1.3198a2e037073p-69 (;=2.02227e-21;) + f64.mul + get_local $l6 + get_local $l9 + f64.sub + get_local $p0 + f64.sub + f64.sub + tee_local $l7 + f64.sub + tee_local $p0 + f64.store + block $B18 + get_local $l8 + get_local $p0 + i64.reinterpret/f64 + i64.const 52 + i64.shr_u + i32.wrap/i64 + i32.const 2047 + i32.and + i32.sub + i32.const 50 + i32.lt_s + br_if $B18 + get_local $p1 + get_local $l9 + get_local $l5 + f64.const 0x1.3198a2ep-69 (;=2.02227e-21;) + f64.mul + tee_local $p0 + f64.sub + tee_local $l6 + get_local $l5 + f64.const 0x1.b839a252049c1p-104 (;=8.47843e-32;) + f64.mul + get_local $l9 + get_local $l6 + f64.sub + get_local $p0 + f64.sub + f64.sub + tee_local $l7 + f64.sub + tee_local $p0 + f64.store + br $B15 + end + get_local $l9 + set_local $l6 + end + get_local $p1 + get_local $l6 + get_local $p0 + f64.sub + get_local $l7 + f64.sub + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + get_local $l4 + return + end + get_local $l1 + i64.const 4503599627370495 + i64.and + i64.const 4710765210229538816 + i64.or + f64.reinterpret/i64 + tee_local $p0 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B5 + i32.const -2147483648 + set_local $l3 + br $B4 + end + get_local $l2 + i32.eqz + br_if $B2 + get_local $p1 + get_local $p0 + f64.const 0x1.921fb544p+2 (;=6.28319;) + f64.add + tee_local $p0 + f64.const 0x1.0b4611a626331p-32 (;=2.43084e-10;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const 0x1.0b4611a626331p-32 (;=2.43084e-10;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const -4 + return + end + get_local $p1 + get_local $p0 + f64.const -0x1.921fb544p+0 (;=-1.5708;) + f64.add + tee_local $p0 + f64.const -0x1.0b4611a626331p-34 (;=-6.0771e-11;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const -0x1.0b4611a626331p-34 (;=-6.0771e-11;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const 1 + return + end + get_local $p1 + get_local $p0 + f64.const -0x1.921fb544p+1 (;=-3.14159;) + f64.add + tee_local $p0 + f64.const -0x1.0b4611a626331p-33 (;=-1.21542e-10;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const -0x1.0b4611a626331p-33 (;=-1.21542e-10;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const 2 + return + end + get_local $p0 + i32.trunc_s/f64 + set_local $l3 + end + get_local $l0 + get_local $l3 + f64.convert_s/i32 + tee_local $l5 + f64.store offset=16 + block $B19 + block $B20 + get_local $p0 + get_local $l5 + f64.sub + f64.const 0x1p+24 (;=1.67772e+07;) + f64.mul + tee_local $p0 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B20 + i32.const -2147483648 + set_local $l3 + br $B19 + end + get_local $p0 + i32.trunc_s/f64 + set_local $l3 + end + get_local $l0 + get_local $l3 + f64.convert_s/i32 + tee_local $l5 + f64.store offset=24 + get_local $l0 + get_local $p0 + get_local $l5 + f64.sub + f64.const 0x1p+24 (;=1.67772e+07;) + f64.mul + tee_local $p0 + f64.store offset=32 + get_local $p0 + f64.const 0x0p+0 (;=0;) + f64.ne + br_if $B1 + get_local $l0 + i32.const 16 + i32.add + i32.const 8 + i32.or + set_local $l3 + i32.const 2 + set_local $l8 + loop $L21 + get_local $l8 + i32.const -1 + i32.add + set_local $l8 + get_local $l3 + f64.load + set_local $p0 + get_local $l3 + i32.const -8 + i32.add + set_local $l3 + get_local $p0 + f64.const 0x0p+0 (;=0;) + f64.eq + br_if $L21 + br $B0 + end + end + get_local $p1 + get_local $p0 + f64.const -0x1.2d97c7f3p+2 (;=-4.71239;) + f64.add + tee_local $p0 + f64.const -0x1.90e91a79394cap-33 (;=-1.82313e-10;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const -0x1.90e91a79394cap-33 (;=-1.82313e-10;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const 3 + return + end + get_local $p1 + get_local $p0 + f64.const -0x1.921fb544p+2 (;=-6.28319;) + f64.add + tee_local $p0 + f64.const -0x1.0b4611a626331p-32 (;=-2.43084e-10;) + f64.add + tee_local $l5 + f64.store + get_local $p1 + get_local $p0 + get_local $l5 + f64.sub + f64.const -0x1.0b4611a626331p-32 (;=-2.43084e-10;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const 4 + return + end + i32.const 2 + set_local $l8 + end + get_local $l0 + i32.const 16 + i32.add + get_local $l0 + get_local $l4 + i32.const 20 + i32.shr_u + i32.const -1046 + i32.add + get_local $l8 + i32.const 1 + i32.add + i32.const 1 + call $__rem_pio2_large + set_local $l3 + get_local $l0 + f64.load + set_local $p0 + block $B22 + get_local $l2 + i32.eqz + br_if $B22 + get_local $p1 + get_local $p0 + f64.neg + f64.store + get_local $p1 + get_local $l0 + f64.load offset=8 + f64.neg + f64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + i32.const 0 + get_local $l3 + i32.sub + return + end + get_local $p1 + get_local $p0 + f64.store + get_local $p1 + get_local $l0 + i64.load offset=8 + i64.store offset=8 + get_local $l0 + i32.const 48 + i32.add + set_global $g0 + get_local $l3) + (func $__sin (type $t5) (param $p0 f64) (param $p1 f64) (param $p2 i32) (result f64) + (local $l0 f64) (local $l1 f64) (local $l2 f64) + get_local $p0 + get_local $p0 + f64.mul + tee_local $l0 + get_local $l0 + get_local $l0 + f64.mul + f64.mul + get_local $l0 + f64.const 0x1.5d93a5acfd57cp-33 (;=1.58969e-10;) + f64.mul + f64.const -0x1.ae5e68a2b9cebp-26 (;=-2.50508e-08;) + f64.add + f64.mul + get_local $l0 + get_local $l0 + f64.const 0x1.71de357b1fe7dp-19 (;=2.75573e-06;) + f64.mul + f64.const -0x1.a01a019c161d5p-13 (;=-0.000198413;) + f64.add + f64.mul + f64.const 0x1.111111110f8a6p-7 (;=0.00833333;) + f64.add + f64.add + set_local $l1 + get_local $l0 + get_local $p0 + f64.mul + set_local $l2 + block $B0 + get_local $p2 + i32.eqz + br_if $B0 + get_local $p0 + get_local $l2 + f64.const 0x1.5555555555549p-3 (;=0.166667;) + f64.mul + get_local $l0 + get_local $p1 + f64.const 0x1p-1 (;=0.5;) + f64.mul + get_local $l2 + get_local $l1 + f64.mul + f64.sub + f64.mul + get_local $p1 + f64.sub + f64.add + f64.sub + return + end + get_local $l2 + get_local $l0 + get_local $l1 + f64.mul + f64.const -0x1.5555555555549p-3 (;=-0.166667;) + f64.add + f64.mul + get_local $p0 + f64.add) + (func $cos (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i32) (local $l2 f64) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + block $B0 + block $B1 + block $B2 + get_local $p0 + i64.reinterpret/f64 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l1 + i32.const 1072243195 + i32.gt_u + br_if $B2 + get_local $l1 + i32.const 1044816029 + i32.gt_u + br_if $B1 + get_local $l0 + get_local $p0 + f64.const 0x1p+120 (;=1.32923e+36;) + f64.add + f64.store + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + f64.const 0x1p+0 (;=1;) + return + end + get_local $l1 + i32.const 2146435072 + i32.lt_u + br_if $B0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + get_local $p0 + f64.sub + return + end + get_local $p0 + f64.const 0x0p+0 (;=0;) + call $__cos + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $p0 + get_local $l0 + call $__rem_pio2 + set_local $l1 + get_local $l0 + f64.load offset=8 + set_local $p0 + get_local $l0 + f64.load + set_local $l2 + block $B3 + block $B4 + block $B5 + get_local $l1 + i32.const 3 + i32.and + tee_local $l1 + i32.const 2 + i32.eq + br_if $B5 + get_local $l1 + i32.const 1 + i32.eq + br_if $B4 + get_local $l1 + br_if $B3 + get_local $l2 + get_local $p0 + call $__cos + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $l2 + get_local $p0 + call $__cos + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.neg + return + end + get_local $l2 + get_local $p0 + i32.const 1 + call $__sin + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.neg + return + end + get_local $l2 + get_local $p0 + i32.const 1 + call $__sin + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0) + (func $__expo2 (type $t1) (param $p0 f64) (result f64) + get_local $p0 + f64.const -0x1.62066151add8bp+10 (;=-1416.1;) + f64.add + call $exp + f64.const 0x1p+1021 (;=2.24712e+307;) + f64.mul + f64.const 0x1p+1021 (;=2.24712e+307;) + f64.mul) + (func $cosh (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i32) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + get_local $p0 + i64.reinterpret/f64 + i64.const 9223372036854775807 + i64.and + tee_local $l1 + f64.reinterpret/i64 + set_local $p0 + block $B0 + block $B1 + block $B2 + get_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $l2 + i32.const 1072049729 + i32.gt_u + br_if $B2 + get_local $l2 + i32.const 1045430271 + i32.gt_u + br_if $B1 + get_local $l0 + get_local $p0 + f64.const 0x1p+120 (;=1.32923e+36;) + f64.add + f64.store offset=8 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + f64.const 0x1p+0 (;=1;) + return + end + get_local $l2 + i32.const 1082535489 + i32.gt_u + br_if $B0 + get_local $p0 + call $exp + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.const 0x1p+0 (;=1;) + get_local $p0 + f64.div + f64.add + f64.const 0x1p-1 (;=0.5;) + f64.mul + return + end + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + call $expm1 + tee_local $p0 + get_local $p0 + f64.mul + get_local $p0 + f64.const 0x1p+0 (;=1;) + f64.add + tee_local $p0 + get_local $p0 + f64.add + f64.div + f64.const 0x1p+0 (;=1;) + f64.add + return + end + get_local $p0 + call $__expo2 + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0) + (func $exp (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i32) (local $l3 i32) (local $l4 f64) (local $l5 f64) (local $l6 f64) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 63 + i64.shr_u + i32.wrap/i64 + set_local $l2 + block $B0 + block $B1 + block $B2 + block $B3 + block $B4 + block $B5 + block $B6 + block $B7 + block $B8 + block $B9 + get_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l3 + i32.const 1082532651 + i32.lt_u + br_if $B9 + get_local $l1 + i64.const 9223372036854775807 + i64.and + i64.const 9218868437227405312 + i64.le_u + br_if $B8 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $l3 + i32.const 1071001155 + i32.lt_u + br_if $B7 + get_local $l3 + i32.const 1072734898 + i32.ge_u + br_if $B5 + get_local $l2 + i32.const 1 + i32.xor + get_local $l2 + i32.sub + set_local $l3 + br $B2 + end + get_local $p0 + f64.const 0x1.62e42fefa39efp+9 (;=709.783;) + f64.gt + i32.const 1 + i32.xor + br_if $B6 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.const 0x1p+1023 (;=8.98847e+307;) + f64.mul + return + end + get_local $l3 + i32.const 1043333120 + i32.le_u + br_if $B4 + i32.const 0 + set_local $l3 + f64.const 0x0p+0 (;=0;) + set_local $l4 + get_local $p0 + set_local $l5 + br $B1 + end + get_local $p0 + f64.const -0x1.6232bdd7abcd2p+9 (;=-708.396;) + f64.lt + i32.const 1 + i32.xor + br_if $B5 + get_local $l0 + f64.const -0x1p-149 (;=-1.4013e-45;) + get_local $p0 + f64.div + f32.demote/f64 + f32.store offset=12 + f64.const 0x0p+0 (;=0;) + set_local $l6 + get_local $p0 + f64.const -0x1.74910d52d3051p+9 (;=-745.133;) + f64.lt + br_if $B0 + end + get_local $p0 + f64.const 0x1.71547652b82fep+0 (;=1.4427;) + f64.mul + get_local $l2 + i32.const 3 + i32.shl + i32.const 3936 + i32.add + f64.load + f64.add + tee_local $l6 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B3 + i32.const -2147483648 + set_local $l3 + br $B2 + end + get_local $l0 + get_local $p0 + f64.const 0x1p+1023 (;=8.98847e+307;) + f64.add + f64.store + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.const 0x1p+0 (;=1;) + f64.add + return + end + get_local $l6 + i32.trunc_s/f64 + set_local $l3 + end + get_local $p0 + get_local $l3 + f64.convert_s/i32 + tee_local $l6 + f64.const -0x1.62e42feep-1 (;=-0.693147;) + f64.mul + f64.add + tee_local $p0 + get_local $l6 + f64.const 0x1.a39ef35793c76p-33 (;=1.90821e-10;) + f64.mul + tee_local $l4 + f64.sub + set_local $l5 + end + get_local $p0 + get_local $l5 + get_local $l5 + get_local $l5 + get_local $l5 + f64.mul + tee_local $l6 + get_local $l6 + get_local $l6 + get_local $l6 + get_local $l6 + f64.const 0x1.6376972bea4dp-25 (;=4.13814e-08;) + f64.mul + f64.const -0x1.bbd41c5d26bf1p-20 (;=-1.65339e-06;) + f64.add + f64.mul + f64.const 0x1.1566aaf25de2cp-14 (;=6.61376e-05;) + f64.add + f64.mul + f64.const -0x1.6c16c16bebd93p-9 (;=-0.00277778;) + f64.add + f64.mul + f64.const 0x1.555555555553ep-3 (;=0.166667;) + f64.add + f64.mul + f64.sub + tee_local $l6 + f64.mul + f64.const 0x1p+1 (;=2;) + get_local $l6 + f64.sub + f64.div + get_local $l4 + f64.sub + f64.add + f64.const 0x1p+0 (;=1;) + f64.add + set_local $l6 + get_local $l3 + i32.eqz + br_if $B0 + get_local $l6 + get_local $l3 + call $scalbn + set_local $l6 + end + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $l6) + (func $expm1 (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i32) (local $l3 i32) (local $l4 f64) (local $l5 f64) (local $l6 f64) (local $l7 f64) + get_global $g0 + i32.const 16 + i32.sub + set_local $l0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 63 + i64.shr_u + i32.wrap/i64 + set_local $l2 + block $B0 + block $B1 + block $B2 + block $B3 + block $B4 + block $B5 + block $B6 + block $B7 + block $B8 + block $B9 + block $B10 + block $B11 + block $B12 + get_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l3 + i32.const 1078159482 + i32.lt_u + br_if $B12 + get_local $l1 + i64.const 9223372036854775807 + i64.and + i64.const 9218868437227405312 + i64.le_u + br_if $B11 + get_local $p0 + return + end + get_local $l3 + i32.const 1071001155 + i32.lt_u + br_if $B10 + get_local $l3 + i32.const 1072734897 + i32.gt_u + br_if $B9 + get_local $l2 + i32.eqz + br_if $B5 + get_local $p0 + f64.const 0x1.62e42feep-1 (;=0.693147;) + f64.add + set_local $l4 + i32.const -1 + set_local $l3 + f64.const -0x1.a39ef35793c76p-33 (;=-1.90821e-10;) + set_local $l5 + br $B1 + end + get_local $l2 + i32.eqz + br_if $B7 + f64.const -0x1p+0 (;=-1;) + return + end + get_local $l3 + i32.const 1016070143 + i32.gt_u + br_if $B8 + get_local $l3 + i32.const 1048575 + i32.gt_u + br_if $B6 + get_local $l0 + get_local $p0 + f32.demote/f64 + f32.store offset=12 + get_local $p0 + return + end + get_local $p0 + f64.const 0x1.71547652b82fep+0 (;=1.4427;) + f64.mul + set_local $l5 + f64.const -0x1p-1 (;=-0.5;) + set_local $l4 + get_local $l2 + br_if $B2 + br $B3 + end + i32.const 0 + set_local $l3 + br $B0 + end + get_local $p0 + f64.const 0x1.62e42fefa39efp+9 (;=709.783;) + f64.gt + i32.eqz + br_if $B4 + get_local $p0 + f64.const 0x1p+1023 (;=8.98847e+307;) + f64.mul + return + end + get_local $p0 + return + end + get_local $p0 + f64.const -0x1.62e42feep-1 (;=-0.693147;) + f64.add + set_local $l4 + i32.const 1 + set_local $l3 + f64.const 0x1.a39ef35793c76p-33 (;=1.90821e-10;) + set_local $l5 + br $B1 + end + get_local $p0 + f64.const 0x1.71547652b82fep+0 (;=1.4427;) + f64.mul + set_local $l5 + end + f64.const 0x1p-1 (;=0.5;) + set_local $l4 + end + block $B13 + block $B14 + get_local $l5 + get_local $l4 + f64.add + tee_local $l4 + f64.abs + f64.const 0x1p+31 (;=2.14748e+09;) + f64.lt + br_if $B14 + i32.const -2147483648 + set_local $l3 + br $B13 + end + get_local $l4 + i32.trunc_s/f64 + set_local $l3 + end + get_local $l3 + f64.convert_s/i32 + tee_local $l4 + f64.const 0x1.a39ef35793c76p-33 (;=1.90821e-10;) + f64.mul + set_local $l5 + get_local $p0 + get_local $l4 + f64.const -0x1.62e42feep-1 (;=-0.693147;) + f64.mul + f64.add + set_local $l4 + end + get_local $l4 + get_local $l4 + get_local $l5 + f64.sub + tee_local $p0 + f64.sub + get_local $l5 + f64.sub + set_local $l5 + end + get_local $p0 + get_local $p0 + f64.const 0x1p-1 (;=0.5;) + f64.mul + tee_local $l6 + f64.mul + tee_local $l4 + get_local $l4 + get_local $l4 + get_local $l4 + get_local $l4 + get_local $l4 + f64.const -0x1.afdb76e09c32dp-23 (;=-2.01099e-07;) + f64.mul + f64.const 0x1.0cfca86e65239p-18 (;=4.00822e-06;) + f64.add + f64.mul + f64.const -0x1.4ce199eaadbb7p-14 (;=-7.93651e-05;) + f64.add + f64.mul + f64.const 0x1.a01a019fe5585p-10 (;=0.0015873;) + f64.add + f64.mul + f64.const -0x1.11111111110f4p-5 (;=-0.0333333;) + f64.add + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + tee_local $l7 + f64.const 0x1.8p+1 (;=3;) + get_local $l6 + get_local $l7 + f64.mul + f64.sub + tee_local $l6 + f64.sub + f64.const 0x1.8p+2 (;=6;) + get_local $p0 + get_local $l6 + f64.mul + f64.sub + f64.div + f64.mul + set_local $l6 + block $B15 + block $B16 + block $B17 + block $B18 + block $B19 + get_local $l3 + i32.eqz + br_if $B19 + get_local $p0 + get_local $l6 + get_local $l5 + f64.sub + f64.mul + get_local $l5 + f64.sub + get_local $l4 + f64.sub + set_local $l4 + get_local $l3 + i32.const 1 + i32.eq + br_if $B18 + get_local $l3 + i32.const -1 + i32.ne + br_if $B17 + get_local $p0 + get_local $l4 + f64.sub + f64.const 0x1p-1 (;=0.5;) + f64.mul + f64.const -0x1p-1 (;=-0.5;) + f64.add + return + end + get_local $p0 + get_local $p0 + get_local $l6 + f64.mul + get_local $l4 + f64.sub + f64.sub + return + end + get_local $p0 + f64.const -0x1p-2 (;=-0.25;) + f64.lt + i32.const 1 + i32.xor + br_if $B16 + get_local $l4 + get_local $p0 + f64.const 0x1p-1 (;=0.5;) + f64.add + f64.sub + f64.const -0x1p+1 (;=-2;) + f64.mul + return + end + get_local $l3 + i32.const 1023 + i32.add + i64.extend_u/i32 + i64.const 52 + i64.shl + f64.reinterpret/i64 + set_local $l5 + get_local $l3 + i32.const 57 + i32.lt_u + br_if $B15 + get_local $p0 + get_local $l4 + f64.sub + f64.const 0x1p+0 (;=1;) + f64.add + tee_local $p0 + get_local $p0 + f64.add + f64.const 0x1p+1023 (;=8.98847e+307;) + f64.mul + get_local $p0 + get_local $l5 + f64.mul + get_local $l3 + i32.const 1024 + i32.eq + select + f64.const -0x1p+0 (;=-1;) + f64.add + return + end + get_local $p0 + get_local $l4 + f64.sub + tee_local $p0 + get_local $p0 + f64.add + f64.const 0x1p+0 (;=1;) + f64.add + return + end + f64.const 0x1p+0 (;=1;) + i32.const 1023 + get_local $l3 + i32.sub + i64.extend_u/i32 + i64.const 52 + i64.shl + f64.reinterpret/i64 + tee_local $l6 + f64.sub + get_local $p0 + get_local $l4 + get_local $l6 + f64.add + f64.sub + get_local $l3 + i32.const 20 + i32.lt_s + tee_local $l3 + select + get_local $p0 + get_local $l4 + f64.sub + f64.const 0x1p+0 (;=1;) + get_local $l3 + select + f64.add + get_local $l5 + f64.mul) + (func $log (type $t1) (param $p0 f64) (result f64) + (local $l0 i64) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 f64) (local $l5 f64) + block $B0 + block $B1 + block $B2 + block $B3 + block $B4 + get_local $p0 + i64.reinterpret/f64 + tee_local $l0 + i64.const 0 + i64.lt_s + br_if $B4 + get_local $l0 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $l1 + i32.const 1048575 + i32.le_u + br_if $B4 + get_local $l1 + i32.const 2146435071 + i32.gt_u + br_if $B1 + i32.const 1072693248 + set_local $l2 + i32.const -1023 + set_local $l3 + get_local $l1 + i32.const 1072693248 + i32.ne + br_if $B3 + get_local $l0 + i32.wrap/i64 + br_if $B2 + f64.const 0x0p+0 (;=0;) + return + end + block $B5 + get_local $l0 + i64.const 9223372036854775807 + i64.and + i64.const 0 + i64.eq + br_if $B5 + get_local $l0 + i64.const -1 + i64.le_s + br_if $B0 + get_local $p0 + f64.const 0x1p+54 (;=1.80144e+16;) + f64.mul + i64.reinterpret/f64 + tee_local $l0 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $l2 + i32.const -1077 + set_local $l3 + br $B2 + end + f64.const -0x1p+0 (;=-1;) + get_local $p0 + get_local $p0 + f64.mul + f64.div + return + end + get_local $l1 + set_local $l2 + end + get_local $l3 + get_local $l2 + i32.const 614242 + i32.add + tee_local $l1 + i32.const 20 + i32.shr_u + i32.add + f64.convert_s/i32 + tee_local $l4 + f64.const 0x1.62e42feep-1 (;=0.693147;) + f64.mul + get_local $l1 + i32.const 1048575 + i32.and + i32.const 1072079006 + i32.add + i64.extend_u/i32 + i64.const 32 + i64.shl + get_local $l0 + i64.const 4294967295 + i64.and + i64.or + f64.reinterpret/i64 + f64.const -0x1p+0 (;=-1;) + f64.add + tee_local $p0 + get_local $l4 + f64.const 0x1.a39ef35793c76p-33 (;=1.90821e-10;) + f64.mul + get_local $p0 + get_local $p0 + f64.const 0x1p+1 (;=2;) + f64.add + f64.div + tee_local $l4 + get_local $p0 + get_local $p0 + f64.const 0x1p-1 (;=0.5;) + f64.mul + f64.mul + tee_local $l5 + get_local $l4 + get_local $l4 + f64.mul + tee_local $l4 + get_local $l4 + f64.mul + tee_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.39a09d078c69fp-3 (;=0.153138;) + f64.mul + f64.const 0x1.c71c51d8e78afp-3 (;=0.222222;) + f64.add + f64.mul + f64.const 0x1.999999997fa04p-2 (;=0.4;) + f64.add + f64.mul + get_local $l4 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.2f112df3e5244p-3 (;=0.147982;) + f64.mul + f64.const 0x1.7466496cb03dep-3 (;=0.181836;) + f64.add + f64.mul + f64.const 0x1.2492494229359p-2 (;=0.285714;) + f64.add + f64.mul + f64.const 0x1.5555555555593p-1 (;=0.666667;) + f64.add + f64.mul + f64.add + f64.add + f64.mul + f64.add + get_local $l5 + f64.sub + f64.add + f64.add + set_local $p0 + end + get_local $p0 + return + end + get_local $p0 + get_local $p0 + f64.sub + f64.const 0x0p+0 (;=0;) + f64.div) + (func $log1p (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i32) (local $l3 f64) (local $l4 f64) (local $l5 f64) + get_global $g0 + i32.const 16 + i32.sub + set_local $l0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $l2 + block $B0 + block $B1 + block $B2 + block $B3 + block $B4 + get_local $l1 + i64.const 0 + i64.lt_s + br_if $B4 + get_local $l2 + i32.const 1071284857 + i32.le_u + br_if $B4 + get_local $l2 + i32.const 2146435071 + i32.le_u + br_if $B3 + get_local $p0 + return + end + block $B5 + get_local $l2 + i32.const -1074790400 + i32.lt_u + br_if $B5 + get_local $p0 + f64.const -0x1p+0 (;=-1;) + f64.ne + br_if $B1 + f64.const -inf (;=-inf;) + return + end + block $B6 + get_local $l2 + i32.const 1 + i32.shl + i32.const 2034237439 + i32.gt_u + br_if $B6 + get_local $l2 + i32.const 2146435072 + i32.and + i32.eqz + br_if $B0 + get_local $p0 + return + end + f64.const 0x0p+0 (;=0;) + set_local $l3 + get_local $l2 + i32.const -1076707643 + i32.ge_u + br_if $B3 + f64.const 0x0p+0 (;=0;) + set_local $l4 + br $B2 + end + f64.const 0x0p+0 (;=0;) + set_local $l3 + block $B7 + get_local $p0 + f64.const 0x1p+0 (;=1;) + f64.add + tee_local $l4 + i64.reinterpret/f64 + tee_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 614242 + i32.add + tee_local $l0 + i32.const 20 + i32.shr_u + i32.const -1023 + i32.add + tee_local $l2 + i32.const 53 + i32.gt_s + br_if $B7 + get_local $p0 + get_local $l4 + f64.sub + f64.const 0x1p+0 (;=1;) + f64.add + get_local $p0 + get_local $l4 + f64.const -0x1p+0 (;=-1;) + f64.add + f64.sub + get_local $l2 + i32.const 1 + i32.gt_s + select + get_local $l4 + f64.div + set_local $l3 + end + get_local $l0 + i32.const 1048575 + i32.and + i32.const 1072079006 + i32.add + i64.extend_u/i32 + i64.const 32 + i64.shl + get_local $l1 + i64.const 4294967295 + i64.and + i64.or + f64.reinterpret/i64 + f64.const -0x1p+0 (;=-1;) + f64.add + set_local $p0 + get_local $l2 + f64.convert_s/i32 + set_local $l4 + end + get_local $l4 + f64.const 0x1.62e42feep-1 (;=0.693147;) + f64.mul + get_local $p0 + get_local $l3 + get_local $l4 + f64.const 0x1.a39ef35793c76p-33 (;=1.90821e-10;) + f64.mul + f64.add + get_local $p0 + get_local $p0 + f64.const 0x1p+1 (;=2;) + f64.add + f64.div + tee_local $l4 + get_local $p0 + get_local $p0 + f64.const 0x1p-1 (;=0.5;) + f64.mul + f64.mul + tee_local $l5 + get_local $l4 + get_local $l4 + f64.mul + tee_local $l3 + get_local $l3 + f64.mul + tee_local $l4 + get_local $l4 + get_local $l4 + f64.const 0x1.39a09d078c69fp-3 (;=0.153138;) + f64.mul + f64.const 0x1.c71c51d8e78afp-3 (;=0.222222;) + f64.add + f64.mul + f64.const 0x1.999999997fa04p-2 (;=0.4;) + f64.add + f64.mul + get_local $l3 + get_local $l4 + get_local $l4 + get_local $l4 + f64.const 0x1.2f112df3e5244p-3 (;=0.147982;) + f64.mul + f64.const 0x1.7466496cb03dep-3 (;=0.181836;) + f64.add + f64.mul + f64.const 0x1.2492494229359p-2 (;=0.285714;) + f64.add + f64.mul + f64.const 0x1.5555555555593p-1 (;=0.666667;) + f64.add + f64.mul + f64.add + f64.add + f64.mul + f64.add + get_local $l5 + f64.sub + f64.add + f64.add + return + end + get_local $p0 + get_local $p0 + f64.sub + f64.const 0x0p+0 (;=0;) + f64.div + return + end + get_local $l0 + get_local $p0 + f32.demote/f64 + f32.store offset=12 + get_local $p0) + (func $pow (type $t2) (param $p0 f64) (param $p1 f64) (result f64) + (local $l0 f64) (local $l1 i64) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 i64) (local $l6 i32) (local $l7 i32) (local $l8 i32) (local $l9 i32) (local $l10 i32) (local $l11 f64) (local $l12 f64) (local $l13 f64) (local $l14 f64) (local $l15 f64) (local $l16 f64) (local $l17 f64) (local $l18 f64) + f64.const 0x1p+0 (;=1;) + set_local $l0 + block $B0 + get_local $p1 + i64.reinterpret/f64 + tee_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $l2 + i32.const 2147483647 + i32.and + tee_local $l3 + get_local $l1 + i32.wrap/i64 + tee_local $l4 + i32.or + i32.eqz + br_if $B0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l5 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $l6 + block $B1 + get_local $l5 + i32.wrap/i64 + tee_local $l7 + br_if $B1 + get_local $l6 + i32.const 1072693248 + i32.eq + br_if $B0 + end + block $B2 + block $B3 + get_local $l6 + i32.const 2147483647 + i32.and + tee_local $l8 + i32.const 2146435072 + i32.gt_u + br_if $B3 + get_local $l7 + i32.const 0 + i32.ne + get_local $l8 + i32.const 2146435072 + i32.eq + i32.and + br_if $B3 + get_local $l3 + i32.const 2146435072 + i32.gt_u + br_if $B3 + get_local $l4 + i32.eqz + br_if $B2 + get_local $l3 + i32.const 2146435072 + i32.ne + br_if $B2 + end + get_local $p0 + get_local $p1 + f64.add + return + end + i32.const 0 + set_local $l9 + block $B4 + block $B5 + block $B6 + block $B7 + get_local $l6 + i32.const -1 + i32.gt_s + br_if $B7 + i32.const 2 + set_local $l9 + get_local $l3 + i32.const 1128267775 + i32.gt_u + br_if $B7 + i32.const 0 + set_local $l9 + get_local $l3 + i32.const 1072693248 + i32.lt_u + br_if $B7 + get_local $l3 + i32.const 20 + i32.shr_u + set_local $l10 + get_local $l3 + i32.const 1094713344 + i32.lt_u + br_if $B6 + i32.const 2 + get_local $l4 + i32.const 1075 + get_local $l10 + i32.sub + tee_local $l9 + i32.shr_u + tee_local $l10 + i32.const 1 + i32.and + i32.sub + i32.const 0 + get_local $l10 + get_local $l9 + i32.shl + get_local $l4 + i32.eq + select + set_local $l9 + end + get_local $l4 + i32.eqz + br_if $B5 + br $B4 + end + i32.const 0 + set_local $l9 + get_local $l4 + br_if $B4 + i32.const 2 + get_local $l3 + i32.const 1043 + get_local $l10 + i32.sub + tee_local $l4 + i32.shr_u + tee_local $l9 + i32.const 1 + i32.and + i32.sub + i32.const 0 + get_local $l9 + get_local $l4 + i32.shl + get_local $l3 + i32.eq + select + set_local $l9 + end + block $B8 + block $B9 + block $B10 + block $B11 + get_local $l3 + i32.const 2146435072 + i32.ne + br_if $B11 + get_local $l8 + i32.const -1072693248 + i32.add + get_local $l7 + i32.or + i32.eqz + br_if $B0 + get_local $l8 + i32.const 1072693248 + i32.lt_u + br_if $B10 + get_local $p1 + f64.const 0x0p+0 (;=0;) + get_local $l2 + i32.const -1 + i32.gt_s + select + return + end + block $B12 + get_local $l3 + i32.const 1072693248 + i32.ne + br_if $B12 + get_local $l2 + i32.const -1 + i32.le_s + br_if $B8 + get_local $p0 + return + end + get_local $l2 + i32.const 1073741824 + i32.ne + br_if $B9 + get_local $p0 + get_local $p0 + f64.mul + return + end + f64.const 0x0p+0 (;=0;) + get_local $p1 + f64.neg + get_local $l2 + i32.const -1 + i32.gt_s + select + return + end + get_local $l6 + i32.const 0 + i32.lt_s + br_if $B4 + get_local $l2 + i32.const 1071644672 + i32.ne + br_if $B4 + get_local $p0 + f64.sqrt + return + end + f64.const 0x1p+0 (;=1;) + get_local $p0 + f64.div + return + end + get_local $p0 + f64.abs + set_local $l0 + block $B13 + block $B14 + block $B15 + block $B16 + block $B17 + block $B18 + block $B19 + block $B20 + block $B21 + block $B22 + block $B23 + block $B24 + block $B25 + get_local $l7 + br_if $B25 + get_local $l8 + i32.eqz + br_if $B24 + get_local $l8 + i32.const 1073741824 + i32.or + i32.const 2146435072 + i32.eq + br_if $B24 + end + f64.const 0x1p+0 (;=1;) + set_local $l11 + get_local $l6 + i32.const -1 + i32.gt_s + br_if $B21 + get_local $l9 + i32.const 1 + i32.eq + br_if $B23 + get_local $l9 + br_if $B21 + get_local $p0 + get_local $p0 + f64.sub + tee_local $p1 + get_local $p1 + f64.div + return + end + f64.const 0x1p+0 (;=1;) + get_local $l0 + f64.div + get_local $l0 + get_local $l2 + i32.const 0 + i32.lt_s + select + set_local $l0 + get_local $l6 + i32.const -1 + i32.gt_s + br_if $B0 + get_local $l9 + get_local $l8 + i32.const -1072693248 + i32.add + i32.or + i32.eqz + br_if $B22 + get_local $l0 + f64.neg + get_local $l0 + get_local $l9 + i32.const 1 + i32.eq + select + return + end + f64.const -0x1p+0 (;=-1;) + set_local $l11 + get_local $l3 + i32.const 1105199105 + i32.ge_u + br_if $B20 + br $B19 + end + get_local $l0 + get_local $l0 + f64.sub + tee_local $p1 + get_local $p1 + f64.div + return + end + get_local $l3 + i32.const 1105199105 + i32.lt_u + br_if $B19 + end + block $B26 + get_local $l3 + i32.const 1139802113 + i32.lt_u + br_if $B26 + get_local $l8 + i32.const 1072693247 + i32.gt_u + br_if $B18 + f64.const inf (;=inf;) + f64.const 0x0p+0 (;=0;) + get_local $l2 + i32.const 0 + i32.lt_s + select + return + end + get_local $l8 + i32.const 1072693246 + i32.gt_u + br_if $B17 + get_local $l11 + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + get_local $l11 + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + get_local $l2 + i32.const 0 + i32.lt_s + select + return + end + i32.const 0 + set_local $l3 + block $B27 + block $B28 + get_local $l8 + i32.const 1048575 + i32.gt_u + br_if $B28 + get_local $l0 + f64.const 0x1p+53 (;=9.0072e+15;) + f64.mul + tee_local $l0 + i64.reinterpret/f64 + i64.const 32 + i64.shr_u + i32.wrap/i64 + set_local $l8 + i32.const -53 + set_local $l2 + br $B27 + end + i32.const 0 + set_local $l2 + end + get_local $l8 + i32.const 1048575 + i32.and + tee_local $l4 + i32.const 1072693248 + i32.or + set_local $l6 + get_local $l8 + i32.const 20 + i32.shr_s + get_local $l2 + i32.add + i32.const -1023 + i32.add + set_local $l2 + get_local $l4 + i32.const 235663 + i32.lt_u + br_if $B15 + get_local $l4 + i32.const 767610 + i32.ge_u + br_if $B16 + i32.const 1 + set_local $l3 + br $B15 + end + f64.const inf (;=inf;) + f64.const 0x0p+0 (;=0;) + get_local $l2 + i32.const 0 + i32.gt_s + select + return + end + get_local $l8 + i32.const 1072693249 + i32.lt_u + br_if $B14 + get_local $l11 + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + get_local $l11 + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + get_local $l2 + i32.const 0 + i32.gt_s + select + return + end + get_local $l6 + i32.const -1048576 + i32.add + set_local $l6 + get_local $l2 + i32.const 1 + i32.add + set_local $l2 + end + get_local $l3 + i32.const 3 + i32.shl + tee_local $l4 + i32.const 3984 + i32.add + f64.load + tee_local $l12 + get_local $l6 + i64.extend_u/i32 + i64.const 32 + i64.shl + get_local $l0 + i64.reinterpret/f64 + i64.const 4294967295 + i64.and + i64.or + f64.reinterpret/i64 + tee_local $l13 + get_local $l4 + i32.const 3952 + i32.add + f64.load + tee_local $l14 + f64.sub + tee_local $l15 + f64.const 0x1p+0 (;=1;) + get_local $l14 + get_local $l13 + f64.add + f64.div + tee_local $l16 + f64.mul + tee_local $l0 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $p0 + get_local $p0 + get_local $p0 + f64.mul + tee_local $l17 + f64.const 0x1.8p+1 (;=3;) + f64.add + get_local $l0 + get_local $p0 + f64.add + get_local $l16 + get_local $l15 + get_local $p0 + get_local $l6 + i32.const 1 + i32.shr_s + i32.const 536870912 + i32.or + get_local $l3 + i32.const 18 + i32.shl + i32.add + i32.const 524288 + i32.add + i64.extend_u/i32 + i64.const 32 + i64.shl + f64.reinterpret/i64 + tee_local $l18 + f64.mul + f64.sub + get_local $p0 + get_local $l13 + get_local $l18 + get_local $l14 + f64.sub + f64.sub + f64.mul + f64.sub + f64.mul + tee_local $l13 + f64.mul + get_local $l0 + get_local $l0 + f64.mul + tee_local $p0 + get_local $p0 + f64.mul + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.a7e284a454eefp-3 (;=0.206975;) + f64.mul + f64.const 0x1.d864a93c9db65p-3 (;=0.230661;) + f64.add + f64.mul + f64.const 0x1.17460a91d4101p-2 (;=0.272728;) + f64.add + f64.mul + f64.const 0x1.55555518f264dp-2 (;=0.333333;) + f64.add + f64.mul + f64.const 0x1.b6db6db6fabffp-2 (;=0.428571;) + f64.add + f64.mul + f64.const 0x1.3333333333303p-1 (;=0.6;) + f64.add + f64.mul + f64.add + tee_local $l14 + f64.add + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $p0 + f64.mul + tee_local $l15 + get_local $l13 + get_local $p0 + f64.mul + get_local $l0 + get_local $l14 + get_local $p0 + f64.const -0x1.8p+1 (;=-3;) + f64.add + get_local $l17 + f64.sub + f64.sub + f64.mul + f64.add + tee_local $l0 + f64.add + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $p0 + f64.const 0x1.ec709ep-1 (;=0.961797;) + f64.mul + tee_local $l13 + get_local $l4 + i32.const 3968 + i32.add + f64.load + get_local $l0 + get_local $p0 + get_local $l15 + f64.sub + f64.sub + f64.const 0x1.ec709dc3a03fdp-1 (;=0.961797;) + f64.mul + get_local $p0 + f64.const -0x1.e2fe0145b01f5p-28 (;=-7.02846e-09;) + f64.mul + f64.add + f64.add + tee_local $l14 + f64.add + f64.add + get_local $l2 + f64.convert_s/i32 + tee_local $l0 + f64.add + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $p0 + get_local $l0 + f64.sub + get_local $l12 + f64.sub + get_local $l13 + f64.sub + set_local $l12 + br $B13 + end + get_local $l0 + f64.const -0x1p+0 (;=-1;) + f64.add + tee_local $p0 + f64.const 0x1.715476p+0 (;=1.4427;) + f64.mul + tee_local $l0 + get_local $p0 + f64.const 0x1.4ae0bf85ddf44p-26 (;=1.92596e-08;) + f64.mul + get_local $p0 + get_local $p0 + f64.mul + f64.const 0x1p-1 (;=0.5;) + get_local $p0 + get_local $p0 + f64.const -0x1p-2 (;=-0.25;) + f64.mul + f64.const 0x1.5555555555555p-2 (;=0.333333;) + f64.add + f64.mul + f64.sub + f64.mul + f64.const -0x1.71547652b82fep+0 (;=-1.4427;) + f64.mul + f64.add + tee_local $l14 + f64.add + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $p0 + get_local $l0 + f64.sub + set_local $l12 + end + get_local $p0 + get_local $l1 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $l13 + f64.mul + tee_local $l0 + get_local $l14 + get_local $l12 + f64.sub + get_local $p1 + f64.mul + get_local $p1 + get_local $l13 + f64.sub + get_local $p0 + f64.mul + f64.add + tee_local $p1 + f64.add + tee_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i32.wrap/i64 + set_local $l3 + block $B29 + block $B30 + block $B31 + block $B32 + block $B33 + get_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $l6 + i32.const 1083179008 + i32.lt_s + br_if $B33 + get_local $l6 + i32.const -1083179008 + i32.add + get_local $l3 + i32.or + i32.eqz + br_if $B32 + get_local $l11 + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + return + end + get_local $l6 + i32.const 2147482624 + i32.and + i32.const 1083231232 + i32.lt_u + br_if $B30 + get_local $l6 + i32.const 1064252416 + i32.add + get_local $l3 + i32.or + i32.eqz + br_if $B31 + get_local $l11 + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + return + end + get_local $p1 + f64.const 0x1.71547652b82fep-54 (;=8.00857e-17;) + f64.add + get_local $p0 + get_local $l0 + f64.sub + f64.gt + i32.const 1 + i32.xor + br_if $B30 + get_local $l11 + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + f64.const 0x1.7e43c8800759cp+996 (;=1e+300;) + f64.mul + return + end + get_local $p1 + get_local $p0 + get_local $l0 + f64.sub + f64.le + i32.const 1 + i32.xor + i32.eqz + br_if $B29 + end + i32.const 0 + set_local $l3 + block $B34 + get_local $l6 + i32.const 2147483647 + i32.and + tee_local $l4 + i32.const 1071644673 + i32.lt_u + br_if $B34 + i32.const 0 + i32.const 1048576 + get_local $l4 + i32.const 20 + i32.shr_u + i32.const -1022 + i32.add + i32.shr_u + get_local $l6 + i32.add + tee_local $l4 + i32.const 1048575 + i32.and + i32.const 1048576 + i32.or + i32.const 1043 + get_local $l4 + i32.const 20 + i32.shr_u + i32.const 2047 + i32.and + tee_local $l2 + i32.sub + i32.shr_u + tee_local $l3 + i32.sub + get_local $l3 + get_local $l6 + i32.const 0 + i32.lt_s + select + set_local $l3 + get_local $p1 + get_local $l0 + i32.const -1048576 + get_local $l2 + i32.const -1023 + i32.add + i32.shr_s + get_local $l4 + i32.and + i64.extend_u/i32 + i64.const 32 + i64.shl + f64.reinterpret/i64 + f64.sub + tee_local $l0 + f64.add + i64.reinterpret/f64 + set_local $l1 + end + block $B35 + get_local $l3 + i32.const 20 + i32.shl + get_local $l1 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $p0 + f64.const 0x1.62e43p-1 (;=0.693147;) + f64.mul + tee_local $l13 + get_local $p1 + get_local $p0 + get_local $l0 + f64.sub + f64.sub + f64.const 0x1.62e42fefa39efp-1 (;=0.693147;) + f64.mul + get_local $p0 + f64.const -0x1.05c610ca86c39p-29 (;=-1.90465e-09;) + f64.mul + f64.add + tee_local $l0 + f64.add + tee_local $p1 + get_local $p1 + get_local $p1 + get_local $p1 + get_local $p1 + f64.mul + tee_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.const 0x1.6376972bea4dp-25 (;=4.13814e-08;) + f64.mul + f64.const -0x1.bbd41c5d26bf1p-20 (;=-1.65339e-06;) + f64.add + f64.mul + f64.const 0x1.1566aaf25de2cp-14 (;=6.61376e-05;) + f64.add + f64.mul + f64.const -0x1.6c16c16bebd93p-9 (;=-0.00277778;) + f64.add + f64.mul + f64.const 0x1.555555555553ep-3 (;=0.166667;) + f64.add + f64.mul + f64.sub + tee_local $p0 + f64.mul + get_local $p0 + f64.const -0x1p+1 (;=-2;) + f64.add + f64.div + get_local $l0 + get_local $p1 + get_local $l13 + f64.sub + f64.sub + tee_local $p0 + get_local $p1 + get_local $p0 + f64.mul + f64.add + f64.sub + f64.sub + f64.const 0x1p+0 (;=1;) + f64.add + tee_local $p1 + i64.reinterpret/f64 + tee_local $l1 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.add + tee_local $l6 + i32.const 1048575 + i32.gt_s + br_if $B35 + get_local $l11 + get_local $p1 + get_local $l3 + call $scalbn + f64.mul + return + end + get_local $l11 + get_local $l6 + i64.extend_u/i32 + i64.const 32 + i64.shl + get_local $l1 + i64.const 4294967295 + i64.and + i64.or + f64.reinterpret/i64 + f64.mul + return + end + get_local $l11 + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + f64.const 0x1.56e1fc2f8f359p-997 (;=1e-300;) + f64.mul + return + end + get_local $l0) + (func $scalbn (type $t6) (param $p0 f64) (param $p1 i32) (result f64) + (local $l0 i32) + block $B0 + block $B1 + block $B2 + block $B3 + get_local $p1 + i32.const 1024 + i32.lt_s + br_if $B3 + get_local $p0 + f64.const 0x1p+1023 (;=8.98847e+307;) + f64.mul + set_local $p0 + get_local $p1 + i32.const -1023 + i32.add + tee_local $l0 + i32.const 1024 + i32.lt_s + br_if $B2 + get_local $p1 + i32.const -2046 + i32.add + tee_local $p1 + i32.const 1023 + get_local $p1 + i32.const 1023 + i32.lt_s + select + set_local $p1 + get_local $p0 + f64.const 0x1p+1023 (;=8.98847e+307;) + f64.mul + set_local $p0 + br $B0 + end + get_local $p1 + i32.const -1023 + i32.gt_s + br_if $B0 + get_local $p0 + f64.const 0x1p-969 (;=2.00417e-292;) + f64.mul + set_local $p0 + get_local $p1 + i32.const 969 + i32.add + tee_local $l0 + i32.const -1023 + i32.gt_s + br_if $B1 + get_local $p1 + i32.const 1938 + i32.add + tee_local $p1 + i32.const -1022 + get_local $p1 + i32.const -1022 + i32.gt_s + select + set_local $p1 + get_local $p0 + f64.const 0x1p-969 (;=2.00417e-292;) + f64.mul + set_local $p0 + br $B0 + end + get_local $l0 + set_local $p1 + br $B0 + end + get_local $l0 + set_local $p1 + end + get_local $p0 + get_local $p1 + i32.const 1023 + i32.add + i64.extend_u/i32 + i64.const 52 + i64.shl + f64.reinterpret/i64 + f64.mul) + (func $sin (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i32) (local $l2 f64) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + block $B0 + block $B1 + block $B2 + get_local $p0 + i64.reinterpret/f64 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l1 + i32.const 1072243195 + i32.gt_u + br_if $B2 + get_local $l1 + i32.const 1045430271 + i32.gt_u + br_if $B1 + get_local $l0 + get_local $p0 + f64.const 0x1p-120 (;=7.52316e-37;) + f64.mul + get_local $p0 + f64.const 0x1p+120 (;=1.32923e+36;) + f64.add + get_local $l1 + i32.const 1048576 + i32.lt_u + select + f64.store + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $l1 + i32.const 2146435072 + i32.lt_u + br_if $B0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + get_local $p0 + f64.sub + return + end + get_local $p0 + f64.const 0x0p+0 (;=0;) + i32.const 0 + call $__sin + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $p0 + get_local $l0 + call $__rem_pio2 + set_local $l1 + get_local $l0 + f64.load offset=8 + set_local $p0 + get_local $l0 + f64.load + set_local $l2 + block $B3 + block $B4 + block $B5 + get_local $l1 + i32.const 3 + i32.and + tee_local $l1 + i32.const 2 + i32.eq + br_if $B5 + get_local $l1 + i32.const 1 + i32.eq + br_if $B4 + get_local $l1 + br_if $B3 + get_local $l2 + get_local $p0 + i32.const 1 + call $__sin + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $l2 + get_local $p0 + i32.const 1 + call $__sin + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.neg + return + end + get_local $l2 + get_local $p0 + call $__cos + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $l2 + get_local $p0 + call $__cos + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.neg) + (func $sinh (type $t1) (param $p0 f64) (result f64) + (local $l0 i64) (local $l1 f64) (local $l2 f64) (local $l3 i32) + f64.const -0x1p-1 (;=-0.5;) + f64.const 0x1p-1 (;=0.5;) + get_local $p0 + i64.reinterpret/f64 + tee_local $l0 + i64.const 0 + i64.lt_s + select + set_local $l1 + get_local $l0 + i64.const 9223372036854775807 + i64.and + tee_local $l0 + f64.reinterpret/i64 + set_local $l2 + block $B0 + block $B1 + block $B2 + get_local $l0 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $l3 + i32.const 1082535489 + i32.gt_u + br_if $B2 + get_local $l2 + call $expm1 + set_local $l2 + get_local $l3 + i32.const 1072693247 + i32.gt_u + br_if $B0 + get_local $l3 + i32.const 1045430272 + i32.lt_u + br_if $B1 + get_local $l1 + get_local $l2 + get_local $l2 + f64.add + get_local $l2 + get_local $l2 + f64.mul + get_local $l2 + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + f64.sub + f64.mul + return + end + get_local $l1 + get_local $l1 + f64.add + get_local $l2 + call $__expo2 + f64.mul + set_local $p0 + end + get_local $p0 + return + end + get_local $l1 + get_local $l2 + get_local $l2 + get_local $l2 + f64.const 0x1p+0 (;=1;) + f64.add + f64.div + f64.add + f64.mul) + (func $__tan (type $t5) (param $p0 f64) (param $p1 f64) (param $p2 i32) (result f64) + (local $l0 i64) (local $l1 i32) (local $l2 i32) (local $l3 f64) (local $l4 f64) (local $l5 f64) + block $B0 + block $B1 + get_local $p0 + i64.reinterpret/f64 + tee_local $l0 + i64.const 9223372002495037440 + i64.and + i64.const 4604249089280835585 + i64.lt_u + tee_local $l1 + br_if $B1 + f64.const 0x1.921fb54442d18p-1 (;=0.785398;) + get_local $p0 + f64.neg + get_local $p0 + get_local $l0 + i64.const 63 + i64.shr_u + i32.wrap/i64 + tee_local $l2 + select + f64.sub + f64.const 0x1.1a62633145c07p-55 (;=3.06162e-17;) + get_local $p1 + f64.neg + get_local $p1 + get_local $l2 + select + f64.sub + f64.add + set_local $p0 + f64.const 0x0p+0 (;=0;) + set_local $p1 + br $B0 + end + end + get_local $p0 + get_local $p0 + get_local $p0 + get_local $p0 + f64.mul + tee_local $l3 + f64.mul + tee_local $l4 + f64.const 0x1.5555555555563p-2 (;=0.333333;) + f64.mul + get_local $p1 + get_local $l3 + get_local $p1 + get_local $l4 + get_local $l3 + get_local $l3 + f64.mul + tee_local $l5 + get_local $l5 + get_local $l5 + get_local $l5 + get_local $l5 + f64.const -0x1.375cbdb605373p-16 (;=-1.85586e-05;) + f64.mul + f64.const 0x1.47e88a03792a6p-14 (;=7.81794e-05;) + f64.add + f64.mul + f64.const 0x1.344d8f2f26501p-11 (;=0.000588041;) + f64.add + f64.mul + f64.const 0x1.d6d22c9560328p-9 (;=0.00359208;) + f64.add + f64.mul + f64.const 0x1.664f48406d637p-6 (;=0.0218695;) + f64.add + f64.mul + f64.const 0x1.111111110fe7ap-3 (;=0.133333;) + f64.add + get_local $l3 + get_local $l5 + get_local $l5 + get_local $l5 + get_local $l5 + get_local $l5 + f64.const 0x1.b2a7074bf7ad4p-16 (;=2.59073e-05;) + f64.mul + f64.const 0x1.2b80f32f0a7e9p-14 (;=7.14072e-05;) + f64.add + f64.mul + f64.const 0x1.026f71a8d1068p-12 (;=0.000246463;) + f64.add + f64.mul + f64.const 0x1.7dbc8fee08315p-10 (;=0.00145621;) + f64.add + f64.mul + f64.const 0x1.226e3e96e8493p-7 (;=0.00886324;) + f64.add + f64.mul + f64.const 0x1.ba1ba1bb341fep-5 (;=0.0539683;) + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.mul + f64.add + f64.add + tee_local $l3 + f64.add + set_local $l5 + block $B2 + get_local $l1 + br_if $B2 + i32.const 1 + get_local $p2 + i32.const 1 + i32.shl + i32.sub + f64.convert_s/i32 + tee_local $p1 + get_local $p0 + get_local $l3 + get_local $l5 + get_local $l5 + f64.mul + get_local $l5 + get_local $p1 + f64.add + f64.div + f64.sub + f64.add + tee_local $l5 + get_local $l5 + f64.add + f64.sub + tee_local $l5 + f64.neg + get_local $l5 + get_local $l2 + select + return + end + block $B3 + get_local $p2 + i32.eqz + br_if $B3 + f64.const -0x1p+0 (;=-1;) + get_local $l5 + f64.div + tee_local $p1 + get_local $l5 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $l4 + get_local $p1 + i64.reinterpret/f64 + i64.const -4294967296 + i64.and + f64.reinterpret/i64 + tee_local $l5 + f64.mul + f64.const 0x1p+0 (;=1;) + f64.add + get_local $l3 + get_local $l4 + get_local $p0 + f64.sub + f64.sub + get_local $l5 + f64.mul + f64.add + f64.mul + get_local $l5 + f64.add + set_local $l5 + end + get_local $l5) + (func $tan (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i32) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + block $B0 + block $B1 + block $B2 + get_local $p0 + i64.reinterpret/f64 + i64.const 32 + i64.shr_u + i32.wrap/i64 + i32.const 2147483647 + i32.and + tee_local $l1 + i32.const 1072243195 + i32.gt_u + br_if $B2 + get_local $l1 + i32.const 1044381695 + i32.gt_u + br_if $B1 + get_local $l0 + get_local $p0 + f64.const 0x1p-120 (;=7.52316e-37;) + f64.mul + get_local $p0 + f64.const 0x1p+120 (;=1.32923e+36;) + f64.add + get_local $l1 + i32.const 1048576 + i32.lt_u + select + f64.store + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $l1 + i32.const 2146435072 + i32.lt_u + br_if $B0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + get_local $p0 + f64.sub + return + end + get_local $p0 + f64.const 0x0p+0 (;=0;) + i32.const 0 + call $__tan + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + return + end + get_local $p0 + get_local $l0 + call $__rem_pio2 + set_local $l1 + get_local $l0 + f64.load + get_local $l0 + f64.load offset=8 + get_local $l1 + i32.const 1 + i32.and + call $__tan + set_local $p0 + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0) + (func $tanh (type $t1) (param $p0 f64) (result f64) + (local $l0 i32) (local $l1 i64) (local $l2 i64) (local $l3 i32) + get_global $g0 + i32.const 16 + i32.sub + tee_local $l0 + set_global $g0 + get_local $p0 + i64.reinterpret/f64 + tee_local $l1 + i64.const 9223372036854775807 + i64.and + tee_local $l2 + f64.reinterpret/i64 + set_local $p0 + block $B0 + block $B1 + block $B2 + block $B3 + get_local $l2 + i64.const 32 + i64.shr_u + i32.wrap/i64 + tee_local $l3 + i32.const 1071748075 + i32.lt_u + br_if $B3 + get_local $l3 + i32.const 1077149697 + i32.lt_u + br_if $B2 + f64.const -0x0p+0 (;=-0;) + get_local $p0 + f64.div + f64.const 0x1p+0 (;=1;) + f64.add + set_local $p0 + br $B0 + end + get_local $l3 + i32.const 1070618799 + i32.lt_u + br_if $B1 + get_local $p0 + get_local $p0 + f64.add + call $expm1 + tee_local $p0 + get_local $p0 + f64.const 0x1p+1 (;=2;) + f64.add + f64.div + set_local $p0 + br $B0 + end + f64.const 0x1p+0 (;=1;) + f64.const 0x1p+1 (;=2;) + get_local $p0 + get_local $p0 + f64.add + call $expm1 + f64.const 0x1p+1 (;=2;) + f64.add + f64.div + f64.sub + set_local $p0 + br $B0 + end + block $B4 + get_local $l3 + i32.const 1048576 + i32.lt_u + br_if $B4 + get_local $p0 + f64.const -0x1p+1 (;=-2;) + f64.mul + call $expm1 + tee_local $p0 + f64.neg + get_local $p0 + f64.const 0x1p+1 (;=2;) + f64.add + f64.div + set_local $p0 + br $B0 + end + get_local $l0 + get_local $p0 + f32.demote/f64 + f32.store offset=12 + end + get_local $l0 + i32.const 16 + i32.add + set_global $g0 + get_local $p0 + f64.neg + get_local $p0 + get_local $l1 + i64.const 0 + i64.lt_s + select) + (func $memset (type $t7) (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32) + (local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i64) + block $B0 + get_local $p2 + i32.eqz + br_if $B0 + get_local $p0 + get_local $p1 + i32.store8 + get_local $p0 + get_local $p2 + i32.add + tee_local $l0 + i32.const -1 + i32.add + get_local $p1 + i32.store8 + get_local $p2 + i32.const 3 + i32.lt_u + br_if $B0 + get_local $p0 + get_local $p1 + i32.store8 offset=2 + get_local $p0 + get_local $p1 + i32.store8 offset=1 + get_local $l0 + i32.const -3 + i32.add + get_local $p1 + i32.store8 + get_local $l0 + i32.const -2 + i32.add + get_local $p1 + i32.store8 + get_local $p2 + i32.const 7 + i32.lt_u + br_if $B0 + get_local $p0 + get_local $p1 + i32.store8 offset=3 + get_local $l0 + i32.const -4 + i32.add + get_local $p1 + i32.store8 + get_local $p2 + i32.const 9 + i32.lt_u + br_if $B0 + get_local $p0 + i32.const 0 + get_local $p0 + i32.sub + i32.const 3 + i32.and + tee_local $l1 + i32.add + tee_local $l0 + get_local $p1 + i32.const 255 + i32.and + i32.const 16843009 + i32.mul + tee_local $p1 + i32.store + get_local $l0 + get_local $p2 + get_local $l1 + i32.sub + i32.const -4 + i32.and + tee_local $l1 + i32.add + tee_local $p2 + i32.const -4 + i32.add + get_local $p1 + i32.store + get_local $l1 + i32.const 9 + i32.lt_u + br_if $B0 + get_local $l0 + get_local $p1 + i32.store offset=8 + get_local $l0 + get_local $p1 + i32.store offset=4 + get_local $p2 + i32.const -8 + i32.add + get_local $p1 + i32.store + get_local $p2 + i32.const -12 + i32.add + get_local $p1 + i32.store + get_local $l1 + i32.const 25 + i32.lt_u + br_if $B0 + get_local $l0 + get_local $p1 + i32.store offset=16 + get_local $l0 + get_local $p1 + i32.store offset=12 + get_local $l0 + get_local $p1 + i32.store offset=20 + get_local $l0 + get_local $p1 + i32.store offset=24 + get_local $p2 + i32.const -24 + i32.add + get_local $p1 + i32.store + get_local $p2 + i32.const -28 + i32.add + get_local $p1 + i32.store + get_local $p2 + i32.const -20 + i32.add + get_local $p1 + i32.store + get_local $p2 + i32.const -16 + i32.add + get_local $p1 + i32.store + get_local $l1 + get_local $l0 + i32.const 4 + i32.and + i32.const 24 + i32.or + tee_local $l2 + i32.sub + tee_local $p2 + i32.const 32 + i32.lt_u + br_if $B0 + get_local $p1 + i64.extend_u/i32 + tee_local $l3 + i64.const 32 + i64.shl + get_local $l3 + i64.or + set_local $l3 + get_local $l0 + get_local $l2 + i32.add + set_local $p1 + loop $L1 + get_local $p1 + get_local $l3 + i64.store + get_local $p1 + i32.const 8 + i32.add + get_local $l3 + i64.store + get_local $p1 + i32.const 16 + i32.add + get_local $l3 + i64.store + get_local $p1 + i32.const 24 + i32.add + get_local $l3 + i64.store + get_local $p1 + i32.const 32 + i32.add + set_local $p1 + get_local $p2 + i32.const -32 + i32.add + tee_local $p2 + i32.const 31 + i32.gt_u + br_if $L1 + end + end + get_local $p0) + (table $T0 1 1 anyfunc) + (memory $memory (export "memory") 2) + (global $g0 (mut i32) (i32.const 69536)) + (global $__heap_base (export "__heap_base") i32 (i32.const 69536)) + (global $__data_end (export "__data_end") i32 (i32.const 4000)) + (data (i32.const 1024) "O\bba\05g\ac\dd?\18-DT\fb!\e9?\9b\f6\81\d2\0bs\ef?\18-DT\fb!\f9?\e2e/\22\7f+z<\07\5c\143&\a6\81<\bd\cb\f0z\88\07p<\07\5c\143&\a6\91<\03\00\00\00\04\00\00\00\04\00\00\00\06\00\00\00\83\f9\a2\00DNn\00\fc)\15\00\d1W'\00\dd4\f5\00b\db\c0\00<\99\95\00A\90C\00cQ\fe\00\bb\de\ab\00\b7a\c5\00:n${'$'}\00\d2MB\00I\06\e0\00\09\ea.\00\1c\92\d1\00\eb\1d\fe\00)\b1\1c\00\e8>\a7\00\f55\82\00D\bb.\00\9c\e9\84\00\b4&p\00A~_\00\d6\919\00S\839\00\9c\f49\00\8b_\84\00(\f9\bd\00\f8\1f;\00\de\ff\97\00\0f\98\05\00\11/\ef\00\0aZ\8b\00m\1fm\00\cf~6\00\09\cb'\00FO\b7\00\9ef?\00-\ea_\00\ba'u\00\e5\eb\c7\00={\f1\00\f79\07\00\92R\8a\00\fbk\ea\00\1f\b1_\00\08]\8d\000\03V\00{\fcF\00\f0\abk\00 \bc\cf\006\f4\9a\00\e3\a9\1d\00^a\91\00\08\1b\e6\00\85\99e\00\a0\14_\00\8d@h\00\80\d8\ff\00'sM\00\06\061\00\caV\15\00\c9\a8s\00{\e2`\00k\8c\c0\00\19\c4G\00\cdg\c3\00\09\e8\dc\00Y\83*\00\8bv\c4\00\a6\1c\96\00D\af\dd\00\19W\d1\00\a5>\05\00\05\07\ff\003~?\00\c22\e8\00\98O\de\00\bb}2\00&=\c3\00\1ek\ef\00\9f\f8^\005\1f:\00\7f\f2\ca\00\f1\87\1d\00|\90!\00j${'$'}|\00\d5n\fa\000-w\00\15;C\00\b5\14\c6\00\c3\19\9d\00\ad\c4\c2\00,MA\00\0c\00]\00\86}F\00\e3q-\00\9b\c6\9a\003b\00\00\b4\d2|\00\b4\a7\97\007U\d5\00\d7>\f6\00\a3\10\18\00Mv\fc\00d\9d*\00p\d7\ab\00c|\f8\00z\b0W\00\17\15\e7\00\c0IV\00;\d6\d9\00\a7\848\00${'$'}#\cb\00\d6\8aw\00ZT#\00\00\1f\b9\00\f1\0a\1b\00\19\ce\df\00\9f1\ff\00f\1ej\00\99Wa\00\ac\fbG\00~\7f\d8\00\22e\b7\002\e8\89\00\e6\bf`\00\ef\c4\cd\00l6\09\00]?\d4\00\16\de\d7\00X;\de\00\de\9b\92\00\d2\22(\00(\86\e8\00\e2XM\00\c6\ca2\00\08\e3\16\00\e0}\cb\00\17\c0P\00\f3\1d\a7\00\18\e0[\00.\134\00\83\12b\00\83H\01\00\f5\8e[\00\ad\b0\7f\00\1e\e9\f2\00HJC\00\10g\d3\00\aa\dd\d8\00\ae_B\00ja\ce\00\0a(\a4\00\d3\99\b4\00\06\a6\f2\00\5cw\7f\00\a3\c2\83\00a<\88\00\8asx\00\af\8cZ\00o\d7\bd\00-\a6c\00\f4\bf\cb\00\8d\81\ef\00&\c1g\00U\caE\00\ca\d96\00(\a8\d2\00\c2a\8d\00\12\c9w\00\04&\14\00\12F\9b\00\c4Y\c4\00\c8\c5D\00M\b2\91\00\00\17\f3\00\d4C\ad\00)I\e5\00\fd\d5\10\00\00\be\fc\00\1e\94\cc\00p\ce\ee\00\13>\f5\00\ec\f1\80\00\b3\e7\c3\00\c7\f8(\00\93\05\94\00\c1q>\00.\09\b3\00\0bE\f3\00\88\12\9c\00\ab {\00.\b5\9f\00G\92\c2\00{2/\00\0cUm\00r\a7\90\00k\e7\1f\001\cb\96\00y\16J\00Ay\e2\00\f4\df\89\00\e8\94\97\00\e2\e6\84\00\991\97\00\88\edk\00__6\00\bb\fd\0e\00H\9a\b4\00g\a4l\00qrB\00\8d]2\00\9f\15\b8\00\bc\e5\09\00\8d1%\00\f7t9\000\05\1c\00\0d\0c\01\00K\08h\00,\eeX\00G\aa\90\00t\e7\02\00\bd\d6${'$'}\00\f7}\a6\00nHr\00\9f\16\ef\00\8e\94\a6\00\b4\91\f6\00\d1SQ\00\cf\0a\f2\00 \983\00\f5K~\00\b2ch\00\dd>_\00@]\03\00\85\89\7f\00UR)\007d\c0\00m\d8\10\002H2\00[Lu\00Nq\d4\00ETn\00\0b\09\c1\00*\f5i\00\14f\d5\00'\07\9d\00]\04P\00\b4;\db\00\eav\c5\00\87\f9\17\00Ik}\00\1d'\ba\00\96i)\00\c6\cc\ac\00\ad\14T\00\90\e2j\00\88\d9\89\00,rP\00\04\a4\be\00w\07\94\00\f30p\00\00\fc'\00\eaq\a8\00f\c2I\00d\e0=\00\97\dd\83\00\a3?\97\00C\94\fd\00\0d\86\8c\001A\de\00\929\9d\00\ddp\8c\00\17\b7\e7\00\08\df;\00\157+\00\5c\80\a0\00Z\80\93\00\10\11\92\00\0f\e8\d8\00l\80\af\00\db\ffK\008\90\0f\00Y\18v\00b\a5\15\00a\cb\bb\00\c7\89\b9\00\10@\bd\00\d2\f2\04\00Iu'\00\eb\b6\f6\00\db\22\bb\00\0a\14\aa\00\89&/\00d\83v\00\09;3\00\0e\94\1a\00Q:\aa\00\1d\a3\c2\00\af\ed\ae\00\5c&\12\00m\c2M\00-z\9c\00\c0V\97\00\03?\83\00\09\f0\f6\00+@\8c\00m1\99\009\b4\07\00\0c \15\00\d8\c3[\00\f5\92\c4\00\c6\adK\00N\ca\a5\00\a77\cd\00\e6\a96\00\ab\92\94\00\ddBh\00\19c\de\00v\8c\ef\00h\8bR\00\fc\db7\00\ae\a1\ab\00\df\151\00\00\ae\a1\00\0c\fb\da\00dMf\00\ed\05\b7\00)e0\00WV\bf\00G\ff:\00j\f9\b9\00u\be\f3\00(\93\df\00\ab\800\00f\8c\f6\00\04\cb\15\00\fa\22\06\00\d9\e4\1d\00=\b3\a4\00W\1b\8f\006\cd\09\00NB\e9\00\13\be\a4\003#\b5\00\f0\aa\1a\00Oe\a8\00\d2\c1\a5\00\0b?\0f\00[x\cd\00#\f9v\00{\8b\04\00\89\17r\00\c6\a6S\00on\e2\00\ef\eb\00\00\9bJX\00\c4\da\b7\00\aaf\ba\00v\cf\cf\00\d1\02\1d\00\b1\f1-\00\8c\99\c1\00\c3\adw\00\86H\da\00\f7]\a0\00\c6\80\f4\00\ac\f0/\00\dd\ec\9a\00?\5c\bc\00\d0\dem\00\90\c7\1f\00*\db\b6\00\a3%:\00\00\af\9a\00\adS\93\00\b6W\04\00)-\b4\00K\80~\00\da\07\a7\00v\aa\0e\00{Y\a1\00\16\12*\00\dc\b7-\00\fa\e5\fd\00\89\db\fe\00\89\be\fd\00\e4vl\00\06\a9\fc\00>\80p\00\85n\15\00\fd\87\ff\00(>\07\00ag3\00*\18\86\00M\bd\ea\00\b3\e7\af\00\8fmn\00\95g9\001\bf[\00\84\d7H\000\df\16\00\c7-C\00%a5\00\c9p\ce\000\cb\b8\00\bfl\fd\00\a4\00\a2\00\05l\e4\00Z\dd\a0\00!oG\00b\12\d2\00\b9\5c\84\00paI\00kV\e0\00\99R\01\00PU7\00\1e\d5\b7\003\f1\c4\00\13n_\00]0\e4\00\85.\a9\00\1d\b2\c3\00\a126\00\08\b7\a4\00\ea\b1\d4\00\16\f7!\00\8fi\e4\00'\ffw\00\0c\03\80\00\8d@-\00O\cd\a0\00 \a5\99\00\b3\a2\d3\00/]\0a\00\b4\f9B\00\11\da\cb\00}\be\d0\00\9b\db\c1\00\ab\17\bd\00\ca\a2\81\00\08j\5c\00.U\17\00'\00U\00\7f\14\f0\00\e1\07\86\00\14\0bd\00\96A\8d\00\87\be\de\00\da\fd*\00k%\b6\00{\894\00\05\f3\fe\00\b9\bf\9e\00hjO\00J*\a8\00O\c4Z\00-\f8\bc\00\d7Z\98\00\f4\c7\95\00\0dM\8d\00 :\a6\00\a4W_\00\14?\b1\00\808\95\00\cc \01\00q\dd\86\00\c9\de\b6\00\bf`\f5\00Me\11\00\01\07k\00\8c\b0\ac\00\b2\c0\d0\00QUH\00\1e\fb\0e\00\95r\c3\00\a3\06;\00\c0@5\00\06\dc{\00\e0E\cc\00N)\fa\00\d6\ca\c8\00\e8\f3A\00|d\de\00\9bd\d8\00\d9\be1\00\a4\97\c3\00wX\d4\00i\e3\c5\00\f0\da\13\00\ba:<\00F\18F\00Uu_\00\d2\bd\f5\00n\92\c6\00\ac.]\00\0eD\ed\00\1c>B\00a\c4\87\00)\fd\e9\00\e7\d6\f3\00\22|\ca\00o\915\00\08\e0\c5\00\ff\d7\8d\00nj\e2\00\b0\fd\c6\00\93\08\c1\00|]t\00k\ad\b2\00\cdn\9d\00>r{\00\c6\11j\00\f7\cf\a9\00)s\df\00\b5\c9\ba\00\b7\00Q\00\e2\b2\0d\00t\ba${'$'}\00\e5}`\00t\d8\8a\00\0d\15,\00\81\18\0c\00~f\94\00\01)\16\00\9fzv\00\fd\fd\be\00VE\ef\00\d9~6\00\ec\d9\13\00\8b\ba\b9\00\c4\97\fc\001\a8'\00\f1n\c3\00\94\c56\00\d8\a8V\00\b4\a8\b5\00\cf\cc\0e\00\12\89-\00oW4\00,V\89\00\99\ce\e3\00\d6 \b9\00k^\aa\00>*\9c\00\11_\cc\00\fd\0bJ\00\e1\f4\fb\00\8e;m\00\e2\86,\00\e9\d4\84\00\fc\b4\a9\00\ef\ee\d1\00.5\c9\00/9a\008!D\00\1b\d9\c8\00\81\fc\0a\00\fbJj\00/\1c\d8\00S\b4\84\00N\99\8c\00T\22\cc\00*U\dc\00\c0\c6\d6\00\0b\19\96\00\1ap\b8\00i\95d\00&Z`\00?R\ee\00\7f\11\0f\00\f4\b5\11\00\fc\cb\f5\004\bc-\004\bc\ee\00\e8]\cc\00\dd^`\00g\8e\9b\00\923\ef\00\c9\17\b8\00aX\9b\00\e1W\bc\00Q\83\c6\00\d8>\10\00\ddqH\00-\1c\dd\00\af\18\a1\00!,F\00Y\f3\d7\00\d9z\98\00\9eT\c0\00O\86\fa\00V\06\fc\00\e5y\ae\00\89\226\008\ad\22\00g\93\dc\00U\e8\aa\00\82&8\00\ca\e7\9b\00Q\0d\a4\00\993\b1\00\a9\d7\0e\00i\05H\00e\b2\f0\00\7f\88\a7\00\88L\97\00\f9\d16\00!\92\b3\00{\82J\00\98\cf!\00@\9f\dc\00\dcGU\00\e1t:\00g\ebB\00\fe\9d\df\00^\d4_\00{g\a4\00\ba\acz\00U\f6\a2\00+\88#\00A\baU\00Yn\08\00!*\86\009G\83\00\89\e3\e6\00\e5\9e\d4\00I\fb@\00\ffV\e9\00\1c\0f\ca\00\c5Y\8a\00\94\fa+\00\d3\c1\c5\00\0f\c5\cf\00\dbZ\ae\00G\c5\86\00\85Cb\00!\86;\00,y\94\00\10a\87\00*L{\00\80,\1a\00C\bf\12\00\88&\90\00x<\89\00\a8\c4\e4\00\e5\db{\00\c4:\c2\00&\f4\ea\00\f7g\8a\00\0d\92\bf\00e\a3+\00=\93\b1\00\bd|\0b\00\a4Q\dc\00'\ddc\00i\e1\dd\00\9a\94\19\00\a8)\95\00h\ce(\00\09\ed\b4\00D\9f \00N\98\ca\00p\82c\00~|#\00\0f\b92\00\a7\f5\8e\00\14V\e7\00!\f1\08\00\b5\9d*\00o~M\00\a5\19Q\00\b5\f9\ab\00\82\df\d6\00\96\dda\00\166\02\00\c4:\9f\00\83\a2\a1\00r\edm\009\8dz\00\82\b8\a9\00k2\5c\00F'[\00\004\ed\00\d2\00w\00\fc\f4U\00\01YM\00\e0q\80\00\00\00\00\00\00\00\00\00\00\00\00@\fb!\f9?\00\00\00\00-Dt>\00\00\00\80\98F\f8<\00\00\00`Q\ccx;\00\00\00\80\83\1b\f09\00\00\00@ %z8\00\00\00\80\22\82\e36\00\00\00\00\1d\f3i5\00\00\00\00\00\00\e0?\00\00\00\00\00\00\e0\bf\00\00\00\00\00\00\f0?\00\00\00\00\00\00\f8?\00\00\00\00\00\00\00\00\06\d0\cfC\eb\fdL>\00\00\00\00\00\00\00\00\00\00\00@\03\b8\e2?")) +""" \ No newline at end of file diff --git a/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt new file mode 100644 index 000000000..307b06e4a --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/kscience/kmath/ast/RealWasmBuilder.kt @@ -0,0 +1,61 @@ +package kscience.kmath.ast + +import binaryen.readBinary +import kscience.kmath.operations.* + +private const val ARGS_PTR = 0 +private const val ARGS_SIZE = 1 + +public fun compileMstToWasmF64(mst: MST) { + val keys = mutableListOf() + + val bin = with(readBinary(rt)) { + fun MST.visit(): binaryen.ExpressionRef = when (this) { + is MST.Symbolic -> { + var idx = keys.indexOf(value) + + if (idx == -1) { + keys += value + idx = keys.lastIndex + } + + f64.load(idx * Double.SIZE_BYTES, 0, local.get(ARGS_PTR, binaryen.i32)) + } + + is MST.Numeric -> f64.const(value) + + is MST.Unary -> when (operation) { + SpaceOperations.MINUS_OPERATION -> f64.neg(value.visit()) + SpaceOperations.PLUS_OPERATION -> value.visit() + PowerOperations.SQRT_OPERATION -> f64.sqrt(value.visit()) + TrigonometricOperations.SIN_OPERATION -> call("sin", arrayOf(value.visit()), binaryen.f64) + else -> throw UnsupportedOperationException() + } + + is MST.Binary -> when (operation) { + SpaceOperations.PLUS_OPERATION -> f64.add(left.visit(), right.visit()) + RingOperations.TIMES_OPERATION -> f64.mul(left.visit(), right.visit()) + FieldOperations.DIV_OPERATION -> f64.div(left.visit(), right.visit()) + else -> throw UnsupportedOperationException() + } + } + + addFunction( + "executable", + binaryen.createType(arrayOf(binaryen.i32, binaryen.i32)), + binaryen.f64, + arrayOf(), + mst.visit() + ) + + setMemory(0, 10000) + addFunctionExport("executable", "executable") + optimize() + + if (!validate().unsafeCast()) + error("Invalid module produced.") + + println(emitText()) + emitBinary() + } +} diff --git a/kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es2015.iterable.kt b/kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es2015.iterable.kt new file mode 100644 index 000000000..4dd4dc696 --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es2015.iterable.kt @@ -0,0 +1,31 @@ +@file:Suppress( + "INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", + "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", + "KDocMissingDocumentation" +) + +package tsstdlib + +external interface IteratorYieldResult { + var done: Boolean? + get() = definedExternally + set(value) = definedExternally + var value: TYield +} + +external interface IteratorReturnResult { + var done: Boolean + var value: TReturn +} + +external interface Iterator { + fun next(vararg args: Any /* JsTuple<> | JsTuple */): dynamic /* IteratorYieldResult | IteratorReturnResult */ + val `return`: ((value: TReturn) -> dynamic)? + val `throw`: ((e: Any) -> dynamic)? +} + +typealias Iterator__1 = Iterator + +external interface Iterable + +external interface IterableIterator : Iterator__1 \ No newline at end of file diff --git a/kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es5.kt b/kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es5.kt new file mode 100644 index 000000000..f806c21bc --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/tsstdlib/lib.es5.kt @@ -0,0 +1,37 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", + "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "DEPRECATION", "KDocMissingDocumentation", "PropertyName", + "PropertyName", "Reformat" +) +package tsstdlib + +import org.khronos.webgl.ArrayBuffer +import org.khronos.webgl.Uint8Array + +external interface ArrayLike { + var length: Number + @nativeGetter + operator fun get(n: Number): T? + @nativeSetter + operator fun set(n: Number, value: T) +} + +external interface ArrayBufferTypes { + var ArrayBuffer: ArrayBuffer +} + +external interface ArrayBufferConstructor { + var prototype: ArrayBuffer + fun isView(arg: Any): Boolean +} + +external interface Uint8ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Uint8Array + fun from(arrayLike: Iterable): Uint8Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Uint8Array + var prototype: Uint8Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Uint8Array + fun from(arrayLike: ArrayLike): Uint8Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Uint8Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Uint8Array +} diff --git a/kmath-ast/src/jsMain/kotlin/wasm.d.ts b/kmath-ast/src/jsMain/kotlin/wasm.d.ts new file mode 100644 index 000000000..34a92f928 --- /dev/null +++ b/kmath-ast/src/jsMain/kotlin/wasm.d.ts @@ -0,0 +1,2 @@ +import * as binaryen from "./index"; +export = binaryen; diff --git a/kmath-ast/src/jsMain/resources/main.wasm b/kmath-ast/src/jsMain/resources/main.wasm new file mode 100644 index 0000000000000000000000000000000000000000..dd3fc3bfbfe2abd2bcf1494bcb0786ae10c73b7b GIT binary patch literal 17961 zcmc(H2YeLO7WaQSltI`yN(2FDsD^1ad3fOodQcVJc&J!e|h@fHtlwx5w zpdgBhqSzpzDxiWq3y5GWsOVF`ic<3Z&z+ggg6R7_{l4EfYi91;x%b@D&%NhfLEf0* z8UQWJHvkx*P1Yt4&?n2?T`ZSY%vZS^llhQuayQf$BeO0vb?Ju7ZIv|LqiHOASy99) zx1mAz)HI5qVs7rBys>$? zgGUT9^u$92b=hDiK~2$$^~rjU{7kG1YMsql%R`mCyrY78sHCL4(&&*4Qx!`l=bPH{ z(U&D_VbZ5A6DFcdQ~j#HE*(!9mnS1!yGi)kYU%-C(H)**9a?(5GBDj5-|Lxk?OZeOvtH{pw=1JWX8Vynr$LRbR?eSB}!m1%Gm60 z3+?aG=BU$akw{e0=%1ibn{%kgom+|)r;ZA0p-M0Hv5KZL#SRKwBov7(iKL~A_L^E~ zp-(krtwVpAw2A3SS!4;nEsdn5Q9F>97CzkWw^N;)evuvV?{+CeGHgTo`^H40aZE{> zUQRwuvE+N>s$|^+W#y=@iA86qrJyXo|Ifmq-D63>MdY9V;x%z0dd#>?7k@^nrIuAP zj0TWI9j$U54&#g3iaClTg3{Ce{eAizK!4R^m>^y@Rfn?8IB(!K-4XEyE?QryL!mf5 zeo$`09a*XrHX3z&&Y|o`0Hks;TPcI|@6%jbvAAb#^7#m*6$G^l$b)r3y|Z{{bzyp0 z0G8*CDZCL{; zi>bwot*Be1o#CS^4W;D^@R%xo3eK{?QNW9oq zPZA5GVOgvtBGPn6rGzzATp&d@jpJciBt|oX%+dft2)IR?rR$s$muhcw>sValV+>PJ zmqa0U)7ecIBd}}Z+S)BNw$Ne@fF4S^83DJl5D}5b^ppm@ru_?FQkZ{ncui?pX?XF; z16MaWuu9_L@Wo@F`Tp7Gr8p|%{8L*;y(Y!Y-z;3TXwfznO^?&x^oG+v41U&r)qO8{9-BB`qj7((+%H+LK|BL^F87QT3Jiie-sXV_CI>4u9 z8dU;5jm3<2QOg?B(rvag!dt2=GFDCpRdSN%)b;qLXVdVxnr2LP#KlePS=8ifM?YB;);R(GrWE5`bTSkUnp&0rY87i&R>`9fv@3x(_{?KnL z)=_|~*Q|T=yFe$lUUl`uC09+EyI$DO!L`z8B;ucu;qlU)B=XO;yk}hnK{rj45JR`+ zhiVTGdO|Sy*E2Kd4Gk;I5BSJbS4bZlD);3#)DcXe6DiIQ>iHpbr$O*FKafaC>IDJa z^oF#2(N29vf!SFG=1_hPWx6>mVOnUVNTU=p(M;&B@F7}>rk)Jyl8{MGSbse; z*@tb@>eTgzYMIFefz(iKd8Dybg^|y8I`N#GA4s<BM7nI=hXFrM|Ijwpy$#ifo z&n|t~#>6cDBTQ7kYHFc7C8XsY@LftSf4zTM;w)GO|t&)Qw?Tkv$}&jp2~gvZ`7jFWE?PojD%I z3e~a!N&uz|DL(ehuw_TB3#3pb1*?ExLXtO-=(IEaGK?0;5Q=?)L|Oy&&tIVM74y)| z6j9a`(r@?`RQ30&p{>D5`HJT)~dj zEK~zJsj~H6@y_&*=DRMoFUe20Q-f}RUWeq!U(Za_Q$W1vdFYRcHNEh=%Cp%H(xF65Z8rtSzevkC@Bydkwd9O zK3jeL5(-XZ8(~-h&`eP}O>$M-<9MQ(q(7hwuS`8?6a+HjRFK#yQ_*wyT_RoNTs8Be zy2w+7Kfjr9B^`nt1^s454@Ne>C>%+r76{D|#`O%P^D0KCs5nbQp>P;kLlCrVCnHR@ zew;THQwwFz?xH8-tI;jlTZLUF6^k6RLb!~e$O$U?b)NrDFk+DK!*~fAwpJ_>6Q7_6}6P}4|EU8#35I1I$C26uN zE-c6KgqCSTGX5?kx8GTafD;tXf{8wbQa4j*P=qPJe}|BuPD?-`-s(OFWr~R#s+@3LW2cLDytq?uqB_vetf7 ze-CMp;EQ_=k#BhRPFq_3oqAK%UTR z$3Kvw%vw)8x1+=*19Fr^dz5CyllNB3kx{nKpSS$}ltX8X6040H zzp-t2v)s>P>*KavBDPtz-9&~tj4b0k(Z@Ba!^_fOf{mvqRAW5Db5$y^Ae7!c;I=)J zH$G@Nb7PO`wx^Qbm5e!V@#vZ<;DG^3R80IvgMLPgrfaFd%0-|O@w2Eb>hb%LkEQoiy zlLL8n17?&35l@;EV%-vA&k$6dI6)mbtDsn0HEL)wN7brySQ4oY-`Aa0hu6jT)=ul4 zP+rx$;;g+{8#lJj-dHJF4hGP*VlZhUNvaA>2I?vbQ9ALoJ7Sf5$r+t%6U>=i+Zm=J z&VqI`EkI}5N}QFO6IU*%sjGYn39oHp~voaTbtETFd1u80STRVfwSZy4Y z%+K4s#gOX6@#x4Iy)AubZCr0xs$US5X>eLT2^0$meLW#xO&&v9nvd8@6b*okqb`V6 z!VWjA_o--OdmNHiU?F4Kyxz$0iPyD0n{NL@lHMQ>oo$>_?!bg6zqj*-_InRrS{nZ5 z;fwD4;@}NTKbYJa3Ey^Vb-&N*z0QQjdwCm}+Gs2ZjmM9rrKhJ)&5lHvCuX|1RIJm~ z1u+gE?xFG>Te1a$X3Lm~8P1^PdrN=y&xcE(vGrQ)Cw+VIgri;V`u zU)fpN$XU$q*r+3G}YelUolN6$NHcQ=u{y51O-ei z>CqwLO*+}`B2pR+dL5lc4&%d8(;ap6h?+wBmGk3+t2553ZGn0Hdp&AXLN9jx;iiP6 z8S&3EwdA*5bEf@QEm0Gvc=cE<>LC+4L*|O&N))?@FH`4~xy`S2ls8>G8yU7lkCZ6| zq3M0DJeX`ba5qEE+NyRl!Z8sCJa)&5GU|_!Eczo_B@2u=ZM=-AI1bHHLbWU6;8iAg zX;pY#O1#wWUEDa%)Vv~_fm=960lOnXcf3|PLE0rj+O713+TwP|y|k1QF^L8?JE%P} z3E)1O>4|a{#k-|EF;uxZ@1;(uCh8t;vMFK2+LL##FAcZ5`iq&{ckYt>_}YCdAFcCt z4bhz2`$}J~R>CIo& zx#i3<^2`-#CvGQh9LGsIgB8<%a;r#ui?3^@U3+_ zGKA@kLPlGs$KZ%P9Il0x{>V;7&{&u)b({~cm2HJ{0n;Qmf}3+7Z0)+;eS*|PPdrZQ^w3` zi-Q%G`e$1KQgZ@ifa)WAvYazHlNFJksdERH+%-bK&iMKiW0Dk=zc8F4C7$w;dTF|u#yT^>weozJpc z&TOqH;1i)szeM#xNk1WkZd|A+73eyOo!nL5Jd!-L-)a1UxfbDKhg$%mkV+|ip<+sw z>mSMb5c(oX$VdyjqdLUqrXDcWCZJ00WQf*6vPyd1XC`qMXnZg!q>U;FF{5qz$C{q5 znE^?ZSs4KZ$)h^BL-SMz&v<4ktqyE9)^w{5F@$3H!Xit~&LxmVvZ<)tn7C&xrq6Vr z#XZ$g1qWf-onhq_jN~*2anrn*BB7M%s^Sd9)D}Cv$!e7$RE;Z{ZDr#nv8GH&LtGq> zHs}tXzkiw{vP5CIAj%;}D}22oKF3V51IZkU95*CUEK3%@ph<-ak|>T5YiR0AxfFE~ ztxT?eR3DX67no#;oFz2%#cU#QT zobFTww{VSM)I^K%${r%83%B^y8Z(d>x}5PvQxhv0P`n5;g-Y zo@@&QQ%s+VY@|j^RlHp=mDn9o3xi-L=%XpTYTOPlDKS+nEeqBtjj}~5_qNiaQ7-g@sSLSt-a!Bg zRO=T$eC1_58&28IxHov;ws}2gz9qp<3)OpKz}R=B*sK1%z5Dc$^C#iTCr9pkarizd z8ZG4djKxSWEmC!UlengHP>#So;h3NHl}F6##3B;Z?-3iS#=53(Nbs1FDtIoXyvG~lh2@~GKV6sR7#J8 z6BmuC6(U4dM1mU8ptE1@q)nCDTfSfU^cgP6ZK~q&N%^K*S@T&W6v-7NBij0VLl9(A-o3G;N~5oY*rSkZLb^3_YO9!jlg*tKfjv z3W_Th{eR6NGV=T``PH_H^E?b`iprFuhuR;D%M+<;*=iB2t)r3*rDUMPC?JH>l6>;* zFXa@^NEQ+f4@+^+bfG}m3=^F226hNacf8Y!eg!(uy4n>ADE(e zd~Tb_tSL1lR%wI3|9(%nixe9geYXXN50_$__dPRy9Q2?RZ#^aHiVa-B@PLH#3%`47 z+1R4S$2*mV4=q2EmHJXOX*w)zPTgPXH08QP zzN$d$HMOc2pA*Mq6(&bcxsOKR5rXIF3>p3nnx+@W(zUi5`I9_81!C8{{%YN;XsXB36#v>7WiJS8bLb$&P&xMP=jI zJEcl^YF@335Aln5CYl5;kLkv>SIw!_YVjyb<}(j_pU`z#Ns=^sb4P0rj>;n_T#y&@ ze<_kzJ*1XsWMg~i{K$vKrTA_3XCpKv*3dqV&K9(A9{F+rBq&rv1kGbm4A}%vYRp~g;Z~LXs!F$h!06PO|(DjA)W)Z8`hCwREsq0 zkz_q;SP$+k@`S3@SPu<~l?r2}A_o+)cZ~|w9?h9WP!E{`S6dbINKVN!gGoHYbms>& zBZtiOv{8FeJoI9hxW#9eYR5_@TXXaQ5(LkqKjr$Be=BNfoa*@eky=;1n&%$+)c$Pi zl>DLWhkl;A+dt;8{r+qAr-LsE7GHF0N9%vnn%Z&Qjw83u@)p_e_jfb^xa>a`&<5moA;HY~$r*-{J(XxMrWZV(=Gfl1Cbq2@gGrwbK*8PRsI$2n-Ws|I315AL>!&xy zUE??7@pB$T_?i8v)9)QT*2xXGw-PO;WMgC2S6Fz}0la!!7V2NR3Fj6Z#*$O6u~n>XU(ULho*KW5(66`zf2 zf`_&)MvI$)HM=Kc&GH3k)8{>W(CKF^O{Dd4!nQo1l(}#`M`NE<7i?g>b(6imNc)#kaP2~s9zqQI^GRaiuWKm zcrCKNnvE~Y2H^1Kw@}zR0sXVzMaF>-a9xK3IPlP1><%_W!<)9ZR+>-H@8KFdJG zZ97n_{2%zC-g4BgxDidOx5V^nH)DEt4L{v;BUU|IjB^itkM2FYAZ_Tsv2y<&Je}Ja z`FU?6vEefOd(j$r9{(OUO(@3Fjnk3WaTe|zGZD|+eFH{*untWgABZ2zc3{rb!>GSu zDEe%_4BPj%M#B}mu`zEBs%@J9SN$5O*7YH5zJ4>_*b+vs=k5n;{eXA7tU{w62XXSf zG+_M+oIC$b6utc&s(1Pc|2bNM=fB*9*N-*CJokKT7}W_)6P}0vvL7(3+QWF#oP?$? zEJ3%q8!;*C5+wB*j?v5SL&2Blq4|yn@vn@Y2>t6*{P^)~d^LXoKK)__7BydhS>F~Q zH@7ujJ(+^;i`QW2vOAUR3H<-TFK_`B=S zZRLF!`=yR`?_YplZhIUfx{t<^jKjER{^MA4|Ic{mn%>x%_&v;pE%4LjQ}EotVc6d( z7dib6+&;S)eXeeVHiODBd`}v(x@Y0WE5_l%3V7D$<27rooBM7^aO@yxeRQ4_xfJ=ptsJzVn)z?Gd3q5Aq|XmS1v zII^-Xt{S`oyEi-re|9QvocI>b|8+bj-Q~jUTBEV`@oO-0#HTp?4e(IU>#+I5wOBdi z6^!4x6YuEtu=;2d+`VW6Hm#a~ncY9cFa0CfTJj^FI&um2|7S6>Z+Z>84h+YAub+p; z`(DJ-3mKK4S&UWJ%)^WQTxir}4K6R4f)BmRF@9wVCS4yzMzzNHXl)bxcJL%-?>mLr z>rdkI@rCd_aRQx6ig5dgnmBn!B^q|}B5!C5G_E}pz1DqAdwK@<4j+LBhPFfVvKuku zgYIbdaRy#*(ghdhwZgWdx6y3JODHQmiDf8-yYO?|us?#p$Zoi~+HSmj(+m{l^*}-2 z3M{%>!$118!MX3PMT?`GQGG-%`ZxO=w>NzP^`6^=XjW_Z)-J=>tLdYD3EY;c{s2Ba*%$>EzKBV)Tf+UrDZE_vD2C-^me?(q~nFnSY~dODyyrxiROO+v+GZ{o^Ezv2DuZ{VvRLYO@003I5& z2Yc5y$Fc>RFyXp)am#00aOA`4c%^+ubgkVLea7Wt_qv}jV(wNv)wDlS!r$VYPMwjr z`3^KXc?e&={{w=Pw`1h}t>CNJg31r(U_}0>c=qI0%=2x)iyFFTCAjNSj)TOD`3@-j9rIDzIX8sO-NO_;x>HTJCNi#01=z|J>QP;GV-jO^DE z7x$fwMQ?wG_sy44@XwX#)c9ef=e~)P{+{^c$K$xC!*F~$^I{x&cLq+Zc>;&Odk0Nh zZNnw)^3XOAM&{l(F!e+tj`z&RCFktHHEU+z%0+kM+TfdL+~*^dZ+##BIuD|5(M!1H zfkCK$!vJJo{T+(aQ}N>q={T|DC$xO63ID#sSN-3_{(la@(0d-j+!lwit=3D(yY3-; z((g6&p1u`(I;CO%sP1TT&VD>oJBq-?U2**nA7JmT3-Rc+<+y6*Z|LhefrI~g8nc6~ z(RNi3L+5>jK3}cGwEAta{mX~AnYj#$TCBzsAEe+GcXtea?g)x!Eyt`Y7U0)+S|c#` zc}$wt6AO0+khA0?eAKNEJ{j8{L%->aQ;&R%f4-ZGNkf<6m8Wh+pPx%{(JZb-Ug?AD zNB9tEJQMA@O~>rdzQDmp-$jq(IjHP=2j{rfPn<7}+h{5cNpn}p5nH=_QJU*ngd z)PcEW7`*f%Tsm(x)=lcOEA4O ziqYQ=N4q(wqE?>8rQkoW1CN80h3V_tY`TX_#o`>ZvesQ1Gyt>g(*sQ!GGS?@>e_ha@G z@a)>z<(rdN2z=+tF<$yK8~^dTM&u12tZmWiQlWDv@L!V19hg^Gm^*On$kAgoSKh#p zV|2INhZ(NCF}I9xx#d30?czV}Fv8=O`!KINH13T#c^vHyw!FI26g1$pcpfFtp2d4E}*%g7d6xL!e+W&*xb+yvs`*% z3te|=4Ubcb|L)ccTe{BL)9w4C_8z^kl~*rp?Kx{duU%WzoZ~bj9?gkImam=#O=^p> z485p@OD}54(VG!kb3)7V5!(b}lSt@(LQm2Q+a&9SZBz8ZcBw{T^JZjH^XBQiWmV&? zMRnd<*5IvGP2O5(@YbdlZ*6Py)~=3GnANN