diff --git a/src/compiler.ts b/src/compiler.ts index 249d351a..5ea69994 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -3027,6 +3027,15 @@ export class Compiler extends DiagnosticEmitter { } break; + case Token.TYPEOF: + // it might make sense to implement typeof in a way that a generic function can detect whether + // its type argument is a class type or string. that could then be used, for example, to + // generate hash codes for sets and maps, depending on the kind of type parameter we have. + // ideally the comparison would not involve actual string comparison and limit available + // operations to hard-coded string literals. + this.error(DiagnosticCode.Operation_not_supported, expression.range); + throw new Error("not implemented"); + default: this.error(DiagnosticCode.Operation_not_supported, expression.range); throw new Error("unary operator expected"); diff --git a/src/tokenizer.ts b/src/tokenizer.ts index ef5d2b3e..dae74f32 100644 --- a/src/tokenizer.ts +++ b/src/tokenizer.ts @@ -309,6 +309,7 @@ export namespace Token { case Token.AS: case Token.CONSTRUCTOR: case Token.DECLARE: + case Token.DELETE: case Token.FROM: case Token.GET: case Token.IS: diff --git a/std/assembly.d.ts b/std/assembly.d.ts index 17061ba0..09d9db95 100644 --- a/std/assembly.d.ts +++ b/std/assembly.d.ts @@ -271,6 +271,14 @@ interface Number {} interface Object {} interface RegExp {} +declare class Set { + readonly size: i32; + has(value: T): bool; + add(value: T): void; + delete(value: T): bool; + clear(): void; +} + // Internal decorators /** Annotates an element as a program global. */ diff --git a/std/assembly/heap.ts b/std/assembly/heap.ts index 1a865ea6..c1fc71ea 100644 --- a/std/assembly/heap.ts +++ b/std/assembly/heap.ts @@ -214,7 +214,7 @@ export function set_memory(dest: usize, c: u8, n: usize): void { // based on musl's implementation of memset // becomes obsolete once https://github.com/WebAssembly/bulk-memory-operations lands - // fill head and tail wwith minimal branching + // fill head and tail with minimal branching if (!n) return; store(dest, c); diff --git a/std/assembly/set.ts b/std/assembly/set.ts index 14792627..6ce9d04a 100644 --- a/std/assembly/set.ts +++ b/std/assembly/set.ts @@ -1,3 +1,60 @@ +// const prime1: u32 = 73; +// const prime2: u32 = 5009; + export class Set { - // TODO + + private __memory: usize; + private __capacity: u32; + private __size: u32; + + constructor() { + this.__memory = 0; + this.__capacity = this.__size = 0; + } + + get size(): i32 { + return this.__size; + } + + // FIXME: not a proper set implementation, just a filler + + has(value: T): bool { + for (var index: usize = 0, limit: usize = this.__size; index < limit; ++index) + if (load(this.__memory + index * sizeof()) == value) + return true; + return false; + } + + add(value: T): Set { + if (this.__size >= this.__capacity) { + var newCapacity = max(this.__capacity << 1, 8); + var newMemory = allocate_memory(newCapacity * sizeof()); + if (this.__memory) { + move_memory(newMemory, this.__memory, this.__capacity * sizeof()); + free_memory(this.__memory); + } + this.__capacity = newCapacity; + this.__memory = newMemory; + } + store(this.__memory + this.__size * sizeof(), value); + ++this.__size; + return this; + } + + delete(value: T): bool { + for (var index: usize = 0, limit: usize = this.__size; index < limit; ++index) + if (load(this.__memory + index * sizeof()) == value) { + if (index + 1 < this.__size) + move_memory(this.__memory + index * sizeof(), this.__memory + (index + 1) * sizeof(), this.__size - index - 1); + --this.__size; + return true; + } + return false; + } + + clear(): void { + this.__size = 0; + } + + // TODO: think about iterators } diff --git a/std/portable.d.ts b/std/portable.d.ts index 84a4668d..a4dfe478 100644 --- a/std/portable.d.ts +++ b/std/portable.d.ts @@ -214,14 +214,16 @@ declare class Symbol { declare class Set { constructor(entries?: T[]); - add(value: T): void; has(value: T): bool; + add(value: T): void; + delete(value: T): bool; clear(): void; [Symbol.iterator](): Iterator; } declare class Map { constructor(entries?: [K, V][]); + readonly size: i32; set(key: K, value: V): void; has(key: K): bool; get(key: K): V | null; diff --git a/tests/compiler/std/array.wast b/tests/compiler/std/array.wast index 7d096405..9f5d4027 100644 --- a/tests/compiler/std/array.wast +++ b/tests/compiler/std/array.wast @@ -4086,6 +4086,7 @@ CLASS_PROTOTYPE: RegExp CLASS_PROTOTYPE: std:set/Set CLASS_PROTOTYPE: Set + PROPERTY: std:set/Set#size GLOBAL: std:string/EMPTY CLASS_PROTOTYPE: std:string/String CLASS_PROTOTYPE: String diff --git a/tests/compiler/std/carray.wast b/tests/compiler/std/carray.wast index b8a276d0..d9dfafa7 100644 --- a/tests/compiler/std/carray.wast +++ b/tests/compiler/std/carray.wast @@ -279,6 +279,7 @@ CLASS_PROTOTYPE: RegExp CLASS_PROTOTYPE: std:set/Set CLASS_PROTOTYPE: Set + PROPERTY: std:set/Set#size GLOBAL: std:string/EMPTY CLASS_PROTOTYPE: std:string/String CLASS_PROTOTYPE: String diff --git a/tests/compiler/std/heap.wast b/tests/compiler/std/heap.wast index 4810c28b..f795044d 100644 --- a/tests/compiler/std/heap.wast +++ b/tests/compiler/std/heap.wast @@ -2870,6 +2870,7 @@ CLASS_PROTOTYPE: RegExp CLASS_PROTOTYPE: std:set/Set CLASS_PROTOTYPE: Set + PROPERTY: std:set/Set#size GLOBAL: std:string/EMPTY CLASS_PROTOTYPE: std:string/String CLASS_PROTOTYPE: String diff --git a/tests/compiler/std/set.optimized-inlined.wast b/tests/compiler/std/set.optimized-inlined.wast new file mode 100644 index 00000000..2b83a915 --- /dev/null +++ b/tests/compiler/std/set.optimized-inlined.wast @@ -0,0 +1,2371 @@ +(module + (type $ii (func (param i32) (result i32))) + (type $iiiv (func (param i32 i32 i32))) + (type $iv (func (param i32))) + (type $iii (func (param i32 i32) (result i32))) + (type $v (func)) + (global $std:heap/HEAP_OFFSET (mut i32) (i32.const 0)) + (global $std/set/set (mut i32) (i32.const 0)) + (global $HEAP_BASE i32 (i32.const 4)) + (memory $0 1) + (export "memory" (memory $0)) + (start $start) + (func $std:heap/allocate_memory (; 0 ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (if + (i32.eqz + (get_local $0) + ) + (return + (i32.const 0) + ) + ) + (set_local $1 + (current_memory) + ) + (if + (i32.gt_u + (i32.add + (get_global $std:heap/HEAP_OFFSET) + (get_local $0) + ) + (i32.shl + (get_local $1) + (i32.const 16) + ) + ) + (if + (i32.lt_s + (grow_memory + (select + (tee_local $2 + (i32.trunc_s/f64 + (f64.ceil + (f64.div + (f64.convert_u/i32 + (get_local $0) + ) + (f64.const 65536) + ) + ) + ) + ) + (tee_local $1 + (i32.sub + (i32.mul + (get_local $1) + (i32.const 2) + ) + (get_local $1) + ) + ) + (i32.gt_s + (get_local $2) + (get_local $1) + ) + ) + ) + (i32.const 0) + ) + (unreachable) + ) + ) + (set_local $1 + (get_global $std:heap/HEAP_OFFSET) + ) + (if + (block (result i32) + (set_global $std:heap/HEAP_OFFSET + (i32.add + (get_global $std:heap/HEAP_OFFSET) + (get_local $0) + ) + ) + (i32.and + (get_global $std:heap/HEAP_OFFSET) + (i32.const 7) + ) + ) + (set_global $std:heap/HEAP_OFFSET + (i32.add + (i32.or + (get_global $std:heap/HEAP_OFFSET) + (i32.const 7) + ) + (i32.const 1) + ) + ) + ) + (get_local $1) + ) + (func $std:set/Set#get:size (; 1 ;) (type $ii) (param $0 i32) (result i32) + (i32.load offset=8 + (get_local $0) + ) + ) + (func $std:heap/copy_memory (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (loop $continue|0 + (if + (if (result i32) + (get_local $2) + (i32.rem_u + (get_local $1) + (i32.const 4) + ) + (get_local $2) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + (if + (i32.eqz + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + ) + (block + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 12) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|1) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 4) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store16 + (get_local $0) + (i32.load16_u + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 2) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (block + (set_local $3 + (get_local $0) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $3 + (get_local $1) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (return) + ) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 32) + ) + (block $break|2 + (block $case2|2 + (block $case1|2 + (block $case0|2 + (block $tablify|0 + (br_table $case0|2 $case1|2 $case2|2 $tablify|0 + (i32.sub + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + (i32.const 1) + ) + ) + ) + (br $break|2) + ) + (set_local $4 + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 3) + ) + ) + (loop $continue|3 + (if + (i32.ge_u + (get_local $2) + (i32.const 17) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 5) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 9) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 13) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|3) + ) + ) + ) + (br $break|2) + ) + (set_local $4 + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 2) + ) + ) + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 18) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 6) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 10) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 14) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|4) + ) + ) + ) + (br $break|2) + ) + (set_local $4 + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $continue|5 + (if + (i32.ge_u + (get_local $2) + (i32.const 19) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 3) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 7) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 11) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 15) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 16) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (block + (set_local $3 + (get_local $0) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $3 + (get_local $1) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + ) + (func $std:heap/move_memory (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (if + (i32.eq + (get_local $0) + (get_local $1) + ) + (return) + ) + (if + (i32.and + (if (result i32) + (tee_local $3 + (i32.le_u + (i32.add + (get_local $1) + (get_local $2) + ) + (get_local $0) + ) + ) + (get_local $3) + (i32.le_u + (i32.add + (get_local $0) + (get_local $2) + ) + (get_local $1) + ) + ) + (i32.const 1) + ) + (block + (call $std:heap/copy_memory + (get_local $0) + (get_local $1) + (get_local $2) + ) + (return) + ) + ) + (if + (i32.lt_u + (get_local $0) + (get_local $1) + ) + (block + (if + (i32.eq + (i32.rem_u + (get_local $1) + (i32.const 8) + ) + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + ) + (block + (loop $continue|0 + (if + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (br $continue|0) + ) + ) + ) + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (i64.store + (get_local $0) + (i64.load + (get_local $1) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + (br $continue|1) + ) + ) + ) + ) + ) + (loop $continue|2 + (if + (get_local $2) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|2) + ) + ) + ) + ) + (block + (if + (i32.eq + (i32.rem_u + (get_local $1) + (i32.const 8) + ) + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + ) + (block + (loop $continue|3 + (if + (i32.rem_u + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 8) + ) + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|3) + ) + ) + ) + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (i64.store + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + ) + (i64.load + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + (loop $continue|5 + (if + (get_local $2) + (block + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + ) + (func $std:set/Set#add (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (if + (i32.ge_u + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (block + (set_local $2 + (call $std:heap/allocate_memory + (i32.mul + (tee_local $3 + (select + (tee_local $2 + (i32.shl + (i32.load offset=4 + (get_local $0) + ) + (i32.const 1) + ) + ) + (tee_local $3 + (i32.const 8) + ) + (i32.gt_u + (get_local $2) + (get_local $3) + ) + ) + ) + (i32.const 4) + ) + ) + ) + (if + (i32.load + (get_local $0) + ) + (block + (call $std:heap/move_memory + (get_local $2) + (i32.load + (get_local $0) + ) + (i32.mul + (i32.load offset=4 + (get_local $0) + ) + (i32.const 4) + ) + ) + (block + (block $__inlined_func$std:heap/free_memory + (set_local $4 + (i32.load + (get_local $0) + ) + ) + (nop) + ) + ) + ) + ) + (i32.store offset=4 + (get_local $0) + (get_local $3) + ) + (i32.store + (get_local $0) + (get_local $2) + ) + ) + ) + (i32.store + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (i32.load offset=8 + (get_local $0) + ) + (i32.const 4) + ) + ) + (get_local $1) + ) + (i32.store offset=8 + (get_local $0) + (i32.add + (i32.load offset=8 + (get_local $0) + ) + (i32.const 1) + ) + ) + (get_local $0) + ) + (func $std:set/Set#has (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (set_local $2 + (i32.const 0) + ) + (set_local $3 + (i32.load offset=8 + (get_local $0) + ) + ) + (loop $continue|0 + (if + (i32.lt_u + (get_local $2) + (get_local $3) + ) + (block + (if + (i32.eq + (i32.load + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + ) + (get_local $1) + ) + (return + (i32.const 1) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + (i32.const 0) + ) + (func $std:set/Set#delete (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (set_local $2 + (i32.const 0) + ) + (set_local $3 + (i32.load offset=8 + (get_local $0) + ) + ) + (loop $continue|0 + (if + (i32.lt_u + (get_local $2) + (get_local $3) + ) + (block + (if + (i32.eq + (i32.load + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + ) + (get_local $1) + ) + (block + (if + (i32.lt_u + (i32.add + (get_local $2) + (i32.const 1) + ) + (i32.load offset=8 + (get_local $0) + ) + ) + (call $std:heap/move_memory + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (i32.add + (get_local $2) + (i32.const 1) + ) + (i32.const 4) + ) + ) + (i32.sub + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (get_local $2) + ) + (i32.const 1) + ) + ) + ) + (i32.store offset=8 + (get_local $0) + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.const 1) + ) + ) + (return + (i32.const 1) + ) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + (i32.const 0) + ) + (func $start (; 7 ;) (type $v) + (local $0 i32) + (set_global $std:heap/HEAP_OFFSET + (get_global $HEAP_BASE) + ) + (set_global $std/set/set + (call $std:heap/allocate_memory + (i32.const 12) + ) + ) + (if + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (unreachable) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 1) + ) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 0) + ) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 2) + ) + ) + (if + (i32.ne + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 3) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 0) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 2) + ) + ) + (unreachable) + ) + (if + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 3) + ) + (unreachable) + ) + (drop + (call $std:set/Set#delete + (get_global $std/set/set) + (i32.const 0) + ) + ) + (if + (i32.ne + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 2) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + ) + (unreachable) + ) + (if + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 0) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 2) + ) + ) + (unreachable) + ) + (block + (block $__inlined_func$std:set/Set#clear + (set_local $0 + (get_global $std/set/set) + ) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + ) + ) + (if + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (unreachable) + ) + (if + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + (unreachable) + ) + ) +) diff --git a/tests/compiler/std/set.optimized.wast b/tests/compiler/std/set.optimized.wast new file mode 100644 index 00000000..5188948c --- /dev/null +++ b/tests/compiler/std/set.optimized.wast @@ -0,0 +1,2365 @@ +(module + (type $ii (func (param i32) (result i32))) + (type $iiiv (func (param i32 i32 i32))) + (type $iv (func (param i32))) + (type $iii (func (param i32 i32) (result i32))) + (type $v (func)) + (global $std:heap/HEAP_OFFSET (mut i32) (i32.const 0)) + (global $std/set/set (mut i32) (i32.const 0)) + (global $HEAP_BASE i32 (i32.const 4)) + (memory $0 1) + (export "memory" (memory $0)) + (start $start) + (func $std:heap/allocate_memory (; 0 ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (if + (i32.eqz + (get_local $0) + ) + (return + (i32.const 0) + ) + ) + (set_local $1 + (current_memory) + ) + (if + (i32.gt_u + (i32.add + (get_global $std:heap/HEAP_OFFSET) + (get_local $0) + ) + (i32.shl + (get_local $1) + (i32.const 16) + ) + ) + (if + (i32.lt_s + (grow_memory + (select + (tee_local $2 + (i32.trunc_s/f64 + (f64.ceil + (f64.div + (f64.convert_u/i32 + (get_local $0) + ) + (f64.const 65536) + ) + ) + ) + ) + (tee_local $1 + (i32.sub + (i32.mul + (get_local $1) + (i32.const 2) + ) + (get_local $1) + ) + ) + (i32.gt_s + (get_local $2) + (get_local $1) + ) + ) + ) + (i32.const 0) + ) + (unreachable) + ) + ) + (set_local $1 + (get_global $std:heap/HEAP_OFFSET) + ) + (if + (block (result i32) + (set_global $std:heap/HEAP_OFFSET + (i32.add + (get_global $std:heap/HEAP_OFFSET) + (get_local $0) + ) + ) + (i32.and + (get_global $std:heap/HEAP_OFFSET) + (i32.const 7) + ) + ) + (set_global $std:heap/HEAP_OFFSET + (i32.add + (i32.or + (get_global $std:heap/HEAP_OFFSET) + (i32.const 7) + ) + (i32.const 1) + ) + ) + ) + (get_local $1) + ) + (func $std:set/Set#get:size (; 1 ;) (type $ii) (param $0 i32) (result i32) + (i32.load offset=8 + (get_local $0) + ) + ) + (func $std:heap/copy_memory (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (loop $continue|0 + (if + (if (result i32) + (get_local $2) + (i32.rem_u + (get_local $1) + (i32.const 4) + ) + (get_local $2) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + (if + (i32.eqz + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + ) + (block + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 12) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|1) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 4) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store16 + (get_local $0) + (i32.load16_u + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 2) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (block + (set_local $3 + (get_local $0) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $3 + (get_local $1) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (return) + ) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 32) + ) + (block $break|2 + (block $case2|2 + (block $case1|2 + (block $case0|2 + (block $tablify|0 + (br_table $case0|2 $case1|2 $case2|2 $tablify|0 + (i32.sub + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + (i32.const 1) + ) + ) + ) + (br $break|2) + ) + (set_local $4 + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 3) + ) + ) + (loop $continue|3 + (if + (i32.ge_u + (get_local $2) + (i32.const 17) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 5) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 9) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 13) + ) + ) + ) + (i32.const 8) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|3) + ) + ) + ) + (br $break|2) + ) + (set_local $4 + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 2) + ) + ) + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 18) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 6) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 10) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 14) + ) + ) + ) + (i32.const 16) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|4) + ) + ) + ) + (br $break|2) + ) + (set_local $4 + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (loop $continue|5 + (if + (i32.ge_u + (get_local $2) + (i32.const 19) + ) + (block + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 3) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 7) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (tee_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 11) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (tee_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 15) + ) + ) + ) + (i32.const 24) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 16) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (block + (set_local $3 + (get_local $0) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $3 + (get_local $1) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + ) + ) + ) + (func $std:heap/move_memory (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (if + (i32.eq + (get_local $0) + (get_local $1) + ) + (return) + ) + (if + (i32.and + (if (result i32) + (tee_local $3 + (i32.le_u + (i32.add + (get_local $1) + (get_local $2) + ) + (get_local $0) + ) + ) + (get_local $3) + (i32.le_u + (i32.add + (get_local $0) + (get_local $2) + ) + (get_local $1) + ) + ) + (i32.const 1) + ) + (block + (call $std:heap/copy_memory + (get_local $0) + (get_local $1) + (get_local $2) + ) + (return) + ) + ) + (if + (i32.lt_u + (get_local $0) + (get_local $1) + ) + (block + (if + (i32.eq + (i32.rem_u + (get_local $1) + (i32.const 8) + ) + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + ) + (block + (loop $continue|0 + (if + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (br $continue|0) + ) + ) + ) + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (i64.store + (get_local $0) + (i64.load + (get_local $1) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + (br $continue|1) + ) + ) + ) + ) + ) + (loop $continue|2 + (if + (get_local $2) + (block + (set_local $0 + (i32.add + (tee_local $3 + (get_local $0) + ) + (i32.const 1) + ) + ) + (i32.store8 + (get_local $3) + (block (result i32) + (set_local $1 + (i32.add + (tee_local $3 + (get_local $1) + ) + (i32.const 1) + ) + ) + (i32.load8_u + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|2) + ) + ) + ) + ) + (block + (if + (i32.eq + (i32.rem_u + (get_local $1) + (i32.const 8) + ) + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + ) + (block + (loop $continue|3 + (if + (i32.rem_u + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 8) + ) + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|3) + ) + ) + ) + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (i64.store + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + ) + (i64.load + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + (loop $continue|5 + (if + (get_local $2) + (block + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + ) + (func $std:heap/free_memory (; 4 ;) (type $iv) (param $0 i32) + (nop) + ) + (func $std:set/Set#add (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (if + (i32.ge_u + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (block + (set_local $2 + (call $std:heap/allocate_memory + (i32.mul + (tee_local $3 + (select + (tee_local $2 + (i32.shl + (i32.load offset=4 + (get_local $0) + ) + (i32.const 1) + ) + ) + (tee_local $3 + (i32.const 8) + ) + (i32.gt_u + (get_local $2) + (get_local $3) + ) + ) + ) + (i32.const 4) + ) + ) + ) + (if + (i32.load + (get_local $0) + ) + (block + (call $std:heap/move_memory + (get_local $2) + (i32.load + (get_local $0) + ) + (i32.mul + (i32.load offset=4 + (get_local $0) + ) + (i32.const 4) + ) + ) + (call $std:heap/free_memory + (i32.load + (get_local $0) + ) + ) + ) + ) + (i32.store offset=4 + (get_local $0) + (get_local $3) + ) + (i32.store + (get_local $0) + (get_local $2) + ) + ) + ) + (i32.store + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (i32.load offset=8 + (get_local $0) + ) + (i32.const 4) + ) + ) + (get_local $1) + ) + (i32.store offset=8 + (get_local $0) + (i32.add + (i32.load offset=8 + (get_local $0) + ) + (i32.const 1) + ) + ) + (get_local $0) + ) + (func $std:set/Set#has (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (set_local $2 + (i32.const 0) + ) + (set_local $3 + (i32.load offset=8 + (get_local $0) + ) + ) + (loop $continue|0 + (if + (i32.lt_u + (get_local $2) + (get_local $3) + ) + (block + (if + (i32.eq + (i32.load + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + ) + (get_local $1) + ) + (return + (i32.const 1) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + (i32.const 0) + ) + (func $std:set/Set#delete (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (set_local $2 + (i32.const 0) + ) + (set_local $3 + (i32.load offset=8 + (get_local $0) + ) + ) + (loop $continue|0 + (if + (i32.lt_u + (get_local $2) + (get_local $3) + ) + (block + (if + (i32.eq + (i32.load + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + ) + (get_local $1) + ) + (block + (if + (i32.lt_u + (i32.add + (get_local $2) + (i32.const 1) + ) + (i32.load offset=8 + (get_local $0) + ) + ) + (call $std:heap/move_memory + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (i32.add + (get_local $2) + (i32.const 1) + ) + (i32.const 4) + ) + ) + (i32.sub + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (get_local $2) + ) + (i32.const 1) + ) + ) + ) + (i32.store offset=8 + (get_local $0) + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.const 1) + ) + ) + (return + (i32.const 1) + ) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + (i32.const 0) + ) + (func $std:set/Set#clear (; 8 ;) (type $iv) (param $0 i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + ) + (func $start (; 9 ;) (type $v) + (set_global $std:heap/HEAP_OFFSET + (get_global $HEAP_BASE) + ) + (set_global $std/set/set + (call $std:heap/allocate_memory + (i32.const 12) + ) + ) + (if + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (unreachable) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 1) + ) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 0) + ) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 2) + ) + ) + (if + (i32.ne + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 3) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 0) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 2) + ) + ) + (unreachable) + ) + (if + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 3) + ) + (unreachable) + ) + (drop + (call $std:set/Set#delete + (get_global $std/set/set) + (i32.const 0) + ) + ) + (if + (i32.ne + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 2) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + ) + (unreachable) + ) + (if + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 0) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 2) + ) + ) + (unreachable) + ) + (call $std:set/Set#clear + (get_global $std/set/set) + ) + (if + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (unreachable) + ) + (if + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + (unreachable) + ) + ) +) diff --git a/tests/compiler/std/set.ts b/tests/compiler/std/set.ts new file mode 100644 index 00000000..4062f369 --- /dev/null +++ b/tests/compiler/std/set.ts @@ -0,0 +1,28 @@ +// note that this doesn't test a real set implementation yet, see std/assembly/set.ts + +var set = changetype>(allocate_memory(sizeof() + 2 * sizeof())); + +assert(set.size == 0); + +set.add(1); +set.add(0); +set.add(2); + +assert(set.size == 3); + +assert(set.has(1)); +assert(set.has(0)); +assert(set.has(2)); +assert(!set.has(3)); + +set.delete(0); + +assert(set.size == 2); +assert(set.has(1)); +assert(!set.has(0)); +assert(set.has(2)); + +set.clear(); + +assert(set.size == 0); +assert(!set.has(1)); diff --git a/tests/compiler/std/set.wast b/tests/compiler/std/set.wast new file mode 100644 index 00000000..5840c819 --- /dev/null +++ b/tests/compiler/std/set.wast @@ -0,0 +1,2790 @@ +(module + (type $i (func (result i32))) + (type $ii (func (param i32) (result i32))) + (type $iiiv (func (param i32 i32 i32))) + (type $iv (func (param i32))) + (type $iii (func (param i32 i32) (result i32))) + (type $v (func)) + (global $std:heap/HEAP_OFFSET (mut i32) (i32.const 0)) + (global $std:heap/ALIGN_LOG2 i32 (i32.const 3)) + (global $std:heap/ALIGN_SIZE i32 (i32.const 8)) + (global $std:heap/ALIGN_MASK i32 (i32.const 7)) + (global $std/set/set (mut i32) (i32.const 0)) + (global $HEAP_BASE i32 (i32.const 4)) + (memory $0 1) + (export "memory" (memory $0)) + (start $start) + (func $std:heap/allocate_memory (; 0 ;) (type $ii) (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (if + (i32.eqz + (get_local $0) + ) + (return + (i32.const 0) + ) + ) + (block + (set_local $1 + (current_memory) + ) + ) + (if + (i32.gt_u + (i32.add + (get_global $std:heap/HEAP_OFFSET) + (get_local $0) + ) + (i32.shl + (get_local $1) + (i32.const 16) + ) + ) + (if + (i32.lt_s + (grow_memory + (select + (tee_local $2 + (i32.trunc_s/f64 + (f64.ceil + (f64.div + (f64.convert_u/i32 + (get_local $0) + ) + (f64.const 65536) + ) + ) + ) + ) + (tee_local $3 + (i32.sub + (i32.mul + (get_local $1) + (i32.const 2) + ) + (get_local $1) + ) + ) + (i32.gt_s + (get_local $2) + (get_local $3) + ) + ) + ) + (i32.const 0) + ) + (unreachable) + ) + ) + (block + (set_local $4 + (get_global $std:heap/HEAP_OFFSET) + ) + ) + (if + (i32.and + (block (result i32) + (set_global $std:heap/HEAP_OFFSET + (i32.add + (get_global $std:heap/HEAP_OFFSET) + (get_local $0) + ) + ) + (get_global $std:heap/HEAP_OFFSET) + ) + (i32.const 7) + ) + (set_global $std:heap/HEAP_OFFSET + (i32.add + (i32.or + (get_global $std:heap/HEAP_OFFSET) + (i32.const 7) + ) + (i32.const 1) + ) + ) + ) + (return + (get_local $4) + ) + ) + (func $std:set/Set#get:size (; 1 ;) (type $ii) (param $0 i32) (result i32) + (return + (i32.load offset=8 + (get_local $0) + ) + ) + ) + (func $std:heap/copy_memory (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (nop) + (block $break|0 + (loop $continue|0 + (if + (if (result i32) + (i32.ne + (get_local $2) + (i32.const 0) + ) + (i32.rem_u + (get_local $1) + (i32.const 4) + ) + (get_local $2) + ) + (block + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (if + (i32.eq + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + (i32.const 0) + ) + (block + (block $break|1 + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 12) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|1) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.load + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store + (get_local $0) + (i32.load + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 4) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 4) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store16 + (get_local $0) + (i32.load16_u + (get_local $1) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 2) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + (return) + ) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 32) + ) + (block $break|2 + (block $case2|2 + (block $case1|2 + (block $case0|2 + (set_local $5 + (i32.rem_u + (get_local $0) + (i32.const 4) + ) + ) + (br_if $case0|2 + (i32.eq + (get_local $5) + (i32.const 1) + ) + ) + (br_if $case1|2 + (i32.eq + (get_local $5) + (i32.const 2) + ) + ) + (br_if $case2|2 + (i32.eq + (get_local $5) + (i32.const 3) + ) + ) + (br $break|2) + ) + (set_local $3 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 3) + ) + ) + (block $break|3 + (loop $continue|3 + (if + (i32.ge_u + (get_local $2) + (i32.const 17) + ) + (block + (block + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (get_local $4) + (i32.const 8) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 5) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (get_local $3) + (i32.const 8) + ) + ) + ) + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 9) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 24) + ) + (i32.shl + (get_local $4) + (i32.const 8) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 13) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 24) + ) + (i32.shl + (get_local $3) + (i32.const 8) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|3) + ) + ) + ) + ) + (br $break|2) + ) + (set_local $3 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 2) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 18) + ) + (block + (block + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 2) + ) + ) + ) + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (get_local $4) + (i32.const 16) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 6) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (get_local $3) + (i32.const 16) + ) + ) + ) + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 10) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 16) + ) + (i32.shl + (get_local $4) + (i32.const 16) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 14) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 16) + ) + (i32.shl + (get_local $3) + (i32.const 16) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + (br $break|2) + ) + (set_local $3 + (i32.load + (get_local $1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (block $break|5 + (loop $continue|5 + (if + (i32.ge_u + (get_local $2) + (i32.const 19) + ) + (block + (block + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 3) + ) + ) + ) + (i32.store + (get_local $0) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (get_local $4) + (i32.const 24) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 7) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 4) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (get_local $3) + (i32.const 24) + ) + ) + ) + (set_local $4 + (i32.load + (i32.add + (get_local $1) + (i32.const 11) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 8) + ) + (i32.or + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + (i32.shl + (get_local $4) + (i32.const 24) + ) + ) + ) + (set_local $3 + (i32.load + (i32.add + (get_local $1) + (i32.const 15) + ) + ) + ) + (i32.store + (i32.add + (get_local $0) + (i32.const 12) + ) + (i32.or + (i32.shr_u + (get_local $4) + (i32.const 8) + ) + (i32.shl + (get_local $3) + (i32.const 24) + ) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 16) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 16) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 16) + ) + ) + ) + (br $continue|5) + ) + ) + ) + ) + (br $break|2) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 16) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 8) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 4) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 2) + ) + (block + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (if + (i32.and + (get_local $2) + (i32.const 1) + ) + (i32.store8 + (block (result i32) + (set_local $5 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + (i32.load8_u + (block (result i32) + (set_local $5 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (get_local $5) + ) + ) + ) + ) + ) + (func $std:heap/move_memory (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32) + (local $3 i32) + (if + (i32.eq + (get_local $0) + (get_local $1) + ) + (return) + ) + (if + (i32.and + (if (result i32) + (i32.ne + (tee_local $3 + (i32.le_u + (i32.add + (get_local $1) + (get_local $2) + ) + (get_local $0) + ) + ) + (i32.const 0) + ) + (get_local $3) + (i32.le_u + (i32.add + (get_local $0) + (get_local $2) + ) + (get_local $1) + ) + ) + (i32.const 1) + ) + (block + (call $std:heap/copy_memory + (get_local $0) + (get_local $1) + (get_local $2) + ) + (return) + ) + ) + (if + (i32.lt_u + (get_local $0) + (get_local $1) + ) + (block + (if + (i32.eq + (i32.rem_u + (get_local $1) + (i32.const 8) + ) + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + ) + (block + (block $break|0 + (loop $continue|0 + (if + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + (block + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + (i32.store8 + (block (result i32) + (set_local $3 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + (i32.load8_u + (block (result i32) + (set_local $3 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + ) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (block $break|1 + (loop $continue|1 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (block + (i64.store + (get_local $0) + (i64.load + (get_local $1) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + (set_local $0 + (i32.add + (get_local $0) + (i32.const 8) + ) + ) + (set_local $1 + (i32.add + (get_local $1) + (i32.const 8) + ) + ) + ) + (br $continue|1) + ) + ) + ) + ) + ) + ) + (block $break|2 + (loop $continue|2 + (if + (get_local $2) + (block + (block + (i32.store8 + (block (result i32) + (set_local $3 + (get_local $0) + ) + (set_local $0 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + (i32.load8_u + (block (result i32) + (set_local $3 + (get_local $1) + ) + (set_local $1 + (i32.add + (get_local $3) + (i32.const 1) + ) + ) + (get_local $3) + ) + ) + ) + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (br $continue|2) + ) + ) + ) + ) + ) + (block + (if + (i32.eq + (i32.rem_u + (get_local $1) + (i32.const 8) + ) + (i32.rem_u + (get_local $0) + (i32.const 8) + ) + ) + (block + (block $break|3 + (loop $continue|3 + (if + (i32.rem_u + (i32.add + (get_local $0) + (get_local $2) + ) + (i32.const 8) + ) + (block + (block + (if + (i32.eqz + (get_local $2) + ) + (return) + ) + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + ) + (br $continue|3) + ) + ) + ) + ) + (block $break|4 + (loop $continue|4 + (if + (i32.ge_u + (get_local $2) + (i32.const 8) + ) + (block + (block + (set_local $2 + (i32.sub + (get_local $2) + (i32.const 8) + ) + ) + (i64.store + (i32.add + (get_local $0) + (get_local $2) + ) + (i64.load + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + ) + (br $continue|4) + ) + ) + ) + ) + ) + ) + (block $break|5 + (loop $continue|5 + (if + (get_local $2) + (block + (i32.store8 + (i32.add + (get_local $0) + (tee_local $2 + (i32.sub + (get_local $2) + (i32.const 1) + ) + ) + ) + (i32.load8_u + (i32.add + (get_local $1) + (get_local $2) + ) + ) + ) + (br $continue|5) + ) + ) + ) + ) + ) + ) + ) + (func $std:heap/free_memory (; 4 ;) (type $iv) (param $0 i32) + ) + (func $std:set/Set#add (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (if + (i32.ge_u + (i32.load offset=8 + (get_local $0) + ) + (i32.load offset=4 + (get_local $0) + ) + ) + (block + (block + (set_local $4 + (select + (tee_local $2 + (i32.shl + (i32.load offset=4 + (get_local $0) + ) + (i32.const 1) + ) + ) + (tee_local $3 + (i32.const 8) + ) + (i32.gt_u + (get_local $2) + (get_local $3) + ) + ) + ) + ) + (block + (set_local $5 + (call $std:heap/allocate_memory + (i32.mul + (get_local $4) + (i32.const 4) + ) + ) + ) + ) + (if + (i32.load + (get_local $0) + ) + (block + (call $std:heap/move_memory + (get_local $5) + (i32.load + (get_local $0) + ) + (i32.mul + (i32.load offset=4 + (get_local $0) + ) + (i32.const 4) + ) + ) + (call $std:heap/free_memory + (i32.load + (get_local $0) + ) + ) + ) + ) + (i32.store offset=4 + (get_local $0) + (get_local $4) + ) + (i32.store + (get_local $0) + (get_local $5) + ) + ) + ) + (i32.store + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (i32.load offset=8 + (get_local $0) + ) + (i32.const 4) + ) + ) + (get_local $1) + ) + (i32.store offset=8 + (get_local $0) + (i32.add + (i32.load offset=8 + (get_local $0) + ) + (i32.const 1) + ) + ) + (return + (get_local $0) + ) + ) + (func $std:set/Set#has (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (block $break|0 + (block + (set_local $2 + (i32.const 0) + ) + (set_local $3 + (i32.load offset=8 + (get_local $0) + ) + ) + ) + (loop $continue|0 + (if + (i32.lt_u + (get_local $2) + (get_local $3) + ) + (block + (if + (i32.eq + (i32.load + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + ) + (get_local $1) + ) + (return + (i32.const 1) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (return + (i32.const 0) + ) + ) + (func $std:set/Set#delete (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + (local $3 i32) + (block $break|0 + (block + (set_local $2 + (i32.const 0) + ) + (set_local $3 + (i32.load offset=8 + (get_local $0) + ) + ) + ) + (loop $continue|0 + (if + (i32.lt_u + (get_local $2) + (get_local $3) + ) + (block + (if + (i32.eq + (i32.load + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + ) + (get_local $1) + ) + (block + (if + (i32.lt_u + (i32.add + (get_local $2) + (i32.const 1) + ) + (i32.load offset=8 + (get_local $0) + ) + ) + (call $std:heap/move_memory + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (get_local $2) + (i32.const 4) + ) + ) + (i32.add + (i32.load + (get_local $0) + ) + (i32.mul + (i32.add + (get_local $2) + (i32.const 1) + ) + (i32.const 4) + ) + ) + (i32.sub + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (get_local $2) + ) + (i32.const 1) + ) + ) + ) + (i32.store offset=8 + (get_local $0) + (i32.sub + (i32.load offset=8 + (get_local $0) + ) + (i32.const 1) + ) + ) + (return + (i32.const 1) + ) + ) + ) + (set_local $2 + (i32.add + (get_local $2) + (i32.const 1) + ) + ) + (br $continue|0) + ) + ) + ) + ) + (return + (i32.const 0) + ) + ) + (func $std:set/Set#clear (; 8 ;) (type $iv) (param $0 i32) + (i32.store offset=8 + (get_local $0) + (i32.const 0) + ) + ) + (func $start (; 9 ;) (type $v) + (set_global $std:heap/HEAP_OFFSET + (get_global $HEAP_BASE) + ) + (set_global $std/set/set + (call $std:heap/allocate_memory + (i32.add + (i32.const 4) + (i32.mul + (i32.const 2) + (i32.const 4) + ) + ) + ) + ) + (if + (i32.eqz + (i32.eq + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 0) + ) + ) + (unreachable) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 1) + ) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 0) + ) + ) + (drop + (call $std:set/Set#add + (get_global $std/set/set) + (i32.const 2) + ) + ) + (if + (i32.eqz + (i32.eq + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 3) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 0) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 2) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 3) + ) + ) + ) + (unreachable) + ) + (drop + (call $std:set/Set#delete + (get_global $std/set/set) + (i32.const 0) + ) + ) + (if + (i32.eqz + (i32.eq + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 2) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 0) + ) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 2) + ) + ) + (unreachable) + ) + (call $std:set/Set#clear + (get_global $std/set/set) + ) + (if + (i32.eqz + (i32.eq + (call $std:set/Set#get:size + (get_global $std/set/set) + ) + (i32.const 0) + ) + ) + (unreachable) + ) + (if + (i32.eqz + (i32.eqz + (call $std:set/Set#has + (get_global $std/set/set) + (i32.const 1) + ) + ) + ) + (unreachable) + ) + ) +) +(; +[program.elements] + GLOBAL: NaN + GLOBAL: Infinity + FUNCTION_PROTOTYPE: isNaN + FUNCTION_PROTOTYPE: isFinite + FUNCTION_PROTOTYPE: clz + FUNCTION_PROTOTYPE: ctz + FUNCTION_PROTOTYPE: popcnt + FUNCTION_PROTOTYPE: rotl + FUNCTION_PROTOTYPE: rotr + FUNCTION_PROTOTYPE: abs + FUNCTION_PROTOTYPE: max + FUNCTION_PROTOTYPE: min + FUNCTION_PROTOTYPE: ceil + FUNCTION_PROTOTYPE: floor + FUNCTION_PROTOTYPE: copysign + FUNCTION_PROTOTYPE: nearest + FUNCTION_PROTOTYPE: reinterpret + FUNCTION_PROTOTYPE: sqrt + FUNCTION_PROTOTYPE: trunc + FUNCTION_PROTOTYPE: load + FUNCTION_PROTOTYPE: store + FUNCTION_PROTOTYPE: sizeof + FUNCTION_PROTOTYPE: select + FUNCTION_PROTOTYPE: unreachable + FUNCTION_PROTOTYPE: current_memory + FUNCTION_PROTOTYPE: grow_memory + FUNCTION_PROTOTYPE: changetype + FUNCTION_PROTOTYPE: assert + FUNCTION_PROTOTYPE: i8 + FUNCTION_PROTOTYPE: i16 + FUNCTION_PROTOTYPE: i32 + FUNCTION_PROTOTYPE: i64 + FUNCTION_PROTOTYPE: u8 + FUNCTION_PROTOTYPE: u16 + FUNCTION_PROTOTYPE: u32 + FUNCTION_PROTOTYPE: u64 + FUNCTION_PROTOTYPE: bool + FUNCTION_PROTOTYPE: f32 + FUNCTION_PROTOTYPE: f64 + FUNCTION_PROTOTYPE: isize + FUNCTION_PROTOTYPE: usize + GLOBAL: HEAP_BASE + CLASS_PROTOTYPE: std:array/Array + CLASS_PROTOTYPE: Array + PROPERTY: std:array/Array#length + CLASS_PROTOTYPE: std:array/CArray + CLASS_PROTOTYPE: CArray + CLASS_PROTOTYPE: std:error/Error + CLASS_PROTOTYPE: Error + CLASS_PROTOTYPE: std:error/RangeError + CLASS_PROTOTYPE: RangeError + GLOBAL: std:heap/ALIGN_LOG2 + GLOBAL: std:heap/ALIGN_SIZE + GLOBAL: std:heap/ALIGN_MASK + GLOBAL: std:heap/HEAP_OFFSET + FUNCTION_PROTOTYPE: std:heap/allocate_memory + FUNCTION_PROTOTYPE: allocate_memory + FUNCTION_PROTOTYPE: std:heap/free_memory + FUNCTION_PROTOTYPE: free_memory + FUNCTION_PROTOTYPE: std:heap/copy_memory + FUNCTION_PROTOTYPE: std:heap/move_memory + FUNCTION_PROTOTYPE: move_memory + FUNCTION_PROTOTYPE: std:heap/set_memory + FUNCTION_PROTOTYPE: set_memory + FUNCTION_PROTOTYPE: std:heap/compare_memory + FUNCTION_PROTOTYPE: compare_memory + CLASS_PROTOTYPE: std:map/Map + CLASS_PROTOTYPE: Map + CLASS_PROTOTYPE: std:regexp/RegExp + CLASS_PROTOTYPE: RegExp + CLASS_PROTOTYPE: std:set/Set + CLASS_PROTOTYPE: Set + PROPERTY: std:set/Set#size + GLOBAL: std:string/EMPTY + CLASS_PROTOTYPE: std:string/String + CLASS_PROTOTYPE: String + FUNCTION_PROTOTYPE: std:string/isWhiteSpaceOrLineTerminator + FUNCTION_PROTOTYPE: std:string/parseInt + FUNCTION_PROTOTYPE: parseInt + FUNCTION_PROTOTYPE: std:string/parseFloat + FUNCTION_PROTOTYPE: parseFloat + GLOBAL: std/set/set +[program.exports] + CLASS_PROTOTYPE: std:array/Array + CLASS_PROTOTYPE: std:array/CArray + CLASS_PROTOTYPE: std:error/Error + CLASS_PROTOTYPE: std:error/RangeError + FUNCTION_PROTOTYPE: std:heap/allocate_memory + FUNCTION_PROTOTYPE: std:heap/free_memory + FUNCTION_PROTOTYPE: std:heap/move_memory + FUNCTION_PROTOTYPE: std:heap/set_memory + FUNCTION_PROTOTYPE: std:heap/compare_memory + CLASS_PROTOTYPE: std:map/Map + CLASS_PROTOTYPE: std:regexp/RegExp + CLASS_PROTOTYPE: std:set/Set + CLASS_PROTOTYPE: std:string/String + FUNCTION_PROTOTYPE: std:string/parseInt + FUNCTION_PROTOTYPE: std:string/parseFloat +;)