diff options
22 files changed, 6683 insertions, 6427 deletions
diff --git a/src/passes/MergeBlocks.cpp b/src/passes/MergeBlocks.cpp index 4999fd234..543c7f89c 100644 --- a/src/passes/MergeBlocks.cpp +++ b/src/passes/MergeBlocks.cpp @@ -335,62 +335,6 @@ struct MergeBlocks : public WalkerPass<PostWalker<MergeBlocks>> { Pass* create() override { return new MergeBlocks; } void visitBlock(Block *curr) { - // If the block has a single child which is a loop, and the block is named, - // then it is the exit for the loop. It's better to move it into the loop, - // where it can be better optimized by other passes. - // Similar logic for ifs: if the block is an exit for the if, we can - // move the block in, consider for example: - // (block $label - // (if (..condition1..) - // (block - // (br_if $label (..condition2..)) - // (..code..) - // ) - // ) - // ) - // After also merging the blocks, we have - // (if (..condition1..) - // (block $label - // (br_if $label (..condition2..)) - // (..code..) - // ) - // ) - // which can be further optimized by other passes. - if (curr->name.is() && curr->list.size() == 1) { - if (auto* loop = curr->list[0]->dynCast<Loop>()) { - curr->list[0] = loop->body; - loop->body = curr; - auto oldOuterType = curr->type; - curr->finalize(curr->type); - loop->finalize(); - // After the flip, the outer type must be the same - assert(loop->type == oldOuterType); - replaceCurrent(loop); - } else if (auto* iff = curr->list[0]->dynCast<If>()) { - // The label can't be used in the condition. - if (BranchUtils::BranchSeeker::countNamed(iff->condition, curr->name) == 0) { - // We can move the block into either arm, if there are no uses in the other. - Expression** target = nullptr; - if (!iff->ifFalse || - BranchUtils::BranchSeeker::countNamed(iff->ifFalse, curr->name) == 0) { - target = &iff->ifTrue; - } else if (BranchUtils::BranchSeeker::countNamed(iff->ifTrue, curr->name) == 0) { - target = &iff->ifFalse; - } - if (target) { - curr->list[0] = *target; - *target = curr; - curr->finalize(curr->type); - iff->finalize(); - replaceCurrent(iff); - // Note that the type might change, e.g. if the if condition is unreachable - // but the block that was on the outside had a break. - } - } - } - // Always fall through to optimize the block, which has a new child now. - } - // Otherwise, do the main merging optimizations. optimizeBlock(curr, getModule(), getPassOptions()); } diff --git a/src/passes/RemoveUnusedBrs.cpp b/src/passes/RemoveUnusedBrs.cpp index ccdf55794..eb81b0a5a 100644 --- a/src/passes/RemoveUnusedBrs.cpp +++ b/src/passes/RemoveUnusedBrs.cpp @@ -102,9 +102,8 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { // if without else stops the flow of values self->stopValueFlow(); } - } else if (curr->is<Block>()) { + } else if (auto* block = curr->dynCast<Block>()) { // any breaks flowing to here are unnecessary, as we get here anyhow - auto* block = curr->cast<Block>(); auto name = block->name; if (name.is()) { size_t size = flows.size(); @@ -436,6 +435,76 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { } } + void sinkBlocks(Function* func) { + struct Sinker : public PostWalker<Sinker> { + bool worked = false; + + void visitBlock(Block* curr) { + // If the block has a single child which is a loop, and the block is named, + // then it is the exit for the loop. It's better to move it into the loop, + // where it can be better optimized by other passes. + // Similar logic for ifs: if the block is an exit for the if, we can + // move the block in, consider for example: + // (block $label + // (if (..condition1..) + // (block + // (br_if $label (..condition2..)) + // (..code..) + // ) + // ) + // ) + // After also merging the blocks, we have + // (if (..condition1..) + // (block $label + // (br_if $label (..condition2..)) + // (..code..) + // ) + // ) + // which can be further optimized later. + if (curr->name.is() && curr->list.size() == 1) { + if (auto* loop = curr->list[0]->dynCast<Loop>()) { + curr->list[0] = loop->body; + loop->body = curr; + curr->finalize(curr->type); + loop->finalize(); + replaceCurrent(loop); + worked = true; + } else if (auto* iff = curr->list[0]->dynCast<If>()) { + // The label can't be used in the condition. + if (BranchUtils::BranchSeeker::countNamed(iff->condition, curr->name) == 0) { + // We can move the block into either arm, if there are no uses in the other. + Expression** target = nullptr; + if (!iff->ifFalse || + BranchUtils::BranchSeeker::countNamed(iff->ifFalse, curr->name) == 0) { + target = &iff->ifTrue; + } else if (BranchUtils::BranchSeeker::countNamed(iff->ifTrue, curr->name) == 0) { + target = &iff->ifFalse; + } + if (target) { + curr->list[0] = *target; + *target = curr; + // The block used to contain the if, and may have changed type from unreachable + // to none, for example, if the if has an unreachable condition but the arm + // is not unreachable. + curr->finalize(); + iff->finalize(); + replaceCurrent(iff); + worked = true; + // Note that the type might change, e.g. if the if condition is unreachable + // but the block that was on the outside had a break. + } + } + } + } + } + } sinker; + + sinker.doWalkFunction(func); + if (sinker.worked) { + anotherCycle = true; + } + } + void doWalkFunction(Function* func) { // multiple cycles may be needed bool worked = false; @@ -463,6 +532,8 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { anotherCycle |= optimizeLoop(loop); } loops.clear(); + // sink blocks + sinkBlocks(func); if (anotherCycle) worked = true; } while (anotherCycle); diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm index 1a6fd9245..616c6ae12 100644 --- a/test/emcc_O2_hello_world.fromasm +++ b/test/emcc_O2_hello_world.fromasm @@ -1339,248 +1339,246 @@ ) ) ) - (block $do-once - (set_local $9 - (if (result i32) - (i32.le_u - (get_local $0) - (i32.const -65) - ) - (block (result i32) - (set_local $1 - (i32.and - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 11) - ) + (set_local $9 + (if (result i32) + (i32.le_u + (get_local $0) + (i32.const -65) + ) + (block $do-once (result i32) + (set_local $1 + (i32.and + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 11) ) - (i32.const -8) ) + (i32.const -8) ) - (if (result i32) - (tee_local $11 - (i32.load - (i32.const 180) - ) + ) + (if (result i32) + (tee_local $11 + (i32.load + (i32.const 180) ) - (block (result i32) - (set_local $0 - (i32.sub - (i32.const 0) - (get_local $1) - ) + ) + (block (result i32) + (set_local $0 + (i32.sub + (i32.const 0) + (get_local $1) ) - (if - (tee_local $15 - (i32.load offset=480 - (i32.shl - (tee_local $9 + ) + (if + (tee_local $15 + (i32.load offset=480 + (i32.shl + (tee_local $9 + (if (result i32) + (tee_local $7 + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + ) (if (result i32) - (tee_local $7 - (i32.shr_u - (get_local $3) - (i32.const 8) - ) + (i32.gt_u + (get_local $1) + (i32.const 16777215) ) - (if (result i32) - (i32.gt_u - (get_local $1) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (get_local $1) - (i32.add - (tee_local $15 - (i32.add - (i32.sub - (i32.const 14) + (i32.const 31) + (i32.or + (i32.and + (i32.shr_u + (get_local $1) + (i32.add + (tee_local $15 + (i32.add + (i32.sub + (i32.const 14) + (i32.or (i32.or - (i32.or - (tee_local $7 - (i32.and - (i32.shr_u - (i32.add - (tee_local $10 - (i32.shl - (get_local $7) - (tee_local $3 - (i32.and - (i32.shr_u - (i32.add - (get_local $7) - (i32.const 1048320) - ) - (i32.const 16) + (tee_local $7 + (i32.and + (i32.shr_u + (i32.add + (tee_local $10 + (i32.shl + (get_local $7) + (tee_local $3 + (i32.and + (i32.shr_u + (i32.add + (get_local $7) + (i32.const 1048320) ) - (i32.const 8) + (i32.const 16) ) + (i32.const 8) ) ) ) - (i32.const 520192) ) - (i32.const 16) + (i32.const 520192) ) - (i32.const 4) + (i32.const 16) ) + (i32.const 4) ) - (get_local $3) ) - (tee_local $10 - (i32.and - (i32.shr_u - (i32.add - (tee_local $17 - (i32.shl - (get_local $10) - (get_local $7) - ) + (get_local $3) + ) + (tee_local $10 + (i32.and + (i32.shr_u + (i32.add + (tee_local $17 + (i32.shl + (get_local $10) + (get_local $7) ) - (i32.const 245760) ) - (i32.const 16) + (i32.const 245760) ) - (i32.const 2) + (i32.const 16) ) + (i32.const 2) ) ) ) - (i32.shr_u - (i32.shl - (get_local $17) - (get_local $10) - ) - (i32.const 15) + ) + (i32.shr_u + (i32.shl + (get_local $17) + (get_local $10) ) + (i32.const 15) ) ) - (i32.const 7) ) + (i32.const 7) ) - (i32.const 1) - ) - (i32.shl - (get_local $15) - (i32.const 1) ) + (i32.const 1) + ) + (i32.shl + (get_local $15) + (i32.const 1) ) ) - (i32.const 0) ) + (i32.const 0) ) - (i32.const 2) ) + (i32.const 2) ) ) - (block $label$break$L123 - (set_local $10 - (get_local $0) - ) - (set_local $17 - (i32.const 0) - ) - (set_local $3 - (i32.shl - (get_local $1) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (get_local $9) - (i32.const 1) - ) - ) - (i32.eq + ) + (block $label$break$L123 + (set_local $10 + (get_local $0) + ) + (set_local $17 + (i32.const 0) + ) + (set_local $3 + (i32.shl + (get_local $1) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u (get_local $9) - (i32.const 31) + (i32.const 1) ) ) + (i32.eq + (get_local $9) + (i32.const 31) + ) ) ) - (set_local $7 - (get_local $15) - ) - (loop $while-in14 - (if - (i32.lt_u - (tee_local $0 - (i32.sub - (tee_local $22 - (i32.and - (i32.load offset=4 - (get_local $7) - ) - (i32.const -8) + ) + (set_local $7 + (get_local $15) + ) + (loop $while-in14 + (if + (i32.lt_u + (tee_local $0 + (i32.sub + (tee_local $22 + (i32.and + (i32.load offset=4 + (get_local $7) ) + (i32.const -8) ) - (get_local $1) ) + (get_local $1) ) - (get_local $10) ) - (set_local $6 - (if (result i32) - (i32.eq - (get_local $22) - (get_local $1) - ) - (block - (set_local $28 - (get_local $0) - ) - (set_local $26 - (get_local $7) - ) - (set_local $30 - (get_local $7) - ) - (set_local $10 - (i32.const 90) - ) - (br $label$break$L123) + (get_local $10) + ) + (set_local $6 + (if (result i32) + (i32.eq + (get_local $22) + (get_local $1) + ) + (block + (set_local $28 + (get_local $0) ) - (block (result i32) - (set_local $10 - (get_local $0) - ) + (set_local $26 (get_local $7) ) - ) - ) - ) - (set_local $22 - (select - (get_local $17) - (tee_local $0 - (i32.load offset=20 + (set_local $30 (get_local $7) ) + (set_local $10 + (i32.const 90) + ) + (br $label$break$L123) ) - (i32.or - (i32.eqz + (block (result i32) + (set_local $10 (get_local $0) ) - (i32.eq - (get_local $0) - (tee_local $7 - (i32.load + (get_local $7) + ) + ) + ) + ) + (set_local $22 + (select + (get_local $17) + (tee_local $0 + (i32.load offset=20 + (get_local $7) + ) + ) + (i32.or + (i32.eqz + (get_local $0) + ) + (i32.eq + (get_local $0) + (tee_local $7 + (i32.load + (i32.add (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (get_local $3) - (i32.const 31) - ) - (i32.const 2) + (get_local $7) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (get_local $3) + (i32.const 31) ) + (i32.const 2) ) ) ) @@ -1588,71 +1586,74 @@ ) ) ) - (set_local $5 - (if (result i32) - (tee_local $0 - (i32.eqz - (get_local $7) - ) + ) + (set_local $5 + (if (result i32) + (tee_local $0 + (i32.eqz + (get_local $7) ) - (block (result i32) - (set_local $33 - (get_local $10) - ) - (set_local $31 - (get_local $6) - ) - (set_local $10 - (i32.const 86) - ) + ) + (block (result i32) + (set_local $33 + (get_local $10) + ) + (set_local $31 + (get_local $6) + ) + (set_local $10 + (i32.const 86) + ) + (get_local $22) + ) + (block + (set_local $17 (get_local $22) ) - (block - (set_local $17 - (get_local $22) - ) - (set_local $3 - (i32.shl - (get_local $3) - (i32.xor - (i32.and - (get_local $0) - (i32.const 1) - ) + (set_local $3 + (i32.shl + (get_local $3) + (i32.xor + (i32.and + (get_local $0) (i32.const 1) ) + (i32.const 1) ) ) - (br $while-in14) ) + (br $while-in14) ) ) ) ) - (block - (set_local $33 - (get_local $0) - ) - (set_local $10 - (i32.const 86) - ) - ) ) - (if - (i32.eq - (get_local $10) + (block + (set_local $33 + (get_local $0) + ) + (set_local $10 (i32.const 86) ) - (if - (tee_local $0 - (if (result i32) - (i32.or - (get_local $5) - (get_local $31) - ) + ) + ) + (if + (i32.eq + (get_local $10) + (i32.const 86) + ) + (if + (tee_local $0 + (if (result i32) + (i32.or (get_local $5) - (block (result i32) - (if + (get_local $31) + ) + (get_local $5) + (block (result i32) + (drop + (br_if $do-once + (get_local $1) (i32.eqz (tee_local $0 (i32.and @@ -1672,178 +1673,193 @@ ) ) ) - (block - (set_local $9 - (get_local $1) - ) - (br $do-once) - ) ) - (set_local $0 - (i32.and - (i32.shr_u - (tee_local $15 - (i32.add - (i32.and + ) + (set_local $0 + (i32.and + (i32.shr_u + (tee_local $15 + (i32.add + (i32.and + (get_local $0) + (i32.sub + (i32.const 0) (get_local $0) - (i32.sub - (i32.const 0) - (get_local $0) - ) ) - (i32.const -1) ) + (i32.const -1) ) - (i32.const 12) ) - (i32.const 16) + (i32.const 12) ) + (i32.const 16) ) - (i32.load offset=480 - (i32.shl - (i32.add + ) + (i32.load offset=480 + (i32.shl + (i32.add + (i32.or (i32.or (i32.or (i32.or - (i32.or - (tee_local $15 - (i32.and - (i32.shr_u - (tee_local $9 - (i32.shr_u - (get_local $15) - (get_local $0) - ) - ) - (i32.const 5) - ) - (i32.const 8) - ) - ) - (get_local $0) - ) - (tee_local $9 + (tee_local $15 (i32.and (i32.shr_u - (tee_local $5 + (tee_local $9 (i32.shr_u - (get_local $9) (get_local $15) + (get_local $0) ) ) - (i32.const 2) + (i32.const 5) ) - (i32.const 4) + (i32.const 8) ) ) + (get_local $0) ) - (tee_local $5 + (tee_local $9 (i32.and (i32.shr_u - (tee_local $6 + (tee_local $5 (i32.shr_u - (get_local $5) (get_local $9) + (get_local $15) ) ) - (i32.const 1) + (i32.const 2) ) - (i32.const 2) + (i32.const 4) ) ) ) - (tee_local $6 + (tee_local $5 (i32.and (i32.shr_u - (tee_local $3 + (tee_local $6 (i32.shr_u - (get_local $6) (get_local $5) + (get_local $9) ) ) (i32.const 1) ) - (i32.const 1) + (i32.const 2) ) ) ) - (i32.shr_u - (get_local $3) - (get_local $6) + (tee_local $6 + (i32.and + (i32.shr_u + (tee_local $3 + (i32.shr_u + (get_local $6) + (get_local $5) + ) + ) + (i32.const 1) + ) + (i32.const 1) + ) ) ) - (i32.const 2) + (i32.shr_u + (get_local $3) + (get_local $6) + ) ) + (i32.const 2) ) ) ) ) - (block - (set_local $28 - (get_local $33) - ) - (set_local $26 - (get_local $0) - ) - (set_local $30 - (get_local $31) - ) - (set_local $10 - (i32.const 90) - ) + ) + (block + (set_local $28 + (get_local $33) ) - (block - (set_local $2 - (get_local $33) - ) - (set_local $12 - (get_local $31) - ) + (set_local $26 + (get_local $0) + ) + (set_local $30 + (get_local $31) + ) + (set_local $10 + (i32.const 90) + ) + ) + (block + (set_local $2 + (get_local $33) + ) + (set_local $12 + (get_local $31) ) ) ) - (if - (i32.eq - (get_local $10) - (i32.const 90) + ) + (if + (i32.eq + (get_local $10) + (i32.const 90) + ) + (loop $while-in16 + (set_local $10 + (i32.const 0) ) - (loop $while-in16 - (set_local $10 - (i32.const 0) - ) - (set_local $3 - (i32.lt_u - (tee_local $6 - (i32.sub - (i32.and - (i32.load offset=4 - (get_local $26) - ) - (i32.const -8) + (set_local $3 + (i32.lt_u + (tee_local $6 + (i32.sub + (i32.and + (i32.load offset=4 + (get_local $26) ) - (get_local $1) + (i32.const -8) ) + (get_local $1) ) - (get_local $28) ) + (get_local $28) ) - (set_local $5 - (select - (get_local $6) - (get_local $28) - (get_local $3) - ) + ) + (set_local $5 + (select + (get_local $6) + (get_local $28) + (get_local $3) ) - (set_local $6 - (select + ) + (set_local $6 + (select + (get_local $26) + (get_local $30) + (get_local $3) + ) + ) + (if + (tee_local $3 + (i32.load offset=16 (get_local $26) - (get_local $30) + ) + ) + (block + (set_local $28 + (get_local $5) + ) + (set_local $26 (get_local $3) ) + (set_local $30 + (get_local $6) + ) + (br $while-in16) ) - (if - (tee_local $3 - (i32.load offset=16 + ) + (set_local $2 + (if (result i32) + (tee_local $26 + (i32.load offset=20 (get_local $26) ) ) @@ -1851,679 +1867,782 @@ (set_local $28 (get_local $5) ) - (set_local $26 - (get_local $3) - ) (set_local $30 (get_local $6) ) (br $while-in16) ) - ) - (set_local $2 - (if (result i32) - (tee_local $26 - (i32.load offset=20 - (get_local $26) - ) - ) - (block - (set_local $28 - (get_local $5) - ) - (set_local $30 - (get_local $6) - ) - (br $while-in16) - ) - (block (result i32) - (set_local $12 - (get_local $6) - ) - (get_local $5) + (block (result i32) + (set_local $12 + (get_local $6) ) + (get_local $5) ) ) ) ) + ) + (if (result i32) (if (result i32) - (if (result i32) - (get_local $12) - (i32.lt_u - (get_local $2) - (i32.sub - (i32.load - (i32.const 184) - ) - (get_local $1) + (get_local $12) + (i32.lt_u + (get_local $2) + (i32.sub + (i32.load + (i32.const 184) ) + (get_local $1) ) - (i32.const 0) ) - (block - (if - (i32.lt_u - (get_local $12) - (tee_local $11 - (i32.load - (i32.const 192) - ) + (i32.const 0) + ) + (block + (if + (i32.lt_u + (get_local $12) + (tee_local $11 + (i32.load + (i32.const 192) ) ) - (call $_abort) ) - (if - (i32.ge_u - (get_local $12) - (tee_local $6 - (i32.add - (get_local $12) - (get_local $1) - ) + (call $_abort) + ) + (if + (i32.ge_u + (get_local $12) + (tee_local $6 + (i32.add + (get_local $12) + (get_local $1) ) ) - (call $_abort) ) - (set_local $5 - (i32.load offset=24 - (get_local $12) - ) + (call $_abort) + ) + (set_local $5 + (i32.load offset=24 + (get_local $12) ) - (if - (i32.eq - (tee_local $3 - (i32.load offset=12 - (get_local $12) - ) + ) + (if + (i32.eq + (tee_local $3 + (i32.load offset=12 + (get_local $12) ) - (get_local $12) ) - (block $do-once17 - (set_local $7 - (if (result i32) - (tee_local $0 - (i32.load - (tee_local $9 - (i32.add - (get_local $12) - (i32.const 20) - ) - ) - ) - ) - (block (result i32) - (set_local $17 - (get_local $0) - ) - (get_local $9) - ) - (if (result i32) - (tee_local $17 - (i32.load - (tee_local $15 - (i32.add - (get_local $12) - (i32.const 16) - ) - ) + (get_local $12) + ) + (block $do-once17 + (set_local $7 + (if (result i32) + (tee_local $0 + (i32.load + (tee_local $9 + (i32.add + (get_local $12) + (i32.const 20) ) ) - (get_local $15) - (br $do-once17) ) ) - ) - (loop $while-in20 - (if - (tee_local $0 - (i32.load - (tee_local $9 - (i32.add - (get_local $17) - (i32.const 20) - ) - ) - ) - ) - (block - (set_local $17 - (get_local $0) - ) - (set_local $7 - (get_local $9) - ) - (br $while-in20) + (block (result i32) + (set_local $17 + (get_local $0) ) + (get_local $9) ) - (if - (tee_local $0 + (if (result i32) + (tee_local $17 (i32.load - (tee_local $9 + (tee_local $15 (i32.add - (get_local $17) + (get_local $12) (i32.const 16) ) ) ) ) - (block - (set_local $17 - (get_local $0) - ) - (set_local $7 - (get_local $9) - ) - (br $while-in20) - ) - ) - ) - (if - (i32.lt_u - (get_local $7) - (get_local $11) - ) - (call $_abort) - (block - (i32.store - (get_local $7) - (i32.const 0) - ) - (set_local $8 - (get_local $17) - ) + (get_local $15) + (br $do-once17) ) ) ) - (block + (loop $while-in20 (if - (i32.lt_u - (tee_local $9 - (i32.load offset=8 - (get_local $12) - ) - ) - (get_local $11) - ) - (call $_abort) - ) - (if - (i32.ne + (tee_local $0 (i32.load - (tee_local $0 + (tee_local $9 (i32.add - (get_local $9) - (i32.const 12) + (get_local $17) + (i32.const 20) ) ) ) - (get_local $12) ) - (call $_abort) + (block + (set_local $17 + (get_local $0) + ) + (set_local $7 + (get_local $9) + ) + (br $while-in20) + ) ) (if - (i32.eq + (tee_local $0 (i32.load - (tee_local $15 + (tee_local $9 (i32.add - (get_local $3) - (i32.const 8) + (get_local $17) + (i32.const 16) ) ) ) - (get_local $12) ) (block - (i32.store + (set_local $17 (get_local $0) - (get_local $3) ) - (i32.store - (get_local $15) + (set_local $7 (get_local $9) ) - (set_local $8 - (get_local $3) + (br $while-in20) + ) + ) + ) + (if + (i32.lt_u + (get_local $7) + (get_local $11) + ) + (call $_abort) + (block + (i32.store + (get_local $7) + (i32.const 0) + ) + (set_local $8 + (get_local $17) + ) + ) + ) + ) + (block + (if + (i32.lt_u + (tee_local $9 + (i32.load offset=8 + (get_local $12) ) ) - (call $_abort) + (get_local $11) ) + (call $_abort) + ) + (if + (i32.ne + (i32.load + (tee_local $0 + (i32.add + (get_local $9) + (i32.const 12) + ) + ) + ) + (get_local $12) + ) + (call $_abort) + ) + (if + (i32.eq + (i32.load + (tee_local $15 + (i32.add + (get_local $3) + (i32.const 8) + ) + ) + ) + (get_local $12) + ) + (block + (i32.store + (get_local $0) + (get_local $3) + ) + (i32.store + (get_local $15) + (get_local $9) + ) + (set_local $8 + (get_local $3) + ) + ) + (call $_abort) ) ) - (if - (get_local $5) - (block $do-once21 - (if - (i32.eq - (get_local $12) - (i32.load - (tee_local $11 - (i32.add - (i32.shl - (tee_local $3 - (i32.load offset=28 - (get_local $12) - ) + ) + (if + (get_local $5) + (block $do-once21 + (if + (i32.eq + (get_local $12) + (i32.load + (tee_local $11 + (i32.add + (i32.shl + (tee_local $3 + (i32.load offset=28 + (get_local $12) ) - (i32.const 2) ) - (i32.const 480) + (i32.const 2) ) + (i32.const 480) ) ) ) - (block - (i32.store - (get_local $11) + ) + (block + (i32.store + (get_local $11) + (get_local $8) + ) + (if + (i32.eqz (get_local $8) ) - (if - (i32.eqz - (get_local $8) - ) - (block - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $3) - ) - (i32.const -1) + (block + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $3) ) + (i32.const -1) ) ) - (br $do-once21) ) + (br $do-once21) ) ) - (block - (if - (i32.lt_u - (get_local $5) - (i32.load - (i32.const 192) - ) + ) + (block + (if + (i32.lt_u + (get_local $5) + (i32.load + (i32.const 192) ) - (call $_abort) ) - (if - (i32.eq - (i32.load - (tee_local $3 - (i32.add - (get_local $5) - (i32.const 16) - ) + (call $_abort) + ) + (if + (i32.eq + (i32.load + (tee_local $3 + (i32.add + (get_local $5) + (i32.const 16) ) ) - (get_local $12) - ) - (i32.store - (get_local $3) - (get_local $8) - ) - (i32.store offset=20 - (get_local $5) - (get_local $8) ) + (get_local $12) ) - (br_if $do-once21 - (i32.eqz - (get_local $8) - ) + (i32.store + (get_local $3) + (get_local $8) + ) + (i32.store offset=20 + (get_local $5) + (get_local $8) ) ) - ) - (if - (i32.lt_u - (get_local $8) - (tee_local $3 - (i32.load - (i32.const 192) - ) + (br_if $do-once21 + (i32.eqz + (get_local $8) ) ) - (call $_abort) ) - (i32.store offset=24 + ) + (if + (i32.lt_u (get_local $8) - (get_local $5) + (tee_local $3 + (i32.load + (i32.const 192) + ) + ) + ) + (call $_abort) + ) + (i32.store offset=24 + (get_local $8) + (get_local $5) + ) + (if + (tee_local $11 + (i32.load offset=16 + (get_local $12) + ) ) (if - (tee_local $11 - (i32.load offset=16 - (get_local $12) - ) + (i32.lt_u + (get_local $11) + (get_local $3) ) - (if - (i32.lt_u + (call $_abort) + (block + (i32.store offset=16 + (get_local $8) (get_local $11) - (get_local $3) ) - (call $_abort) - (block - (i32.store offset=16 - (get_local $8) - (get_local $11) - ) - (i32.store offset=24 - (get_local $11) - (get_local $8) - ) + (i32.store offset=24 + (get_local $11) + (get_local $8) ) ) ) + ) + (if + (tee_local $11 + (i32.load offset=20 + (get_local $12) + ) + ) (if - (tee_local $11 - (i32.load offset=20 - (get_local $12) + (i32.lt_u + (get_local $11) + (i32.load + (i32.const 192) ) ) - (if - (i32.lt_u + (call $_abort) + (block + (i32.store offset=20 + (get_local $8) (get_local $11) - (i32.load - (i32.const 192) - ) ) - (call $_abort) - (block - (i32.store offset=20 - (get_local $8) - (get_local $11) - ) - (i32.store offset=24 - (get_local $11) - (get_local $8) - ) + (i32.store offset=24 + (get_local $11) + (get_local $8) ) ) ) ) ) - (if - (i32.ge_u - (get_local $2) - (i32.const 16) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block $do-once25 + (i32.store offset=4 + (get_local $12) + (i32.or + (get_local $1) + (i32.const 3) + ) ) - (block $do-once25 - (i32.store offset=4 - (get_local $12) - (i32.or - (get_local $1) - (i32.const 3) - ) + (i32.store offset=4 + (get_local $6) + (i32.or + (get_local $2) + (i32.const 1) ) - (i32.store offset=4 + ) + (i32.store + (i32.add (get_local $6) - (i32.or - (get_local $2) - (i32.const 1) - ) + (get_local $2) ) - (i32.store - (i32.add - (get_local $6) - (get_local $2) - ) + (get_local $2) + ) + (set_local $5 + (i32.shr_u (get_local $2) + (i32.const 3) ) - (set_local $5 - (i32.shr_u - (get_local $2) - (i32.const 3) - ) + ) + (if + (i32.lt_u + (get_local $2) + (i32.const 256) ) - (if - (i32.lt_u - (get_local $2) - (i32.const 256) + (block + (set_local $11 + (i32.add + (i32.shl + (get_local $5) + (i32.const 3) + ) + (i32.const 216) + ) ) - (block - (set_local $11 - (i32.add + (if + (i32.and + (tee_local $3 + (i32.load + (i32.const 176) + ) + ) + (tee_local $9 (i32.shl + (i32.const 1) (get_local $5) - (i32.const 3) ) - (i32.const 216) ) ) (if - (i32.and - (tee_local $3 + (i32.lt_u + (tee_local $15 (i32.load - (i32.const 176) - ) - ) - (tee_local $9 - (i32.shl - (i32.const 1) - (get_local $5) - ) - ) - ) - (if - (i32.lt_u - (tee_local $15 - (i32.load - (tee_local $5 - (i32.add - (get_local $11) - (i32.const 8) - ) + (tee_local $5 + (i32.add + (get_local $11) + (i32.const 8) ) ) ) - (i32.load - (i32.const 192) - ) ) - (call $_abort) - (block - (set_local $16 - (get_local $5) - ) - (set_local $27 - (get_local $15) - ) + (i32.load + (i32.const 192) ) ) + (call $_abort) (block - (i32.store - (i32.const 176) - (i32.or - (get_local $3) - (get_local $9) - ) - ) (set_local $16 - (i32.add - (get_local $11) - (i32.const 8) - ) + (get_local $5) ) (set_local $27 - (get_local $11) + (get_local $15) ) ) ) - (i32.store - (get_local $16) - (get_local $6) - ) - (i32.store offset=12 - (get_local $27) - (get_local $6) - ) - (i32.store offset=8 - (get_local $6) - (get_local $27) - ) - (i32.store offset=12 - (get_local $6) - (get_local $11) + (block + (i32.store + (i32.const 176) + (i32.or + (get_local $3) + (get_local $9) + ) + ) + (set_local $16 + (i32.add + (get_local $11) + (i32.const 8) + ) + ) + (set_local $27 + (get_local $11) + ) ) - (br $do-once25) ) + (i32.store + (get_local $16) + (get_local $6) + ) + (i32.store offset=12 + (get_local $27) + (get_local $6) + ) + (i32.store offset=8 + (get_local $6) + (get_local $27) + ) + (i32.store offset=12 + (get_local $6) + (get_local $11) + ) + (br $do-once25) ) - (set_local $5 - (i32.add - (i32.shl - (tee_local $7 + ) + (set_local $5 + (i32.add + (i32.shl + (tee_local $7 + (if (result i32) + (tee_local $11 + (i32.shr_u + (get_local $2) + (i32.const 8) + ) + ) (if (result i32) - (tee_local $11 - (i32.shr_u - (get_local $2) - (i32.const 8) - ) + (i32.gt_u + (get_local $2) + (i32.const 16777215) ) - (if (result i32) - (i32.gt_u - (get_local $2) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (get_local $2) - (i32.add - (tee_local $5 - (i32.add - (i32.sub - (i32.const 14) + (i32.const 31) + (i32.or + (i32.and + (i32.shr_u + (get_local $2) + (i32.add + (tee_local $5 + (i32.add + (i32.sub + (i32.const 14) + (i32.or (i32.or - (i32.or - (tee_local $11 - (i32.and - (i32.shr_u - (i32.add - (tee_local $3 - (i32.shl - (get_local $11) - (tee_local $9 - (i32.and - (i32.shr_u - (i32.add - (get_local $11) - (i32.const 1048320) - ) - (i32.const 16) + (tee_local $11 + (i32.and + (i32.shr_u + (i32.add + (tee_local $3 + (i32.shl + (get_local $11) + (tee_local $9 + (i32.and + (i32.shr_u + (i32.add + (get_local $11) + (i32.const 1048320) ) - (i32.const 8) + (i32.const 16) ) + (i32.const 8) ) ) ) - (i32.const 520192) ) - (i32.const 16) + (i32.const 520192) ) - (i32.const 4) + (i32.const 16) ) + (i32.const 4) ) - (get_local $9) ) - (tee_local $3 - (i32.and - (i32.shr_u - (i32.add - (tee_local $15 - (i32.shl - (get_local $3) - (get_local $11) - ) + (get_local $9) + ) + (tee_local $3 + (i32.and + (i32.shr_u + (i32.add + (tee_local $15 + (i32.shl + (get_local $3) + (get_local $11) ) - (i32.const 245760) ) - (i32.const 16) + (i32.const 245760) ) - (i32.const 2) + (i32.const 16) ) + (i32.const 2) ) ) ) - (i32.shr_u - (i32.shl - (get_local $15) - (get_local $3) - ) - (i32.const 15) + ) + (i32.shr_u + (i32.shl + (get_local $15) + (get_local $3) ) + (i32.const 15) ) ) - (i32.const 7) ) + (i32.const 7) ) - (i32.const 1) - ) - (i32.shl - (get_local $5) - (i32.const 1) ) + (i32.const 1) + ) + (i32.shl + (get_local $5) + (i32.const 1) ) ) - (i32.const 0) ) + (i32.const 0) ) - (i32.const 2) ) - (i32.const 480) + (i32.const 2) ) + (i32.const 480) ) - (i32.store offset=28 - (get_local $6) - (get_local $7) + ) + (i32.store offset=28 + (get_local $6) + (get_local $7) + ) + (i32.store offset=4 + (tee_local $3 + (i32.add + (get_local $6) + (i32.const 16) + ) ) - (i32.store offset=4 - (tee_local $3 - (i32.add - (get_local $6) - (i32.const 16) + (i32.const 0) + ) + (i32.store + (get_local $3) + (i32.const 0) + ) + (if + (i32.eqz + (i32.and + (tee_local $3 + (i32.load + (i32.const 180) + ) + ) + (tee_local $15 + (i32.shl + (i32.const 1) + (get_local $7) + ) ) ) - (i32.const 0) ) - (i32.store - (get_local $3) - (i32.const 0) + (block + (i32.store + (i32.const 180) + (i32.or + (get_local $3) + (get_local $15) + ) + ) + (i32.store + (get_local $5) + (get_local $6) + ) + (i32.store offset=24 + (get_local $6) + (get_local $5) + ) + (i32.store offset=12 + (get_local $6) + (get_local $6) + ) + (i32.store offset=8 + (get_local $6) + (get_local $6) + ) + (br $do-once25) ) - (if - (i32.eqz - (i32.and - (tee_local $3 - (i32.load - (i32.const 180) - ) + ) + (set_local $15 + (i32.shl + (get_local $2) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (get_local $7) + (i32.const 1) ) - (tee_local $15 - (i32.shl - (i32.const 1) - (get_local $7) + ) + (i32.eq + (get_local $7) + (i32.const 31) + ) + ) + ) + ) + (set_local $3 + (i32.load + (get_local $5) + ) + ) + (if + (i32.eq + (tee_local $10 + (loop $while-in28 (result i32) + (block $while-out27 (result i32) + (if + (i32.eq + (i32.and + (i32.load offset=4 + (get_local $3) + ) + (i32.const -8) + ) + (get_local $2) + ) + (block + (set_local $14 + (get_local $3) + ) + (br $while-out27 + (i32.const 148) + ) + ) + ) + (if (result i32) + (tee_local $9 + (i32.load + (tee_local $5 + (i32.add + (i32.add + (get_local $3) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (get_local $15) + (i32.const 31) + ) + (i32.const 2) + ) + ) + ) + ) + ) + (block + (set_local $15 + (i32.shl + (get_local $15) + (i32.const 1) + ) + ) + (set_local $3 + (get_local $9) + ) + (br $while-in28) + ) + (block (result i32) + (set_local $23 + (get_local $5) + ) + (set_local $20 + (get_local $3) + ) + (i32.const 145) + ) ) ) ) ) - (block - (i32.store - (i32.const 180) - (i32.or - (get_local $3) - (get_local $15) - ) + (i32.const 145) + ) + (if + (i32.lt_u + (get_local $23) + (i32.load + (i32.const 192) ) + ) + (call $_abort) + (block (i32.store - (get_local $5) + (get_local $23) (get_local $6) ) (i32.store offset=24 (get_local $6) - (get_local $5) + (get_local $20) ) (i32.store offset=12 (get_local $6) @@ -2533,234 +2652,110 @@ (get_local $6) (get_local $6) ) - (br $do-once25) - ) - ) - (set_local $15 - (i32.shl - (get_local $2) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (get_local $7) - (i32.const 1) - ) - ) - (i32.eq - (get_local $7) - (i32.const 31) - ) - ) - ) - ) - (set_local $3 - (i32.load - (get_local $5) ) ) (if (i32.eq - (tee_local $10 - (loop $while-in28 (result i32) - (block $while-out27 (result i32) - (if - (i32.eq - (i32.and - (i32.load offset=4 - (get_local $3) - ) - (i32.const -8) - ) - (get_local $2) - ) - (block - (set_local $14 - (get_local $3) - ) - (br $while-out27 - (i32.const 148) + (get_local $10) + (i32.const 148) + ) + (if + (i32.and + (i32.ge_u + (tee_local $15 + (i32.load + (tee_local $3 + (i32.add + (get_local $14) + (i32.const 8) ) ) ) - (if (result i32) - (tee_local $9 - (i32.load - (tee_local $5 - (i32.add - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (get_local $15) - (i32.const 31) - ) - (i32.const 2) - ) - ) - ) - ) - ) - (block - (set_local $15 - (i32.shl - (get_local $15) - (i32.const 1) - ) - ) - (set_local $3 - (get_local $9) - ) - (br $while-in28) - ) - (block (result i32) - (set_local $23 - (get_local $5) - ) - (set_local $20 - (get_local $3) - ) - (i32.const 145) - ) + ) + (tee_local $9 + (i32.load + (i32.const 192) ) ) ) - ) - (i32.const 145) - ) - (if - (i32.lt_u - (get_local $23) - (i32.load - (i32.const 192) + (i32.ge_u + (get_local $14) + (get_local $9) ) ) - (call $_abort) (block + (i32.store offset=12 + (get_local $15) + (get_local $6) + ) (i32.store - (get_local $23) + (get_local $3) (get_local $6) ) - (i32.store offset=24 + (i32.store offset=8 (get_local $6) - (get_local $20) + (get_local $15) ) (i32.store offset=12 (get_local $6) - (get_local $6) + (get_local $14) ) - (i32.store offset=8 - (get_local $6) + (i32.store offset=24 (get_local $6) + (i32.const 0) ) ) - ) - (if - (i32.eq - (get_local $10) - (i32.const 148) - ) - (if - (i32.and - (i32.ge_u - (tee_local $15 - (i32.load - (tee_local $3 - (i32.add - (get_local $14) - (i32.const 8) - ) - ) - ) - ) - (tee_local $9 - (i32.load - (i32.const 192) - ) - ) - ) - (i32.ge_u - (get_local $14) - (get_local $9) - ) - ) - (block - (i32.store offset=12 - (get_local $15) - (get_local $6) - ) - (i32.store - (get_local $3) - (get_local $6) - ) - (i32.store offset=8 - (get_local $6) - (get_local $15) - ) - (i32.store offset=12 - (get_local $6) - (get_local $14) - ) - (i32.store offset=24 - (get_local $6) - (i32.const 0) - ) - ) - (call $_abort) - ) + (call $_abort) ) ) ) - (block - (i32.store offset=4 - (get_local $12) - (i32.or - (tee_local $15 - (i32.add - (get_local $2) - (get_local $1) - ) + ) + (block + (i32.store offset=4 + (get_local $12) + (i32.or + (tee_local $15 + (i32.add + (get_local $2) + (get_local $1) ) - (i32.const 3) ) + (i32.const 3) ) - (i32.store - (tee_local $3 + ) + (i32.store + (tee_local $3 + (i32.add (i32.add - (i32.add - (get_local $12) - (get_local $15) - ) - (i32.const 4) + (get_local $12) + (get_local $15) ) + (i32.const 4) ) - (i32.or - (i32.load - (get_local $3) - ) - (i32.const 1) + ) + (i32.or + (i32.load + (get_local $3) ) + (i32.const 1) ) ) ) - (return - (i32.add - (get_local $12) - (i32.const 8) - ) + ) + (return + (i32.add + (get_local $12) + (i32.const 8) ) ) - (get_local $1) ) + (get_local $1) ) - (get_local $1) ) + (get_local $1) ) - (i32.const -1) ) + (i32.const -1) ) ) ) @@ -3063,384 +3058,381 @@ (i32.const 0) (i32.eq (tee_local $10 - (block $label$break$L257 (result i32) - (if - (i32.eqz - (i32.and + (if (result i32) + (i32.and + (i32.load + (i32.const 620) + ) + (i32.const 4) + ) + (i32.const 190) + (block $label$break$L257 (result i32) + (if + (tee_local $7 (i32.load - (i32.const 620) + (i32.const 200) ) - (i32.const 4) ) - ) - (block - (if - (tee_local $7 - (i32.load - (i32.const 200) - ) + (block $label$break$L259 + (set_local $16 + (i32.const 624) ) - (block $label$break$L259 - (set_local $16 - (i32.const 624) - ) - (loop $while-in34 - (block $while-out33 - (if - (if (result i32) - (i32.le_u - (tee_local $27 - (i32.load - (get_local $16) - ) + (loop $while-in34 + (block $while-out33 + (if + (if (result i32) + (i32.le_u + (tee_local $27 + (i32.load + (get_local $16) ) - (get_local $7) ) - (i32.gt_u - (i32.add - (get_local $27) - (i32.load - (tee_local $8 - (i32.add - (get_local $16) - (i32.const 4) - ) + (get_local $7) + ) + (i32.gt_u + (i32.add + (get_local $27) + (i32.load + (tee_local $8 + (i32.add + (get_local $16) + (i32.const 4) ) ) ) - (get_local $7) - ) - (i32.const 0) - ) - (block - (set_local $6 - (get_local $16) ) - (set_local $5 - (get_local $8) - ) - (br $while-out33) + (get_local $7) ) + (i32.const 0) ) - (br_if $while-in34 - (tee_local $16 - (i32.load offset=8 - (get_local $16) - ) + (block + (set_local $6 + (get_local $16) ) + (set_local $5 + (get_local $8) + ) + (br $while-out33) ) - (set_local $10 - (i32.const 173) - ) - (br $label$break$L259) ) - ) - (if - (i32.lt_u + (br_if $while-in34 (tee_local $16 - (i32.and - (i32.sub - (get_local $20) - (i32.load - (i32.const 188) - ) - ) - (get_local $23) + (i32.load offset=8 + (get_local $16) ) ) - (i32.const 2147483647) ) - (if - (i32.eq - (tee_local $8 - (call $_sbrk - (get_local $16) - ) - ) - (i32.add + (set_local $10 + (i32.const 173) + ) + (br $label$break$L259) + ) + ) + (if + (i32.lt_u + (tee_local $16 + (i32.and + (i32.sub + (get_local $20) (i32.load - (get_local $6) - ) - (i32.load - (get_local $5) + (i32.const 188) ) ) + (get_local $23) ) - (if - (i32.ne - (get_local $8) - (i32.const -1) + ) + (i32.const 2147483647) + ) + (if + (i32.eq + (tee_local $8 + (call $_sbrk + (get_local $16) ) - (block - (set_local $19 - (get_local $8) - ) - (set_local $21 - (get_local $16) - ) - (br $label$break$L257 - (i32.const 193) - ) + ) + (i32.add + (i32.load + (get_local $6) ) + (i32.load + (get_local $5) + ) + ) + ) + (if + (i32.ne + (get_local $8) + (i32.const -1) ) (block - (set_local $13 + (set_local $19 (get_local $8) ) - (set_local $18 + (set_local $21 (get_local $16) ) - (set_local $10 - (i32.const 183) + (br $label$break$L257 + (i32.const 193) ) ) ) + (block + (set_local $13 + (get_local $8) + ) + (set_local $18 + (get_local $16) + ) + (set_local $10 + (i32.const 183) + ) + ) ) ) - (set_local $10 + ) + (set_local $10 + (i32.const 173) + ) + ) + (if + (if (result i32) + (i32.eq + (get_local $10) (i32.const 173) ) - ) - (if - (if (result i32) - (i32.eq - (get_local $10) - (i32.const 173) - ) - (i32.ne - (tee_local $7 - (call $_sbrk - (i32.const 0) - ) + (i32.ne + (tee_local $7 + (call $_sbrk + (i32.const 0) ) - (i32.const -1) ) - (i32.const 0) + (i32.const -1) ) - (block $do-once35 - (set_local $0 - (if (result i32) - (i32.and - (tee_local $8 - (i32.add - (tee_local $16 - (i32.load - (i32.const 652) - ) + (i32.const 0) + ) + (block $do-once35 + (set_local $0 + (if (result i32) + (i32.and + (tee_local $8 + (i32.add + (tee_local $16 + (i32.load + (i32.const 652) ) - (i32.const -1) ) - ) - (tee_local $1 - (get_local $7) + (i32.const -1) ) ) - (i32.add - (i32.sub - (get_local $2) + (tee_local $1 + (get_local $7) + ) + ) + (i32.add + (i32.sub + (get_local $2) + (get_local $1) + ) + (i32.and + (i32.add + (get_local $8) (get_local $1) ) - (i32.and - (i32.add - (get_local $8) - (get_local $1) - ) - (i32.sub - (i32.const 0) - (get_local $16) - ) + (i32.sub + (i32.const 0) + (get_local $16) ) ) - (get_local $2) ) + (get_local $2) ) - (set_local $1 - (i32.add - (tee_local $16 - (i32.load - (i32.const 608) - ) + ) + (set_local $1 + (i32.add + (tee_local $16 + (i32.load + (i32.const 608) ) - (get_local $0) ) + (get_local $0) ) - (if - (i32.and - (i32.gt_u - (get_local $0) - (get_local $9) - ) - (i32.lt_u - (get_local $0) - (i32.const 2147483647) - ) + ) + (if + (i32.and + (i32.gt_u + (get_local $0) + (get_local $9) ) - (block - (br_if $do-once35 - (select - (i32.or - (i32.le_u - (get_local $1) - (get_local $16) - ) - (i32.gt_u - (get_local $1) - (tee_local $8 - (i32.load - (i32.const 616) - ) - ) - ) + (i32.lt_u + (get_local $0) + (i32.const 2147483647) + ) + ) + (block + (br_if $do-once35 + (select + (i32.or + (i32.le_u + (get_local $1) + (get_local $16) ) - (i32.const 0) - (get_local $8) - ) - ) - (set_local $18 - (if (result i32) - (i32.eq + (i32.gt_u + (get_local $1) (tee_local $8 - (call $_sbrk - (get_local $0) + (i32.load + (i32.const 616) ) ) - (get_local $7) ) - (block - (set_local $19 - (get_local $7) - ) - (set_local $21 + ) + (i32.const 0) + (get_local $8) + ) + ) + (set_local $18 + (if (result i32) + (i32.eq + (tee_local $8 + (call $_sbrk (get_local $0) ) - (br $label$break$L257 - (i32.const 193) - ) ) - (block (result i32) - (set_local $13 - (get_local $8) - ) - (set_local $10 - (i32.const 183) - ) + (get_local $7) + ) + (block + (set_local $19 + (get_local $7) + ) + (set_local $21 (get_local $0) ) + (br $label$break$L257 + (i32.const 193) + ) + ) + (block (result i32) + (set_local $13 + (get_local $8) + ) + (set_local $10 + (i32.const 183) + ) + (get_local $0) ) ) ) ) ) ) - (if - (i32.eq - (get_local $10) - (i32.const 183) - ) - (block $label$break$L279 - (set_local $8 - (i32.sub - (i32.const 0) - (get_local $18) - ) + ) + (if + (i32.eq + (get_local $10) + (i32.const 183) + ) + (block $label$break$L279 + (set_local $8 + (i32.sub + (i32.const 0) + (get_local $18) ) - (set_local $4 + ) + (set_local $4 + (if (result i32) (if (result i32) - (if (result i32) + (i32.and + (i32.gt_u + (get_local $14) + (get_local $18) + ) (i32.and - (i32.gt_u - (get_local $14) + (i32.lt_u (get_local $18) + (i32.const 2147483647) ) - (i32.and - (i32.lt_u - (get_local $18) - (i32.const 2147483647) - ) - (i32.ne - (get_local $13) - (i32.const -1) - ) + (i32.ne + (get_local $13) + (i32.const -1) ) ) - (i32.lt_u - (tee_local $1 - (i32.and - (i32.add - (i32.sub - (get_local $12) - (get_local $18) - ) - (tee_local $7 - (i32.load - (i32.const 656) - ) - ) - ) + ) + (i32.lt_u + (tee_local $1 + (i32.and + (i32.add (i32.sub - (i32.const 0) - (get_local $7) + (get_local $12) + (get_local $18) ) + (tee_local $7 + (i32.load + (i32.const 656) + ) + ) + ) + (i32.sub + (i32.const 0) + (get_local $7) ) ) - (i32.const 2147483647) ) - (i32.const 0) + (i32.const 2147483647) ) - (if (result i32) - (i32.eq - (call $_sbrk - (get_local $1) - ) - (i32.const -1) + (i32.const 0) + ) + (if (result i32) + (i32.eq + (call $_sbrk + (get_local $1) ) - (block - (drop - (call $_sbrk - (get_local $8) - ) + (i32.const -1) + ) + (block + (drop + (call $_sbrk + (get_local $8) ) - (br $label$break$L279) - ) - (i32.add - (get_local $1) - (get_local $18) ) + (br $label$break$L279) + ) + (i32.add + (get_local $1) + (get_local $18) ) - (get_local $18) ) + (get_local $18) ) - (if - (i32.ne + ) + (if + (i32.ne + (get_local $13) + (i32.const -1) + ) + (block + (set_local $19 (get_local $13) - (i32.const -1) ) - (block - (set_local $19 - (get_local $13) - ) - (set_local $21 - (get_local $4) - ) - (br $label$break$L257 - (i32.const 193) - ) + (set_local $21 + (get_local $4) + ) + (br $label$break$L257 + (i32.const 193) ) ) ) ) - (i32.store - (i32.const 620) - (i32.or - (i32.load - (i32.const 620) - ) - (i32.const 4) + ) + (i32.store + (i32.const 620) + (i32.or + (i32.load + (i32.const 620) ) + (i32.const 4) ) ) + (i32.const 190) ) - (i32.const 190) ) ) (i32.const 190) @@ -7988,7 +7980,7 @@ (local $6 i32) (local $7 i32) (if - (tee_local $5 + (tee_local $4 (i32.load (tee_local $3 (i32.add @@ -8000,7 +7992,7 @@ ) (block (set_local $6 - (get_local $5) + (get_local $4) ) (set_local $7 (i32.const 5) @@ -8029,26 +8021,26 @@ (get_local $7) (i32.const 5) ) - (block $label$break$L5 - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 20) + (set_local $5 + (block $label$break$L5 (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $6) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) + ) ) ) ) ) + (get_local $1) ) - (get_local $1) - ) - (block - (set_local $4 + (br $label$break$L5 (call_indirect (type $FUNCSIG$iiii) (get_local $2) (get_local $0) @@ -8064,122 +8056,116 @@ ) ) ) - (br $label$break$L5) ) - ) - (set_local $4 - (get_local $3) - ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (set_local $5 + (get_local $3) ) - (block $label$break$L10 - (set_local $3 - (get_local $1) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) + (block $label$break$L10 + (set_local $3 + (get_local $1) + ) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) + ) + (br $label$break$L10) ) - (br $label$break$L10) ) - ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $6 + (i32.add + (get_local $3) + (i32.const -1) + ) ) ) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (set_local $3 - (get_local $6) + (block + (set_local $3 + (get_local $6) + ) + (br $while-in) ) - (br $while-in) ) ) - ) - (if - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) + (drop + (br_if $label$break$L5 (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) + ) + (i32.const 7) + ) + (i32.const 2) ) - (i32.const 7) ) - (i32.const 2) + (get_local $3) ) ) - (get_local $3) ) - (block - (set_local $4 + (set_local $1 + (i32.sub + (get_local $1) (get_local $3) ) - (br $label$break$L5) ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) + (set_local $5 + (i32.load + (get_local $4) + ) ) ) - (set_local $4 - (i32.load - (get_local $5) - ) + (set_local $3 + (i32.const 0) ) ) - (set_local $3 - (i32.const 0) + (drop + (call $_memcpy + (get_local $5) + (get_local $0) + (get_local $1) + ) ) - ) - (drop - (call $_memcpy + (i32.store (get_local $4) - (get_local $0) - (get_local $1) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) + (i32.add + (i32.load + (get_local $4) + ) + (get_local $1) ) - (get_local $1) ) - ) - (set_local $4 (i32.add (get_local $3) (get_local $1) @@ -8187,7 +8173,7 @@ ) ) ) - (get_local $4) + (get_local $5) ) (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) diff --git a/test/emcc_O2_hello_world.fromasm.clamp b/test/emcc_O2_hello_world.fromasm.clamp index 1a6fd9245..616c6ae12 100644 --- a/test/emcc_O2_hello_world.fromasm.clamp +++ b/test/emcc_O2_hello_world.fromasm.clamp @@ -1339,248 +1339,246 @@ ) ) ) - (block $do-once - (set_local $9 - (if (result i32) - (i32.le_u - (get_local $0) - (i32.const -65) - ) - (block (result i32) - (set_local $1 - (i32.and - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 11) - ) + (set_local $9 + (if (result i32) + (i32.le_u + (get_local $0) + (i32.const -65) + ) + (block $do-once (result i32) + (set_local $1 + (i32.and + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 11) ) - (i32.const -8) ) + (i32.const -8) ) - (if (result i32) - (tee_local $11 - (i32.load - (i32.const 180) - ) + ) + (if (result i32) + (tee_local $11 + (i32.load + (i32.const 180) ) - (block (result i32) - (set_local $0 - (i32.sub - (i32.const 0) - (get_local $1) - ) + ) + (block (result i32) + (set_local $0 + (i32.sub + (i32.const 0) + (get_local $1) ) - (if - (tee_local $15 - (i32.load offset=480 - (i32.shl - (tee_local $9 + ) + (if + (tee_local $15 + (i32.load offset=480 + (i32.shl + (tee_local $9 + (if (result i32) + (tee_local $7 + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + ) (if (result i32) - (tee_local $7 - (i32.shr_u - (get_local $3) - (i32.const 8) - ) + (i32.gt_u + (get_local $1) + (i32.const 16777215) ) - (if (result i32) - (i32.gt_u - (get_local $1) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (get_local $1) - (i32.add - (tee_local $15 - (i32.add - (i32.sub - (i32.const 14) + (i32.const 31) + (i32.or + (i32.and + (i32.shr_u + (get_local $1) + (i32.add + (tee_local $15 + (i32.add + (i32.sub + (i32.const 14) + (i32.or (i32.or - (i32.or - (tee_local $7 - (i32.and - (i32.shr_u - (i32.add - (tee_local $10 - (i32.shl - (get_local $7) - (tee_local $3 - (i32.and - (i32.shr_u - (i32.add - (get_local $7) - (i32.const 1048320) - ) - (i32.const 16) + (tee_local $7 + (i32.and + (i32.shr_u + (i32.add + (tee_local $10 + (i32.shl + (get_local $7) + (tee_local $3 + (i32.and + (i32.shr_u + (i32.add + (get_local $7) + (i32.const 1048320) ) - (i32.const 8) + (i32.const 16) ) + (i32.const 8) ) ) ) - (i32.const 520192) ) - (i32.const 16) + (i32.const 520192) ) - (i32.const 4) + (i32.const 16) ) + (i32.const 4) ) - (get_local $3) ) - (tee_local $10 - (i32.and - (i32.shr_u - (i32.add - (tee_local $17 - (i32.shl - (get_local $10) - (get_local $7) - ) + (get_local $3) + ) + (tee_local $10 + (i32.and + (i32.shr_u + (i32.add + (tee_local $17 + (i32.shl + (get_local $10) + (get_local $7) ) - (i32.const 245760) ) - (i32.const 16) + (i32.const 245760) ) - (i32.const 2) + (i32.const 16) ) + (i32.const 2) ) ) ) - (i32.shr_u - (i32.shl - (get_local $17) - (get_local $10) - ) - (i32.const 15) + ) + (i32.shr_u + (i32.shl + (get_local $17) + (get_local $10) ) + (i32.const 15) ) ) - (i32.const 7) ) + (i32.const 7) ) - (i32.const 1) - ) - (i32.shl - (get_local $15) - (i32.const 1) ) + (i32.const 1) + ) + (i32.shl + (get_local $15) + (i32.const 1) ) ) - (i32.const 0) ) + (i32.const 0) ) - (i32.const 2) ) + (i32.const 2) ) ) - (block $label$break$L123 - (set_local $10 - (get_local $0) - ) - (set_local $17 - (i32.const 0) - ) - (set_local $3 - (i32.shl - (get_local $1) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (get_local $9) - (i32.const 1) - ) - ) - (i32.eq + ) + (block $label$break$L123 + (set_local $10 + (get_local $0) + ) + (set_local $17 + (i32.const 0) + ) + (set_local $3 + (i32.shl + (get_local $1) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u (get_local $9) - (i32.const 31) + (i32.const 1) ) ) + (i32.eq + (get_local $9) + (i32.const 31) + ) ) ) - (set_local $7 - (get_local $15) - ) - (loop $while-in14 - (if - (i32.lt_u - (tee_local $0 - (i32.sub - (tee_local $22 - (i32.and - (i32.load offset=4 - (get_local $7) - ) - (i32.const -8) + ) + (set_local $7 + (get_local $15) + ) + (loop $while-in14 + (if + (i32.lt_u + (tee_local $0 + (i32.sub + (tee_local $22 + (i32.and + (i32.load offset=4 + (get_local $7) ) + (i32.const -8) ) - (get_local $1) ) + (get_local $1) ) - (get_local $10) ) - (set_local $6 - (if (result i32) - (i32.eq - (get_local $22) - (get_local $1) - ) - (block - (set_local $28 - (get_local $0) - ) - (set_local $26 - (get_local $7) - ) - (set_local $30 - (get_local $7) - ) - (set_local $10 - (i32.const 90) - ) - (br $label$break$L123) + (get_local $10) + ) + (set_local $6 + (if (result i32) + (i32.eq + (get_local $22) + (get_local $1) + ) + (block + (set_local $28 + (get_local $0) ) - (block (result i32) - (set_local $10 - (get_local $0) - ) + (set_local $26 (get_local $7) ) - ) - ) - ) - (set_local $22 - (select - (get_local $17) - (tee_local $0 - (i32.load offset=20 + (set_local $30 (get_local $7) ) + (set_local $10 + (i32.const 90) + ) + (br $label$break$L123) ) - (i32.or - (i32.eqz + (block (result i32) + (set_local $10 (get_local $0) ) - (i32.eq - (get_local $0) - (tee_local $7 - (i32.load + (get_local $7) + ) + ) + ) + ) + (set_local $22 + (select + (get_local $17) + (tee_local $0 + (i32.load offset=20 + (get_local $7) + ) + ) + (i32.or + (i32.eqz + (get_local $0) + ) + (i32.eq + (get_local $0) + (tee_local $7 + (i32.load + (i32.add (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (get_local $3) - (i32.const 31) - ) - (i32.const 2) + (get_local $7) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (get_local $3) + (i32.const 31) ) + (i32.const 2) ) ) ) @@ -1588,71 +1586,74 @@ ) ) ) - (set_local $5 - (if (result i32) - (tee_local $0 - (i32.eqz - (get_local $7) - ) + ) + (set_local $5 + (if (result i32) + (tee_local $0 + (i32.eqz + (get_local $7) ) - (block (result i32) - (set_local $33 - (get_local $10) - ) - (set_local $31 - (get_local $6) - ) - (set_local $10 - (i32.const 86) - ) + ) + (block (result i32) + (set_local $33 + (get_local $10) + ) + (set_local $31 + (get_local $6) + ) + (set_local $10 + (i32.const 86) + ) + (get_local $22) + ) + (block + (set_local $17 (get_local $22) ) - (block - (set_local $17 - (get_local $22) - ) - (set_local $3 - (i32.shl - (get_local $3) - (i32.xor - (i32.and - (get_local $0) - (i32.const 1) - ) + (set_local $3 + (i32.shl + (get_local $3) + (i32.xor + (i32.and + (get_local $0) (i32.const 1) ) + (i32.const 1) ) ) - (br $while-in14) ) + (br $while-in14) ) ) ) ) - (block - (set_local $33 - (get_local $0) - ) - (set_local $10 - (i32.const 86) - ) - ) ) - (if - (i32.eq - (get_local $10) + (block + (set_local $33 + (get_local $0) + ) + (set_local $10 (i32.const 86) ) - (if - (tee_local $0 - (if (result i32) - (i32.or - (get_local $5) - (get_local $31) - ) + ) + ) + (if + (i32.eq + (get_local $10) + (i32.const 86) + ) + (if + (tee_local $0 + (if (result i32) + (i32.or (get_local $5) - (block (result i32) - (if + (get_local $31) + ) + (get_local $5) + (block (result i32) + (drop + (br_if $do-once + (get_local $1) (i32.eqz (tee_local $0 (i32.and @@ -1672,178 +1673,193 @@ ) ) ) - (block - (set_local $9 - (get_local $1) - ) - (br $do-once) - ) ) - (set_local $0 - (i32.and - (i32.shr_u - (tee_local $15 - (i32.add - (i32.and + ) + (set_local $0 + (i32.and + (i32.shr_u + (tee_local $15 + (i32.add + (i32.and + (get_local $0) + (i32.sub + (i32.const 0) (get_local $0) - (i32.sub - (i32.const 0) - (get_local $0) - ) ) - (i32.const -1) ) + (i32.const -1) ) - (i32.const 12) ) - (i32.const 16) + (i32.const 12) ) + (i32.const 16) ) - (i32.load offset=480 - (i32.shl - (i32.add + ) + (i32.load offset=480 + (i32.shl + (i32.add + (i32.or (i32.or (i32.or (i32.or - (i32.or - (tee_local $15 - (i32.and - (i32.shr_u - (tee_local $9 - (i32.shr_u - (get_local $15) - (get_local $0) - ) - ) - (i32.const 5) - ) - (i32.const 8) - ) - ) - (get_local $0) - ) - (tee_local $9 + (tee_local $15 (i32.and (i32.shr_u - (tee_local $5 + (tee_local $9 (i32.shr_u - (get_local $9) (get_local $15) + (get_local $0) ) ) - (i32.const 2) + (i32.const 5) ) - (i32.const 4) + (i32.const 8) ) ) + (get_local $0) ) - (tee_local $5 + (tee_local $9 (i32.and (i32.shr_u - (tee_local $6 + (tee_local $5 (i32.shr_u - (get_local $5) (get_local $9) + (get_local $15) ) ) - (i32.const 1) + (i32.const 2) ) - (i32.const 2) + (i32.const 4) ) ) ) - (tee_local $6 + (tee_local $5 (i32.and (i32.shr_u - (tee_local $3 + (tee_local $6 (i32.shr_u - (get_local $6) (get_local $5) + (get_local $9) ) ) (i32.const 1) ) - (i32.const 1) + (i32.const 2) ) ) ) - (i32.shr_u - (get_local $3) - (get_local $6) + (tee_local $6 + (i32.and + (i32.shr_u + (tee_local $3 + (i32.shr_u + (get_local $6) + (get_local $5) + ) + ) + (i32.const 1) + ) + (i32.const 1) + ) ) ) - (i32.const 2) + (i32.shr_u + (get_local $3) + (get_local $6) + ) ) + (i32.const 2) ) ) ) ) - (block - (set_local $28 - (get_local $33) - ) - (set_local $26 - (get_local $0) - ) - (set_local $30 - (get_local $31) - ) - (set_local $10 - (i32.const 90) - ) + ) + (block + (set_local $28 + (get_local $33) ) - (block - (set_local $2 - (get_local $33) - ) - (set_local $12 - (get_local $31) - ) + (set_local $26 + (get_local $0) + ) + (set_local $30 + (get_local $31) + ) + (set_local $10 + (i32.const 90) + ) + ) + (block + (set_local $2 + (get_local $33) + ) + (set_local $12 + (get_local $31) ) ) ) - (if - (i32.eq - (get_local $10) - (i32.const 90) + ) + (if + (i32.eq + (get_local $10) + (i32.const 90) + ) + (loop $while-in16 + (set_local $10 + (i32.const 0) ) - (loop $while-in16 - (set_local $10 - (i32.const 0) - ) - (set_local $3 - (i32.lt_u - (tee_local $6 - (i32.sub - (i32.and - (i32.load offset=4 - (get_local $26) - ) - (i32.const -8) + (set_local $3 + (i32.lt_u + (tee_local $6 + (i32.sub + (i32.and + (i32.load offset=4 + (get_local $26) ) - (get_local $1) + (i32.const -8) ) + (get_local $1) ) - (get_local $28) ) + (get_local $28) ) - (set_local $5 - (select - (get_local $6) - (get_local $28) - (get_local $3) - ) + ) + (set_local $5 + (select + (get_local $6) + (get_local $28) + (get_local $3) ) - (set_local $6 - (select + ) + (set_local $6 + (select + (get_local $26) + (get_local $30) + (get_local $3) + ) + ) + (if + (tee_local $3 + (i32.load offset=16 (get_local $26) - (get_local $30) + ) + ) + (block + (set_local $28 + (get_local $5) + ) + (set_local $26 (get_local $3) ) + (set_local $30 + (get_local $6) + ) + (br $while-in16) ) - (if - (tee_local $3 - (i32.load offset=16 + ) + (set_local $2 + (if (result i32) + (tee_local $26 + (i32.load offset=20 (get_local $26) ) ) @@ -1851,679 +1867,782 @@ (set_local $28 (get_local $5) ) - (set_local $26 - (get_local $3) - ) (set_local $30 (get_local $6) ) (br $while-in16) ) - ) - (set_local $2 - (if (result i32) - (tee_local $26 - (i32.load offset=20 - (get_local $26) - ) - ) - (block - (set_local $28 - (get_local $5) - ) - (set_local $30 - (get_local $6) - ) - (br $while-in16) - ) - (block (result i32) - (set_local $12 - (get_local $6) - ) - (get_local $5) + (block (result i32) + (set_local $12 + (get_local $6) ) + (get_local $5) ) ) ) ) + ) + (if (result i32) (if (result i32) - (if (result i32) - (get_local $12) - (i32.lt_u - (get_local $2) - (i32.sub - (i32.load - (i32.const 184) - ) - (get_local $1) + (get_local $12) + (i32.lt_u + (get_local $2) + (i32.sub + (i32.load + (i32.const 184) ) + (get_local $1) ) - (i32.const 0) ) - (block - (if - (i32.lt_u - (get_local $12) - (tee_local $11 - (i32.load - (i32.const 192) - ) + (i32.const 0) + ) + (block + (if + (i32.lt_u + (get_local $12) + (tee_local $11 + (i32.load + (i32.const 192) ) ) - (call $_abort) ) - (if - (i32.ge_u - (get_local $12) - (tee_local $6 - (i32.add - (get_local $12) - (get_local $1) - ) + (call $_abort) + ) + (if + (i32.ge_u + (get_local $12) + (tee_local $6 + (i32.add + (get_local $12) + (get_local $1) ) ) - (call $_abort) ) - (set_local $5 - (i32.load offset=24 - (get_local $12) - ) + (call $_abort) + ) + (set_local $5 + (i32.load offset=24 + (get_local $12) ) - (if - (i32.eq - (tee_local $3 - (i32.load offset=12 - (get_local $12) - ) + ) + (if + (i32.eq + (tee_local $3 + (i32.load offset=12 + (get_local $12) ) - (get_local $12) ) - (block $do-once17 - (set_local $7 - (if (result i32) - (tee_local $0 - (i32.load - (tee_local $9 - (i32.add - (get_local $12) - (i32.const 20) - ) - ) - ) - ) - (block (result i32) - (set_local $17 - (get_local $0) - ) - (get_local $9) - ) - (if (result i32) - (tee_local $17 - (i32.load - (tee_local $15 - (i32.add - (get_local $12) - (i32.const 16) - ) - ) + (get_local $12) + ) + (block $do-once17 + (set_local $7 + (if (result i32) + (tee_local $0 + (i32.load + (tee_local $9 + (i32.add + (get_local $12) + (i32.const 20) ) ) - (get_local $15) - (br $do-once17) ) ) - ) - (loop $while-in20 - (if - (tee_local $0 - (i32.load - (tee_local $9 - (i32.add - (get_local $17) - (i32.const 20) - ) - ) - ) - ) - (block - (set_local $17 - (get_local $0) - ) - (set_local $7 - (get_local $9) - ) - (br $while-in20) + (block (result i32) + (set_local $17 + (get_local $0) ) + (get_local $9) ) - (if - (tee_local $0 + (if (result i32) + (tee_local $17 (i32.load - (tee_local $9 + (tee_local $15 (i32.add - (get_local $17) + (get_local $12) (i32.const 16) ) ) ) ) - (block - (set_local $17 - (get_local $0) - ) - (set_local $7 - (get_local $9) - ) - (br $while-in20) - ) - ) - ) - (if - (i32.lt_u - (get_local $7) - (get_local $11) - ) - (call $_abort) - (block - (i32.store - (get_local $7) - (i32.const 0) - ) - (set_local $8 - (get_local $17) - ) + (get_local $15) + (br $do-once17) ) ) ) - (block + (loop $while-in20 (if - (i32.lt_u - (tee_local $9 - (i32.load offset=8 - (get_local $12) - ) - ) - (get_local $11) - ) - (call $_abort) - ) - (if - (i32.ne + (tee_local $0 (i32.load - (tee_local $0 + (tee_local $9 (i32.add - (get_local $9) - (i32.const 12) + (get_local $17) + (i32.const 20) ) ) ) - (get_local $12) ) - (call $_abort) + (block + (set_local $17 + (get_local $0) + ) + (set_local $7 + (get_local $9) + ) + (br $while-in20) + ) ) (if - (i32.eq + (tee_local $0 (i32.load - (tee_local $15 + (tee_local $9 (i32.add - (get_local $3) - (i32.const 8) + (get_local $17) + (i32.const 16) ) ) ) - (get_local $12) ) (block - (i32.store + (set_local $17 (get_local $0) - (get_local $3) ) - (i32.store - (get_local $15) + (set_local $7 (get_local $9) ) - (set_local $8 - (get_local $3) + (br $while-in20) + ) + ) + ) + (if + (i32.lt_u + (get_local $7) + (get_local $11) + ) + (call $_abort) + (block + (i32.store + (get_local $7) + (i32.const 0) + ) + (set_local $8 + (get_local $17) + ) + ) + ) + ) + (block + (if + (i32.lt_u + (tee_local $9 + (i32.load offset=8 + (get_local $12) ) ) - (call $_abort) + (get_local $11) ) + (call $_abort) + ) + (if + (i32.ne + (i32.load + (tee_local $0 + (i32.add + (get_local $9) + (i32.const 12) + ) + ) + ) + (get_local $12) + ) + (call $_abort) + ) + (if + (i32.eq + (i32.load + (tee_local $15 + (i32.add + (get_local $3) + (i32.const 8) + ) + ) + ) + (get_local $12) + ) + (block + (i32.store + (get_local $0) + (get_local $3) + ) + (i32.store + (get_local $15) + (get_local $9) + ) + (set_local $8 + (get_local $3) + ) + ) + (call $_abort) ) ) - (if - (get_local $5) - (block $do-once21 - (if - (i32.eq - (get_local $12) - (i32.load - (tee_local $11 - (i32.add - (i32.shl - (tee_local $3 - (i32.load offset=28 - (get_local $12) - ) + ) + (if + (get_local $5) + (block $do-once21 + (if + (i32.eq + (get_local $12) + (i32.load + (tee_local $11 + (i32.add + (i32.shl + (tee_local $3 + (i32.load offset=28 + (get_local $12) ) - (i32.const 2) ) - (i32.const 480) + (i32.const 2) ) + (i32.const 480) ) ) ) - (block - (i32.store - (get_local $11) + ) + (block + (i32.store + (get_local $11) + (get_local $8) + ) + (if + (i32.eqz (get_local $8) ) - (if - (i32.eqz - (get_local $8) - ) - (block - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $3) - ) - (i32.const -1) + (block + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $3) ) + (i32.const -1) ) ) - (br $do-once21) ) + (br $do-once21) ) ) - (block - (if - (i32.lt_u - (get_local $5) - (i32.load - (i32.const 192) - ) + ) + (block + (if + (i32.lt_u + (get_local $5) + (i32.load + (i32.const 192) ) - (call $_abort) ) - (if - (i32.eq - (i32.load - (tee_local $3 - (i32.add - (get_local $5) - (i32.const 16) - ) + (call $_abort) + ) + (if + (i32.eq + (i32.load + (tee_local $3 + (i32.add + (get_local $5) + (i32.const 16) ) ) - (get_local $12) - ) - (i32.store - (get_local $3) - (get_local $8) - ) - (i32.store offset=20 - (get_local $5) - (get_local $8) ) + (get_local $12) ) - (br_if $do-once21 - (i32.eqz - (get_local $8) - ) + (i32.store + (get_local $3) + (get_local $8) + ) + (i32.store offset=20 + (get_local $5) + (get_local $8) ) ) - ) - (if - (i32.lt_u - (get_local $8) - (tee_local $3 - (i32.load - (i32.const 192) - ) + (br_if $do-once21 + (i32.eqz + (get_local $8) ) ) - (call $_abort) ) - (i32.store offset=24 + ) + (if + (i32.lt_u (get_local $8) - (get_local $5) + (tee_local $3 + (i32.load + (i32.const 192) + ) + ) + ) + (call $_abort) + ) + (i32.store offset=24 + (get_local $8) + (get_local $5) + ) + (if + (tee_local $11 + (i32.load offset=16 + (get_local $12) + ) ) (if - (tee_local $11 - (i32.load offset=16 - (get_local $12) - ) + (i32.lt_u + (get_local $11) + (get_local $3) ) - (if - (i32.lt_u + (call $_abort) + (block + (i32.store offset=16 + (get_local $8) (get_local $11) - (get_local $3) ) - (call $_abort) - (block - (i32.store offset=16 - (get_local $8) - (get_local $11) - ) - (i32.store offset=24 - (get_local $11) - (get_local $8) - ) + (i32.store offset=24 + (get_local $11) + (get_local $8) ) ) ) + ) + (if + (tee_local $11 + (i32.load offset=20 + (get_local $12) + ) + ) (if - (tee_local $11 - (i32.load offset=20 - (get_local $12) + (i32.lt_u + (get_local $11) + (i32.load + (i32.const 192) ) ) - (if - (i32.lt_u + (call $_abort) + (block + (i32.store offset=20 + (get_local $8) (get_local $11) - (i32.load - (i32.const 192) - ) ) - (call $_abort) - (block - (i32.store offset=20 - (get_local $8) - (get_local $11) - ) - (i32.store offset=24 - (get_local $11) - (get_local $8) - ) + (i32.store offset=24 + (get_local $11) + (get_local $8) ) ) ) ) ) - (if - (i32.ge_u - (get_local $2) - (i32.const 16) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block $do-once25 + (i32.store offset=4 + (get_local $12) + (i32.or + (get_local $1) + (i32.const 3) + ) ) - (block $do-once25 - (i32.store offset=4 - (get_local $12) - (i32.or - (get_local $1) - (i32.const 3) - ) + (i32.store offset=4 + (get_local $6) + (i32.or + (get_local $2) + (i32.const 1) ) - (i32.store offset=4 + ) + (i32.store + (i32.add (get_local $6) - (i32.or - (get_local $2) - (i32.const 1) - ) + (get_local $2) ) - (i32.store - (i32.add - (get_local $6) - (get_local $2) - ) + (get_local $2) + ) + (set_local $5 + (i32.shr_u (get_local $2) + (i32.const 3) ) - (set_local $5 - (i32.shr_u - (get_local $2) - (i32.const 3) - ) + ) + (if + (i32.lt_u + (get_local $2) + (i32.const 256) ) - (if - (i32.lt_u - (get_local $2) - (i32.const 256) + (block + (set_local $11 + (i32.add + (i32.shl + (get_local $5) + (i32.const 3) + ) + (i32.const 216) + ) ) - (block - (set_local $11 - (i32.add + (if + (i32.and + (tee_local $3 + (i32.load + (i32.const 176) + ) + ) + (tee_local $9 (i32.shl + (i32.const 1) (get_local $5) - (i32.const 3) ) - (i32.const 216) ) ) (if - (i32.and - (tee_local $3 + (i32.lt_u + (tee_local $15 (i32.load - (i32.const 176) - ) - ) - (tee_local $9 - (i32.shl - (i32.const 1) - (get_local $5) - ) - ) - ) - (if - (i32.lt_u - (tee_local $15 - (i32.load - (tee_local $5 - (i32.add - (get_local $11) - (i32.const 8) - ) + (tee_local $5 + (i32.add + (get_local $11) + (i32.const 8) ) ) ) - (i32.load - (i32.const 192) - ) ) - (call $_abort) - (block - (set_local $16 - (get_local $5) - ) - (set_local $27 - (get_local $15) - ) + (i32.load + (i32.const 192) ) ) + (call $_abort) (block - (i32.store - (i32.const 176) - (i32.or - (get_local $3) - (get_local $9) - ) - ) (set_local $16 - (i32.add - (get_local $11) - (i32.const 8) - ) + (get_local $5) ) (set_local $27 - (get_local $11) + (get_local $15) ) ) ) - (i32.store - (get_local $16) - (get_local $6) - ) - (i32.store offset=12 - (get_local $27) - (get_local $6) - ) - (i32.store offset=8 - (get_local $6) - (get_local $27) - ) - (i32.store offset=12 - (get_local $6) - (get_local $11) + (block + (i32.store + (i32.const 176) + (i32.or + (get_local $3) + (get_local $9) + ) + ) + (set_local $16 + (i32.add + (get_local $11) + (i32.const 8) + ) + ) + (set_local $27 + (get_local $11) + ) ) - (br $do-once25) ) + (i32.store + (get_local $16) + (get_local $6) + ) + (i32.store offset=12 + (get_local $27) + (get_local $6) + ) + (i32.store offset=8 + (get_local $6) + (get_local $27) + ) + (i32.store offset=12 + (get_local $6) + (get_local $11) + ) + (br $do-once25) ) - (set_local $5 - (i32.add - (i32.shl - (tee_local $7 + ) + (set_local $5 + (i32.add + (i32.shl + (tee_local $7 + (if (result i32) + (tee_local $11 + (i32.shr_u + (get_local $2) + (i32.const 8) + ) + ) (if (result i32) - (tee_local $11 - (i32.shr_u - (get_local $2) - (i32.const 8) - ) + (i32.gt_u + (get_local $2) + (i32.const 16777215) ) - (if (result i32) - (i32.gt_u - (get_local $2) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (get_local $2) - (i32.add - (tee_local $5 - (i32.add - (i32.sub - (i32.const 14) + (i32.const 31) + (i32.or + (i32.and + (i32.shr_u + (get_local $2) + (i32.add + (tee_local $5 + (i32.add + (i32.sub + (i32.const 14) + (i32.or (i32.or - (i32.or - (tee_local $11 - (i32.and - (i32.shr_u - (i32.add - (tee_local $3 - (i32.shl - (get_local $11) - (tee_local $9 - (i32.and - (i32.shr_u - (i32.add - (get_local $11) - (i32.const 1048320) - ) - (i32.const 16) + (tee_local $11 + (i32.and + (i32.shr_u + (i32.add + (tee_local $3 + (i32.shl + (get_local $11) + (tee_local $9 + (i32.and + (i32.shr_u + (i32.add + (get_local $11) + (i32.const 1048320) ) - (i32.const 8) + (i32.const 16) ) + (i32.const 8) ) ) ) - (i32.const 520192) ) - (i32.const 16) + (i32.const 520192) ) - (i32.const 4) + (i32.const 16) ) + (i32.const 4) ) - (get_local $9) ) - (tee_local $3 - (i32.and - (i32.shr_u - (i32.add - (tee_local $15 - (i32.shl - (get_local $3) - (get_local $11) - ) + (get_local $9) + ) + (tee_local $3 + (i32.and + (i32.shr_u + (i32.add + (tee_local $15 + (i32.shl + (get_local $3) + (get_local $11) ) - (i32.const 245760) ) - (i32.const 16) + (i32.const 245760) ) - (i32.const 2) + (i32.const 16) ) + (i32.const 2) ) ) ) - (i32.shr_u - (i32.shl - (get_local $15) - (get_local $3) - ) - (i32.const 15) + ) + (i32.shr_u + (i32.shl + (get_local $15) + (get_local $3) ) + (i32.const 15) ) ) - (i32.const 7) ) + (i32.const 7) ) - (i32.const 1) - ) - (i32.shl - (get_local $5) - (i32.const 1) ) + (i32.const 1) + ) + (i32.shl + (get_local $5) + (i32.const 1) ) ) - (i32.const 0) ) + (i32.const 0) ) - (i32.const 2) ) - (i32.const 480) + (i32.const 2) ) + (i32.const 480) ) - (i32.store offset=28 - (get_local $6) - (get_local $7) + ) + (i32.store offset=28 + (get_local $6) + (get_local $7) + ) + (i32.store offset=4 + (tee_local $3 + (i32.add + (get_local $6) + (i32.const 16) + ) ) - (i32.store offset=4 - (tee_local $3 - (i32.add - (get_local $6) - (i32.const 16) + (i32.const 0) + ) + (i32.store + (get_local $3) + (i32.const 0) + ) + (if + (i32.eqz + (i32.and + (tee_local $3 + (i32.load + (i32.const 180) + ) + ) + (tee_local $15 + (i32.shl + (i32.const 1) + (get_local $7) + ) ) ) - (i32.const 0) ) - (i32.store - (get_local $3) - (i32.const 0) + (block + (i32.store + (i32.const 180) + (i32.or + (get_local $3) + (get_local $15) + ) + ) + (i32.store + (get_local $5) + (get_local $6) + ) + (i32.store offset=24 + (get_local $6) + (get_local $5) + ) + (i32.store offset=12 + (get_local $6) + (get_local $6) + ) + (i32.store offset=8 + (get_local $6) + (get_local $6) + ) + (br $do-once25) ) - (if - (i32.eqz - (i32.and - (tee_local $3 - (i32.load - (i32.const 180) - ) + ) + (set_local $15 + (i32.shl + (get_local $2) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (get_local $7) + (i32.const 1) ) - (tee_local $15 - (i32.shl - (i32.const 1) - (get_local $7) + ) + (i32.eq + (get_local $7) + (i32.const 31) + ) + ) + ) + ) + (set_local $3 + (i32.load + (get_local $5) + ) + ) + (if + (i32.eq + (tee_local $10 + (loop $while-in28 (result i32) + (block $while-out27 (result i32) + (if + (i32.eq + (i32.and + (i32.load offset=4 + (get_local $3) + ) + (i32.const -8) + ) + (get_local $2) + ) + (block + (set_local $14 + (get_local $3) + ) + (br $while-out27 + (i32.const 148) + ) + ) + ) + (if (result i32) + (tee_local $9 + (i32.load + (tee_local $5 + (i32.add + (i32.add + (get_local $3) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (get_local $15) + (i32.const 31) + ) + (i32.const 2) + ) + ) + ) + ) + ) + (block + (set_local $15 + (i32.shl + (get_local $15) + (i32.const 1) + ) + ) + (set_local $3 + (get_local $9) + ) + (br $while-in28) + ) + (block (result i32) + (set_local $23 + (get_local $5) + ) + (set_local $20 + (get_local $3) + ) + (i32.const 145) + ) ) ) ) ) - (block - (i32.store - (i32.const 180) - (i32.or - (get_local $3) - (get_local $15) - ) + (i32.const 145) + ) + (if + (i32.lt_u + (get_local $23) + (i32.load + (i32.const 192) ) + ) + (call $_abort) + (block (i32.store - (get_local $5) + (get_local $23) (get_local $6) ) (i32.store offset=24 (get_local $6) - (get_local $5) + (get_local $20) ) (i32.store offset=12 (get_local $6) @@ -2533,234 +2652,110 @@ (get_local $6) (get_local $6) ) - (br $do-once25) - ) - ) - (set_local $15 - (i32.shl - (get_local $2) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (get_local $7) - (i32.const 1) - ) - ) - (i32.eq - (get_local $7) - (i32.const 31) - ) - ) - ) - ) - (set_local $3 - (i32.load - (get_local $5) ) ) (if (i32.eq - (tee_local $10 - (loop $while-in28 (result i32) - (block $while-out27 (result i32) - (if - (i32.eq - (i32.and - (i32.load offset=4 - (get_local $3) - ) - (i32.const -8) - ) - (get_local $2) - ) - (block - (set_local $14 - (get_local $3) - ) - (br $while-out27 - (i32.const 148) + (get_local $10) + (i32.const 148) + ) + (if + (i32.and + (i32.ge_u + (tee_local $15 + (i32.load + (tee_local $3 + (i32.add + (get_local $14) + (i32.const 8) ) ) ) - (if (result i32) - (tee_local $9 - (i32.load - (tee_local $5 - (i32.add - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (get_local $15) - (i32.const 31) - ) - (i32.const 2) - ) - ) - ) - ) - ) - (block - (set_local $15 - (i32.shl - (get_local $15) - (i32.const 1) - ) - ) - (set_local $3 - (get_local $9) - ) - (br $while-in28) - ) - (block (result i32) - (set_local $23 - (get_local $5) - ) - (set_local $20 - (get_local $3) - ) - (i32.const 145) - ) + ) + (tee_local $9 + (i32.load + (i32.const 192) ) ) ) - ) - (i32.const 145) - ) - (if - (i32.lt_u - (get_local $23) - (i32.load - (i32.const 192) + (i32.ge_u + (get_local $14) + (get_local $9) ) ) - (call $_abort) (block + (i32.store offset=12 + (get_local $15) + (get_local $6) + ) (i32.store - (get_local $23) + (get_local $3) (get_local $6) ) - (i32.store offset=24 + (i32.store offset=8 (get_local $6) - (get_local $20) + (get_local $15) ) (i32.store offset=12 (get_local $6) - (get_local $6) + (get_local $14) ) - (i32.store offset=8 - (get_local $6) + (i32.store offset=24 (get_local $6) + (i32.const 0) ) ) - ) - (if - (i32.eq - (get_local $10) - (i32.const 148) - ) - (if - (i32.and - (i32.ge_u - (tee_local $15 - (i32.load - (tee_local $3 - (i32.add - (get_local $14) - (i32.const 8) - ) - ) - ) - ) - (tee_local $9 - (i32.load - (i32.const 192) - ) - ) - ) - (i32.ge_u - (get_local $14) - (get_local $9) - ) - ) - (block - (i32.store offset=12 - (get_local $15) - (get_local $6) - ) - (i32.store - (get_local $3) - (get_local $6) - ) - (i32.store offset=8 - (get_local $6) - (get_local $15) - ) - (i32.store offset=12 - (get_local $6) - (get_local $14) - ) - (i32.store offset=24 - (get_local $6) - (i32.const 0) - ) - ) - (call $_abort) - ) + (call $_abort) ) ) ) - (block - (i32.store offset=4 - (get_local $12) - (i32.or - (tee_local $15 - (i32.add - (get_local $2) - (get_local $1) - ) + ) + (block + (i32.store offset=4 + (get_local $12) + (i32.or + (tee_local $15 + (i32.add + (get_local $2) + (get_local $1) ) - (i32.const 3) ) + (i32.const 3) ) - (i32.store - (tee_local $3 + ) + (i32.store + (tee_local $3 + (i32.add (i32.add - (i32.add - (get_local $12) - (get_local $15) - ) - (i32.const 4) + (get_local $12) + (get_local $15) ) + (i32.const 4) ) - (i32.or - (i32.load - (get_local $3) - ) - (i32.const 1) + ) + (i32.or + (i32.load + (get_local $3) ) + (i32.const 1) ) ) ) - (return - (i32.add - (get_local $12) - (i32.const 8) - ) + ) + (return + (i32.add + (get_local $12) + (i32.const 8) ) ) - (get_local $1) ) + (get_local $1) ) - (get_local $1) ) + (get_local $1) ) - (i32.const -1) ) + (i32.const -1) ) ) ) @@ -3063,384 +3058,381 @@ (i32.const 0) (i32.eq (tee_local $10 - (block $label$break$L257 (result i32) - (if - (i32.eqz - (i32.and + (if (result i32) + (i32.and + (i32.load + (i32.const 620) + ) + (i32.const 4) + ) + (i32.const 190) + (block $label$break$L257 (result i32) + (if + (tee_local $7 (i32.load - (i32.const 620) + (i32.const 200) ) - (i32.const 4) ) - ) - (block - (if - (tee_local $7 - (i32.load - (i32.const 200) - ) + (block $label$break$L259 + (set_local $16 + (i32.const 624) ) - (block $label$break$L259 - (set_local $16 - (i32.const 624) - ) - (loop $while-in34 - (block $while-out33 - (if - (if (result i32) - (i32.le_u - (tee_local $27 - (i32.load - (get_local $16) - ) + (loop $while-in34 + (block $while-out33 + (if + (if (result i32) + (i32.le_u + (tee_local $27 + (i32.load + (get_local $16) ) - (get_local $7) ) - (i32.gt_u - (i32.add - (get_local $27) - (i32.load - (tee_local $8 - (i32.add - (get_local $16) - (i32.const 4) - ) + (get_local $7) + ) + (i32.gt_u + (i32.add + (get_local $27) + (i32.load + (tee_local $8 + (i32.add + (get_local $16) + (i32.const 4) ) ) ) - (get_local $7) - ) - (i32.const 0) - ) - (block - (set_local $6 - (get_local $16) ) - (set_local $5 - (get_local $8) - ) - (br $while-out33) + (get_local $7) ) + (i32.const 0) ) - (br_if $while-in34 - (tee_local $16 - (i32.load offset=8 - (get_local $16) - ) + (block + (set_local $6 + (get_local $16) ) + (set_local $5 + (get_local $8) + ) + (br $while-out33) ) - (set_local $10 - (i32.const 173) - ) - (br $label$break$L259) ) - ) - (if - (i32.lt_u + (br_if $while-in34 (tee_local $16 - (i32.and - (i32.sub - (get_local $20) - (i32.load - (i32.const 188) - ) - ) - (get_local $23) + (i32.load offset=8 + (get_local $16) ) ) - (i32.const 2147483647) ) - (if - (i32.eq - (tee_local $8 - (call $_sbrk - (get_local $16) - ) - ) - (i32.add + (set_local $10 + (i32.const 173) + ) + (br $label$break$L259) + ) + ) + (if + (i32.lt_u + (tee_local $16 + (i32.and + (i32.sub + (get_local $20) (i32.load - (get_local $6) - ) - (i32.load - (get_local $5) + (i32.const 188) ) ) + (get_local $23) ) - (if - (i32.ne - (get_local $8) - (i32.const -1) + ) + (i32.const 2147483647) + ) + (if + (i32.eq + (tee_local $8 + (call $_sbrk + (get_local $16) ) - (block - (set_local $19 - (get_local $8) - ) - (set_local $21 - (get_local $16) - ) - (br $label$break$L257 - (i32.const 193) - ) + ) + (i32.add + (i32.load + (get_local $6) ) + (i32.load + (get_local $5) + ) + ) + ) + (if + (i32.ne + (get_local $8) + (i32.const -1) ) (block - (set_local $13 + (set_local $19 (get_local $8) ) - (set_local $18 + (set_local $21 (get_local $16) ) - (set_local $10 - (i32.const 183) + (br $label$break$L257 + (i32.const 193) ) ) ) + (block + (set_local $13 + (get_local $8) + ) + (set_local $18 + (get_local $16) + ) + (set_local $10 + (i32.const 183) + ) + ) ) ) - (set_local $10 + ) + (set_local $10 + (i32.const 173) + ) + ) + (if + (if (result i32) + (i32.eq + (get_local $10) (i32.const 173) ) - ) - (if - (if (result i32) - (i32.eq - (get_local $10) - (i32.const 173) - ) - (i32.ne - (tee_local $7 - (call $_sbrk - (i32.const 0) - ) + (i32.ne + (tee_local $7 + (call $_sbrk + (i32.const 0) ) - (i32.const -1) ) - (i32.const 0) + (i32.const -1) ) - (block $do-once35 - (set_local $0 - (if (result i32) - (i32.and - (tee_local $8 - (i32.add - (tee_local $16 - (i32.load - (i32.const 652) - ) + (i32.const 0) + ) + (block $do-once35 + (set_local $0 + (if (result i32) + (i32.and + (tee_local $8 + (i32.add + (tee_local $16 + (i32.load + (i32.const 652) ) - (i32.const -1) ) - ) - (tee_local $1 - (get_local $7) + (i32.const -1) ) ) - (i32.add - (i32.sub - (get_local $2) + (tee_local $1 + (get_local $7) + ) + ) + (i32.add + (i32.sub + (get_local $2) + (get_local $1) + ) + (i32.and + (i32.add + (get_local $8) (get_local $1) ) - (i32.and - (i32.add - (get_local $8) - (get_local $1) - ) - (i32.sub - (i32.const 0) - (get_local $16) - ) + (i32.sub + (i32.const 0) + (get_local $16) ) ) - (get_local $2) ) + (get_local $2) ) - (set_local $1 - (i32.add - (tee_local $16 - (i32.load - (i32.const 608) - ) + ) + (set_local $1 + (i32.add + (tee_local $16 + (i32.load + (i32.const 608) ) - (get_local $0) ) + (get_local $0) ) - (if - (i32.and - (i32.gt_u - (get_local $0) - (get_local $9) - ) - (i32.lt_u - (get_local $0) - (i32.const 2147483647) - ) + ) + (if + (i32.and + (i32.gt_u + (get_local $0) + (get_local $9) ) - (block - (br_if $do-once35 - (select - (i32.or - (i32.le_u - (get_local $1) - (get_local $16) - ) - (i32.gt_u - (get_local $1) - (tee_local $8 - (i32.load - (i32.const 616) - ) - ) - ) + (i32.lt_u + (get_local $0) + (i32.const 2147483647) + ) + ) + (block + (br_if $do-once35 + (select + (i32.or + (i32.le_u + (get_local $1) + (get_local $16) ) - (i32.const 0) - (get_local $8) - ) - ) - (set_local $18 - (if (result i32) - (i32.eq + (i32.gt_u + (get_local $1) (tee_local $8 - (call $_sbrk - (get_local $0) + (i32.load + (i32.const 616) ) ) - (get_local $7) ) - (block - (set_local $19 - (get_local $7) - ) - (set_local $21 + ) + (i32.const 0) + (get_local $8) + ) + ) + (set_local $18 + (if (result i32) + (i32.eq + (tee_local $8 + (call $_sbrk (get_local $0) ) - (br $label$break$L257 - (i32.const 193) - ) ) - (block (result i32) - (set_local $13 - (get_local $8) - ) - (set_local $10 - (i32.const 183) - ) + (get_local $7) + ) + (block + (set_local $19 + (get_local $7) + ) + (set_local $21 (get_local $0) ) + (br $label$break$L257 + (i32.const 193) + ) + ) + (block (result i32) + (set_local $13 + (get_local $8) + ) + (set_local $10 + (i32.const 183) + ) + (get_local $0) ) ) ) ) ) ) - (if - (i32.eq - (get_local $10) - (i32.const 183) - ) - (block $label$break$L279 - (set_local $8 - (i32.sub - (i32.const 0) - (get_local $18) - ) + ) + (if + (i32.eq + (get_local $10) + (i32.const 183) + ) + (block $label$break$L279 + (set_local $8 + (i32.sub + (i32.const 0) + (get_local $18) ) - (set_local $4 + ) + (set_local $4 + (if (result i32) (if (result i32) - (if (result i32) + (i32.and + (i32.gt_u + (get_local $14) + (get_local $18) + ) (i32.and - (i32.gt_u - (get_local $14) + (i32.lt_u (get_local $18) + (i32.const 2147483647) ) - (i32.and - (i32.lt_u - (get_local $18) - (i32.const 2147483647) - ) - (i32.ne - (get_local $13) - (i32.const -1) - ) + (i32.ne + (get_local $13) + (i32.const -1) ) ) - (i32.lt_u - (tee_local $1 - (i32.and - (i32.add - (i32.sub - (get_local $12) - (get_local $18) - ) - (tee_local $7 - (i32.load - (i32.const 656) - ) - ) - ) + ) + (i32.lt_u + (tee_local $1 + (i32.and + (i32.add (i32.sub - (i32.const 0) - (get_local $7) + (get_local $12) + (get_local $18) ) + (tee_local $7 + (i32.load + (i32.const 656) + ) + ) + ) + (i32.sub + (i32.const 0) + (get_local $7) ) ) - (i32.const 2147483647) ) - (i32.const 0) + (i32.const 2147483647) ) - (if (result i32) - (i32.eq - (call $_sbrk - (get_local $1) - ) - (i32.const -1) + (i32.const 0) + ) + (if (result i32) + (i32.eq + (call $_sbrk + (get_local $1) ) - (block - (drop - (call $_sbrk - (get_local $8) - ) + (i32.const -1) + ) + (block + (drop + (call $_sbrk + (get_local $8) ) - (br $label$break$L279) - ) - (i32.add - (get_local $1) - (get_local $18) ) + (br $label$break$L279) + ) + (i32.add + (get_local $1) + (get_local $18) ) - (get_local $18) ) + (get_local $18) ) - (if - (i32.ne + ) + (if + (i32.ne + (get_local $13) + (i32.const -1) + ) + (block + (set_local $19 (get_local $13) - (i32.const -1) ) - (block - (set_local $19 - (get_local $13) - ) - (set_local $21 - (get_local $4) - ) - (br $label$break$L257 - (i32.const 193) - ) + (set_local $21 + (get_local $4) + ) + (br $label$break$L257 + (i32.const 193) ) ) ) ) - (i32.store - (i32.const 620) - (i32.or - (i32.load - (i32.const 620) - ) - (i32.const 4) + ) + (i32.store + (i32.const 620) + (i32.or + (i32.load + (i32.const 620) ) + (i32.const 4) ) ) + (i32.const 190) ) - (i32.const 190) ) ) (i32.const 190) @@ -7988,7 +7980,7 @@ (local $6 i32) (local $7 i32) (if - (tee_local $5 + (tee_local $4 (i32.load (tee_local $3 (i32.add @@ -8000,7 +7992,7 @@ ) (block (set_local $6 - (get_local $5) + (get_local $4) ) (set_local $7 (i32.const 5) @@ -8029,26 +8021,26 @@ (get_local $7) (i32.const 5) ) - (block $label$break$L5 - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 20) + (set_local $5 + (block $label$break$L5 (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $6) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) + ) ) ) ) ) + (get_local $1) ) - (get_local $1) - ) - (block - (set_local $4 + (br $label$break$L5 (call_indirect (type $FUNCSIG$iiii) (get_local $2) (get_local $0) @@ -8064,122 +8056,116 @@ ) ) ) - (br $label$break$L5) ) - ) - (set_local $4 - (get_local $3) - ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (set_local $5 + (get_local $3) ) - (block $label$break$L10 - (set_local $3 - (get_local $1) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) + (block $label$break$L10 + (set_local $3 + (get_local $1) + ) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) + ) + (br $label$break$L10) ) - (br $label$break$L10) ) - ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $6 + (i32.add + (get_local $3) + (i32.const -1) + ) ) ) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (set_local $3 - (get_local $6) + (block + (set_local $3 + (get_local $6) + ) + (br $while-in) ) - (br $while-in) ) ) - ) - (if - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) + (drop + (br_if $label$break$L5 (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) + ) + (i32.const 7) + ) + (i32.const 2) ) - (i32.const 7) ) - (i32.const 2) + (get_local $3) ) ) - (get_local $3) ) - (block - (set_local $4 + (set_local $1 + (i32.sub + (get_local $1) (get_local $3) ) - (br $label$break$L5) ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) + (set_local $5 + (i32.load + (get_local $4) + ) ) ) - (set_local $4 - (i32.load - (get_local $5) - ) + (set_local $3 + (i32.const 0) ) ) - (set_local $3 - (i32.const 0) + (drop + (call $_memcpy + (get_local $5) + (get_local $0) + (get_local $1) + ) ) - ) - (drop - (call $_memcpy + (i32.store (get_local $4) - (get_local $0) - (get_local $1) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) + (i32.add + (i32.load + (get_local $4) + ) + (get_local $1) ) - (get_local $1) ) - ) - (set_local $4 (i32.add (get_local $3) (get_local $1) @@ -8187,7 +8173,7 @@ ) ) ) - (get_local $4) + (get_local $5) ) (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) diff --git a/test/emcc_O2_hello_world.fromasm.imprecise b/test/emcc_O2_hello_world.fromasm.imprecise index cbdba1b17..57857f966 100644 --- a/test/emcc_O2_hello_world.fromasm.imprecise +++ b/test/emcc_O2_hello_world.fromasm.imprecise @@ -1338,248 +1338,246 @@ ) ) ) - (block $do-once - (set_local $9 - (if (result i32) - (i32.le_u - (get_local $0) - (i32.const -65) - ) - (block (result i32) - (set_local $1 - (i32.and - (tee_local $3 - (i32.add - (get_local $0) - (i32.const 11) - ) + (set_local $9 + (if (result i32) + (i32.le_u + (get_local $0) + (i32.const -65) + ) + (block $do-once (result i32) + (set_local $1 + (i32.and + (tee_local $3 + (i32.add + (get_local $0) + (i32.const 11) ) - (i32.const -8) ) + (i32.const -8) ) - (if (result i32) - (tee_local $11 - (i32.load - (i32.const 180) - ) + ) + (if (result i32) + (tee_local $11 + (i32.load + (i32.const 180) ) - (block (result i32) - (set_local $0 - (i32.sub - (i32.const 0) - (get_local $1) - ) + ) + (block (result i32) + (set_local $0 + (i32.sub + (i32.const 0) + (get_local $1) ) - (if - (tee_local $15 - (i32.load offset=480 - (i32.shl - (tee_local $9 + ) + (if + (tee_local $15 + (i32.load offset=480 + (i32.shl + (tee_local $9 + (if (result i32) + (tee_local $7 + (i32.shr_u + (get_local $3) + (i32.const 8) + ) + ) (if (result i32) - (tee_local $7 - (i32.shr_u - (get_local $3) - (i32.const 8) - ) + (i32.gt_u + (get_local $1) + (i32.const 16777215) ) - (if (result i32) - (i32.gt_u - (get_local $1) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (get_local $1) - (i32.add - (tee_local $15 - (i32.add - (i32.sub - (i32.const 14) + (i32.const 31) + (i32.or + (i32.and + (i32.shr_u + (get_local $1) + (i32.add + (tee_local $15 + (i32.add + (i32.sub + (i32.const 14) + (i32.or (i32.or - (i32.or - (tee_local $7 - (i32.and - (i32.shr_u - (i32.add - (tee_local $10 - (i32.shl - (get_local $7) - (tee_local $3 - (i32.and - (i32.shr_u - (i32.add - (get_local $7) - (i32.const 1048320) - ) - (i32.const 16) + (tee_local $7 + (i32.and + (i32.shr_u + (i32.add + (tee_local $10 + (i32.shl + (get_local $7) + (tee_local $3 + (i32.and + (i32.shr_u + (i32.add + (get_local $7) + (i32.const 1048320) ) - (i32.const 8) + (i32.const 16) ) + (i32.const 8) ) ) ) - (i32.const 520192) ) - (i32.const 16) + (i32.const 520192) ) - (i32.const 4) + (i32.const 16) ) + (i32.const 4) ) - (get_local $3) ) - (tee_local $10 - (i32.and - (i32.shr_u - (i32.add - (tee_local $17 - (i32.shl - (get_local $10) - (get_local $7) - ) + (get_local $3) + ) + (tee_local $10 + (i32.and + (i32.shr_u + (i32.add + (tee_local $17 + (i32.shl + (get_local $10) + (get_local $7) ) - (i32.const 245760) ) - (i32.const 16) + (i32.const 245760) ) - (i32.const 2) + (i32.const 16) ) + (i32.const 2) ) ) ) - (i32.shr_u - (i32.shl - (get_local $17) - (get_local $10) - ) - (i32.const 15) + ) + (i32.shr_u + (i32.shl + (get_local $17) + (get_local $10) ) + (i32.const 15) ) ) - (i32.const 7) ) + (i32.const 7) ) - (i32.const 1) - ) - (i32.shl - (get_local $15) - (i32.const 1) ) + (i32.const 1) + ) + (i32.shl + (get_local $15) + (i32.const 1) ) ) - (i32.const 0) ) + (i32.const 0) ) - (i32.const 2) ) + (i32.const 2) ) ) - (block $label$break$L123 - (set_local $10 - (get_local $0) - ) - (set_local $17 - (i32.const 0) - ) - (set_local $3 - (i32.shl - (get_local $1) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (get_local $9) - (i32.const 1) - ) - ) - (i32.eq + ) + (block $label$break$L123 + (set_local $10 + (get_local $0) + ) + (set_local $17 + (i32.const 0) + ) + (set_local $3 + (i32.shl + (get_local $1) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u (get_local $9) - (i32.const 31) + (i32.const 1) ) ) + (i32.eq + (get_local $9) + (i32.const 31) + ) ) ) - (set_local $7 - (get_local $15) - ) - (loop $while-in14 - (if - (i32.lt_u - (tee_local $0 - (i32.sub - (tee_local $22 - (i32.and - (i32.load offset=4 - (get_local $7) - ) - (i32.const -8) + ) + (set_local $7 + (get_local $15) + ) + (loop $while-in14 + (if + (i32.lt_u + (tee_local $0 + (i32.sub + (tee_local $22 + (i32.and + (i32.load offset=4 + (get_local $7) ) + (i32.const -8) ) - (get_local $1) ) + (get_local $1) ) - (get_local $10) ) - (set_local $6 - (if (result i32) - (i32.eq - (get_local $22) - (get_local $1) - ) - (block - (set_local $28 - (get_local $0) - ) - (set_local $26 - (get_local $7) - ) - (set_local $30 - (get_local $7) - ) - (set_local $10 - (i32.const 90) - ) - (br $label$break$L123) + (get_local $10) + ) + (set_local $6 + (if (result i32) + (i32.eq + (get_local $22) + (get_local $1) + ) + (block + (set_local $28 + (get_local $0) ) - (block (result i32) - (set_local $10 - (get_local $0) - ) + (set_local $26 (get_local $7) ) - ) - ) - ) - (set_local $22 - (select - (get_local $17) - (tee_local $0 - (i32.load offset=20 + (set_local $30 (get_local $7) ) + (set_local $10 + (i32.const 90) + ) + (br $label$break$L123) ) - (i32.or - (i32.eqz + (block (result i32) + (set_local $10 (get_local $0) ) - (i32.eq - (get_local $0) - (tee_local $7 - (i32.load + (get_local $7) + ) + ) + ) + ) + (set_local $22 + (select + (get_local $17) + (tee_local $0 + (i32.load offset=20 + (get_local $7) + ) + ) + (i32.or + (i32.eqz + (get_local $0) + ) + (i32.eq + (get_local $0) + (tee_local $7 + (i32.load + (i32.add (i32.add - (i32.add - (get_local $7) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (get_local $3) - (i32.const 31) - ) - (i32.const 2) + (get_local $7) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (get_local $3) + (i32.const 31) ) + (i32.const 2) ) ) ) @@ -1587,71 +1585,74 @@ ) ) ) - (set_local $5 - (if (result i32) - (tee_local $0 - (i32.eqz - (get_local $7) - ) + ) + (set_local $5 + (if (result i32) + (tee_local $0 + (i32.eqz + (get_local $7) ) - (block (result i32) - (set_local $33 - (get_local $10) - ) - (set_local $31 - (get_local $6) - ) - (set_local $10 - (i32.const 86) - ) + ) + (block (result i32) + (set_local $33 + (get_local $10) + ) + (set_local $31 + (get_local $6) + ) + (set_local $10 + (i32.const 86) + ) + (get_local $22) + ) + (block + (set_local $17 (get_local $22) ) - (block - (set_local $17 - (get_local $22) - ) - (set_local $3 - (i32.shl - (get_local $3) - (i32.xor - (i32.and - (get_local $0) - (i32.const 1) - ) + (set_local $3 + (i32.shl + (get_local $3) + (i32.xor + (i32.and + (get_local $0) (i32.const 1) ) + (i32.const 1) ) ) - (br $while-in14) ) + (br $while-in14) ) ) ) ) - (block - (set_local $33 - (get_local $0) - ) - (set_local $10 - (i32.const 86) - ) - ) ) - (if - (i32.eq - (get_local $10) + (block + (set_local $33 + (get_local $0) + ) + (set_local $10 (i32.const 86) ) - (if - (tee_local $0 - (if (result i32) - (i32.or - (get_local $5) - (get_local $31) - ) + ) + ) + (if + (i32.eq + (get_local $10) + (i32.const 86) + ) + (if + (tee_local $0 + (if (result i32) + (i32.or (get_local $5) - (block (result i32) - (if + (get_local $31) + ) + (get_local $5) + (block (result i32) + (drop + (br_if $do-once + (get_local $1) (i32.eqz (tee_local $0 (i32.and @@ -1671,178 +1672,193 @@ ) ) ) - (block - (set_local $9 - (get_local $1) - ) - (br $do-once) - ) ) - (set_local $0 - (i32.and - (i32.shr_u - (tee_local $15 - (i32.add - (i32.and + ) + (set_local $0 + (i32.and + (i32.shr_u + (tee_local $15 + (i32.add + (i32.and + (get_local $0) + (i32.sub + (i32.const 0) (get_local $0) - (i32.sub - (i32.const 0) - (get_local $0) - ) ) - (i32.const -1) ) + (i32.const -1) ) - (i32.const 12) ) - (i32.const 16) + (i32.const 12) ) + (i32.const 16) ) - (i32.load offset=480 - (i32.shl - (i32.add + ) + (i32.load offset=480 + (i32.shl + (i32.add + (i32.or (i32.or (i32.or (i32.or - (i32.or - (tee_local $15 - (i32.and - (i32.shr_u - (tee_local $9 - (i32.shr_u - (get_local $15) - (get_local $0) - ) - ) - (i32.const 5) - ) - (i32.const 8) - ) - ) - (get_local $0) - ) - (tee_local $9 + (tee_local $15 (i32.and (i32.shr_u - (tee_local $5 + (tee_local $9 (i32.shr_u - (get_local $9) (get_local $15) + (get_local $0) ) ) - (i32.const 2) + (i32.const 5) ) - (i32.const 4) + (i32.const 8) ) ) + (get_local $0) ) - (tee_local $5 + (tee_local $9 (i32.and (i32.shr_u - (tee_local $6 + (tee_local $5 (i32.shr_u - (get_local $5) (get_local $9) + (get_local $15) ) ) - (i32.const 1) + (i32.const 2) ) - (i32.const 2) + (i32.const 4) ) ) ) - (tee_local $6 + (tee_local $5 (i32.and (i32.shr_u - (tee_local $3 + (tee_local $6 (i32.shr_u - (get_local $6) (get_local $5) + (get_local $9) ) ) (i32.const 1) ) - (i32.const 1) + (i32.const 2) ) ) ) - (i32.shr_u - (get_local $3) - (get_local $6) + (tee_local $6 + (i32.and + (i32.shr_u + (tee_local $3 + (i32.shr_u + (get_local $6) + (get_local $5) + ) + ) + (i32.const 1) + ) + (i32.const 1) + ) ) ) - (i32.const 2) + (i32.shr_u + (get_local $3) + (get_local $6) + ) ) + (i32.const 2) ) ) ) ) - (block - (set_local $28 - (get_local $33) - ) - (set_local $26 - (get_local $0) - ) - (set_local $30 - (get_local $31) - ) - (set_local $10 - (i32.const 90) - ) + ) + (block + (set_local $28 + (get_local $33) ) - (block - (set_local $2 - (get_local $33) - ) - (set_local $12 - (get_local $31) - ) + (set_local $26 + (get_local $0) + ) + (set_local $30 + (get_local $31) + ) + (set_local $10 + (i32.const 90) + ) + ) + (block + (set_local $2 + (get_local $33) + ) + (set_local $12 + (get_local $31) ) ) ) - (if - (i32.eq - (get_local $10) - (i32.const 90) + ) + (if + (i32.eq + (get_local $10) + (i32.const 90) + ) + (loop $while-in16 + (set_local $10 + (i32.const 0) ) - (loop $while-in16 - (set_local $10 - (i32.const 0) - ) - (set_local $3 - (i32.lt_u - (tee_local $6 - (i32.sub - (i32.and - (i32.load offset=4 - (get_local $26) - ) - (i32.const -8) + (set_local $3 + (i32.lt_u + (tee_local $6 + (i32.sub + (i32.and + (i32.load offset=4 + (get_local $26) ) - (get_local $1) + (i32.const -8) ) + (get_local $1) ) - (get_local $28) ) + (get_local $28) ) - (set_local $5 - (select - (get_local $6) - (get_local $28) - (get_local $3) - ) + ) + (set_local $5 + (select + (get_local $6) + (get_local $28) + (get_local $3) ) - (set_local $6 - (select + ) + (set_local $6 + (select + (get_local $26) + (get_local $30) + (get_local $3) + ) + ) + (if + (tee_local $3 + (i32.load offset=16 (get_local $26) - (get_local $30) + ) + ) + (block + (set_local $28 + (get_local $5) + ) + (set_local $26 (get_local $3) ) + (set_local $30 + (get_local $6) + ) + (br $while-in16) ) - (if - (tee_local $3 - (i32.load offset=16 + ) + (set_local $2 + (if (result i32) + (tee_local $26 + (i32.load offset=20 (get_local $26) ) ) @@ -1850,679 +1866,782 @@ (set_local $28 (get_local $5) ) - (set_local $26 - (get_local $3) - ) (set_local $30 (get_local $6) ) (br $while-in16) ) - ) - (set_local $2 - (if (result i32) - (tee_local $26 - (i32.load offset=20 - (get_local $26) - ) - ) - (block - (set_local $28 - (get_local $5) - ) - (set_local $30 - (get_local $6) - ) - (br $while-in16) - ) - (block (result i32) - (set_local $12 - (get_local $6) - ) - (get_local $5) + (block (result i32) + (set_local $12 + (get_local $6) ) + (get_local $5) ) ) ) ) - (if (result i32) - (select - (i32.lt_u - (get_local $2) - (i32.sub - (i32.load - (i32.const 184) - ) - (get_local $1) + ) + (if (result i32) + (select + (i32.lt_u + (get_local $2) + (i32.sub + (i32.load + (i32.const 184) ) + (get_local $1) ) - (i32.const 0) - (get_local $12) ) - (block - (if - (i32.lt_u - (get_local $12) - (tee_local $11 - (i32.load - (i32.const 192) - ) + (i32.const 0) + (get_local $12) + ) + (block + (if + (i32.lt_u + (get_local $12) + (tee_local $11 + (i32.load + (i32.const 192) ) ) - (call $_abort) ) - (if - (i32.ge_u - (get_local $12) - (tee_local $6 - (i32.add - (get_local $12) - (get_local $1) - ) + (call $_abort) + ) + (if + (i32.ge_u + (get_local $12) + (tee_local $6 + (i32.add + (get_local $12) + (get_local $1) ) ) - (call $_abort) ) - (set_local $5 - (i32.load offset=24 - (get_local $12) - ) + (call $_abort) + ) + (set_local $5 + (i32.load offset=24 + (get_local $12) ) - (if - (i32.eq - (tee_local $3 - (i32.load offset=12 - (get_local $12) - ) + ) + (if + (i32.eq + (tee_local $3 + (i32.load offset=12 + (get_local $12) ) - (get_local $12) ) - (block $do-once17 - (set_local $7 - (if (result i32) - (tee_local $0 - (i32.load - (tee_local $9 - (i32.add - (get_local $12) - (i32.const 20) - ) - ) - ) - ) - (block (result i32) - (set_local $17 - (get_local $0) - ) - (get_local $9) - ) - (if (result i32) - (tee_local $17 - (i32.load - (tee_local $15 - (i32.add - (get_local $12) - (i32.const 16) - ) - ) + (get_local $12) + ) + (block $do-once17 + (set_local $7 + (if (result i32) + (tee_local $0 + (i32.load + (tee_local $9 + (i32.add + (get_local $12) + (i32.const 20) ) ) - (get_local $15) - (br $do-once17) ) ) - ) - (loop $while-in20 - (if - (tee_local $0 - (i32.load - (tee_local $9 - (i32.add - (get_local $17) - (i32.const 20) - ) - ) - ) - ) - (block - (set_local $17 - (get_local $0) - ) - (set_local $7 - (get_local $9) - ) - (br $while-in20) + (block (result i32) + (set_local $17 + (get_local $0) ) + (get_local $9) ) - (if - (tee_local $0 + (if (result i32) + (tee_local $17 (i32.load - (tee_local $9 + (tee_local $15 (i32.add - (get_local $17) + (get_local $12) (i32.const 16) ) ) ) ) - (block - (set_local $17 - (get_local $0) - ) - (set_local $7 - (get_local $9) - ) - (br $while-in20) - ) - ) - ) - (if - (i32.lt_u - (get_local $7) - (get_local $11) - ) - (call $_abort) - (block - (i32.store - (get_local $7) - (i32.const 0) - ) - (set_local $8 - (get_local $17) - ) + (get_local $15) + (br $do-once17) ) ) ) - (block - (if - (i32.lt_u - (tee_local $9 - (i32.load offset=8 - (get_local $12) - ) - ) - (get_local $11) - ) - (call $_abort) - ) + (loop $while-in20 (if - (i32.ne + (tee_local $0 (i32.load - (tee_local $0 + (tee_local $9 (i32.add - (get_local $9) - (i32.const 12) + (get_local $17) + (i32.const 20) ) ) ) - (get_local $12) ) - (call $_abort) + (block + (set_local $17 + (get_local $0) + ) + (set_local $7 + (get_local $9) + ) + (br $while-in20) + ) ) (if - (i32.eq + (tee_local $0 (i32.load - (tee_local $15 + (tee_local $9 (i32.add - (get_local $3) - (i32.const 8) + (get_local $17) + (i32.const 16) ) ) ) - (get_local $12) ) (block - (i32.store + (set_local $17 (get_local $0) - (get_local $3) ) - (i32.store - (get_local $15) + (set_local $7 (get_local $9) ) - (set_local $8 - (get_local $3) + (br $while-in20) + ) + ) + ) + (if + (i32.lt_u + (get_local $7) + (get_local $11) + ) + (call $_abort) + (block + (i32.store + (get_local $7) + (i32.const 0) + ) + (set_local $8 + (get_local $17) + ) + ) + ) + ) + (block + (if + (i32.lt_u + (tee_local $9 + (i32.load offset=8 + (get_local $12) ) ) - (call $_abort) + (get_local $11) ) + (call $_abort) + ) + (if + (i32.ne + (i32.load + (tee_local $0 + (i32.add + (get_local $9) + (i32.const 12) + ) + ) + ) + (get_local $12) + ) + (call $_abort) + ) + (if + (i32.eq + (i32.load + (tee_local $15 + (i32.add + (get_local $3) + (i32.const 8) + ) + ) + ) + (get_local $12) + ) + (block + (i32.store + (get_local $0) + (get_local $3) + ) + (i32.store + (get_local $15) + (get_local $9) + ) + (set_local $8 + (get_local $3) + ) + ) + (call $_abort) ) ) - (if - (get_local $5) - (block $do-once21 - (if - (i32.eq - (get_local $12) - (i32.load - (tee_local $11 - (i32.add - (i32.shl - (tee_local $3 - (i32.load offset=28 - (get_local $12) - ) + ) + (if + (get_local $5) + (block $do-once21 + (if + (i32.eq + (get_local $12) + (i32.load + (tee_local $11 + (i32.add + (i32.shl + (tee_local $3 + (i32.load offset=28 + (get_local $12) ) - (i32.const 2) ) - (i32.const 480) + (i32.const 2) ) + (i32.const 480) ) ) ) - (block - (i32.store - (get_local $11) + ) + (block + (i32.store + (get_local $11) + (get_local $8) + ) + (if + (i32.eqz (get_local $8) ) - (if - (i32.eqz - (get_local $8) - ) - (block - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) - ) - (i32.xor - (i32.shl - (i32.const 1) - (get_local $3) - ) - (i32.const -1) + (block + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (get_local $3) ) + (i32.const -1) ) ) - (br $do-once21) ) + (br $do-once21) ) ) - (block - (if - (i32.lt_u - (get_local $5) - (i32.load - (i32.const 192) - ) + ) + (block + (if + (i32.lt_u + (get_local $5) + (i32.load + (i32.const 192) ) - (call $_abort) ) - (if - (i32.eq - (i32.load - (tee_local $3 - (i32.add - (get_local $5) - (i32.const 16) - ) + (call $_abort) + ) + (if + (i32.eq + (i32.load + (tee_local $3 + (i32.add + (get_local $5) + (i32.const 16) ) ) - (get_local $12) - ) - (i32.store - (get_local $3) - (get_local $8) - ) - (i32.store offset=20 - (get_local $5) - (get_local $8) ) + (get_local $12) ) - (br_if $do-once21 - (i32.eqz - (get_local $8) - ) + (i32.store + (get_local $3) + (get_local $8) + ) + (i32.store offset=20 + (get_local $5) + (get_local $8) ) ) - ) - (if - (i32.lt_u - (get_local $8) - (tee_local $3 - (i32.load - (i32.const 192) - ) + (br_if $do-once21 + (i32.eqz + (get_local $8) ) ) - (call $_abort) ) - (i32.store offset=24 + ) + (if + (i32.lt_u (get_local $8) - (get_local $5) + (tee_local $3 + (i32.load + (i32.const 192) + ) + ) + ) + (call $_abort) + ) + (i32.store offset=24 + (get_local $8) + (get_local $5) + ) + (if + (tee_local $11 + (i32.load offset=16 + (get_local $12) + ) ) (if - (tee_local $11 - (i32.load offset=16 - (get_local $12) - ) + (i32.lt_u + (get_local $11) + (get_local $3) ) - (if - (i32.lt_u + (call $_abort) + (block + (i32.store offset=16 + (get_local $8) (get_local $11) - (get_local $3) ) - (call $_abort) - (block - (i32.store offset=16 - (get_local $8) - (get_local $11) - ) - (i32.store offset=24 - (get_local $11) - (get_local $8) - ) + (i32.store offset=24 + (get_local $11) + (get_local $8) ) ) ) + ) + (if + (tee_local $11 + (i32.load offset=20 + (get_local $12) + ) + ) (if - (tee_local $11 - (i32.load offset=20 - (get_local $12) + (i32.lt_u + (get_local $11) + (i32.load + (i32.const 192) ) ) - (if - (i32.lt_u + (call $_abort) + (block + (i32.store offset=20 + (get_local $8) (get_local $11) - (i32.load - (i32.const 192) - ) ) - (call $_abort) - (block - (i32.store offset=20 - (get_local $8) - (get_local $11) - ) - (i32.store offset=24 - (get_local $11) - (get_local $8) - ) + (i32.store offset=24 + (get_local $11) + (get_local $8) ) ) ) ) ) - (if - (i32.ge_u - (get_local $2) - (i32.const 16) + ) + (if + (i32.ge_u + (get_local $2) + (i32.const 16) + ) + (block $do-once25 + (i32.store offset=4 + (get_local $12) + (i32.or + (get_local $1) + (i32.const 3) + ) ) - (block $do-once25 - (i32.store offset=4 - (get_local $12) - (i32.or - (get_local $1) - (i32.const 3) - ) + (i32.store offset=4 + (get_local $6) + (i32.or + (get_local $2) + (i32.const 1) ) - (i32.store offset=4 + ) + (i32.store + (i32.add (get_local $6) - (i32.or - (get_local $2) - (i32.const 1) - ) + (get_local $2) ) - (i32.store - (i32.add - (get_local $6) - (get_local $2) - ) + (get_local $2) + ) + (set_local $5 + (i32.shr_u (get_local $2) + (i32.const 3) ) - (set_local $5 - (i32.shr_u - (get_local $2) - (i32.const 3) - ) + ) + (if + (i32.lt_u + (get_local $2) + (i32.const 256) ) - (if - (i32.lt_u - (get_local $2) - (i32.const 256) + (block + (set_local $11 + (i32.add + (i32.shl + (get_local $5) + (i32.const 3) + ) + (i32.const 216) + ) ) - (block - (set_local $11 - (i32.add + (if + (i32.and + (tee_local $3 + (i32.load + (i32.const 176) + ) + ) + (tee_local $9 (i32.shl + (i32.const 1) (get_local $5) - (i32.const 3) ) - (i32.const 216) ) ) (if - (i32.and - (tee_local $3 + (i32.lt_u + (tee_local $15 (i32.load - (i32.const 176) - ) - ) - (tee_local $9 - (i32.shl - (i32.const 1) - (get_local $5) - ) - ) - ) - (if - (i32.lt_u - (tee_local $15 - (i32.load - (tee_local $5 - (i32.add - (get_local $11) - (i32.const 8) - ) + (tee_local $5 + (i32.add + (get_local $11) + (i32.const 8) ) ) ) - (i32.load - (i32.const 192) - ) ) - (call $_abort) - (block - (set_local $16 - (get_local $5) - ) - (set_local $27 - (get_local $15) - ) + (i32.load + (i32.const 192) ) ) + (call $_abort) (block - (i32.store - (i32.const 176) - (i32.or - (get_local $3) - (get_local $9) - ) - ) (set_local $16 - (i32.add - (get_local $11) - (i32.const 8) - ) + (get_local $5) ) (set_local $27 - (get_local $11) + (get_local $15) ) ) ) - (i32.store - (get_local $16) - (get_local $6) - ) - (i32.store offset=12 - (get_local $27) - (get_local $6) - ) - (i32.store offset=8 - (get_local $6) - (get_local $27) - ) - (i32.store offset=12 - (get_local $6) - (get_local $11) + (block + (i32.store + (i32.const 176) + (i32.or + (get_local $3) + (get_local $9) + ) + ) + (set_local $16 + (i32.add + (get_local $11) + (i32.const 8) + ) + ) + (set_local $27 + (get_local $11) + ) ) - (br $do-once25) ) + (i32.store + (get_local $16) + (get_local $6) + ) + (i32.store offset=12 + (get_local $27) + (get_local $6) + ) + (i32.store offset=8 + (get_local $6) + (get_local $27) + ) + (i32.store offset=12 + (get_local $6) + (get_local $11) + ) + (br $do-once25) ) - (set_local $5 - (i32.add - (i32.shl - (tee_local $7 + ) + (set_local $5 + (i32.add + (i32.shl + (tee_local $7 + (if (result i32) + (tee_local $11 + (i32.shr_u + (get_local $2) + (i32.const 8) + ) + ) (if (result i32) - (tee_local $11 - (i32.shr_u - (get_local $2) - (i32.const 8) - ) + (i32.gt_u + (get_local $2) + (i32.const 16777215) ) - (if (result i32) - (i32.gt_u - (get_local $2) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (get_local $2) - (i32.add - (tee_local $5 - (i32.add - (i32.sub - (i32.const 14) + (i32.const 31) + (i32.or + (i32.and + (i32.shr_u + (get_local $2) + (i32.add + (tee_local $5 + (i32.add + (i32.sub + (i32.const 14) + (i32.or (i32.or - (i32.or - (tee_local $11 - (i32.and - (i32.shr_u - (i32.add - (tee_local $3 - (i32.shl - (get_local $11) - (tee_local $9 - (i32.and - (i32.shr_u - (i32.add - (get_local $11) - (i32.const 1048320) - ) - (i32.const 16) + (tee_local $11 + (i32.and + (i32.shr_u + (i32.add + (tee_local $3 + (i32.shl + (get_local $11) + (tee_local $9 + (i32.and + (i32.shr_u + (i32.add + (get_local $11) + (i32.const 1048320) ) - (i32.const 8) + (i32.const 16) ) + (i32.const 8) ) ) ) - (i32.const 520192) ) - (i32.const 16) + (i32.const 520192) ) - (i32.const 4) + (i32.const 16) ) + (i32.const 4) ) - (get_local $9) ) - (tee_local $3 - (i32.and - (i32.shr_u - (i32.add - (tee_local $15 - (i32.shl - (get_local $3) - (get_local $11) - ) + (get_local $9) + ) + (tee_local $3 + (i32.and + (i32.shr_u + (i32.add + (tee_local $15 + (i32.shl + (get_local $3) + (get_local $11) ) - (i32.const 245760) ) - (i32.const 16) + (i32.const 245760) ) - (i32.const 2) + (i32.const 16) ) + (i32.const 2) ) ) ) - (i32.shr_u - (i32.shl - (get_local $15) - (get_local $3) - ) - (i32.const 15) + ) + (i32.shr_u + (i32.shl + (get_local $15) + (get_local $3) ) + (i32.const 15) ) ) - (i32.const 7) ) + (i32.const 7) ) - (i32.const 1) - ) - (i32.shl - (get_local $5) - (i32.const 1) ) + (i32.const 1) + ) + (i32.shl + (get_local $5) + (i32.const 1) ) ) - (i32.const 0) ) + (i32.const 0) ) - (i32.const 2) ) - (i32.const 480) + (i32.const 2) ) + (i32.const 480) ) - (i32.store offset=28 - (get_local $6) - (get_local $7) + ) + (i32.store offset=28 + (get_local $6) + (get_local $7) + ) + (i32.store offset=4 + (tee_local $3 + (i32.add + (get_local $6) + (i32.const 16) + ) ) - (i32.store offset=4 - (tee_local $3 - (i32.add - (get_local $6) - (i32.const 16) + (i32.const 0) + ) + (i32.store + (get_local $3) + (i32.const 0) + ) + (if + (i32.eqz + (i32.and + (tee_local $3 + (i32.load + (i32.const 180) + ) + ) + (tee_local $15 + (i32.shl + (i32.const 1) + (get_local $7) + ) ) ) - (i32.const 0) ) - (i32.store - (get_local $3) - (i32.const 0) + (block + (i32.store + (i32.const 180) + (i32.or + (get_local $3) + (get_local $15) + ) + ) + (i32.store + (get_local $5) + (get_local $6) + ) + (i32.store offset=24 + (get_local $6) + (get_local $5) + ) + (i32.store offset=12 + (get_local $6) + (get_local $6) + ) + (i32.store offset=8 + (get_local $6) + (get_local $6) + ) + (br $do-once25) ) - (if - (i32.eqz - (i32.and - (tee_local $3 - (i32.load - (i32.const 180) - ) + ) + (set_local $15 + (i32.shl + (get_local $2) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (get_local $7) + (i32.const 1) ) - (tee_local $15 - (i32.shl - (i32.const 1) - (get_local $7) + ) + (i32.eq + (get_local $7) + (i32.const 31) + ) + ) + ) + ) + (set_local $3 + (i32.load + (get_local $5) + ) + ) + (if + (i32.eq + (tee_local $10 + (loop $while-in28 (result i32) + (block $while-out27 (result i32) + (if + (i32.eq + (i32.and + (i32.load offset=4 + (get_local $3) + ) + (i32.const -8) + ) + (get_local $2) + ) + (block + (set_local $14 + (get_local $3) + ) + (br $while-out27 + (i32.const 148) + ) + ) + ) + (if (result i32) + (tee_local $9 + (i32.load + (tee_local $5 + (i32.add + (i32.add + (get_local $3) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (get_local $15) + (i32.const 31) + ) + (i32.const 2) + ) + ) + ) + ) + ) + (block + (set_local $15 + (i32.shl + (get_local $15) + (i32.const 1) + ) + ) + (set_local $3 + (get_local $9) + ) + (br $while-in28) + ) + (block (result i32) + (set_local $23 + (get_local $5) + ) + (set_local $20 + (get_local $3) + ) + (i32.const 145) + ) ) ) ) ) - (block - (i32.store - (i32.const 180) - (i32.or - (get_local $3) - (get_local $15) - ) + (i32.const 145) + ) + (if + (i32.lt_u + (get_local $23) + (i32.load + (i32.const 192) ) + ) + (call $_abort) + (block (i32.store - (get_local $5) + (get_local $23) (get_local $6) ) (i32.store offset=24 (get_local $6) - (get_local $5) + (get_local $20) ) (i32.store offset=12 (get_local $6) @@ -2532,234 +2651,110 @@ (get_local $6) (get_local $6) ) - (br $do-once25) - ) - ) - (set_local $15 - (i32.shl - (get_local $2) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (get_local $7) - (i32.const 1) - ) - ) - (i32.eq - (get_local $7) - (i32.const 31) - ) - ) - ) - ) - (set_local $3 - (i32.load - (get_local $5) ) ) (if (i32.eq - (tee_local $10 - (loop $while-in28 (result i32) - (block $while-out27 (result i32) - (if - (i32.eq - (i32.and - (i32.load offset=4 - (get_local $3) - ) - (i32.const -8) - ) - (get_local $2) - ) - (block - (set_local $14 - (get_local $3) - ) - (br $while-out27 - (i32.const 148) + (get_local $10) + (i32.const 148) + ) + (if + (i32.and + (i32.ge_u + (tee_local $15 + (i32.load + (tee_local $3 + (i32.add + (get_local $14) + (i32.const 8) ) ) ) - (if (result i32) - (tee_local $9 - (i32.load - (tee_local $5 - (i32.add - (i32.add - (get_local $3) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (get_local $15) - (i32.const 31) - ) - (i32.const 2) - ) - ) - ) - ) - ) - (block - (set_local $15 - (i32.shl - (get_local $15) - (i32.const 1) - ) - ) - (set_local $3 - (get_local $9) - ) - (br $while-in28) - ) - (block (result i32) - (set_local $23 - (get_local $5) - ) - (set_local $20 - (get_local $3) - ) - (i32.const 145) - ) + ) + (tee_local $9 + (i32.load + (i32.const 192) ) ) ) - ) - (i32.const 145) - ) - (if - (i32.lt_u - (get_local $23) - (i32.load - (i32.const 192) + (i32.ge_u + (get_local $14) + (get_local $9) ) ) - (call $_abort) (block + (i32.store offset=12 + (get_local $15) + (get_local $6) + ) (i32.store - (get_local $23) + (get_local $3) (get_local $6) ) - (i32.store offset=24 + (i32.store offset=8 (get_local $6) - (get_local $20) + (get_local $15) ) (i32.store offset=12 (get_local $6) - (get_local $6) + (get_local $14) ) - (i32.store offset=8 - (get_local $6) + (i32.store offset=24 (get_local $6) + (i32.const 0) ) ) - ) - (if - (i32.eq - (get_local $10) - (i32.const 148) - ) - (if - (i32.and - (i32.ge_u - (tee_local $15 - (i32.load - (tee_local $3 - (i32.add - (get_local $14) - (i32.const 8) - ) - ) - ) - ) - (tee_local $9 - (i32.load - (i32.const 192) - ) - ) - ) - (i32.ge_u - (get_local $14) - (get_local $9) - ) - ) - (block - (i32.store offset=12 - (get_local $15) - (get_local $6) - ) - (i32.store - (get_local $3) - (get_local $6) - ) - (i32.store offset=8 - (get_local $6) - (get_local $15) - ) - (i32.store offset=12 - (get_local $6) - (get_local $14) - ) - (i32.store offset=24 - (get_local $6) - (i32.const 0) - ) - ) - (call $_abort) - ) + (call $_abort) ) ) ) - (block - (i32.store offset=4 - (get_local $12) - (i32.or - (tee_local $15 - (i32.add - (get_local $2) - (get_local $1) - ) + ) + (block + (i32.store offset=4 + (get_local $12) + (i32.or + (tee_local $15 + (i32.add + (get_local $2) + (get_local $1) ) - (i32.const 3) ) + (i32.const 3) ) - (i32.store - (tee_local $3 + ) + (i32.store + (tee_local $3 + (i32.add (i32.add - (i32.add - (get_local $12) - (get_local $15) - ) - (i32.const 4) + (get_local $12) + (get_local $15) ) + (i32.const 4) ) - (i32.or - (i32.load - (get_local $3) - ) - (i32.const 1) + ) + (i32.or + (i32.load + (get_local $3) ) + (i32.const 1) ) ) ) - (return - (i32.add - (get_local $12) - (i32.const 8) - ) + ) + (return + (i32.add + (get_local $12) + (i32.const 8) ) ) - (get_local $1) ) + (get_local $1) ) - (get_local $1) ) + (get_local $1) ) - (i32.const -1) ) + (i32.const -1) ) ) ) @@ -3062,384 +3057,381 @@ (i32.const 0) (i32.eq (tee_local $10 - (block $label$break$L257 (result i32) - (if - (i32.eqz - (i32.and + (if (result i32) + (i32.and + (i32.load + (i32.const 620) + ) + (i32.const 4) + ) + (i32.const 190) + (block $label$break$L257 (result i32) + (if + (tee_local $7 (i32.load - (i32.const 620) + (i32.const 200) ) - (i32.const 4) ) - ) - (block - (if - (tee_local $7 - (i32.load - (i32.const 200) - ) + (block $label$break$L259 + (set_local $16 + (i32.const 624) ) - (block $label$break$L259 - (set_local $16 - (i32.const 624) - ) - (loop $while-in34 - (block $while-out33 - (if - (if (result i32) - (i32.le_u - (tee_local $27 - (i32.load - (get_local $16) - ) + (loop $while-in34 + (block $while-out33 + (if + (if (result i32) + (i32.le_u + (tee_local $27 + (i32.load + (get_local $16) ) - (get_local $7) ) - (i32.gt_u - (i32.add - (get_local $27) - (i32.load - (tee_local $8 - (i32.add - (get_local $16) - (i32.const 4) - ) + (get_local $7) + ) + (i32.gt_u + (i32.add + (get_local $27) + (i32.load + (tee_local $8 + (i32.add + (get_local $16) + (i32.const 4) ) ) ) - (get_local $7) ) - (i32.const 0) - ) - (block - (set_local $6 - (get_local $16) - ) - (set_local $5 - (get_local $8) - ) - (br $while-out33) + (get_local $7) ) + (i32.const 0) ) - (br_if $while-in34 - (tee_local $16 - (i32.load offset=8 - (get_local $16) - ) + (block + (set_local $6 + (get_local $16) ) + (set_local $5 + (get_local $8) + ) + (br $while-out33) ) - (set_local $10 - (i32.const 173) - ) - (br $label$break$L259) ) - ) - (if - (i32.lt_u + (br_if $while-in34 (tee_local $16 - (i32.and - (i32.sub - (get_local $20) - (i32.load - (i32.const 188) - ) - ) - (get_local $23) + (i32.load offset=8 + (get_local $16) ) ) - (i32.const 2147483647) ) - (if - (i32.eq - (tee_local $8 - (call $_sbrk - (get_local $16) - ) - ) - (i32.add - (i32.load - (get_local $6) - ) + (set_local $10 + (i32.const 173) + ) + (br $label$break$L259) + ) + ) + (if + (i32.lt_u + (tee_local $16 + (i32.and + (i32.sub + (get_local $20) (i32.load - (get_local $5) + (i32.const 188) ) ) + (get_local $23) ) - (if - (i32.ne - (get_local $8) - (i32.const -1) + ) + (i32.const 2147483647) + ) + (if + (i32.eq + (tee_local $8 + (call $_sbrk + (get_local $16) ) - (block - (set_local $19 - (get_local $8) - ) - (set_local $21 - (get_local $16) - ) - (br $label$break$L257 - (i32.const 193) - ) + ) + (i32.add + (i32.load + (get_local $6) + ) + (i32.load + (get_local $5) ) ) + ) + (if + (i32.ne + (get_local $8) + (i32.const -1) + ) (block - (set_local $13 + (set_local $19 (get_local $8) ) - (set_local $18 + (set_local $21 (get_local $16) ) - (set_local $10 - (i32.const 183) + (br $label$break$L257 + (i32.const 193) ) ) ) + (block + (set_local $13 + (get_local $8) + ) + (set_local $18 + (get_local $16) + ) + (set_local $10 + (i32.const 183) + ) + ) ) ) - (set_local $10 + ) + (set_local $10 + (i32.const 173) + ) + ) + (if + (if (result i32) + (i32.eq + (get_local $10) (i32.const 173) ) - ) - (if - (if (result i32) - (i32.eq - (get_local $10) - (i32.const 173) - ) - (i32.ne - (tee_local $7 - (call $_sbrk - (i32.const 0) - ) + (i32.ne + (tee_local $7 + (call $_sbrk + (i32.const 0) ) - (i32.const -1) ) - (i32.const 0) + (i32.const -1) ) - (block $do-once35 - (set_local $0 - (if (result i32) - (i32.and - (tee_local $8 - (i32.add - (tee_local $16 - (i32.load - (i32.const 652) - ) + (i32.const 0) + ) + (block $do-once35 + (set_local $0 + (if (result i32) + (i32.and + (tee_local $8 + (i32.add + (tee_local $16 + (i32.load + (i32.const 652) ) - (i32.const -1) ) - ) - (tee_local $1 - (get_local $7) + (i32.const -1) ) ) - (i32.add - (i32.sub - (get_local $2) + (tee_local $1 + (get_local $7) + ) + ) + (i32.add + (i32.sub + (get_local $2) + (get_local $1) + ) + (i32.and + (i32.add + (get_local $8) (get_local $1) ) - (i32.and - (i32.add - (get_local $8) - (get_local $1) - ) - (i32.sub - (i32.const 0) - (get_local $16) - ) + (i32.sub + (i32.const 0) + (get_local $16) ) ) - (get_local $2) ) + (get_local $2) ) - (set_local $1 - (i32.add - (tee_local $16 - (i32.load - (i32.const 608) - ) + ) + (set_local $1 + (i32.add + (tee_local $16 + (i32.load + (i32.const 608) ) - (get_local $0) ) + (get_local $0) ) - (if - (i32.and - (i32.gt_u - (get_local $0) - (get_local $9) - ) - (i32.lt_u - (get_local $0) - (i32.const 2147483647) - ) + ) + (if + (i32.and + (i32.gt_u + (get_local $0) + (get_local $9) ) - (block - (br_if $do-once35 - (select - (i32.or - (i32.le_u - (get_local $1) - (get_local $16) - ) - (i32.gt_u - (get_local $1) - (tee_local $8 - (i32.load - (i32.const 616) - ) - ) - ) + (i32.lt_u + (get_local $0) + (i32.const 2147483647) + ) + ) + (block + (br_if $do-once35 + (select + (i32.or + (i32.le_u + (get_local $1) + (get_local $16) ) - (i32.const 0) - (get_local $8) - ) - ) - (set_local $18 - (if (result i32) - (i32.eq + (i32.gt_u + (get_local $1) (tee_local $8 - (call $_sbrk - (get_local $0) + (i32.load + (i32.const 616) ) ) - (get_local $7) ) - (block - (set_local $19 - (get_local $7) - ) - (set_local $21 + ) + (i32.const 0) + (get_local $8) + ) + ) + (set_local $18 + (if (result i32) + (i32.eq + (tee_local $8 + (call $_sbrk (get_local $0) ) - (br $label$break$L257 - (i32.const 193) - ) ) - (block (result i32) - (set_local $13 - (get_local $8) - ) - (set_local $10 - (i32.const 183) - ) + (get_local $7) + ) + (block + (set_local $19 + (get_local $7) + ) + (set_local $21 (get_local $0) ) + (br $label$break$L257 + (i32.const 193) + ) + ) + (block (result i32) + (set_local $13 + (get_local $8) + ) + (set_local $10 + (i32.const 183) + ) + (get_local $0) ) ) ) ) ) ) - (if - (i32.eq - (get_local $10) - (i32.const 183) - ) - (block $label$break$L279 - (set_local $8 - (i32.sub - (i32.const 0) - (get_local $18) - ) + ) + (if + (i32.eq + (get_local $10) + (i32.const 183) + ) + (block $label$break$L279 + (set_local $8 + (i32.sub + (i32.const 0) + (get_local $18) ) - (set_local $4 + ) + (set_local $4 + (if (result i32) (if (result i32) - (if (result i32) + (i32.and + (i32.gt_u + (get_local $14) + (get_local $18) + ) (i32.and - (i32.gt_u - (get_local $14) + (i32.lt_u (get_local $18) + (i32.const 2147483647) ) - (i32.and - (i32.lt_u - (get_local $18) - (i32.const 2147483647) - ) - (i32.ne - (get_local $13) - (i32.const -1) - ) + (i32.ne + (get_local $13) + (i32.const -1) ) ) - (i32.lt_u - (tee_local $1 - (i32.and - (i32.add - (i32.sub - (get_local $12) - (get_local $18) - ) - (tee_local $7 - (i32.load - (i32.const 656) - ) - ) - ) + ) + (i32.lt_u + (tee_local $1 + (i32.and + (i32.add (i32.sub - (i32.const 0) - (get_local $7) + (get_local $12) + (get_local $18) + ) + (tee_local $7 + (i32.load + (i32.const 656) + ) ) ) + (i32.sub + (i32.const 0) + (get_local $7) + ) ) - (i32.const 2147483647) ) - (i32.const 0) + (i32.const 2147483647) ) - (if (result i32) - (i32.eq - (call $_sbrk - (get_local $1) - ) - (i32.const -1) + (i32.const 0) + ) + (if (result i32) + (i32.eq + (call $_sbrk + (get_local $1) ) - (block - (drop - (call $_sbrk - (get_local $8) - ) + (i32.const -1) + ) + (block + (drop + (call $_sbrk + (get_local $8) ) - (br $label$break$L279) - ) - (i32.add - (get_local $1) - (get_local $18) ) + (br $label$break$L279) + ) + (i32.add + (get_local $1) + (get_local $18) ) - (get_local $18) ) + (get_local $18) ) - (if - (i32.ne + ) + (if + (i32.ne + (get_local $13) + (i32.const -1) + ) + (block + (set_local $19 (get_local $13) - (i32.const -1) ) - (block - (set_local $19 - (get_local $13) - ) - (set_local $21 - (get_local $4) - ) - (br $label$break$L257 - (i32.const 193) - ) + (set_local $21 + (get_local $4) + ) + (br $label$break$L257 + (i32.const 193) ) ) ) ) - (i32.store - (i32.const 620) - (i32.or - (i32.load - (i32.const 620) - ) - (i32.const 4) + ) + (i32.store + (i32.const 620) + (i32.or + (i32.load + (i32.const 620) ) + (i32.const 4) ) ) + (i32.const 190) ) - (i32.const 190) ) ) (i32.const 190) @@ -7987,7 +7979,7 @@ (local $6 i32) (local $7 i32) (if - (tee_local $5 + (tee_local $4 (i32.load (tee_local $3 (i32.add @@ -7999,7 +7991,7 @@ ) (block (set_local $6 - (get_local $5) + (get_local $4) ) (set_local $7 (i32.const 5) @@ -8028,26 +8020,26 @@ (get_local $7) (i32.const 5) ) - (block $label$break$L5 - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 20) + (set_local $5 + (block $label$break$L5 (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $6) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) + ) ) ) ) ) + (get_local $1) ) - (get_local $1) - ) - (block - (set_local $4 + (br $label$break$L5 (call_indirect (type $FUNCSIG$iiii) (get_local $2) (get_local $0) @@ -8063,122 +8055,116 @@ ) ) ) - (br $label$break$L5) ) - ) - (set_local $4 - (get_local $3) - ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (set_local $5 + (get_local $3) ) - (block $label$break$L10 - (set_local $3 - (get_local $1) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) + (block $label$break$L10 + (set_local $3 + (get_local $1) + ) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) + ) + (br $label$break$L10) ) - (br $label$break$L10) ) - ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $6 + (i32.add + (get_local $3) + (i32.const -1) + ) ) ) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (set_local $3 - (get_local $6) + (block + (set_local $3 + (get_local $6) + ) + (br $while-in) ) - (br $while-in) ) ) - ) - (if - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) + (drop + (br_if $label$break$L5 (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) + ) + (i32.const 7) + ) + (i32.const 2) ) - (i32.const 7) ) - (i32.const 2) + (get_local $3) ) ) - (get_local $3) ) - (block - (set_local $4 + (set_local $1 + (i32.sub + (get_local $1) (get_local $3) ) - (br $label$break$L5) ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) + (set_local $5 + (i32.load + (get_local $4) + ) ) ) - (set_local $4 - (i32.load - (get_local $5) - ) + (set_local $3 + (i32.const 0) ) ) - (set_local $3 - (i32.const 0) + (drop + (call $_memcpy + (get_local $5) + (get_local $0) + (get_local $1) + ) ) - ) - (drop - (call $_memcpy + (i32.store (get_local $4) - (get_local $0) - (get_local $1) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) + (i32.add + (i32.load + (get_local $4) + ) + (get_local $1) ) - (get_local $1) ) - ) - (set_local $4 (i32.add (get_local $3) (get_local $1) @@ -8186,7 +8172,7 @@ ) ) ) - (get_local $4) + (get_local $5) ) (func $_fflush (; 19 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm index 83f811c55..cb9b99b74 100644 --- a/test/emcc_hello_world.fromasm +++ b/test/emcc_hello_world.fromasm @@ -2166,7 +2166,7 @@ (local $49 i32) (local $50 i32) (local $51 i32) - (set_local $35 + (set_local $34 (get_global $STACKTOP) ) (set_global $STACKTOP @@ -2184,14 +2184,14 @@ ) (set_local $20 (i32.add - (get_local $35) + (get_local $34) (i32.const 16) ) ) - (set_local $36 + (set_local $35 (i32.add (tee_local $14 - (get_local $35) + (get_local $34) ) (i32.const 528) ) @@ -2232,7 +2232,7 @@ (i32.const 4) ) ) - (set_local $33 + (set_local $32 (i32.add (tee_local $5 (i32.add @@ -2252,9 +2252,9 @@ (set_local $45 (i32.sub (tee_local $27 - (get_local $33) + (get_local $32) ) - (tee_local $37 + (tee_local $36 (tee_local $22 (i32.add (get_local $14) @@ -2267,7 +2267,7 @@ (set_local $46 (i32.sub (i32.const -2) - (get_local $37) + (get_local $36) ) ) (set_local $47 @@ -2295,7 +2295,7 @@ ) ) ) - (set_local $34 + (set_local $33 (i32.add (get_local $22) (i32.const 8) @@ -4050,10 +4050,10 @@ ) (i32.const 31) ) - (get_local $33) + (get_local $32) ) ) - (get_local $33) + (get_local $32) ) (block (i32.store8 @@ -4154,7 +4154,7 @@ (i32.const 1) ) ) - (get_local $37) + (get_local $36) ) (i32.const 1) ) @@ -4263,7 +4263,7 @@ (set_local $5 (i32.sub (get_local $5) - (get_local $37) + (get_local $36) ) ) (if @@ -4631,7 +4631,7 @@ (i32.const -1) ) ) - (set_local $38 + (set_local $37 (i32.shr_u (i32.const 1000000000) (get_local $13) @@ -4648,7 +4648,7 @@ (get_local $7) (i32.add (i32.shr_u - (tee_local $32 + (tee_local $38 (i32.load (get_local $7) ) @@ -4661,10 +4661,10 @@ (set_local $9 (i32.mul (i32.and - (get_local $32) + (get_local $38) (get_local $12) ) - (get_local $38) + (get_local $37) ) ) (br_if $while-in74 @@ -4871,7 +4871,7 @@ (i32.const 0) ) ) - (tee_local $38 + (tee_local $37 (i32.eq (get_local $24) (i32.const 103) @@ -4975,7 +4975,7 @@ (if (i32.eqz (i32.and - (tee_local $32 + (tee_local $38 (i32.eq (i32.add (get_local $6) @@ -5012,7 +5012,7 @@ (f64.const 1) (f64.const 1.5) (i32.and - (get_local $32) + (get_local $38) (i32.eq (get_local $13) (get_local $51) @@ -5207,12 +5207,6 @@ ) ) ) - (set_local $32 - (i32.sub - (i32.const 0) - (get_local $13) - ) - ) (set_local $9 (loop $while-in90 (result i32) (block $while-out89 (result i32) @@ -5255,251 +5249,258 @@ ) ) ) - (call $_pad - (get_local $0) - (i32.const 32) - (get_local $15) - (tee_local $13 - (i32.add - (i32.add - (i32.add - (i32.add - (get_local $26) - (i32.const 1) - ) - (tee_local $5 - (if (result i32) - (get_local $38) - (block $do-once91 (result i32) - (set_local $7 - (if (result i32) - (i32.and - (i32.gt_s - (tee_local $5 - (i32.add - (i32.xor - (get_local $31) - (i32.const 1) - ) - (get_local $18) - ) - ) - (get_local $13) - ) - (i32.gt_s - (get_local $13) - (i32.const -5) - ) - ) - (block (result i32) - (set_local $18 - (i32.sub - (i32.add - (get_local $5) - (i32.const -1) - ) - (get_local $13) - ) - ) - (i32.add - (get_local $19) - (i32.const -1) - ) - ) - (block (result i32) - (set_local $18 - (i32.add - (get_local $5) - (i32.const -1) - ) - ) - (i32.add - (get_local $19) - (i32.const -2) - ) - ) + (set_local $5 + (if (result i32) + (get_local $37) + (block $do-once91 (result i32) + (set_local $7 + (if (result i32) + (i32.and + (i32.gt_s + (tee_local $5 + (i32.add + (i32.xor + (get_local $31) + (i32.const 1) ) + (get_local $18) ) - (if - (tee_local $5 - (i32.and - (get_local $11) - (i32.const 8) - ) - ) - (block - (set_local $21 - (get_local $5) - ) - (br $do-once91 - (get_local $18) - ) - ) + ) + (get_local $13) + ) + (i32.gt_s + (get_local $13) + (i32.const -5) + ) + ) + (block (result i32) + (set_local $18 + (i32.sub + (i32.add + (get_local $5) + (i32.const -1) ) - (if - (get_local $24) - (block $do-once93 - (if - (i32.eqz - (tee_local $19 - (i32.load - (i32.add - (get_local $9) - (i32.const -4) - ) - ) - ) - ) - (block - (set_local $5 - (i32.const 9) - ) - (br $do-once93) - ) - ) - (set_local $5 - (if (result i32) - (call $i32u-rem - (get_local $19) - (i32.const 10) - ) - (block - (set_local $5 - (i32.const 0) - ) - (br $do-once93) - ) - (block (result i32) - (set_local $6 - (i32.const 10) - ) - (i32.const 0) - ) - ) - ) - (loop $while-in96 - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (br_if $while-in96 - (i32.eqz - (call $i32u-rem - (get_local $19) - (tee_local $6 - (i32.mul - (get_local $6) - (i32.const 10) - ) - ) - ) - ) - ) - ) - ) - (set_local $5 - (i32.const 9) + (get_local $13) + ) + ) + (i32.add + (get_local $19) + (i32.const -1) + ) + ) + (block (result i32) + (set_local $18 + (i32.add + (get_local $5) + (i32.const -1) + ) + ) + (i32.add + (get_local $19) + (i32.const -2) + ) + ) + ) + ) + (if + (tee_local $5 + (i32.and + (get_local $11) + (i32.const 8) + ) + ) + (block + (set_local $21 + (get_local $5) + ) + (br $do-once91 + (get_local $18) + ) + ) + ) + (if + (get_local $24) + (block $do-once93 + (if + (i32.eqz + (tee_local $19 + (i32.load + (i32.add + (get_local $9) + (i32.const -4) ) ) + ) + ) + (block + (set_local $5 + (i32.const 9) + ) + (br $do-once93) + ) + ) + (set_local $5 + (if (result i32) + (call $i32u-rem + (get_local $19) + (i32.const 10) + ) + (block + (set_local $5 + (i32.const 0) + ) + (br $do-once93) + ) + (block (result i32) (set_local $6 - (i32.add + (i32.const 10) + ) + (i32.const 0) + ) + ) + ) + (loop $while-in96 + (set_local $5 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (br_if $while-in96 + (i32.eqz + (call $i32u-rem + (get_local $19) + (tee_local $6 (i32.mul - (i32.shr_s - (i32.sub - (get_local $9) - (get_local $21) - ) - (i32.const 2) - ) - (i32.const 9) + (get_local $6) + (i32.const 10) ) - (i32.const -9) ) ) - (if (result i32) - (i32.eq - (i32.or - (get_local $7) - (i32.const 32) - ) - (i32.const 102) - ) - (block (result i32) - (set_local $21 - (i32.const 0) - ) - (select - (get_local $18) - (tee_local $5 - (select - (i32.const 0) - (tee_local $5 - (i32.sub - (get_local $6) - (get_local $5) - ) - ) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (i32.lt_s - (get_local $18) - (get_local $5) - ) - ) - ) - (block (result i32) - (set_local $21 - (i32.const 0) - ) - (select - (get_local $18) - (tee_local $5 - (select - (i32.const 0) - (tee_local $5 - (i32.sub - (i32.add - (get_local $6) - (get_local $13) - ) - (get_local $5) - ) - ) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (i32.lt_s - (get_local $18) - (get_local $5) - ) - ) + ) + ) + ) + ) + (set_local $5 + (i32.const 9) + ) + ) + (set_local $6 + (i32.add + (i32.mul + (i32.shr_s + (i32.sub + (get_local $9) + (get_local $21) + ) + (i32.const 2) + ) + (i32.const 9) + ) + (i32.const -9) + ) + ) + (if (result i32) + (i32.eq + (i32.or + (get_local $7) + (i32.const 32) + ) + (i32.const 102) + ) + (block (result i32) + (set_local $21 + (i32.const 0) + ) + (select + (get_local $18) + (tee_local $5 + (select + (i32.const 0) + (tee_local $5 + (i32.sub + (get_local $6) + (get_local $5) ) ) + (i32.lt_s + (get_local $5) + (i32.const 0) + ) ) - (block (result i32) - (set_local $21 - (i32.and - (get_local $11) - (i32.const 8) + ) + (i32.lt_s + (get_local $18) + (get_local $5) + ) + ) + ) + (block (result i32) + (set_local $21 + (i32.const 0) + ) + (select + (get_local $18) + (tee_local $5 + (select + (i32.const 0) + (tee_local $5 + (i32.sub + (i32.add + (get_local $6) + (get_local $13) + ) + (get_local $5) ) ) - (set_local $7 - (get_local $19) + (i32.lt_s + (get_local $5) + (i32.const 0) ) - (get_local $18) ) ) + (i32.lt_s + (get_local $18) + (get_local $5) + ) ) ) + ) + ) + (block (result i32) + (set_local $21 + (i32.and + (get_local $11) + (i32.const 8) + ) + ) + (set_local $7 + (get_local $19) + ) + (get_local $18) + ) + ) + ) + (set_local $6 + (i32.sub + (i32.const 0) + (get_local $13) + ) + ) + (call $_pad + (get_local $0) + (i32.const 32) + (get_local $15) + (tee_local $13 + (i32.add + (i32.add + (i32.add + (i32.add + (get_local $26) + (i32.const 1) + ) + (get_local $5) + ) (i32.ne (tee_local $31 (i32.or @@ -5542,7 +5543,7 @@ (call $_fmt_u (tee_local $6 (select - (get_local $32) + (get_local $6) (get_local $13) (i32.lt_s (get_local $13) @@ -5560,7 +5561,7 @@ ) (i32.const 31) ) - (get_local $33) + (get_local $32) ) ) ) @@ -5688,11 +5689,11 @@ ) ) (i32.store8 - (get_local $34) + (get_local $33) (i32.const 48) ) (set_local $7 - (get_local $34) + (get_local $33) ) ) (block @@ -5936,11 +5937,11 @@ ) (block (i32.store8 - (get_local $34) + (get_local $33) (i32.const 48) ) (set_local $5 - (get_local $34) + (get_local $33) ) ) ) @@ -6461,7 +6462,7 @@ (i32.lt_s (tee_local $7 (call $_wctomb - (get_local $36) + (get_local $35) (get_local $9) ) ) @@ -6546,7 +6547,7 @@ (i32.add (tee_local $8 (call $_wctomb - (get_local $36) + (get_local $35) (get_local $8) ) ) @@ -6568,7 +6569,7 @@ ) (drop (call $___fwritex - (get_local $36) + (get_local $35) (get_local $8) (get_local $0) ) @@ -6901,7 +6902,7 @@ ) ) (set_global $STACKTOP - (get_local $35) + (get_local $34) ) (get_local $17) ) diff --git a/test/emcc_hello_world.fromasm.clamp b/test/emcc_hello_world.fromasm.clamp index e26fa19d8..dafa2db7b 100644 --- a/test/emcc_hello_world.fromasm.clamp +++ b/test/emcc_hello_world.fromasm.clamp @@ -2216,7 +2216,7 @@ (local $49 i32) (local $50 i32) (local $51 i32) - (set_local $35 + (set_local $34 (get_global $STACKTOP) ) (set_global $STACKTOP @@ -2234,14 +2234,14 @@ ) (set_local $20 (i32.add - (get_local $35) + (get_local $34) (i32.const 16) ) ) - (set_local $36 + (set_local $35 (i32.add (tee_local $14 - (get_local $35) + (get_local $34) ) (i32.const 528) ) @@ -2282,7 +2282,7 @@ (i32.const 4) ) ) - (set_local $33 + (set_local $32 (i32.add (tee_local $5 (i32.add @@ -2302,9 +2302,9 @@ (set_local $45 (i32.sub (tee_local $27 - (get_local $33) + (get_local $32) ) - (tee_local $37 + (tee_local $36 (tee_local $22 (i32.add (get_local $14) @@ -2317,7 +2317,7 @@ (set_local $46 (i32.sub (i32.const -2) - (get_local $37) + (get_local $36) ) ) (set_local $47 @@ -2345,7 +2345,7 @@ ) ) ) - (set_local $34 + (set_local $33 (i32.add (get_local $22) (i32.const 8) @@ -4100,10 +4100,10 @@ ) (i32.const 31) ) - (get_local $33) + (get_local $32) ) ) - (get_local $33) + (get_local $32) ) (block (i32.store8 @@ -4204,7 +4204,7 @@ (i32.const 1) ) ) - (get_local $37) + (get_local $36) ) (i32.const 1) ) @@ -4313,7 +4313,7 @@ (set_local $5 (i32.sub (get_local $5) - (get_local $37) + (get_local $36) ) ) (if @@ -4681,7 +4681,7 @@ (i32.const -1) ) ) - (set_local $38 + (set_local $37 (i32.shr_u (i32.const 1000000000) (get_local $13) @@ -4698,7 +4698,7 @@ (get_local $7) (i32.add (i32.shr_u - (tee_local $32 + (tee_local $38 (i32.load (get_local $7) ) @@ -4711,10 +4711,10 @@ (set_local $9 (i32.mul (i32.and - (get_local $32) + (get_local $38) (get_local $12) ) - (get_local $38) + (get_local $37) ) ) (br_if $while-in74 @@ -4921,7 +4921,7 @@ (i32.const 0) ) ) - (tee_local $38 + (tee_local $37 (i32.eq (get_local $24) (i32.const 103) @@ -5025,7 +5025,7 @@ (if (i32.eqz (i32.and - (tee_local $32 + (tee_local $38 (i32.eq (i32.add (get_local $6) @@ -5062,7 +5062,7 @@ (f64.const 1) (f64.const 1.5) (i32.and - (get_local $32) + (get_local $38) (i32.eq (get_local $13) (get_local $51) @@ -5257,12 +5257,6 @@ ) ) ) - (set_local $32 - (i32.sub - (i32.const 0) - (get_local $13) - ) - ) (set_local $9 (loop $while-in90 (result i32) (block $while-out89 (result i32) @@ -5305,251 +5299,258 @@ ) ) ) - (call $_pad - (get_local $0) - (i32.const 32) - (get_local $15) - (tee_local $13 - (i32.add - (i32.add - (i32.add - (i32.add - (get_local $26) - (i32.const 1) - ) - (tee_local $5 - (if (result i32) - (get_local $38) - (block $do-once91 (result i32) - (set_local $7 - (if (result i32) - (i32.and - (i32.gt_s - (tee_local $5 - (i32.add - (i32.xor - (get_local $31) - (i32.const 1) - ) - (get_local $18) - ) - ) - (get_local $13) - ) - (i32.gt_s - (get_local $13) - (i32.const -5) - ) - ) - (block (result i32) - (set_local $18 - (i32.sub - (i32.add - (get_local $5) - (i32.const -1) - ) - (get_local $13) - ) - ) - (i32.add - (get_local $19) - (i32.const -1) - ) - ) - (block (result i32) - (set_local $18 - (i32.add - (get_local $5) - (i32.const -1) - ) - ) - (i32.add - (get_local $19) - (i32.const -2) - ) - ) + (set_local $5 + (if (result i32) + (get_local $37) + (block $do-once91 (result i32) + (set_local $7 + (if (result i32) + (i32.and + (i32.gt_s + (tee_local $5 + (i32.add + (i32.xor + (get_local $31) + (i32.const 1) ) + (get_local $18) ) - (if - (tee_local $5 - (i32.and - (get_local $11) - (i32.const 8) - ) - ) - (block - (set_local $21 - (get_local $5) - ) - (br $do-once91 - (get_local $18) - ) - ) + ) + (get_local $13) + ) + (i32.gt_s + (get_local $13) + (i32.const -5) + ) + ) + (block (result i32) + (set_local $18 + (i32.sub + (i32.add + (get_local $5) + (i32.const -1) ) - (if - (get_local $24) - (block $do-once93 - (if - (i32.eqz - (tee_local $19 - (i32.load - (i32.add - (get_local $9) - (i32.const -4) - ) - ) - ) - ) - (block - (set_local $5 - (i32.const 9) - ) - (br $do-once93) - ) - ) - (set_local $5 - (if (result i32) - (call $i32u-rem - (get_local $19) - (i32.const 10) - ) - (block - (set_local $5 - (i32.const 0) - ) - (br $do-once93) - ) - (block (result i32) - (set_local $6 - (i32.const 10) - ) - (i32.const 0) - ) - ) - ) - (loop $while-in96 - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (br_if $while-in96 - (i32.eqz - (call $i32u-rem - (get_local $19) - (tee_local $6 - (i32.mul - (get_local $6) - (i32.const 10) - ) - ) - ) - ) - ) - ) - ) - (set_local $5 - (i32.const 9) + (get_local $13) + ) + ) + (i32.add + (get_local $19) + (i32.const -1) + ) + ) + (block (result i32) + (set_local $18 + (i32.add + (get_local $5) + (i32.const -1) + ) + ) + (i32.add + (get_local $19) + (i32.const -2) + ) + ) + ) + ) + (if + (tee_local $5 + (i32.and + (get_local $11) + (i32.const 8) + ) + ) + (block + (set_local $21 + (get_local $5) + ) + (br $do-once91 + (get_local $18) + ) + ) + ) + (if + (get_local $24) + (block $do-once93 + (if + (i32.eqz + (tee_local $19 + (i32.load + (i32.add + (get_local $9) + (i32.const -4) ) ) + ) + ) + (block + (set_local $5 + (i32.const 9) + ) + (br $do-once93) + ) + ) + (set_local $5 + (if (result i32) + (call $i32u-rem + (get_local $19) + (i32.const 10) + ) + (block + (set_local $5 + (i32.const 0) + ) + (br $do-once93) + ) + (block (result i32) (set_local $6 - (i32.add + (i32.const 10) + ) + (i32.const 0) + ) + ) + ) + (loop $while-in96 + (set_local $5 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (br_if $while-in96 + (i32.eqz + (call $i32u-rem + (get_local $19) + (tee_local $6 (i32.mul - (i32.shr_s - (i32.sub - (get_local $9) - (get_local $21) - ) - (i32.const 2) - ) - (i32.const 9) + (get_local $6) + (i32.const 10) ) - (i32.const -9) ) ) - (if (result i32) - (i32.eq - (i32.or - (get_local $7) - (i32.const 32) - ) - (i32.const 102) - ) - (block (result i32) - (set_local $21 - (i32.const 0) - ) - (select - (get_local $18) - (tee_local $5 - (select - (i32.const 0) - (tee_local $5 - (i32.sub - (get_local $6) - (get_local $5) - ) - ) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (i32.lt_s - (get_local $18) - (get_local $5) - ) - ) - ) - (block (result i32) - (set_local $21 - (i32.const 0) - ) - (select - (get_local $18) - (tee_local $5 - (select - (i32.const 0) - (tee_local $5 - (i32.sub - (i32.add - (get_local $6) - (get_local $13) - ) - (get_local $5) - ) - ) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (i32.lt_s - (get_local $18) - (get_local $5) - ) - ) + ) + ) + ) + ) + (set_local $5 + (i32.const 9) + ) + ) + (set_local $6 + (i32.add + (i32.mul + (i32.shr_s + (i32.sub + (get_local $9) + (get_local $21) + ) + (i32.const 2) + ) + (i32.const 9) + ) + (i32.const -9) + ) + ) + (if (result i32) + (i32.eq + (i32.or + (get_local $7) + (i32.const 32) + ) + (i32.const 102) + ) + (block (result i32) + (set_local $21 + (i32.const 0) + ) + (select + (get_local $18) + (tee_local $5 + (select + (i32.const 0) + (tee_local $5 + (i32.sub + (get_local $6) + (get_local $5) ) ) + (i32.lt_s + (get_local $5) + (i32.const 0) + ) ) - (block (result i32) - (set_local $21 - (i32.and - (get_local $11) - (i32.const 8) + ) + (i32.lt_s + (get_local $18) + (get_local $5) + ) + ) + ) + (block (result i32) + (set_local $21 + (i32.const 0) + ) + (select + (get_local $18) + (tee_local $5 + (select + (i32.const 0) + (tee_local $5 + (i32.sub + (i32.add + (get_local $6) + (get_local $13) + ) + (get_local $5) ) ) - (set_local $7 - (get_local $19) + (i32.lt_s + (get_local $5) + (i32.const 0) ) - (get_local $18) ) ) + (i32.lt_s + (get_local $18) + (get_local $5) + ) ) ) + ) + ) + (block (result i32) + (set_local $21 + (i32.and + (get_local $11) + (i32.const 8) + ) + ) + (set_local $7 + (get_local $19) + ) + (get_local $18) + ) + ) + ) + (set_local $6 + (i32.sub + (i32.const 0) + (get_local $13) + ) + ) + (call $_pad + (get_local $0) + (i32.const 32) + (get_local $15) + (tee_local $13 + (i32.add + (i32.add + (i32.add + (i32.add + (get_local $26) + (i32.const 1) + ) + (get_local $5) + ) (i32.ne (tee_local $31 (i32.or @@ -5592,7 +5593,7 @@ (call $_fmt_u (tee_local $6 (select - (get_local $32) + (get_local $6) (get_local $13) (i32.lt_s (get_local $13) @@ -5610,7 +5611,7 @@ ) (i32.const 31) ) - (get_local $33) + (get_local $32) ) ) ) @@ -5738,11 +5739,11 @@ ) ) (i32.store8 - (get_local $34) + (get_local $33) (i32.const 48) ) (set_local $7 - (get_local $34) + (get_local $33) ) ) (block @@ -5986,11 +5987,11 @@ ) (block (i32.store8 - (get_local $34) + (get_local $33) (i32.const 48) ) (set_local $5 - (get_local $34) + (get_local $33) ) ) ) @@ -6511,7 +6512,7 @@ (i32.lt_s (tee_local $7 (call $_wctomb - (get_local $36) + (get_local $35) (get_local $9) ) ) @@ -6596,7 +6597,7 @@ (i32.add (tee_local $8 (call $_wctomb - (get_local $36) + (get_local $35) (get_local $8) ) ) @@ -6618,7 +6619,7 @@ ) (drop (call $___fwritex - (get_local $36) + (get_local $35) (get_local $8) (get_local $0) ) @@ -6951,7 +6952,7 @@ ) ) (set_global $STACKTOP - (get_local $35) + (get_local $34) ) (get_local $17) ) diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise index ff64fbb71..ed05f6905 100644 --- a/test/emcc_hello_world.fromasm.imprecise +++ b/test/emcc_hello_world.fromasm.imprecise @@ -2104,7 +2104,7 @@ (local $48 i32) (local $49 i32) (local $50 i32) - (set_local $35 + (set_local $34 (get_global $STACKTOP) ) (set_global $STACKTOP @@ -2122,14 +2122,14 @@ ) (set_local $20 (i32.add - (get_local $35) + (get_local $34) (i32.const 16) ) ) - (set_local $36 + (set_local $35 (i32.add (tee_local $14 - (get_local $35) + (get_local $34) ) (i32.const 528) ) @@ -2170,7 +2170,7 @@ (i32.const 4) ) ) - (set_local $33 + (set_local $32 (i32.add (tee_local $5 (i32.add @@ -2190,9 +2190,9 @@ (set_local $45 (i32.sub (tee_local $27 - (get_local $33) + (get_local $32) ) - (tee_local $37 + (tee_local $36 (tee_local $22 (i32.add (get_local $14) @@ -2205,7 +2205,7 @@ (set_local $46 (i32.sub (i32.const -2) - (get_local $37) + (get_local $36) ) ) (set_local $47 @@ -2233,7 +2233,7 @@ ) ) ) - (set_local $34 + (set_local $33 (i32.add (get_local $22) (i32.const 8) @@ -3970,10 +3970,10 @@ ) (i32.const 31) ) - (get_local $33) + (get_local $32) ) ) - (get_local $33) + (get_local $32) ) (block (i32.store8 @@ -4074,7 +4074,7 @@ (i32.const 1) ) ) - (get_local $37) + (get_local $36) ) (i32.const 1) ) @@ -4183,7 +4183,7 @@ (set_local $5 (i32.sub (get_local $5) - (get_local $37) + (get_local $36) ) ) (if @@ -4551,7 +4551,7 @@ (i32.const -1) ) ) - (set_local $38 + (set_local $37 (i32.shr_u (i32.const 1000000000) (get_local $13) @@ -4568,7 +4568,7 @@ (get_local $7) (i32.add (i32.shr_u - (tee_local $32 + (tee_local $38 (i32.load (get_local $7) ) @@ -4581,10 +4581,10 @@ (set_local $9 (i32.mul (i32.and - (get_local $32) + (get_local $38) (get_local $12) ) - (get_local $38) + (get_local $37) ) ) (br_if $while-in74 @@ -4791,7 +4791,7 @@ (i32.const 0) ) ) - (tee_local $38 + (tee_local $37 (i32.eq (get_local $24) (i32.const 103) @@ -4892,7 +4892,7 @@ (if (i32.eqz (i32.and - (tee_local $32 + (tee_local $38 (i32.eq (i32.add (get_local $6) @@ -4923,7 +4923,7 @@ (f64.const 1) (f64.const 1.5) (i32.and - (get_local $32) + (get_local $38) (i32.eq (get_local $13) (get_local $50) @@ -5121,12 +5121,6 @@ ) ) ) - (set_local $32 - (i32.sub - (i32.const 0) - (get_local $13) - ) - ) (set_local $9 (loop $while-in90 (result i32) (block $while-out89 (result i32) @@ -5169,250 +5163,257 @@ ) ) ) - (call $_pad - (get_local $0) - (i32.const 32) - (get_local $15) - (tee_local $13 - (i32.add - (i32.add - (i32.add - (i32.add - (get_local $26) - (i32.const 1) - ) - (tee_local $5 - (if (result i32) - (get_local $38) - (block $do-once91 (result i32) - (set_local $7 - (if (result i32) - (i32.and - (i32.gt_s - (tee_local $5 - (i32.add - (i32.xor - (get_local $31) - (i32.const 1) - ) - (get_local $18) - ) - ) - (get_local $13) - ) - (i32.gt_s - (get_local $13) - (i32.const -5) - ) - ) - (block (result i32) - (set_local $18 - (i32.sub - (i32.add - (get_local $5) - (i32.const -1) - ) - (get_local $13) - ) - ) - (i32.add - (get_local $19) - (i32.const -1) - ) - ) - (block (result i32) - (set_local $18 - (i32.add - (get_local $5) - (i32.const -1) - ) - ) - (i32.add - (get_local $19) - (i32.const -2) - ) - ) + (set_local $5 + (if (result i32) + (get_local $37) + (block $do-once91 (result i32) + (set_local $7 + (if (result i32) + (i32.and + (i32.gt_s + (tee_local $5 + (i32.add + (i32.xor + (get_local $31) + (i32.const 1) ) + (get_local $18) ) - (if - (tee_local $5 - (i32.and - (get_local $11) - (i32.const 8) - ) - ) - (block - (set_local $21 - (get_local $5) - ) - (br $do-once91 - (get_local $18) - ) - ) + ) + (get_local $13) + ) + (i32.gt_s + (get_local $13) + (i32.const -5) + ) + ) + (block (result i32) + (set_local $18 + (i32.sub + (i32.add + (get_local $5) + (i32.const -1) ) - (if - (get_local $24) - (block $do-once93 - (if - (i32.eqz - (tee_local $19 - (i32.load - (i32.add - (get_local $9) - (i32.const -4) - ) - ) - ) - ) - (block - (set_local $5 - (i32.const 9) - ) - (br $do-once93) - ) - ) - (set_local $5 - (if (result i32) - (i32.rem_u - (get_local $19) - (i32.const 10) - ) - (block - (set_local $5 - (i32.const 0) - ) - (br $do-once93) - ) - (block (result i32) - (set_local $6 - (i32.const 10) - ) - (i32.const 0) - ) - ) - ) - (loop $while-in96 - (set_local $5 - (i32.add - (get_local $5) - (i32.const 1) - ) - ) - (br_if $while-in96 - (i32.eqz - (i32.rem_u - (get_local $19) - (tee_local $6 - (i32.mul - (get_local $6) - (i32.const 10) - ) - ) - ) - ) - ) - ) - ) - (set_local $5 - (i32.const 9) + (get_local $13) + ) + ) + (i32.add + (get_local $19) + (i32.const -1) + ) + ) + (block (result i32) + (set_local $18 + (i32.add + (get_local $5) + (i32.const -1) + ) + ) + (i32.add + (get_local $19) + (i32.const -2) + ) + ) + ) + ) + (if + (tee_local $5 + (i32.and + (get_local $11) + (i32.const 8) + ) + ) + (block + (set_local $21 + (get_local $5) + ) + (br $do-once91 + (get_local $18) + ) + ) + ) + (if + (get_local $24) + (block $do-once93 + (if + (i32.eqz + (tee_local $19 + (i32.load + (i32.add + (get_local $9) + (i32.const -4) ) ) + ) + ) + (block + (set_local $5 + (i32.const 9) + ) + (br $do-once93) + ) + ) + (set_local $5 + (if (result i32) + (i32.rem_u + (get_local $19) + (i32.const 10) + ) + (block + (set_local $5 + (i32.const 0) + ) + (br $do-once93) + ) + (block (result i32) (set_local $6 - (i32.add + (i32.const 10) + ) + (i32.const 0) + ) + ) + ) + (loop $while-in96 + (set_local $5 + (i32.add + (get_local $5) + (i32.const 1) + ) + ) + (br_if $while-in96 + (i32.eqz + (i32.rem_u + (get_local $19) + (tee_local $6 (i32.mul - (i32.shr_s - (i32.sub - (get_local $9) - (get_local $21) - ) - (i32.const 2) - ) - (i32.const 9) + (get_local $6) + (i32.const 10) ) - (i32.const -9) ) ) - (if (result i32) - (i32.eq - (i32.or - (get_local $7) - (i32.const 32) - ) - (i32.const 102) - ) - (block (result i32) - (set_local $21 - (i32.const 0) - ) - (select - (get_local $18) - (tee_local $5 - (select - (i32.const 0) - (tee_local $5 - (i32.sub - (get_local $6) - (get_local $5) - ) - ) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (i32.lt_s - (get_local $18) - (get_local $5) - ) - ) - ) - (block (result i32) - (set_local $21 - (i32.const 0) - ) - (select - (get_local $18) - (tee_local $5 - (select - (i32.const 0) - (tee_local $5 - (i32.sub - (i32.add - (get_local $6) - (get_local $13) - ) - (get_local $5) - ) - ) - (i32.lt_s - (get_local $5) - (i32.const 0) - ) - ) - ) - (i32.lt_s - (get_local $18) - (get_local $5) - ) - ) + ) + ) + ) + ) + (set_local $5 + (i32.const 9) + ) + ) + (set_local $6 + (i32.add + (i32.mul + (i32.shr_s + (i32.sub + (get_local $9) + (get_local $21) + ) + (i32.const 2) + ) + (i32.const 9) + ) + (i32.const -9) + ) + ) + (if (result i32) + (i32.eq + (i32.or + (get_local $7) + (i32.const 32) + ) + (i32.const 102) + ) + (block (result i32) + (set_local $21 + (i32.const 0) + ) + (select + (get_local $18) + (tee_local $5 + (select + (i32.const 0) + (tee_local $5 + (i32.sub + (get_local $6) + (get_local $5) ) ) + (i32.lt_s + (get_local $5) + (i32.const 0) + ) ) - (block (result i32) - (set_local $21 - (i32.and - (get_local $11) - (i32.const 8) + ) + (i32.lt_s + (get_local $18) + (get_local $5) + ) + ) + ) + (block (result i32) + (set_local $21 + (i32.const 0) + ) + (select + (get_local $18) + (tee_local $5 + (select + (i32.const 0) + (tee_local $5 + (i32.sub + (i32.add + (get_local $6) + (get_local $13) + ) + (get_local $5) ) ) - (set_local $7 - (get_local $19) + (i32.lt_s + (get_local $5) + (i32.const 0) ) - (get_local $18) ) ) + (i32.lt_s + (get_local $18) + (get_local $5) + ) + ) + ) + ) + ) + (block (result i32) + (set_local $21 + (i32.and + (get_local $11) + (i32.const 8) + ) + ) + (set_local $7 + (get_local $19) + ) + (get_local $18) + ) + ) + ) + (set_local $6 + (i32.sub + (i32.const 0) + (get_local $13) + ) + ) + (call $_pad + (get_local $0) + (i32.const 32) + (get_local $15) + (tee_local $13 + (i32.add + (i32.add + (i32.add + (i32.add + (get_local $26) + (i32.const 1) ) + (get_local $5) ) (i32.ne (tee_local $31 @@ -5456,7 +5457,7 @@ (call $_fmt_u (tee_local $6 (select - (get_local $32) + (get_local $6) (get_local $13) (i32.lt_s (get_local $13) @@ -5474,7 +5475,7 @@ ) (i32.const 31) ) - (get_local $33) + (get_local $32) ) ) ) @@ -5602,11 +5603,11 @@ ) ) (i32.store8 - (get_local $34) + (get_local $33) (i32.const 48) ) (set_local $7 - (get_local $34) + (get_local $33) ) ) (block @@ -5850,11 +5851,11 @@ ) (block (i32.store8 - (get_local $34) + (get_local $33) (i32.const 48) ) (set_local $5 - (get_local $34) + (get_local $33) ) ) ) @@ -6375,7 +6376,7 @@ (i32.lt_s (tee_local $7 (call $_wctomb - (get_local $36) + (get_local $35) (get_local $9) ) ) @@ -6460,7 +6461,7 @@ (i32.add (tee_local $8 (call $_wctomb - (get_local $36) + (get_local $35) (get_local $8) ) ) @@ -6482,7 +6483,7 @@ ) (drop (call $___fwritex - (get_local $36) + (get_local $35) (get_local $8) (get_local $0) ) @@ -6815,7 +6816,7 @@ ) ) (set_global $STACKTOP - (get_local $35) + (get_local $34) ) (get_local $17) ) diff --git a/test/memorygrowth.fromasm b/test/memorygrowth.fromasm index 5a8a49d8f..38d5d9e5d 100644 --- a/test/memorygrowth.fromasm +++ b/test/memorygrowth.fromasm @@ -3081,265 +3081,262 @@ (if (i32.eq (tee_local $8 - (block $label$break$b (result i32) - (if - (i32.eqz - (i32.and + (if (result i32) + (i32.and + (i32.load + (i32.const 1652) + ) + (i32.const 4) + ) + (i32.const 188) + (block $label$break$b (result i32) + (if + (tee_local $18 (i32.load - (i32.const 1652) + (i32.const 1232) ) - (i32.const 4) ) - ) - (block - (if - (tee_local $18 - (i32.load - (i32.const 1232) - ) + (block $label$break$c + (set_local $7 + (i32.const 1656) ) - (block $label$break$c - (set_local $7 - (i32.const 1656) - ) - (loop $while-in32 - (block $while-out31 - (if - (i32.le_u - (tee_local $3 - (i32.load - (get_local $7) - ) + (loop $while-in32 + (block $while-out31 + (if + (i32.le_u + (tee_local $3 + (i32.load + (get_local $7) ) - (get_local $18) ) - (if - (i32.gt_u - (i32.add - (get_local $3) - (i32.load - (tee_local $19 - (i32.add - (get_local $7) - (i32.const 4) - ) + (get_local $18) + ) + (if + (i32.gt_u + (i32.add + (get_local $3) + (i32.load + (tee_local $19 + (i32.add + (get_local $7) + (i32.const 4) ) ) ) - (get_local $18) - ) - (block - (set_local $0 - (get_local $7) - ) - (set_local $5 - (get_local $19) - ) - (br $while-out31) ) + (get_local $18) ) - ) - (br_if $while-in32 - (tee_local $7 - (i32.load offset=8 + (block + (set_local $0 (get_local $7) ) + (set_local $5 + (get_local $19) + ) + (br $while-out31) ) ) - (set_local $8 - (i32.const 171) - ) - (br $label$break$c) ) - ) - (if - (i32.lt_u + (br_if $while-in32 (tee_local $7 - (i32.and - (i32.sub - (get_local $11) - (i32.load - (i32.const 1220) - ) - ) - (get_local $21) + (i32.load offset=8 + (get_local $7) ) ) - (i32.const 2147483647) ) - (if - (i32.eq - (tee_local $19 - (call $ta - (get_local $7) - ) - ) - (i32.add - (i32.load - (get_local $0) - ) + (set_local $8 + (i32.const 171) + ) + (br $label$break$c) + ) + ) + (if + (i32.lt_u + (tee_local $7 + (i32.and + (i32.sub + (get_local $11) (i32.load - (get_local $5) + (i32.const 1220) ) ) + (get_local $21) ) - (if - (i32.ne - (get_local $19) - (i32.const -1) + ) + (i32.const 2147483647) + ) + (if + (i32.eq + (tee_local $19 + (call $ta + (get_local $7) ) - (block - (set_local $20 - (get_local $19) - ) - (set_local $26 - (get_local $7) - ) - (br $label$break$b - (i32.const 191) - ) + ) + (i32.add + (i32.load + (get_local $0) + ) + (i32.load + (get_local $5) ) ) + ) + (if + (i32.ne + (get_local $19) + (i32.const -1) + ) (block - (set_local $12 + (set_local $20 (get_local $19) ) - (set_local $1 + (set_local $26 (get_local $7) ) - (set_local $8 - (i32.const 181) + (br $label$break$b + (i32.const 191) ) ) ) + (block + (set_local $12 + (get_local $19) + ) + (set_local $1 + (get_local $7) + ) + (set_local $8 + (i32.const 181) + ) + ) ) ) - (set_local $8 - (i32.const 171) - ) + ) + (set_local $8 + (i32.const 171) + ) + ) + (if + (i32.eq + (get_local $8) + (i32.const 171) ) (if - (i32.eq - (get_local $8) - (i32.const 171) - ) - (if - (i32.ne - (tee_local $18 - (call $ta - (i32.const 0) - ) + (i32.ne + (tee_local $18 + (call $ta + (i32.const 0) ) - (i32.const -1) ) - (block $do-once33 - (set_local $2 - (if (result i32) - (i32.and - (tee_local $19 - (i32.add - (tee_local $7 - (i32.load - (i32.const 1684) - ) + (i32.const -1) + ) + (block $do-once33 + (set_local $2 + (if (result i32) + (i32.and + (tee_local $19 + (i32.add + (tee_local $7 + (i32.load + (i32.const 1684) ) - (i32.const -1) ) - ) - (tee_local $0 - (get_local $18) + (i32.const -1) ) ) - (i32.add - (i32.sub - (get_local $14) + (tee_local $0 + (get_local $18) + ) + ) + (i32.add + (i32.sub + (get_local $14) + (get_local $0) + ) + (i32.and + (i32.add + (get_local $19) (get_local $0) ) - (i32.and - (i32.add - (get_local $19) - (get_local $0) - ) - (i32.sub - (i32.const 0) - (get_local $7) - ) + (i32.sub + (i32.const 0) + (get_local $7) ) ) - (get_local $14) ) + (get_local $14) ) - (set_local $0 - (i32.add - (tee_local $7 - (i32.load - (i32.const 1640) - ) + ) + (set_local $0 + (i32.add + (tee_local $7 + (i32.load + (i32.const 1640) ) + ) + (get_local $2) + ) + ) + (if + (i32.and + (i32.gt_u (get_local $2) + (get_local $6) + ) + (i32.lt_u + (get_local $2) + (i32.const 2147483647) ) ) - (if - (i32.and - (i32.gt_u - (get_local $2) - (get_local $6) - ) - (i32.lt_u - (get_local $2) - (i32.const 2147483647) + (block + (if + (tee_local $19 + (i32.load + (i32.const 1648) + ) ) - ) - (block - (if - (tee_local $19 - (i32.load - (i32.const 1648) + (br_if $do-once33 + (i32.or + (i32.le_u + (get_local $0) + (get_local $7) ) - ) - (br_if $do-once33 - (i32.or - (i32.le_u - (get_local $0) - (get_local $7) - ) - (i32.gt_u - (get_local $0) - (get_local $19) - ) + (i32.gt_u + (get_local $0) + (get_local $19) ) ) ) - (set_local $1 - (if (result i32) - (i32.eq - (tee_local $19 - (call $ta - (get_local $2) - ) - ) - (get_local $18) - ) - (block - (set_local $20 - (get_local $18) - ) - (set_local $26 + ) + (set_local $1 + (if (result i32) + (i32.eq + (tee_local $19 + (call $ta (get_local $2) ) - (br $label$break$b - (i32.const 191) - ) ) - (block (result i32) - (set_local $12 - (get_local $19) - ) - (set_local $8 - (i32.const 181) - ) + (get_local $18) + ) + (block + (set_local $20 + (get_local $18) + ) + (set_local $26 (get_local $2) ) + (br $label$break$b + (i32.const 191) + ) + ) + (block (result i32) + (set_local $12 + (get_local $19) + ) + (set_local $8 + (i32.const 181) + ) + (get_local $2) ) ) ) @@ -3347,115 +3344,115 @@ ) ) ) - (if - (i32.eq - (get_local $8) - (i32.const 181) - ) - (block $label$break$d - (set_local $19 - (i32.sub - (i32.const 0) - (get_local $1) - ) + ) + (if + (i32.eq + (get_local $8) + (i32.const 181) + ) + (block $label$break$d + (set_local $19 + (i32.sub + (i32.const 0) + (get_local $1) ) - (set_local $4 - (if (result i32) + ) + (set_local $4 + (if (result i32) + (i32.and + (i32.gt_u + (get_local $15) + (get_local $1) + ) (i32.and - (i32.gt_u - (get_local $15) + (i32.lt_u (get_local $1) + (i32.const 2147483647) ) - (i32.and - (i32.lt_u - (get_local $1) - (i32.const 2147483647) - ) - (i32.ne - (get_local $12) - (i32.const -1) - ) + (i32.ne + (get_local $12) + (i32.const -1) ) ) - (if (result i32) - (i32.lt_u - (tee_local $0 - (i32.and - (i32.add - (i32.sub - (get_local $17) - (get_local $1) - ) - (tee_local $18 - (i32.load - (i32.const 1688) - ) - ) - ) + ) + (if (result i32) + (i32.lt_u + (tee_local $0 + (i32.and + (i32.add (i32.sub - (i32.const 0) - (get_local $18) + (get_local $17) + (get_local $1) ) + (tee_local $18 + (i32.load + (i32.const 1688) + ) + ) + ) + (i32.sub + (i32.const 0) + (get_local $18) ) ) - (i32.const 2147483647) ) - (if (result i32) - (i32.eq - (call $ta - (get_local $0) - ) - (i32.const -1) + (i32.const 2147483647) + ) + (if (result i32) + (i32.eq + (call $ta + (get_local $0) ) - (block - (drop - (call $ta - (get_local $19) - ) + (i32.const -1) + ) + (block + (drop + (call $ta + (get_local $19) ) - (br $label$break$d) - ) - (i32.add - (get_local $0) - (get_local $1) ) + (br $label$break$d) + ) + (i32.add + (get_local $0) + (get_local $1) ) - (get_local $1) ) (get_local $1) ) + (get_local $1) ) - (if - (i32.ne + ) + (if + (i32.ne + (get_local $12) + (i32.const -1) + ) + (block + (set_local $20 (get_local $12) - (i32.const -1) ) - (block - (set_local $20 - (get_local $12) - ) - (set_local $26 - (get_local $4) - ) - (br $label$break$b - (i32.const 191) - ) + (set_local $26 + (get_local $4) + ) + (br $label$break$b + (i32.const 191) ) ) ) ) - (i32.store - (i32.const 1652) - (i32.or - (i32.load - (i32.const 1652) - ) - (i32.const 4) + ) + (i32.store + (i32.const 1652) + (i32.or + (i32.load + (i32.const 1652) ) + (i32.const 4) ) ) + (i32.const 188) ) - (i32.const 188) ) ) (i32.const 188) @@ -8033,7 +8030,7 @@ (local $6 i32) (local $7 i32) (if - (tee_local $5 + (tee_local $4 (i32.load (tee_local $3 (i32.add @@ -8045,7 +8042,7 @@ ) (block (set_local $6 - (get_local $5) + (get_local $4) ) (set_local $7 (i32.const 5) @@ -8074,26 +8071,26 @@ (get_local $7) (i32.const 5) ) - (block $label$break$a - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 20) + (set_local $5 + (block $label$break$a (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $6) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) + ) ) ) ) ) + (get_local $1) ) - (get_local $1) - ) - (block - (set_local $4 + (br $label$break$a (call_indirect (type $FUNCSIG$iiii) (get_local $2) (get_local $0) @@ -8109,122 +8106,116 @@ ) ) ) - (br $label$break$a) ) - ) - (set_local $4 - (get_local $3) - ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (set_local $5 + (get_local $3) ) - (block $label$break$b - (set_local $3 - (get_local $1) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) + (block $label$break$b + (set_local $3 + (get_local $1) + ) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) + ) + (br $label$break$b) ) - (br $label$break$b) ) - ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $6 + (i32.add + (get_local $3) + (i32.const -1) + ) ) ) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (set_local $3 - (get_local $6) + (block + (set_local $3 + (get_local $6) + ) + (br $while-in) ) - (br $while-in) ) ) - ) - (if - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) + (drop + (br_if $label$break$a (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) + ) + (i32.const 3) + ) + (i32.const 2) ) - (i32.const 3) ) - (i32.const 2) + (get_local $3) ) ) - (get_local $3) ) - (block - (set_local $4 + (set_local $1 + (i32.sub + (get_local $1) (get_local $3) ) - (br $label$break$a) ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) + (set_local $5 + (i32.load + (get_local $4) + ) ) ) - (set_local $4 - (i32.load - (get_local $5) - ) + (set_local $3 + (i32.const 0) ) ) - (set_local $3 - (i32.const 0) + (drop + (call $jb + (get_local $5) + (get_local $0) + (get_local $1) + ) ) - ) - (drop - (call $jb + (i32.store (get_local $4) - (get_local $0) - (get_local $1) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) + (i32.add + (i32.load + (get_local $4) + ) + (get_local $1) ) - (get_local $1) ) - ) - (set_local $4 (i32.add (get_local $3) (get_local $1) @@ -8232,7 +8223,7 @@ ) ) ) - (get_local $4) + (get_local $5) ) (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) diff --git a/test/memorygrowth.fromasm.clamp b/test/memorygrowth.fromasm.clamp index 5a8a49d8f..38d5d9e5d 100644 --- a/test/memorygrowth.fromasm.clamp +++ b/test/memorygrowth.fromasm.clamp @@ -3081,265 +3081,262 @@ (if (i32.eq (tee_local $8 - (block $label$break$b (result i32) - (if - (i32.eqz - (i32.and + (if (result i32) + (i32.and + (i32.load + (i32.const 1652) + ) + (i32.const 4) + ) + (i32.const 188) + (block $label$break$b (result i32) + (if + (tee_local $18 (i32.load - (i32.const 1652) + (i32.const 1232) ) - (i32.const 4) ) - ) - (block - (if - (tee_local $18 - (i32.load - (i32.const 1232) - ) + (block $label$break$c + (set_local $7 + (i32.const 1656) ) - (block $label$break$c - (set_local $7 - (i32.const 1656) - ) - (loop $while-in32 - (block $while-out31 - (if - (i32.le_u - (tee_local $3 - (i32.load - (get_local $7) - ) + (loop $while-in32 + (block $while-out31 + (if + (i32.le_u + (tee_local $3 + (i32.load + (get_local $7) ) - (get_local $18) ) - (if - (i32.gt_u - (i32.add - (get_local $3) - (i32.load - (tee_local $19 - (i32.add - (get_local $7) - (i32.const 4) - ) + (get_local $18) + ) + (if + (i32.gt_u + (i32.add + (get_local $3) + (i32.load + (tee_local $19 + (i32.add + (get_local $7) + (i32.const 4) ) ) ) - (get_local $18) - ) - (block - (set_local $0 - (get_local $7) - ) - (set_local $5 - (get_local $19) - ) - (br $while-out31) ) + (get_local $18) ) - ) - (br_if $while-in32 - (tee_local $7 - (i32.load offset=8 + (block + (set_local $0 (get_local $7) ) + (set_local $5 + (get_local $19) + ) + (br $while-out31) ) ) - (set_local $8 - (i32.const 171) - ) - (br $label$break$c) ) - ) - (if - (i32.lt_u + (br_if $while-in32 (tee_local $7 - (i32.and - (i32.sub - (get_local $11) - (i32.load - (i32.const 1220) - ) - ) - (get_local $21) + (i32.load offset=8 + (get_local $7) ) ) - (i32.const 2147483647) ) - (if - (i32.eq - (tee_local $19 - (call $ta - (get_local $7) - ) - ) - (i32.add - (i32.load - (get_local $0) - ) + (set_local $8 + (i32.const 171) + ) + (br $label$break$c) + ) + ) + (if + (i32.lt_u + (tee_local $7 + (i32.and + (i32.sub + (get_local $11) (i32.load - (get_local $5) + (i32.const 1220) ) ) + (get_local $21) ) - (if - (i32.ne - (get_local $19) - (i32.const -1) + ) + (i32.const 2147483647) + ) + (if + (i32.eq + (tee_local $19 + (call $ta + (get_local $7) ) - (block - (set_local $20 - (get_local $19) - ) - (set_local $26 - (get_local $7) - ) - (br $label$break$b - (i32.const 191) - ) + ) + (i32.add + (i32.load + (get_local $0) + ) + (i32.load + (get_local $5) ) ) + ) + (if + (i32.ne + (get_local $19) + (i32.const -1) + ) (block - (set_local $12 + (set_local $20 (get_local $19) ) - (set_local $1 + (set_local $26 (get_local $7) ) - (set_local $8 - (i32.const 181) + (br $label$break$b + (i32.const 191) ) ) ) + (block + (set_local $12 + (get_local $19) + ) + (set_local $1 + (get_local $7) + ) + (set_local $8 + (i32.const 181) + ) + ) ) ) - (set_local $8 - (i32.const 171) - ) + ) + (set_local $8 + (i32.const 171) + ) + ) + (if + (i32.eq + (get_local $8) + (i32.const 171) ) (if - (i32.eq - (get_local $8) - (i32.const 171) - ) - (if - (i32.ne - (tee_local $18 - (call $ta - (i32.const 0) - ) + (i32.ne + (tee_local $18 + (call $ta + (i32.const 0) ) - (i32.const -1) ) - (block $do-once33 - (set_local $2 - (if (result i32) - (i32.and - (tee_local $19 - (i32.add - (tee_local $7 - (i32.load - (i32.const 1684) - ) + (i32.const -1) + ) + (block $do-once33 + (set_local $2 + (if (result i32) + (i32.and + (tee_local $19 + (i32.add + (tee_local $7 + (i32.load + (i32.const 1684) ) - (i32.const -1) ) - ) - (tee_local $0 - (get_local $18) + (i32.const -1) ) ) - (i32.add - (i32.sub - (get_local $14) + (tee_local $0 + (get_local $18) + ) + ) + (i32.add + (i32.sub + (get_local $14) + (get_local $0) + ) + (i32.and + (i32.add + (get_local $19) (get_local $0) ) - (i32.and - (i32.add - (get_local $19) - (get_local $0) - ) - (i32.sub - (i32.const 0) - (get_local $7) - ) + (i32.sub + (i32.const 0) + (get_local $7) ) ) - (get_local $14) ) + (get_local $14) ) - (set_local $0 - (i32.add - (tee_local $7 - (i32.load - (i32.const 1640) - ) + ) + (set_local $0 + (i32.add + (tee_local $7 + (i32.load + (i32.const 1640) ) + ) + (get_local $2) + ) + ) + (if + (i32.and + (i32.gt_u (get_local $2) + (get_local $6) + ) + (i32.lt_u + (get_local $2) + (i32.const 2147483647) ) ) - (if - (i32.and - (i32.gt_u - (get_local $2) - (get_local $6) - ) - (i32.lt_u - (get_local $2) - (i32.const 2147483647) + (block + (if + (tee_local $19 + (i32.load + (i32.const 1648) + ) ) - ) - (block - (if - (tee_local $19 - (i32.load - (i32.const 1648) + (br_if $do-once33 + (i32.or + (i32.le_u + (get_local $0) + (get_local $7) ) - ) - (br_if $do-once33 - (i32.or - (i32.le_u - (get_local $0) - (get_local $7) - ) - (i32.gt_u - (get_local $0) - (get_local $19) - ) + (i32.gt_u + (get_local $0) + (get_local $19) ) ) ) - (set_local $1 - (if (result i32) - (i32.eq - (tee_local $19 - (call $ta - (get_local $2) - ) - ) - (get_local $18) - ) - (block - (set_local $20 - (get_local $18) - ) - (set_local $26 + ) + (set_local $1 + (if (result i32) + (i32.eq + (tee_local $19 + (call $ta (get_local $2) ) - (br $label$break$b - (i32.const 191) - ) ) - (block (result i32) - (set_local $12 - (get_local $19) - ) - (set_local $8 - (i32.const 181) - ) + (get_local $18) + ) + (block + (set_local $20 + (get_local $18) + ) + (set_local $26 (get_local $2) ) + (br $label$break$b + (i32.const 191) + ) + ) + (block (result i32) + (set_local $12 + (get_local $19) + ) + (set_local $8 + (i32.const 181) + ) + (get_local $2) ) ) ) @@ -3347,115 +3344,115 @@ ) ) ) - (if - (i32.eq - (get_local $8) - (i32.const 181) - ) - (block $label$break$d - (set_local $19 - (i32.sub - (i32.const 0) - (get_local $1) - ) + ) + (if + (i32.eq + (get_local $8) + (i32.const 181) + ) + (block $label$break$d + (set_local $19 + (i32.sub + (i32.const 0) + (get_local $1) ) - (set_local $4 - (if (result i32) + ) + (set_local $4 + (if (result i32) + (i32.and + (i32.gt_u + (get_local $15) + (get_local $1) + ) (i32.and - (i32.gt_u - (get_local $15) + (i32.lt_u (get_local $1) + (i32.const 2147483647) ) - (i32.and - (i32.lt_u - (get_local $1) - (i32.const 2147483647) - ) - (i32.ne - (get_local $12) - (i32.const -1) - ) + (i32.ne + (get_local $12) + (i32.const -1) ) ) - (if (result i32) - (i32.lt_u - (tee_local $0 - (i32.and - (i32.add - (i32.sub - (get_local $17) - (get_local $1) - ) - (tee_local $18 - (i32.load - (i32.const 1688) - ) - ) - ) + ) + (if (result i32) + (i32.lt_u + (tee_local $0 + (i32.and + (i32.add (i32.sub - (i32.const 0) - (get_local $18) + (get_local $17) + (get_local $1) ) + (tee_local $18 + (i32.load + (i32.const 1688) + ) + ) + ) + (i32.sub + (i32.const 0) + (get_local $18) ) ) - (i32.const 2147483647) ) - (if (result i32) - (i32.eq - (call $ta - (get_local $0) - ) - (i32.const -1) + (i32.const 2147483647) + ) + (if (result i32) + (i32.eq + (call $ta + (get_local $0) ) - (block - (drop - (call $ta - (get_local $19) - ) + (i32.const -1) + ) + (block + (drop + (call $ta + (get_local $19) ) - (br $label$break$d) - ) - (i32.add - (get_local $0) - (get_local $1) ) + (br $label$break$d) + ) + (i32.add + (get_local $0) + (get_local $1) ) - (get_local $1) ) (get_local $1) ) + (get_local $1) ) - (if - (i32.ne + ) + (if + (i32.ne + (get_local $12) + (i32.const -1) + ) + (block + (set_local $20 (get_local $12) - (i32.const -1) ) - (block - (set_local $20 - (get_local $12) - ) - (set_local $26 - (get_local $4) - ) - (br $label$break$b - (i32.const 191) - ) + (set_local $26 + (get_local $4) + ) + (br $label$break$b + (i32.const 191) ) ) ) ) - (i32.store - (i32.const 1652) - (i32.or - (i32.load - (i32.const 1652) - ) - (i32.const 4) + ) + (i32.store + (i32.const 1652) + (i32.or + (i32.load + (i32.const 1652) ) + (i32.const 4) ) ) + (i32.const 188) ) - (i32.const 188) ) ) (i32.const 188) @@ -8033,7 +8030,7 @@ (local $6 i32) (local $7 i32) (if - (tee_local $5 + (tee_local $4 (i32.load (tee_local $3 (i32.add @@ -8045,7 +8042,7 @@ ) (block (set_local $6 - (get_local $5) + (get_local $4) ) (set_local $7 (i32.const 5) @@ -8074,26 +8071,26 @@ (get_local $7) (i32.const 5) ) - (block $label$break$a - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 20) + (set_local $5 + (block $label$break$a (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $6) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) + ) ) ) ) ) + (get_local $1) ) - (get_local $1) - ) - (block - (set_local $4 + (br $label$break$a (call_indirect (type $FUNCSIG$iiii) (get_local $2) (get_local $0) @@ -8109,122 +8106,116 @@ ) ) ) - (br $label$break$a) ) - ) - (set_local $4 - (get_local $3) - ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (set_local $5 + (get_local $3) ) - (block $label$break$b - (set_local $3 - (get_local $1) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) + (block $label$break$b + (set_local $3 + (get_local $1) + ) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) + ) + (br $label$break$b) ) - (br $label$break$b) ) - ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $6 + (i32.add + (get_local $3) + (i32.const -1) + ) ) ) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (set_local $3 - (get_local $6) + (block + (set_local $3 + (get_local $6) + ) + (br $while-in) ) - (br $while-in) ) ) - ) - (if - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) + (drop + (br_if $label$break$a (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) + ) + (i32.const 3) + ) + (i32.const 2) ) - (i32.const 3) ) - (i32.const 2) + (get_local $3) ) ) - (get_local $3) ) - (block - (set_local $4 + (set_local $1 + (i32.sub + (get_local $1) (get_local $3) ) - (br $label$break$a) ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) + (set_local $5 + (i32.load + (get_local $4) + ) ) ) - (set_local $4 - (i32.load - (get_local $5) - ) + (set_local $3 + (i32.const 0) ) ) - (set_local $3 - (i32.const 0) + (drop + (call $jb + (get_local $5) + (get_local $0) + (get_local $1) + ) ) - ) - (drop - (call $jb + (i32.store (get_local $4) - (get_local $0) - (get_local $1) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) + (i32.add + (i32.load + (get_local $4) + ) + (get_local $1) ) - (get_local $1) ) - ) - (set_local $4 (i32.add (get_local $3) (get_local $1) @@ -8232,7 +8223,7 @@ ) ) ) - (get_local $4) + (get_local $5) ) (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) diff --git a/test/memorygrowth.fromasm.imprecise b/test/memorygrowth.fromasm.imprecise index 77af5f25a..5f0518c42 100644 --- a/test/memorygrowth.fromasm.imprecise +++ b/test/memorygrowth.fromasm.imprecise @@ -3079,265 +3079,262 @@ (if (i32.eq (tee_local $8 - (block $label$break$b (result i32) - (if - (i32.eqz - (i32.and + (if (result i32) + (i32.and + (i32.load + (i32.const 1652) + ) + (i32.const 4) + ) + (i32.const 188) + (block $label$break$b (result i32) + (if + (tee_local $18 (i32.load - (i32.const 1652) + (i32.const 1232) ) - (i32.const 4) ) - ) - (block - (if - (tee_local $18 - (i32.load - (i32.const 1232) - ) + (block $label$break$c + (set_local $7 + (i32.const 1656) ) - (block $label$break$c - (set_local $7 - (i32.const 1656) - ) - (loop $while-in32 - (block $while-out31 - (if - (i32.le_u - (tee_local $3 - (i32.load - (get_local $7) - ) + (loop $while-in32 + (block $while-out31 + (if + (i32.le_u + (tee_local $3 + (i32.load + (get_local $7) ) - (get_local $18) ) - (if - (i32.gt_u - (i32.add - (get_local $3) - (i32.load - (tee_local $19 - (i32.add - (get_local $7) - (i32.const 4) - ) + (get_local $18) + ) + (if + (i32.gt_u + (i32.add + (get_local $3) + (i32.load + (tee_local $19 + (i32.add + (get_local $7) + (i32.const 4) ) ) ) - (get_local $18) - ) - (block - (set_local $0 - (get_local $7) - ) - (set_local $5 - (get_local $19) - ) - (br $while-out31) ) + (get_local $18) ) - ) - (br_if $while-in32 - (tee_local $7 - (i32.load offset=8 + (block + (set_local $0 (get_local $7) ) + (set_local $5 + (get_local $19) + ) + (br $while-out31) ) ) - (set_local $8 - (i32.const 171) - ) - (br $label$break$c) ) - ) - (if - (i32.lt_u + (br_if $while-in32 (tee_local $7 - (i32.and - (i32.sub - (get_local $11) - (i32.load - (i32.const 1220) - ) - ) - (get_local $21) + (i32.load offset=8 + (get_local $7) ) ) - (i32.const 2147483647) ) - (if - (i32.eq - (tee_local $19 - (call $ta - (get_local $7) - ) - ) - (i32.add - (i32.load - (get_local $0) - ) + (set_local $8 + (i32.const 171) + ) + (br $label$break$c) + ) + ) + (if + (i32.lt_u + (tee_local $7 + (i32.and + (i32.sub + (get_local $11) (i32.load - (get_local $5) + (i32.const 1220) ) ) + (get_local $21) ) - (if - (i32.ne - (get_local $19) - (i32.const -1) + ) + (i32.const 2147483647) + ) + (if + (i32.eq + (tee_local $19 + (call $ta + (get_local $7) ) - (block - (set_local $20 - (get_local $19) - ) - (set_local $26 - (get_local $7) - ) - (br $label$break$b - (i32.const 191) - ) + ) + (i32.add + (i32.load + (get_local $0) + ) + (i32.load + (get_local $5) ) ) + ) + (if + (i32.ne + (get_local $19) + (i32.const -1) + ) (block - (set_local $12 + (set_local $20 (get_local $19) ) - (set_local $1 + (set_local $26 (get_local $7) ) - (set_local $8 - (i32.const 181) + (br $label$break$b + (i32.const 191) ) ) ) + (block + (set_local $12 + (get_local $19) + ) + (set_local $1 + (get_local $7) + ) + (set_local $8 + (i32.const 181) + ) + ) ) ) - (set_local $8 - (i32.const 171) - ) + ) + (set_local $8 + (i32.const 171) + ) + ) + (if + (i32.eq + (get_local $8) + (i32.const 171) ) (if - (i32.eq - (get_local $8) - (i32.const 171) - ) - (if - (i32.ne - (tee_local $18 - (call $ta - (i32.const 0) - ) + (i32.ne + (tee_local $18 + (call $ta + (i32.const 0) ) - (i32.const -1) ) - (block $do-once33 - (set_local $2 - (if (result i32) - (i32.and - (tee_local $19 - (i32.add - (tee_local $7 - (i32.load - (i32.const 1684) - ) + (i32.const -1) + ) + (block $do-once33 + (set_local $2 + (if (result i32) + (i32.and + (tee_local $19 + (i32.add + (tee_local $7 + (i32.load + (i32.const 1684) ) - (i32.const -1) ) - ) - (tee_local $0 - (get_local $18) + (i32.const -1) ) ) - (i32.add - (i32.sub - (get_local $14) + (tee_local $0 + (get_local $18) + ) + ) + (i32.add + (i32.sub + (get_local $14) + (get_local $0) + ) + (i32.and + (i32.add + (get_local $19) (get_local $0) ) - (i32.and - (i32.add - (get_local $19) - (get_local $0) - ) - (i32.sub - (i32.const 0) - (get_local $7) - ) + (i32.sub + (i32.const 0) + (get_local $7) ) ) - (get_local $14) ) + (get_local $14) ) - (set_local $0 - (i32.add - (tee_local $7 - (i32.load - (i32.const 1640) - ) + ) + (set_local $0 + (i32.add + (tee_local $7 + (i32.load + (i32.const 1640) ) + ) + (get_local $2) + ) + ) + (if + (i32.and + (i32.gt_u (get_local $2) + (get_local $6) + ) + (i32.lt_u + (get_local $2) + (i32.const 2147483647) ) ) - (if - (i32.and - (i32.gt_u - (get_local $2) - (get_local $6) - ) - (i32.lt_u - (get_local $2) - (i32.const 2147483647) + (block + (if + (tee_local $19 + (i32.load + (i32.const 1648) + ) ) - ) - (block - (if - (tee_local $19 - (i32.load - (i32.const 1648) + (br_if $do-once33 + (i32.or + (i32.le_u + (get_local $0) + (get_local $7) ) - ) - (br_if $do-once33 - (i32.or - (i32.le_u - (get_local $0) - (get_local $7) - ) - (i32.gt_u - (get_local $0) - (get_local $19) - ) + (i32.gt_u + (get_local $0) + (get_local $19) ) ) ) - (set_local $1 - (if (result i32) - (i32.eq - (tee_local $19 - (call $ta - (get_local $2) - ) - ) - (get_local $18) - ) - (block - (set_local $20 - (get_local $18) - ) - (set_local $26 + ) + (set_local $1 + (if (result i32) + (i32.eq + (tee_local $19 + (call $ta (get_local $2) ) - (br $label$break$b - (i32.const 191) - ) ) - (block (result i32) - (set_local $12 - (get_local $19) - ) - (set_local $8 - (i32.const 181) - ) + (get_local $18) + ) + (block + (set_local $20 + (get_local $18) + ) + (set_local $26 (get_local $2) ) + (br $label$break$b + (i32.const 191) + ) + ) + (block (result i32) + (set_local $12 + (get_local $19) + ) + (set_local $8 + (i32.const 181) + ) + (get_local $2) ) ) ) @@ -3345,115 +3342,115 @@ ) ) ) - (if - (i32.eq - (get_local $8) - (i32.const 181) - ) - (block $label$break$d - (set_local $19 - (i32.sub - (i32.const 0) - (get_local $1) - ) + ) + (if + (i32.eq + (get_local $8) + (i32.const 181) + ) + (block $label$break$d + (set_local $19 + (i32.sub + (i32.const 0) + (get_local $1) ) - (set_local $4 - (if (result i32) + ) + (set_local $4 + (if (result i32) + (i32.and + (i32.gt_u + (get_local $15) + (get_local $1) + ) (i32.and - (i32.gt_u - (get_local $15) + (i32.lt_u (get_local $1) + (i32.const 2147483647) ) - (i32.and - (i32.lt_u - (get_local $1) - (i32.const 2147483647) - ) - (i32.ne - (get_local $12) - (i32.const -1) - ) + (i32.ne + (get_local $12) + (i32.const -1) ) ) - (if (result i32) - (i32.lt_u - (tee_local $0 - (i32.and - (i32.add - (i32.sub - (get_local $17) - (get_local $1) - ) - (tee_local $18 - (i32.load - (i32.const 1688) - ) - ) - ) + ) + (if (result i32) + (i32.lt_u + (tee_local $0 + (i32.and + (i32.add (i32.sub - (i32.const 0) - (get_local $18) + (get_local $17) + (get_local $1) ) + (tee_local $18 + (i32.load + (i32.const 1688) + ) + ) + ) + (i32.sub + (i32.const 0) + (get_local $18) ) ) - (i32.const 2147483647) ) - (if (result i32) - (i32.eq - (call $ta - (get_local $0) - ) - (i32.const -1) + (i32.const 2147483647) + ) + (if (result i32) + (i32.eq + (call $ta + (get_local $0) ) - (block - (drop - (call $ta - (get_local $19) - ) + (i32.const -1) + ) + (block + (drop + (call $ta + (get_local $19) ) - (br $label$break$d) - ) - (i32.add - (get_local $0) - (get_local $1) ) + (br $label$break$d) + ) + (i32.add + (get_local $0) + (get_local $1) ) - (get_local $1) ) (get_local $1) ) + (get_local $1) ) - (if - (i32.ne + ) + (if + (i32.ne + (get_local $12) + (i32.const -1) + ) + (block + (set_local $20 (get_local $12) - (i32.const -1) ) - (block - (set_local $20 - (get_local $12) - ) - (set_local $26 - (get_local $4) - ) - (br $label$break$b - (i32.const 191) - ) + (set_local $26 + (get_local $4) + ) + (br $label$break$b + (i32.const 191) ) ) ) ) - (i32.store - (i32.const 1652) - (i32.or - (i32.load - (i32.const 1652) - ) - (i32.const 4) + ) + (i32.store + (i32.const 1652) + (i32.or + (i32.load + (i32.const 1652) ) + (i32.const 4) ) ) + (i32.const 188) ) - (i32.const 188) ) ) (i32.const 188) @@ -8031,7 +8028,7 @@ (local $6 i32) (local $7 i32) (if - (tee_local $5 + (tee_local $4 (i32.load (tee_local $3 (i32.add @@ -8043,7 +8040,7 @@ ) (block (set_local $6 - (get_local $5) + (get_local $4) ) (set_local $7 (i32.const 5) @@ -8072,26 +8069,26 @@ (get_local $7) (i32.const 5) ) - (block $label$break$a - (if - (i32.lt_u - (i32.sub - (get_local $6) - (tee_local $3 - (i32.load - (tee_local $5 - (i32.add - (get_local $2) - (i32.const 20) + (set_local $5 + (block $label$break$a (result i32) + (if + (i32.lt_u + (i32.sub + (get_local $6) + (tee_local $3 + (i32.load + (tee_local $4 + (i32.add + (get_local $2) + (i32.const 20) + ) ) ) ) ) + (get_local $1) ) - (get_local $1) - ) - (block - (set_local $4 + (br $label$break$a (call_indirect (type $FUNCSIG$iiii) (get_local $2) (get_local $0) @@ -8107,122 +8104,116 @@ ) ) ) - (br $label$break$a) ) - ) - (set_local $4 - (get_local $3) - ) - (if - (i32.gt_s - (i32.load8_s offset=75 - (get_local $2) - ) - (i32.const -1) + (set_local $5 + (get_local $3) ) - (block $label$break$b - (set_local $3 - (get_local $1) + (if + (i32.gt_s + (i32.load8_s offset=75 + (get_local $2) + ) + (i32.const -1) ) - (loop $while-in - (if - (i32.eqz - (get_local $3) - ) - (block - (set_local $3 - (i32.const 0) + (block $label$break$b + (set_local $3 + (get_local $1) + ) + (loop $while-in + (if + (i32.eqz + (get_local $3) + ) + (block + (set_local $3 + (i32.const 0) + ) + (br $label$break$b) ) - (br $label$break$b) ) - ) - (if - (i32.ne - (i32.load8_s - (i32.add - (get_local $0) - (tee_local $6 - (i32.add - (get_local $3) - (i32.const -1) + (if + (i32.ne + (i32.load8_s + (i32.add + (get_local $0) + (tee_local $6 + (i32.add + (get_local $3) + (i32.const -1) + ) ) ) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (set_local $3 - (get_local $6) + (block + (set_local $3 + (get_local $6) + ) + (br $while-in) ) - (br $while-in) ) ) - ) - (if - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (get_local $2) - (get_local $0) + (drop + (br_if $label$break$a (get_local $3) - (i32.add - (i32.and - (i32.load offset=36 - (get_local $2) + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (get_local $2) + (get_local $0) + (get_local $3) + (i32.add + (i32.and + (i32.load offset=36 + (get_local $2) + ) + (i32.const 3) + ) + (i32.const 2) ) - (i32.const 3) ) - (i32.const 2) + (get_local $3) ) ) - (get_local $3) ) - (block - (set_local $4 + (set_local $1 + (i32.sub + (get_local $1) (get_local $3) ) - (br $label$break$a) ) - ) - (set_local $1 - (i32.sub - (get_local $1) - (get_local $3) + (set_local $0 + (i32.add + (get_local $0) + (get_local $3) + ) ) - ) - (set_local $0 - (i32.add - (get_local $0) - (get_local $3) + (set_local $5 + (i32.load + (get_local $4) + ) ) ) - (set_local $4 - (i32.load - (get_local $5) - ) + (set_local $3 + (i32.const 0) ) ) - (set_local $3 - (i32.const 0) + (drop + (call $jb + (get_local $5) + (get_local $0) + (get_local $1) + ) ) - ) - (drop - (call $jb + (i32.store (get_local $4) - (get_local $0) - (get_local $1) - ) - ) - (i32.store - (get_local $5) - (i32.add - (i32.load - (get_local $5) + (i32.add + (i32.load + (get_local $4) + ) + (get_local $1) ) - (get_local $1) ) - ) - (set_local $4 (i32.add (get_local $3) (get_local $1) @@ -8230,7 +8221,7 @@ ) ) ) - (get_local $4) + (get_local $5) ) (func $Za (; 17 ;) (; has Stack IR ;) (param $0 i32) (result i32) (local $1 i32) diff --git a/test/passes/inlining-optimizing_optimize-level=3.txt b/test/passes/inlining-optimizing_optimize-level=3.txt index a8a8a24f9..5e498c475 100644 --- a/test/passes/inlining-optimizing_optimize-level=3.txt +++ b/test/passes/inlining-optimizing_optimize-level=3.txt @@ -556,29 +556,26 @@ (local $2 i32) (if (get_local $0) - (block $do-once - (if - (i32.le_s - (i32.load offset=76 - (get_local $0) + (set_local $0 + (block $do-once (result i32) + (if + (i32.le_s + (i32.load offset=76 + (get_local $0) + ) + (i32.const -1) ) - (i32.const -1) - ) - (block - (set_local $0 + (br $do-once (call $___fflush_unlocked (get_local $0) ) ) - (br $do-once) ) - ) - (set_local $1 - (call $___fflush_unlocked - (get_local $0) + (set_local $1 + (call $___fflush_unlocked + (get_local $0) + ) ) - ) - (set_local $0 (get_local $1) ) ) diff --git a/test/passes/merge-blocks.txt b/test/passes/merge-blocks.txt index 1a2ee186c..da5f8b315 100644 --- a/test/passes/merge-blocks.txt +++ b/test/passes/merge-blocks.txt @@ -90,8 +90,8 @@ (drop (block $label$0 (result i32) (drop - (loop $label$2 - (block $label$1 + (block $label$1 + (loop $label$2 (br $label$2) ) ) @@ -130,9 +130,9 @@ ) ) (func $if-block (; 9 ;) (type $0) - (if - (i32.const 1) - (block $label + (block $label + (if + (i32.const 1) (block $block (drop (i32.const 2) @@ -160,31 +160,31 @@ ) ) (func $if-block-br (; 11 ;) (type $0) - (if - (i32.const 1) - (block $label + (block $label + (if + (i32.const 1) (br $label) ) ) ) (func $if-block-br-1 (; 12 ;) (type $0) - (if - (i32.const 1) - (block $label + (block $label + (if + (i32.const 1) (br $label) - ) - (drop - (i32.const 3) + (drop + (i32.const 3) + ) ) ) ) (func $if-block-br-2 (; 13 ;) (type $0) - (if - (i32.const 1) - (drop - (i32.const 3) - ) - (block $label + (block $label + (if + (i32.const 1) + (drop + (i32.const 3) + ) (br $label) ) ) @@ -199,36 +199,36 @@ ) ) (func $if-block-br-4-eithre (; 15 ;) (type $0) - (if - (i32.const 1) - (block $label + (block $label + (if + (i32.const 1) (drop (i32.const 2) ) - ) - (drop - (i32.const 3) + (drop + (i32.const 3) + ) ) ) ) (func $if-block-br-5-value (; 16 ;) (type $2) (result i32) - (if (result i32) - (i32.const 1) - (block $label (result i32) + (block $label (result i32) + (if (result i32) + (i32.const 1) (i32.const 2) + (i32.const 3) ) - (i32.const 3) ) ) (func $restructure-if-outerType-change (; 17 ;) (type $0) (loop $label$1 (br_if $label$1 (block $label$2 - (if - (block $label$4 - (unreachable) - ) - (block $label$3 + (block $label$3 + (if + (block $label$4 + (unreachable) + ) (br $label$3) ) ) @@ -237,4 +237,36 @@ ) ) ) + (func $if-arm-unreachable (; 18 ;) (type $0) + (block $label$1 + (if + (unreachable) + (nop) + (unreachable) + ) + ) + ) + (func $propagate-type-if-we-optimize (; 19 ;) (type $0) + (if + (i32.const 1) + (nop) + (block $block + (drop + (loop $label$3 (result i64) + (br_if $label$3 + (block $label$4 (result i32) + (if + (i32.const 0) + (unreachable) + (unreachable) + ) + ) + ) + (i64.const -9) + ) + ) + (unreachable) + ) + ) + ) ) diff --git a/test/passes/merge-blocks.wast b/test/passes/merge-blocks.wast index 2fe784b18..cab2d1804 100644 --- a/test/passes/merge-blocks.wast +++ b/test/passes/merge-blocks.wast @@ -200,5 +200,37 @@ ) ) ) + (func $if-arm-unreachable + (block $label$1 + (if + (unreachable) ;; unreachable condition + (nop) + (unreachable) + ) + ) + ) + (func $propagate-type-if-we-optimize + (if + (i32.const 1) + (nop) + (block + (drop + (loop $label$3 (result i64) + (br_if $label$3 + (block $label$4 (result i32) + (if + (i32.const 0) + (unreachable) + (unreachable) + ) + ) + ) + (i64.const -9) + ) + ) + (unreachable) + ) + ) + ) ) diff --git a/test/passes/merge-blocks_remove-unused-brs.txt b/test/passes/merge-blocks_remove-unused-brs.txt index 62be8f17c..2d055b6e9 100644 --- a/test/passes/merge-blocks_remove-unused-brs.txt +++ b/test/passes/merge-blocks_remove-unused-brs.txt @@ -3,13 +3,12 @@ (func $func (; 0 ;) (type $0) (param $x i32) (loop $loop (block $out - (if - (get_local $x) - (nop) - (block - (nop) - (br $loop) + (block + (br_if $out + (get_local $x) ) + (nop) + (br $loop) ) ) ) diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt index 952018440..3f4528a5c 100644 --- a/test/passes/remove-unused-brs.txt +++ b/test/passes/remove-unused-brs.txt @@ -125,9 +125,9 @@ ) ) (func $b12-yes (; 12 ;) (type $1) - (block $topmost - (if - (i32.const 1) + (if + (i32.const 1) + (block $topmost (block $block1 (drop (i32.const 12) @@ -138,14 +138,14 @@ ) ) ) - (block $block3 + ) + (block $block3 + (drop + (i32.const 27) + ) + (block $block0 (drop - (i32.const 27) - ) - (block $block0 - (drop - (i32.const 2) - ) + (i32.const 2) ) ) ) @@ -179,15 +179,15 @@ ) ) (func $b14 (; 14 ;) (type $2) (result i32) - (block $topmost (result i32) - (if (result i32) - (i32.const 1) + (if (result i32) + (i32.const 1) + (block $topmost (result i32) (block $block1 (result i32) (i32.const 12) ) - (block $block3 (result i32) - (i32.const 27) - ) + ) + (block $block3 (result i32) + (i32.const 27) ) ) ) @@ -199,9 +199,9 @@ ) ) (func $b15b (; 16 ;) (type $1) - (block $topmost - (if - (i32.const 18) + (if + (i32.const 18) + (block $topmost (block $block (drop (i32.const 0) @@ -231,45 +231,45 @@ ) ) (func $b17 (; 18 ;) (type $1) - (block $a - (if - (i32.const 0) + (if + (i32.const 0) + (block $a (block $block1 ) - (block $block3 - ) + ) + (block $block3 ) ) - (block $a7 - (if - (i32.const 0) + (if + (i32.const 0) + (block $a7 (drop (i32.const 1) ) - (block $block6 - ) + ) + (block $block6 ) ) - (block $a9 - (if - (i32.const 0) + (if + (i32.const 0) + (block $a9 (block $block8 ) - (drop - (i32.const 1) - ) + ) + (drop + (i32.const 1) ) ) - (block $c - (block $b - (if - (i32.const 0) + (if + (i32.const 0) + (block $c + (block $b (block $block11 ) - (block $block13 - ) ) ) + (block $block13 + ) ) ) (func $ret-1 (; 19 ;) (type $1) @@ -282,12 +282,11 @@ ) ) (func $ret-3 (; 21 ;) (type $1) - (block $block0 - (if - (i32.const 0) - (nop) - (block $block3 - ) + (if + (i32.const 0) + (block $block0 + ) + (block $block3 ) ) ) @@ -485,127 +484,118 @@ ) ) (loop $in45 - (block $out46 - (br_if $in45 - (i32.eqz - (i32.const 0) - ) + (if + (i32.const 0) + (block $out46 + (unreachable) ) - (unreachable) + (br $in45) ) ) (loop $in48 - (block $out49 - (br_if $in48 - (i32.eqz - (i32.const 0) + (if + (i32.const 0) + (block $out49 + (block $block + (call $loops) ) ) - (block $block - (call $loops) - ) + (br $in48) ) ) (loop $in-todo - (block $out-todo - (if - (i32.const 0) - (nop) - (block - (call $loops) - (br $in-todo) - ) + (if + (i32.const 0) + (block $out-todo + ) + (block + (call $loops) + (br $in-todo) ) ) ) (loop $in52 - (block $out53 - (if - (i32.const 0) - (nop) - (block - (call $loops) - (br $in52) - ) + (if + (i32.const 0) + (block $out53 + ) + (block + (call $loops) + (br $in52) ) ) ) (loop $in55 - (block $out56 - (if - (i32.const 0) - (block - (call $loops) - (br $in55) - ) - (nop) + (if + (i32.const 0) + (block + (call $loops) + (br $in55) + ) + (block $out56 ) ) ) (loop $in58 - (block $out59 - (if - (i32.const 0) - (block - (block $block61 - (drop - (i32.const 1) - ) - (call $loops) + (if + (i32.const 0) + (block + (block $block61 + (drop + (i32.const 1) ) - (br $in58) + (call $loops) ) - (nop) + (br $in58) + ) + (block $out59 ) ) ) (loop $in62 - (block $out63 - (if - (i32.const 0) - (nop) - (block - (call $loops) - (drop - (i32.const 100) - ) - (br $in62) + (if + (i32.const 0) + (block $out63 + ) + (block + (call $loops) + (drop + (i32.const 100) ) + (br $in62) ) ) ) (loop $in65 - (block $out66 - (if - (i32.const 0) - (block - (call $loops) - (drop - (i32.const 101) - ) - (br $in65) + (if + (i32.const 0) + (block + (call $loops) + (drop + (i32.const 101) ) - (nop) + (br $in65) + ) + (block $out66 ) ) ) (loop $in68 - (block $out69 - (if - (i32.const 0) - (block - (block $block71 - (drop - (i32.const 1) - ) - (call $loops) - ) + (if + (i32.const 0) + (block + (block $block71 (drop - (i32.const 102) + (i32.const 1) ) - (br $in68) + (call $loops) ) - (nop) + (drop + (i32.const 102) + ) + (br $in68) + ) + (block $out69 ) ) ) @@ -633,19 +623,18 @@ ) ) (loop $in78 - (block $out79 - (if - (i32.const 0) - (nop) - (block - (call $loops) - (drop - (block $out2 (result i32) - (i32.const 1) - ) + (if + (i32.const 0) + (block $out79 + ) + (block + (call $loops) + (drop + (block $out2 (result i32) + (i32.const 1) ) - (br $in78) ) + (br $in78) ) ) ) @@ -659,14 +648,13 @@ ) ) (loop $in-todo2 - (block $out-todo2 - (if - (i32.const 0) - (nop) - (block - (call $loops) - (br $in-todo2) - ) + (if + (i32.const 0) + (block $out-todo2 + ) + (block + (call $loops) + (br $in-todo2) ) ) ) @@ -697,17 +685,16 @@ ) ) (loop $in-todo287 - (block $out-todo288 - (if - (i32.const 0) - (nop) - (block - (call $loops) - (drop - (i32.const 1) - ) - (br $in-todo287) + (if + (i32.const 0) + (block $out-todo288 + ) + (block + (call $loops) + (drop + (i32.const 1) ) + (br $in-todo287) ) ) ) @@ -863,8 +850,8 @@ ) ) (func $fuzz (; 31 ;) (type $4) (param $j i32) (param $g i32) - (block $label$break$c - (loop $label$continue$d + (loop $label$continue$d + (block $label$break$c (block $label$break$d (if (i32.lt_s @@ -948,17 +935,19 @@ ) ) (func $loop-if (; 33 ;) (type $2) (result i32) - (block $outer (result i32) - (loop $typed (result i32) - (if (result i32) - (i32.const 2) - (block $block (result i32) - (drop - (call $loop-if) + (loop $typed (result i32) + (block $outer (result i32) + (block (result i32) + (if (result i32) + (i32.const 2) + (block $block (result i32) + (drop + (call $loop-if) + ) + (i32.const 0) ) - (i32.const 0) + (br $typed) ) - (br $typed) ) ) ) @@ -973,15 +962,17 @@ ) ) (func $loop-break (; 35 ;) (type $0) (param $0 i32) - (block $block$7$break - (loop $shape$6$continue - (call $loop-break - (i32.const 1) - ) - (br_if $shape$6$continue - (get_local $0) + (loop $shape$6$continue + (block $block$7$break + (block + (call $loop-break + (i32.const 1) + ) + (br_if $shape$6$continue + (get_local $0) + ) + (nop) ) - (nop) ) ) ) @@ -1105,9 +1096,9 @@ (func $no-flow-through-if-without-else (; 43 ;) (type $8) (result f32) (local $0 i32) (local $2 f32) - (block $label$0 (result f32) - (if (result f32) - (get_local $0) + (if (result f32) + (get_local $0) + (block $label$0 (block $label$11 (return (f32.const 239) @@ -1119,8 +1110,8 @@ ) ) ) - (f32.const -9223372036854775808) ) + (f32.const -9223372036854775808) ) ) (func $unreachable-return-loop-value (; 44 ;) (type $7) (result i64) @@ -1658,12 +1649,11 @@ (unreachable) ) (func $tiny-switch (; 65 ;) (type $1) - (block $x + (if + (i32.const 0) (block $y - (drop - (i32.const 0) - ) - (br $x) + ) + (block $x ) ) (block $z @@ -1671,7 +1661,7 @@ (drop (i32.const 0) ) - (br $z) + (nop) ) ) ) @@ -1925,24 +1915,23 @@ (func $fuzz-block-unreachable-brs-with-values (; 80 ;) (type $2) (result i32) (local $0 i32) (loop $label$1 - (block $label$2 - (br_if $label$1 - (i32.eqz - (get_local $0) - ) - ) - (tee_local $0 - (loop $label$5 - (br_if $label$5 - (block - (unreachable) - (drop - (i32.const 0) + (if + (get_local $0) + (block $label$2 + (tee_local $0 + (loop $label$5 + (br_if $label$5 + (block + (unreachable) + (drop + (i32.const 0) + ) ) ) ) ) ) + (br $label$1) ) ) ) @@ -2003,4 +1992,141 @@ (i32.const 0) ) ) + (func $if-block (; 86 ;) (type $1) + (if + (i32.const 1) + (block $label + (block $block + (drop + (i32.const 2) + ) + (drop + (i32.const 3) + ) + ) + ) + ) + ) + (func $if-block-bad (; 87 ;) (type $1) + (block $label + (if + (br $label) + (block $block + (drop + (i32.const 2) + ) + (drop + (i32.const 3) + ) + ) + ) + ) + ) + (func $if-block-br (; 88 ;) (type $1) + (block $label + (br_if $label + (i32.const 1) + ) + ) + ) + (func $if-block-br-1 (; 89 ;) (type $1) + (if + (i32.const 1) + (block $label + ) + (drop + (i32.const 3) + ) + ) + ) + (func $if-block-br-2 (; 90 ;) (type $1) + (if + (i32.const 1) + (block $label + (drop + (i32.const 3) + ) + ) + (nop) + ) + ) + (func $if-block-br-3 (; 91 ;) (type $1) + (if + (i32.const 1) + (block $label + ) + (nop) + ) + ) + (func $if-block-br-4-eithre (; 92 ;) (type $1) + (if + (i32.const 1) + (block $label + (drop + (i32.const 2) + ) + ) + (drop + (i32.const 3) + ) + ) + ) + (func $if-block-br-5-value (; 93 ;) (type $2) (result i32) + (if (result i32) + (i32.const 1) + (block $label (result i32) + (i32.const 2) + ) + (i32.const 3) + ) + ) + (func $restructure-if-outerType-change (; 94 ;) (type $1) + (loop $label$1 + (br_if $label$1 + (block $label$2 + (if + (block $label$4 + (unreachable) + ) + (block $label$3 + (br $label$3) + ) + ) + (unreachable) + ) + ) + ) + ) + (func $if-arm-unreachable (; 95 ;) (type $1) + (if + (unreachable) + (block $label$1 + (nop) + ) + (unreachable) + ) + ) + (func $propagate-type-if-we-optimize (; 96 ;) (type $1) + (if + (i32.const 1) + (nop) + (block $block + (drop + (loop $label$3 (result i64) + (br_if $label$3 + (if + (i32.const 0) + (block $label$4 + (unreachable) + ) + (unreachable) + ) + ) + (i64.const -9) + ) + ) + (unreachable) + ) + ) + ) ) diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast index 7f77fd00c..ea3e5f320 100644 --- a/test/passes/remove-unused-brs.wast +++ b/test/passes/remove-unused-brs.wast @@ -1617,5 +1617,129 @@ (i32.const 0) ) ) + (func $if-block + (block $label + (if + (i32.const 1) + (block + (drop (i32.const 2)) + (drop (i32.const 3)) + ) + ) + ) + ) + (func $if-block-bad + (block $label + (if + (br $label) ;; use outside of arm + (block + (drop (i32.const 2)) + (drop (i32.const 3)) + ) + ) + ) + ) + (func $if-block-br + (block $label + (if + (i32.const 1) + (br $label) + ) + ) + ) + (func $if-block-br-1 + (block $label + (if + (i32.const 1) + (br $label) + (drop (i32.const 3)) + ) + ) + ) + (func $if-block-br-2 + (block $label + (if + (i32.const 1) + (drop (i32.const 3)) + (br $label) + ) + ) + ) + (func $if-block-br-3 + (block $label + (if + (i32.const 1) + (br $label) + (br $label) + ) + ) + ) + (func $if-block-br-4-eithre + (block $label + (if + (i32.const 1) + (drop (i32.const 2)) + (drop (i32.const 3)) + ) + ) + ) + (func $if-block-br-5-value (result i32) + (block $label (result i32) + (if (result i32) + (i32.const 1) + (i32.const 2) + (i32.const 3) + ) + ) + ) + (func $restructure-if-outerType-change + (loop $label$1 + (br_if $label$1 + (block $label$2 + (block $label$3 + (if + (block $label$4 + (unreachable) + ) + (br $label$3) + ) + ) + (unreachable) + ) + ) + ) + ) + (func $if-arm-unreachable + (block $label$1 + (if + (unreachable) ;; unreachable condition + (nop) + (unreachable) + ) + ) + ) + (func $propagate-type-if-we-optimize + (if + (i32.const 1) + (nop) + (block + (drop + (loop $label$3 (result i64) + (br_if $label$3 + (block $label$4 (result i32) + (if + (i32.const 0) + (unreachable) + (unreachable) + ) + ) + ) + (i64.const -9) + ) + ) + (unreachable) + ) + ) + ) ) diff --git a/test/passes/remove-unused-names_merge-blocks.txt b/test/passes/remove-unused-names_merge-blocks.txt index 69a83d725..5cc6ca891 100644 --- a/test/passes/remove-unused-names_merge-blocks.txt +++ b/test/passes/remove-unused-names_merge-blocks.txt @@ -1095,30 +1095,30 @@ (drop (i32.const 3) ) - (loop $l3 - (block $b1 + (block $b1 + (loop $l3 (br_if $b1 (i32.const 4) ) (br_if $l3 (i32.const 5) ) - (drop - (i32.const 6) - ) + ) + (drop + (i32.const 6) ) ) - (loop $l4 - (block $b2 + (block $b2 + (loop $l4 (br_if $l4 (i32.const 7) ) - (br_if $b2 - (i32.const 8) - ) - (drop - (i32.const 9) - ) + ) + (br_if $b2 + (i32.const 8) + ) + (drop + (i32.const 9) ) ) (loop $l5 diff --git a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt index 375ff949d..2bc3c04b1 100644 --- a/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt +++ b/test/passes/remove-unused-names_remove-unused-brs_vacuum.txt @@ -85,9 +85,9 @@ (local $var$6 i32) (local $var$7 i32) (local $var$8 i32) - (block $label$3 - (if - (get_local $var$4) + (if + (get_local $var$4) + (block $label$3 (block (if (i32.eqz diff --git a/test/unit.fromasm b/test/unit.fromasm index cd623d401..691c65136 100644 --- a/test/unit.fromasm +++ b/test/unit.fromasm @@ -549,7 +549,6 @@ ) (br $while-in) ) - (nop) ) ) ) diff --git a/test/unit.fromasm.clamp b/test/unit.fromasm.clamp index b840f615e..44de1e100 100644 --- a/test/unit.fromasm.clamp +++ b/test/unit.fromasm.clamp @@ -599,7 +599,6 @@ ) (br $while-in) ) - (nop) ) ) ) diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index d4f3115a8..d9cd05f28 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -548,7 +548,6 @@ ) (br $while-in) ) - (nop) ) ) ) |