summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-10-10 10:11:17 -0700
committerGitHub <noreply@github.com>2017-10-10 10:11:17 -0700
commit58d13aeef288d33fa6634e31985ae6c296d88edb (patch)
tree45f798dec86b6d6d1a6a6af24f16bff0150b04ea
parent874fc0897484d97cf94c0eb898ca5fabe7a9b34a (diff)
downloadbinaryen-58d13aeef288d33fa6634e31985ae6c296d88edb.tar.gz
binaryen-58d13aeef288d33fa6634e31985ae6c296d88edb.tar.bz2
binaryen-58d13aeef288d33fa6634e31985ae6c296d88edb.zip
Fuzzer: create and use globals in fuzz programs (#1217)
-rw-r--r--src/tools/translate-to-fuzz.h49
-rw-r--r--test/passes/translate-to-fuzz.txt1298
2 files changed, 974 insertions, 373 deletions
diff --git a/src/tools/translate-to-fuzz.h b/src/tools/translate-to-fuzz.h
index 821416d87..415d90ac0 100644
--- a/src/tools/translate-to-fuzz.h
+++ b/src/tools/translate-to-fuzz.h
@@ -141,6 +141,7 @@ private:
void build() {
setupMemory();
setupTable();
+ setupGlobals();
// keep adding functions until we run out of input
while (!finishedInput) {
addFunction();
@@ -172,6 +173,24 @@ private:
wasm.table.segments.emplace_back(builder.makeConst(Literal(int32_t(0))));
}
+ std::map<WasmType, std::vector<Name>> globalsByType;
+
+ void setupGlobals() {
+ size_t index = 0;
+ for (auto type : { i32, i64, f32, f64 }) {
+ auto num = upTo(3);
+ for (size_t i = 0; i < num; i++) {
+ auto* glob = new Global;
+ glob->name = std::string("global$") + std::to_string(index++);
+ glob->type = type;
+ glob->init = makeConst(type);
+ glob->mutable_ = true;
+ wasm.addGlobal(glob);
+ globalsByType[type].push_back(glob->name);
+ }
+ }
+ }
+
void finalizeTable() {
wasm.table.initial = wasm.table.segments[0].data.size();
wasm.table.max = oneIn(2) ? Address(Table::kMaxSize) : wasm.table.initial;
@@ -369,7 +388,7 @@ private:
}
Expression* _makei32() {
- switch (upTo(13)) {
+ switch (upTo(14)) {
case 0: return makeBlock(i32);
case 1: return makeIf(i32);
case 2: return makeLoop(i32);
@@ -383,12 +402,13 @@ private:
case 10: return makeUnary(i32);
case 11: return makeBinary(i32);
case 12: return makeSelect(i32);
+ case 13: return makeGetGlobal(i32);
}
WASM_UNREACHABLE();
}
Expression* _makei64() {
- switch (upTo(13)) {
+ switch (upTo(14)) {
case 0: return makeBlock(i64);
case 1: return makeIf(i64);
case 2: return makeLoop(i64);
@@ -402,12 +422,13 @@ private:
case 10: return makeUnary(i64);
case 11: return makeBinary(i64);
case 12: return makeSelect(i64);
+ case 13: return makeGetGlobal(i64);
}
WASM_UNREACHABLE();
}
Expression* _makef32() {
- switch (upTo(13)) {
+ switch (upTo(14)) {
case 0: return makeBlock(f32);
case 1: return makeIf(f32);
case 2: return makeLoop(f32);
@@ -421,12 +442,13 @@ private:
case 10: return makeUnary(f32);
case 11: return makeBinary(f32);
case 12: return makeSelect(f32);
+ case 13: return makeGetGlobal(f32);
}
WASM_UNREACHABLE();
}
Expression* _makef64() {
- switch (upTo(13)) {
+ switch (upTo(14)) {
case 0: return makeBlock(f64);
case 1: return makeIf(f64);
case 2: return makeLoop(f64);
@@ -440,12 +462,13 @@ private:
case 10: return makeUnary(f64);
case 11: return makeBinary(f64);
case 12: return makeSelect(f64);
+ case 13: return makeGetGlobal(f64);
}
WASM_UNREACHABLE();
}
Expression* _makenone() {
- switch (upTo(10)) {
+ switch (upTo(11)) {
case 0: return makeBlock(none);
case 1: return makeIf(none);
case 2: return makeLoop(none);
@@ -456,6 +479,7 @@ private:
case 7: return makeStore(none);
case 8: return makeDrop(none);
case 9: return makeNop(none);
+ case 10: return makeSetGlobal(none);
}
WASM_UNREACHABLE();
}
@@ -766,6 +790,21 @@ private:
}
}
+ Expression* makeGetGlobal(WasmType type) {
+ auto& globals = globalsByType[type];
+ if (globals.empty()) return makeConst(type);
+ return builder.makeGetGlobal(vectorPick(globals), type);
+ }
+
+ Expression* makeSetGlobal(WasmType type) {
+ assert(type == none);
+ type = getConcreteType();
+ auto& globals = globalsByType[type];
+ if (globals.empty()) return makeTrivial(none);
+ auto* value = make(type);
+ return builder.makeSetGlobal(vectorPick(globals), value);
+ }
+
Expression* makePointer() {
auto* ret = make(i32);
// with high probability, mask the pointer so it's in a reasonable
diff --git a/test/passes/translate-to-fuzz.txt b/test/passes/translate-to-fuzz.txt
index 3b49f86c1..fca9307df 100644
--- a/test/passes/translate-to-fuzz.txt
+++ b/test/passes/translate-to-fuzz.txt
@@ -1,22 +1,26 @@
(module
+ (type $FUNCSIG$ifi (func (param f32 i32) (result i32)))
+ (type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$j (func (result i64)))
+ (global $global$0 (mut f64) (f64.const 138413376))
+ (global $global$1 (mut f64) (f64.const 1.1754943508222875e-38))
(global $hangLimit (mut i32) (i32.const 100))
- (table 0 0 anyfunc)
-
+ (table 1 anyfunc)
+ (elem (i32.const 0) $func_3)
(memory $0 1 1)
(data (i32.const 0) "\00C\00[\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
(export "func_0" (func $func_0))
+ (export "func_3" (func $func_3))
+ (export "func_4" (func $func_4))
(export "hangLimitInitializer" (func $hangLimitInitializer))
- (func $func_0 (type $FUNCSIG$j) (result i64)
- (local $0 i32)
- (local $1 f64)
+ (func $func_0 (type $FUNCSIG$ifi) (param $0 f32) (param $1 i32) (result i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const -68719476736)
+ (i32.const -2147483648)
)
)
(set_global $hangLimit
@@ -26,157 +30,215 @@
)
)
)
- (block $label$0 (result i64)
- (nop)
- (br_if $label$0
- (i64.const 127)
+ (get_local $1)
+ )
+ (func $func_1
+ (block
+ (if
(i32.eqz
- (loop $label$37 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const -524288)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$38 (result i32)
+ (get_global $hangLimit)
+ )
+ (return)
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (loop $label$0
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return)
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$1
+ (nop)
+ (nop)
+ )
+ )
+ )
+ (func $func_2 (param $0 f32) (result f64)
+ (local $1 f32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const 26471)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (call $deNan64
+ (f64.mul
+ (f64.const 1)
+ (if (result f64)
+ (select
+ (block $label$10 (result i32)
(if
(i32.eqz
- (i32.wrap/i64
- (i64.const -82)
+ (tee_local $2
+ (i32.const -2147483648)
)
)
- (br_if $label$37
- (i32.eqz
- (i64.gt_u
- (i64.const 79723535910970419)
- (i64.const 255)
+ (drop
+ (i32.const -131072)
+ )
+ (block $label$11
+ (br_if $label$11
+ (tee_local $4
+ (i32.const -128)
)
)
+ (call $func_1)
)
- (block $label$39
- (loop $label$40
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
+ )
+ (return
+ (f64.const 4)
+ )
+ )
+ (tee_local $2
+ (tee_local $3
+ (get_local $3)
+ )
+ )
+ (i32.load16_u offset=4
+ (i32.and
+ (i32.load offset=4 align=1
+ (i32.and
+ (loop $label$0 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const -nan:0xfffffffffffb5)
+ )
)
- (return
- (i64.const 1073741824)
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (block $label$1 (result i32)
+ (block $label$2
+ (nop)
+ (call $func_1)
)
- )
- )
- (set_local $1
- (call $deNan64
(select
- (call $deNan64
- (f64.convert_s/i64
- (i64.const 286791702)
+ (if (result i32)
+ (get_local $3)
+ (block $label$3 (result i32)
+ (block $label$4
+ (set_local $2
+ (get_local $3)
+ )
+ (set_local $0
+ (get_local $1)
+ )
+ )
+ (br $label$0)
+ )
+ (if (result i32)
+ (i32.eqz
+ (get_local $3)
+ )
+ (i32.const -123)
+ (get_local $4)
)
)
- (call $deNan64
- (select
- (tee_local $1
- (block $label$44 (result f64)
- (set_local $1
- (get_local $1)
- )
+ (tee_local $2
+ (if (result i32)
+ (i32.eqz
+ (call $func_0
(get_local $1)
+ (i32.const 0)
)
)
- (call $deNan64
- (f64.copysign
- (call $deNan64
- (select
- (f64.const 18445)
- (f64.const 251925010)
- (i32.const 286004740)
+ (block $label$5 (result i32)
+ (loop $label$6
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const -33554432)
+ )
)
- )
- (block $label$45 (result f64)
- (nop)
- (loop $label$46 (result f64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const -57)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
- (get_local $1)
)
)
- )
- )
- (br_if $label$38
- (i32.reinterpret/f32
- (f32.const -9223372036854775808)
- )
- (i32.eqz
- (get_local $0)
- )
- )
- )
- )
- (tee_local $0
- (if (result i32)
- (i32.trunc_u/f64
- (get_local $1)
- )
- (block $label$41 (result i32)
- (nop)
- (br $label$40)
- )
- (loop $label$42 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
+ (block
+ (i64.store offset=4 align=1
+ (i32.and
+ (get_local $4)
+ (i32.const 31)
+ )
+ (i64.const -1)
+ )
+ (br_if $label$6
+ (get_local $2)
)
- (return
- (i64.const 2241978001322417182)
+ (f32.store offset=4
+ (i32.and
+ (i32.const -256)
+ (i32.const 31)
+ )
+ (f32.const 2147483648)
)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ )
+ (i32.load8_s offset=4
+ (i32.and
+ (i32.load16_u offset=3 align=1
+ (i32.and
+ (get_local $2)
+ (i32.const 31)
+ )
)
+ (i32.const 31)
)
)
- (block (result i32)
- (loop $label$43
+ )
+ (block $label$7 (result i32)
+ (block $label$8
+ (nop)
+ (loop $label$9
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const -8796093022208)
+ (f64.const -8192)
)
)
(set_global $hangLimit
@@ -186,348 +248,848 @@
)
)
)
- (set_local $0
- (select
- (i32.const -70)
- (get_local $0)
- (get_local $0)
- )
- )
- )
- (br_if $label$42
- (select
- (get_local $0)
- (get_local $0)
- (get_local $0)
- )
- )
- (f64.le
- (call $deNan64
- (f64.min
- (get_local $1)
- (get_local $1)
+ (set_local $2
+ (br_if $label$7
+ (tee_local $4
+ (if (result i32)
+ (i32.eqz
+ (get_local $4)
+ )
+ (get_local $2)
+ (i32.const 1514756685)
+ )
+ )
+ (i32.eqz
+ (i32.load offset=2
+ (i32.and
+ (i32.const 514)
+ (i32.const 31)
+ )
+ )
+ )
)
)
- (get_local $1)
)
)
+ (br $label$0)
)
)
)
+ (i32.const 2147483647)
)
)
)
+ (i32.const 31)
)
- (if
- (i32.const 1142375256)
- (block $label$47
- (block $label$48
- (nop)
- (block $label$49
- (set_local $0
- (i32.const -1)
+ )
+ (i32.const 31)
+ )
+ )
+ )
+ (get_global $global$1)
+ (block $label$12 (result f64)
+ (call $func_1)
+ (return
+ (f64.const -140737488355328)
+ )
+ )
+ )
+ )
+ )
+ )
+ (func $func_3 (type $FUNCSIG$i) (result i32)
+ (local $0 i32)
+ (local $1 i64)
+ (local $2 f64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0 (result i32)
+ (nop)
+ (return
+ (i32.const -4194304)
+ )
+ )
+ )
+ (func $func_4 (type $FUNCSIG$j) (result i64)
+ (local $0 i64)
+ (local $1 f32)
+ (local $2 i64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 68719476736)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$0
+ (i64.store32 offset=4 align=2
+ (i32.and
+ (if (result i32)
+ (i32.eqz
+ (block $label$1 (result i32)
+ (if
+ (i32.eqz
+ (loop $label$2 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
)
- (loop $label$50
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 8589934592)
- )
+ (return
+ (i64.const 512)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$3 (result i32)
+ (return
+ (get_local $2)
+ )
+ )
+ )
+ )
+ (block $label$4
+ (block $label$5
+ (set_local $2
+ (loop $label$6 (result i64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ (return
+ (get_local $0)
)
)
- (block $label$51
- (loop $label$52
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 15442)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block
- (f64.store offset=3 align=4
- (i32.and
- (select
- (i32.const 255)
- (br_if $label$38
- (get_local $0)
- (get_local $0)
- )
- (i32.const -4194304)
- )
- (i32.const 31)
- )
- (get_local $1)
- )
- (br_if $label$52
- (i32.const 111)
- )
- (nop)
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i64)
+ (block $label$7
+ (drop
+ (get_local $1)
+ )
+ (br_if $label$5
+ (i32.eqz
+ (i32.const 1393493003)
)
)
- (set_local $0
- (block $label$53 (result i32)
- (set_local $0
- (i32.const -512)
+ )
+ (br_if $label$6
+ (i32.eqz
+ (br_if $label$1
+ (i32.const 32766)
+ (i32.eqz
+ (i32.const -73)
)
- (br $label$47)
)
)
)
+ (get_local $0)
)
)
)
- (block $label$54
- (set_local $1
- (f64.const 36028797018963968)
+ (call $func_1)
+ )
+ (block $label$8
+ (drop
+ (loop $label$9 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $2)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (f64.const 30079)
)
)
)
- (if
- (i32.eqz
- (select
- (get_local $0)
- (block $label$60 (result i32)
- (br_if $label$37
- (i32.eqz
- (i32.const -4194304)
+ )
+ (nop)
+ )
+ (call_indirect $FUNCSIG$i
+ (i32.const 0)
+ )
+ )
+ )
+ (block $label$10 (result i32)
+ (i32.store8 offset=22
+ (i32.and
+ (if (result i32)
+ (i32.eqz
+ (select
+ (i32.const 6)
+ (if (result i32)
+ (i32.const 4103)
+ (block $label$12 (result i32)
+ (drop
+ (i64.ctz
+ (i64.const 17)
)
)
- (select
- (br_if $label$60
- (tee_local $0
- (get_local $0)
+ (return
+ (i64.const 18505)
+ )
+ )
+ (f32.ne
+ (loop $label$13 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 17728)
+ )
)
- (i32.eqz
- (block $label$61 (result i32)
- (nop)
- (get_local $0)
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
)
)
- (if (result i32)
- (i32.eqz
- (if (result i32)
+ (block (result f32)
+ (block $label$14
+ (block $label$15
+ (nop)
+ (nop)
+ )
+ (if
(i32.eqz
- (i64.ne
- (i64.const -1024)
- (i64.load32_u offset=4
- (i32.and
- (get_local $0)
- (i32.const 31)
- )
- )
- )
- )
- (block $label$62 (result i32)
- (set_local $0
- (get_local $0)
- )
- (loop $label$63 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const -95)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (br_if $label$10
+ (if (result i32)
+ (if (result i32)
+ (i32.const -65536)
+ (i32.const -32768)
+ (call_indirect $FUNCSIG$i
+ (i32.const 0)
)
)
+ (i32.const 454301983)
+ (i32.const 18460)
)
- (block (result i32)
- (set_local $1
- (get_local $1)
- )
- (br_if $label$63
- (get_local $0)
- )
- (i32.const 48)
- )
+ (i32.const -64)
)
)
- (block $label$64 (result i32)
+ (block $label$16
(if
- (i32.eqz
- (i32.wrap/i64
- (loop $label$65 (result i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 470816280)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ (i32.const 1014178876)
+ (if
+ (i32.eqz
+ (i32.const -116)
+ )
+ (nop)
+ (i32.store16 offset=2 align=1
+ (i32.and
+ (i32.const -16)
+ (i32.const 31)
+ )
+ (i32.load16_s offset=3
+ (i32.and
+ (block $label$17 (result i32)
+ (nop)
+ (i32.const 23528569)
)
+ (i32.const 31)
)
- (i64.const 108)
)
)
)
(nop)
- (drop
- (f64.const 2075497995636940095578691e82)
- )
)
- (loop $label$66 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const -27)
- )
+ (br_if $label$16
+ (i32.eqz
+ (block $label$18 (result i32)
+ (nop)
+ (i32.const -93)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ )
+ )
+ )
+ (br_if $label$13
+ (i32.eqz
+ (i32.const 512)
+ )
+ )
+ )
+ )
+ (br_if $label$13
+ (i32.eqz
+ (br_if $label$10
+ (call $func_0
+ (call $deNan32
+ (f32.convert_u/i64
+ (if (result i64)
+ (i32.eqz
+ (i32.const 8388608)
+ )
+ (get_local $0)
+ (get_local $0)
)
)
)
- (block (result i32)
- (nop)
- (br_if $label$66
- (i32.const -36)
+ (if (result i32)
+ (i32.const 4)
+ (i32.const 1196969301)
+ (select
+ (i32.const 64)
+ (i32.trunc_s/f32
+ (get_local $1)
+ )
+ (i32.const -2)
)
- (get_local $0)
)
)
+ (i32.const -1048576)
)
)
)
- (block $label$67 (result i32)
- (f64.store offset=1
- (i32.and
- (br_if $label$38
+ (loop $label$19 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 357908754)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$20 (result f32)
+ (nop)
+ (br $label$19)
+ )
+ )
+ )
+ )
+ (call $deNan32
+ (f32.floor
+ (loop $label$21 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
(get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (loop $label$22 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result f32)
+ (br_if $label$21
(i32.eqz
- (i32.reinterpret/f32
- (f32.const 2706.389892578125)
+ (if (result i32)
+ (i32.eqz
+ (i32.const -4194304)
+ )
+ (i32.const 9537)
+ (i32.const -262144)
)
)
)
- (i32.const 31)
+ (br_if $label$22
+ (call $func_3)
+ )
+ (tee_local $1
+ (get_local $1)
+ )
)
- (f64.const 68719476736)
)
- (i32.const 25)
)
- (i32.const 1449089114)
)
- (get_local $0)
)
)
- (select
- (i32.const -4)
- (i32.eqz
- (loop $label$58 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 303239698)
+ )
+ (i32.load offset=4 align=2
+ (i32.and
+ (select
+ (call $func_3)
+ (i32.const 1)
+ (call $func_0
+ (call $deNan32
+ (select
+ (tee_local $1
+ (f32.const 9223372036854775808)
)
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (f32.const -1)
+ (if (result i32)
+ (i32.eqz
+ (i32.const 404363289)
+ )
+ (i32.const 32767)
+ (block $label$11 (result i32)
+ (nop)
+ (i64.eqz
+ (i64.popcnt
+ (get_local $0)
+ )
+ )
+ )
)
)
)
- (block $label$59 (result i32)
- (br_if $label$38
- (i32.const 268435456)
- (i32.eqz
- (br_if $label$59
- (get_local $0)
- (get_local $0)
+ (i32.const 4)
+ )
+ )
+ (i32.const 31)
+ )
+ )
+ )
+ )
+ (if (result i32)
+ (call_indirect $FUNCSIG$i
+ (i32.const 0)
+ )
+ (block $label$23 (result i32)
+ (return
+ (i64.const -2)
+ )
+ )
+ (block $label$24 (result i32)
+ (i32.store16 offset=22 align=1
+ (i32.and
+ (i32.load16_s offset=4 align=1
+ (i32.and
+ (i32.const 125568104)
+ (i32.const 31)
+ )
+ )
+ (i32.const 31)
+ )
+ (call $func_3)
+ )
+ (i32.load16_s offset=3 align=1
+ (i32.and
+ (call $func_0
+ (f32.const 0)
+ (i32.load16_u offset=4
+ (i32.and
+ (if (result i32)
+ (call_indirect $FUNCSIG$i
+ (i32.const 0)
+ )
+ (select
+ (select
+ (i32.const 1734962792)
+ (i32.const -4096)
+ (i32.const 218824716)
+ )
+ (i32.const -1073741824)
+ (i32.const 40)
+ )
+ (block $label$25 (result i32)
+ (block $label$26
+ (nop)
+ (block $label$27
+ (nop)
+ (f64.store offset=4 align=4
+ (call $func_0
+ (f32.const 9223372036854775808)
+ (f32.eq
+ (f32.const 18446744073709551615)
+ (f32.load offset=4
+ (i32.and
+ (i32.const 524288)
+ (i32.const 31)
+ )
+ )
+ )
+ )
+ (f64.const -1099511627776)
+ )
+ )
)
+ (i32.const 128)
)
)
+ (i32.const 31)
)
)
)
- (tee_local $0
- (tee_local $0
- (tee_local $0
- (i32.const 975322409)
- )
- )
+ (i32.const 31)
+ )
+ )
+ )
+ )
+ (i32.const 335937919)
+ )
+ (i32.const 31)
+ )
+ (if (result i32)
+ (i32.eqz
+ (call $func_3)
+ )
+ (block $label$28 (result i32)
+ (block $label$29
+ (if
+ (i32.eqz
+ (block $label$30 (result i32)
+ (nop)
+ (call_indirect $FUNCSIG$i
+ (i32.const 0)
)
)
)
+ (block $label$31
+ (nop)
+ (nop)
+ )
+ (block $label$32
+ (nop)
+ )
)
- (block $label$68
- (block $label$69
- (br_if $label$39
- (block $label$70 (result i32)
- (if
- (i32.clz
- (br_if $label$38
- (get_local $0)
- (get_local $0)
+ (drop
+ (i64.div_s
+ (block $label$33 (result i64)
+ (call $func_1)
+ (i64.const -94)
+ )
+ (tee_local $2
+ (loop $label$34 (result i64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $2)
)
)
- (block $label$71
- (set_local $1
- (f64.const 1.1754943508222875e-38)
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
)
- (set_local $0
- (i32.const 32)
+ )
+ )
+ (block (result i64)
+ (block $label$35
+ (nop)
+ (f64.store offset=4 align=2
+ (i32.and
+ (i32.const 127)
+ (i32.const 31)
+ )
+ (f64.const -2251799813685248)
+ )
+ )
+ (br_if $label$34
+ (i32.const 471406943)
+ )
+ (select
+ (get_local $0)
+ (get_local $0)
+ (loop $label$36 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (select
+ (i32.const 23130)
+ (i32.const 1111901516)
+ (block $label$37 (result i32)
+ (nop)
+ (i32.const -2147483648)
+ )
+ )
)
)
- (nop)
)
- (get_local $0)
)
)
- (nop)
)
- (nop)
)
- (block $label$72
- (nop)
+ )
+ (return
+ (get_local $2)
+ )
+ )
+ (block $label$39 (result i32)
+ (drop
+ (i64.const 255)
+ )
+ (call $func_3)
+ )
+ )
+ )
+ (drop
+ (block $label$40 (result f32)
+ (return
+ (i64.const -562949953421312)
+ )
+ )
+ )
+ (f32.ne
+ (f32.const 217.36842346191406)
+ (f32.load offset=4
+ (i32.and
+ (i32.const 822703163)
+ (i32.const 31)
+ )
+ )
+ )
+ )
+ (select
+ (i32.const 1931754023)
+ (i32.const -128)
+ (block $label$41 (result i32)
+ (call $func_1)
+ (i32.const 1701396008)
+ )
+ )
+ )
+ (i32.const 31)
+ )
+ (get_local $2)
+ )
+ (return
+ (get_local $2)
+ )
+ )
+ )
+ (func $func_5 (result i64)
+ (local $0 i32)
+ (local $1 i32)
+ (local $2 f32)
+ (local $3 f32)
+ (local $4 f32)
+ (local $5 i64)
+ (local $6 i64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $6)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (drop
+ (drop
+ (block $label$0
+ (loop $label$1
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 6364521229224202323)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (nop)
+ )
+ (f64.store offset=4 align=1
+ (block $label$9
+ (if
+ (i32.eqz
+ (if (result i32)
+ (if (result i32)
+ (if (result i32)
+ (f64.eq
+ (f64.const 7196)
+ (f64.const -562949953421312)
+ )
+ (call $func_3)
+ (block $label$10 (result i32)
+ (set_global $global$0
+ (f64.const 1.9804914402226382e-202)
+ )
+ (return
+ (get_local $6)
+ )
+ )
+ )
+ (block $label$11 (result i32)
+ (loop $label$12
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const -281474976710656)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (set_global $global$0
+ (f64.const 127)
+ )
+ )
+ (i32.load8_u offset=2
+ (i32.and
+ (i32.trunc_u/f32
+ (f32.const -33554432)
+ )
+ (i32.const 31)
+ )
+ )
+ )
+ (block $label$13 (result i32)
+ (call_indirect $FUNCSIG$i
+ (i32.const 0)
+ )
+ )
+ )
+ (block $label$14 (result i32)
+ (nop)
+ (loop $label$18 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const -4096)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block (result i32)
+ (block $label$19
+ (set_local $6
+ (i64.const 36028797018963968)
+ )
+ (set_local $6
+ (tee_local $6
+ (call $func_4)
+ )
+ )
+ )
+ (br_if $label$18
+ (tee_local $1
+ (i32.const 442457430)
+ )
+ )
+ (i32.const -262144)
+ )
)
)
+ (get_local $1)
)
)
+ (set_local $1
+ (i32.const -2147483648)
+ )
+ (block $label$20
+ (nop)
+ )
)
- (get_local $0)
+ (return
+ (get_local $5)
+ )
+ )
+ (return
+ (i64.const 819399075040401932)
)
)
)