diff options
Diffstat (limited to 'src/relooper')
33 files changed, 2223 insertions, 875 deletions
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp index a457914b..aefcad93 100644 --- a/src/relooper/Relooper.cpp +++ b/src/relooper/Relooper.cpp @@ -104,12 +104,14 @@ void Branch::Render(Block *Target, bool SetLabel) { int Block::IdCounter = 1; // 0 is reserved for clearings -Block::Block(const char *CodeInit) : Parent(NULL), Id(Block::IdCounter++), IsCheckedMultipleEntry(false) { +Block::Block(const char *CodeInit, const char *BranchVarInit) : Parent(NULL), Id(Block::IdCounter++), IsCheckedMultipleEntry(false) { Code = strdup(CodeInit); + BranchVar = BranchVarInit ? strdup(BranchVarInit) : NULL; } Block::~Block() { if (Code) free((void*)Code); + if (BranchVar) free((void*)BranchVar); for (BlockBranchMap::iterator iter = ProcessedBranchesOut.begin(); iter != ProcessedBranchesOut.end(); iter++) { delete iter->second; } @@ -189,8 +191,16 @@ void Block::Render(bool InLoop) { } assert(DefaultTarget); // Since each block *must* branch somewhere, this must be set + if (ProcessedBranchesOut.size() > 2) assert(BranchVar); // must have a branch variable if multiple conditions + + bool useSwitch = BranchVar != NULL; + + if (useSwitch) { + PrintIndented("switch (%s) {\n", BranchVar); + } + ministring RemainingConditions; - bool First = true; + bool First = !useSwitch; // when using a switch, there is no special first for (BlockBranchMap::iterator iter = ProcessedBranchesOut.begin();; iter++) { Block *Target; Branch *Details; @@ -208,26 +218,39 @@ void Block::Render(bool InLoop) { bool HasContent = SetCurrLabel || Details->Type != Branch::Direct || HasFusedContent || Details->Code; if (iter != ProcessedBranchesOut.end()) { // If there is nothing to show in this branch, omit the condition - if (HasContent) { - PrintIndented("%sif (%s) {\n", First ? "" : "} else ", Details->Condition); - First = false; + if (useSwitch) { + PrintIndented("%s {\n", Details->Condition); } else { - if (RemainingConditions.size() > 0) RemainingConditions += " && "; - RemainingConditions += "!("; - RemainingConditions += Details->Condition; - RemainingConditions += ")"; + if (HasContent) { + PrintIndented("%sif (%s) {\n", First ? "" : "} else ", Details->Condition); + First = false; + } else { + if (RemainingConditions.size() > 0) RemainingConditions += " && "; + RemainingConditions += "!("; + if (BranchVar) { + RemainingConditions += BranchVar; + RemainingConditions += " == "; + } + RemainingConditions += Details->Condition; + RemainingConditions += ")"; + } } } else { - if (HasContent) { - if (RemainingConditions.size() > 0) { - if (First) { - PrintIndented("if (%s) {\n", RemainingConditions.c_str()); - First = false; - } else { - PrintIndented("} else if (%s) {\n", RemainingConditions.c_str()); + // this is the default + if (useSwitch) { + PrintIndented("default: {\n"); + } else { + if (HasContent) { + if (RemainingConditions.size() > 0) { + if (First) { + PrintIndented("if (%s) {\n", RemainingConditions.c_str()); + First = false; + } else { + PrintIndented("} else if (%s) {\n", RemainingConditions.c_str()); + } + } else if (!First) { + PrintIndented("} else {\n"); } - } else if (!First) { - PrintIndented("} else {\n"); } } } @@ -236,7 +259,13 @@ void Block::Render(bool InLoop) { if (HasFusedContent) { Fused->InnerMap.find(Target)->second->Render(InLoop); } + if (useSwitch && iter != ProcessedBranchesOut.end()) { + PrintIndented("break;\n"); + } if (!First) Indenter::Unindent(); + if (useSwitch) { + PrintIndented("}\n"); + } if (iter == ProcessedBranchesOut.end()) break; } if (!First) PrintIndented("}\n"); @@ -392,7 +421,7 @@ void Relooper::Calculate(Block *Entry) { PrintDebug("Splitting block %d\n", Original->Id); for (BlockSet::iterator iter = Original->BranchesIn.begin(); iter != Original->BranchesIn.end(); iter++) { Block *Prior = *iter; - Block *Split = new Block(Original->Code); + Block *Split = new Block(Original->Code, Original->BranchVar); Parent->Blocks.push_back(Split); PrintDebug(" to %d\n", Split->Id); Split->BranchesIn.insert(Prior); @@ -975,6 +1004,8 @@ void Relooper::Calculate(Block *Entry) { Root = Next; Next = NULL; SHAPE_SWITCH(Root, { + if (Simple->Inner->BranchVar) LastLoop = NULL; // a switch clears out the loop (TODO: only for breaks, not continue) + // If there is a next block, we already know at Simple creation time to make direct branches, // and we can do nothing more. If there is no next however, then Natural is where we will // go to by doing nothing, so we can potentially optimize some branches to direct. @@ -1028,6 +1059,11 @@ void Relooper::Calculate(Block *Entry) { // If we are fusing a Multiple with a loop into this Simple, then visit it now if (Fused && Fused->NeedLoop) { LoopStack.push(Fused); + } + if (Simple->Inner->BranchVar) { + LoopStack.push(NULL); // a switch means breaks are now useless, push a dummy + } + if (Fused) { RECURSE_Multiple(Fused, FindLabeledLoops); } for (BlockBranchMap::iterator iter = Simple->Inner->ProcessedBranchesOut.begin(); iter != Simple->Inner->ProcessedBranchesOut.end(); iter++) { @@ -1038,14 +1074,18 @@ void Relooper::Calculate(Block *Entry) { if (Details->Ancestor != LoopStack.top() && Details->Labeled) { LabeledShape *Labeled = Shape::IsLabeled(Details->Ancestor); Labeled->Labeled = true; - Details->Labeled = true; } else { Details->Labeled = false; } } } + if (Simple->Inner->BranchVar) { + LoopStack.pop(); + } if (Fused && Fused->NeedLoop) { LoopStack.pop(); + } + if (Fused) { Next = Fused->Next; } else { Next = Root->Next; @@ -1173,8 +1213,8 @@ void rl_set_asm_js_mode(int on) { Relooper::SetAsmJSMode(on); } -void *rl_new_block(const char *text) { - Block *ret = new Block(text); +void *rl_new_block(const char *text, const char *branch_var) { + Block *ret = new Block(text, branch_var); #if DEBUG printf(" void *b%d = rl_new_block(\"// code %d\");\n", ret->Id, ret->Id); __blockDebugMap__[ret] = ret->Id; diff --git a/src/relooper/Relooper.h b/src/relooper/Relooper.h index e54b578c..f3dedf8c 100644 --- a/src/relooper/Relooper.h +++ b/src/relooper/Relooper.h @@ -59,9 +59,10 @@ struct Block { Shape *Parent; // The shape we are directly inside int Id; // A unique identifier const char *Code; // The string representation of the code in this block. Owning pointer (we copy the input) + const char *BranchVar; // If we have more than one branch out, the variable whose value determines where we go bool IsCheckedMultipleEntry; // If true, we are a multiple entry, so reaching us requires setting the label variable - Block(const char *CodeInit); + Block(const char *CodeInit, const char *BranchVarInit); ~Block(); void AddBranchTo(Block *Target, const char *Condition, const char *Code=NULL); @@ -235,7 +236,7 @@ extern "C" { RELOOPERDLL_API void rl_set_output_buffer(char *buffer, int size); RELOOPERDLL_API void rl_make_output_buffer(int size); RELOOPERDLL_API void rl_set_asm_js_mode(int on); -RELOOPERDLL_API void *rl_new_block(const char *text); +RELOOPERDLL_API void *rl_new_block(const char *text, const char *branch_var); RELOOPERDLL_API void rl_delete_block(void *block); RELOOPERDLL_API void rl_block_add_branch_to(void *from, void *to, const char *condition, const char *code); RELOOPERDLL_API void *rl_new_relooper(); diff --git a/src/relooper/emscripten/glue.js b/src/relooper/emscripten/glue.js index 36922185..40ddabec 100644 --- a/src/relooper/emscripten/glue.js +++ b/src/relooper/emscripten/glue.js @@ -6,15 +6,22 @@ var TBUFFER_SIZE = 10*1024*1024; var tbuffer = _malloc(TBUFFER_SIZE); + var VBUFFER_SIZE = 256; + var vbuffer = _malloc(VBUFFER_SIZE); + var RelooperGlue = {}; RelooperGlue['init'] = function() { this.r = _rl_new_relooper(); }, - RelooperGlue['addBlock'] = function(text) { + RelooperGlue['addBlock'] = function(text, branchVar) { assert(this.r); assert(text.length+1 < TBUFFER_SIZE); writeStringToMemory(text, tbuffer); - var b = _rl_new_block(tbuffer); + if (branchVar) { + assert(branchVar.length+1 < VBUFFER_SIZE); + writeStringToMemory(branchVar, vbuffer); + } + var b = _rl_new_block(tbuffer, branchVar ? vbuffer : 0); _rl_relooper_add_block(this.r, b); return b; }; diff --git a/src/relooper/fuzzer.py b/src/relooper/fuzzer.py index 5f6bae3d..50846d10 100644 --- a/src/relooper/fuzzer.py +++ b/src/relooper/fuzzer.py @@ -26,13 +26,13 @@ while True: pass # parts - entry = '''print('entry'); var label; var state; var decisions = %s; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }''' % str(decisions) + entry = '''print('entry'); var label; var state; var modded; var decisions = %s; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }''' % str(decisions) slow = entry + '\n' for i in range(len(branches[0])): if i > 0: slow += 'else ' b = branches[0] - slow += 'if (state %% %d == %d) { label = %d; }\n' % (len(b)+1, i, b[i]) # TODO: split range 1-n into these options + slow += 'if (modded == %d) { label = %d; }\n' % (i, b[i]) # TODO: split range 1-n into these options if len(branches[0]): slow += 'else ' slow += 'label = %d;\n' % defaults[0] @@ -51,26 +51,35 @@ int main() { ''' for i in range(1, num): - slow += ' case %d: print(%d); state = check(); \n' % (i, i) + slow += ' case %d: print(%d); state = check(); modded = state %% %d\n' % (i, i, len(branches[i])+1) b = branches[i] for j in range(len(b)): - slow += ' if (state %% %d == %d) { label = %d; break }\n' % (len(b)+1, j, b[j]) # TODO: split range 1-n into these options + slow += ' if (modded == %d) { label = %d; break }\n' % (j, b[j]) # TODO: split range 1-n into these options slow += ' label = %d; break\n' % defaults[i] + branch_vars = [] for i in range(num): + branch_var = '"modded"' if len(branches[i]) > 0 and not (len(branches[i]) == 1 and random.random() < 0.5) else 'NULL' + branch_vars.append(branch_var) + if i == 0: fast += ''' - Block *b%d = new Block("%s"); -''' % (i, entry) + Block *b%d = new Block("%s", %s); +''' % (i, entry, branch_var) else: - fast += ''' Block *b%d = new Block("print(%d); state = check();%s"); -''' % (i, i, '// ' + ('.' * int(random.expovariate(0.5/num)))) + fast += ''' Block *b%d = new Block("print(%d); state = check(); modded = state %% %d; %s", %s); +''' % (i, i, len(branches[i])+1, '// ' + ('.' * int(random.expovariate(0.5/num))), branch_var) for i in range(num): + branch_var = branch_vars[i] b = branches[i] for j in range(len(b)): - fast += ''' b%d->AddBranchTo(b%d, "state %% %d == %d"); -''' % (i, b[j], len(b)+1, j) + if branch_var == 'NULL': + fast += ''' b%d->AddBranchTo(b%d, "modded == %d"); +''' % (i, b[j], j) + else: + fast += ''' b%d->AddBranchTo(b%d, "case %d:"); +''' % (i, b[j], j) fast += ''' b%d->AddBranchTo(b%d, NULL); ''' % (i, defaults[i]) diff --git a/src/relooper/test.cpp b/src/relooper/test.cpp index b2d500d7..fbd9c7aa 100644 --- a/src/relooper/test.cpp +++ b/src/relooper/test.cpp @@ -7,11 +7,11 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- If pattern --\n\n"); + printf("\n\n-- If pattern --\n\n", "the_var"); - Block *b_a = new Block("// block A\n"); - Block *b_b = new Block("// block B\n"); - Block *b_c = new Block("// block C\n"); + Block *b_a = new Block("// block A\n", "the_var"); + Block *b_b = new Block("// block B\n", "the_var"); + Block *b_c = new Block("// block C\n", "the_var"); b_a->AddBranchTo(b_b, "check == 10", "atob();"); b_a->AddBranchTo(b_c, NULL, "atoc();"); @@ -24,7 +24,7 @@ int main() { r.AddBlock(b_c); r.Calculate(b_a); - printf("\n\n"); + printf("\n\n", "the_var"); r.Render(); puts(buffer); @@ -33,12 +33,12 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- If-else pattern --\n\n"); + printf("\n\n-- If-else pattern --\n\n", "the_var"); - Block *b_a = new Block("// block A\n"); - Block *b_b = new Block("// block B\n"); - Block *b_c = new Block("// block C\n"); - Block *b_d = new Block("// block D\n"); + Block *b_a = new Block("// block A\n", "the_var"); + Block *b_b = new Block("// block B\n", "the_var"); + Block *b_c = new Block("// block C\n", "the_var"); + Block *b_d = new Block("// block D\n", "the_var"); b_a->AddBranchTo(b_b, "check == 15"); b_a->AddBranchTo(b_c, NULL); @@ -54,7 +54,7 @@ int main() { r.AddBlock(b_d); r.Calculate(b_a); - printf("\n\n"); + printf("\n\n", "the_var"); r.Render(); puts(buffer); @@ -63,11 +63,11 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- Loop + tail pattern --\n\n"); + printf("\n\n-- Loop + tail pattern --\n\n", "the_var"); - Block *b_a = new Block("// block A\nvar check = maybe();\n"); - Block *b_b = new Block("// block B\n"); - Block *b_c = new Block("// block C\n"); + Block *b_a = new Block("// block A\nvar check = maybe();\n", "the_var"); + Block *b_b = new Block("// block B\n", "the_var"); + Block *b_c = new Block("// block C\n", "the_var"); b_a->AddBranchTo(b_b, NULL); @@ -80,7 +80,7 @@ int main() { r.AddBlock(b_c); r.Calculate(b_a); - printf("\n\n"); + printf("\n\n", "the_var"); r.Render(); puts(buffer); @@ -89,29 +89,29 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- Loop with phi to head \n\n"); + printf("\n\n-- Loop with phi to head \n\n", "the_var"); void *block_map[10000]; void *rl = rl_new_relooper(); - void *b1 = rl_new_block("// code 1"); + void *b1 = rl_new_block("// code 1", "the_var"); block_map[1] = b1; rl_relooper_add_block(rl, block_map[1]); - void *b2 = rl_new_block("// code 2"); + void *b2 = rl_new_block("// code 2", "the_var"); block_map[2] = b2; rl_relooper_add_block(rl, block_map[2]); - void *b3 = rl_new_block("// code 3"); + void *b3 = rl_new_block("// code 3", "the_var"); block_map[3] = b3; rl_relooper_add_block(rl, block_map[3]); - void *b4 = rl_new_block("// code 4"); + void *b4 = rl_new_block("// code 4", "the_var"); block_map[4] = b4; rl_relooper_add_block(rl, block_map[4]); - void *b5 = rl_new_block("// code 5"); + void *b5 = rl_new_block("// code 5", "the_var"); block_map[5] = b5; rl_relooper_add_block(rl, block_map[5]); - void *b6 = rl_new_block("// code 6"); + void *b6 = rl_new_block("// code 6", "the_var"); block_map[6] = b6; rl_relooper_add_block(rl, block_map[6]); - void *b7 = rl_new_block("// code 7"); + void *b7 = rl_new_block("// code 7", "the_var"); block_map[7] = b7; rl_relooper_add_block(rl, block_map[7]); rl_block_add_branch_to(block_map[1], block_map[2], NULL, "var $i_0 = 0;var $x_0 = 5; "); @@ -132,13 +132,13 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- phi on split dead ends --\n\n"); + printf("\n\n-- phi on split dead ends --\n\n", "the_var"); - Block *b_a = new Block("// block A...................................................................................................\n"); - Block *b_b = new Block("// block B...................................................................................................\n"); - Block *b_c = new Block("// block C...................................................................................................\n"); - Block *b_d = new Block("// block D\n"); // small and splittable! - Block *b_e = new Block("// block E\n"); + Block *b_a = new Block("// block A...................................................................................................\n", "the_var"); + Block *b_b = new Block("// block B...................................................................................................\n", "the_var"); + Block *b_c = new Block("// block C...................................................................................................\n", "the_var"); + Block *b_d = new Block("// block D\n", "the_var"); // small and splittable! + Block *b_e = new Block("// block E\n", "the_var"); b_a->AddBranchTo(b_b, "chak()", "atob();"); b_a->AddBranchTo(b_c, NULL, "atoc();"); @@ -155,7 +155,7 @@ int main() { r.AddBlock(b_e); r.Calculate(b_a); - printf("\n\n"); + printf("\n\n", "the_var"); r.Render(); puts(buffer); @@ -164,12 +164,12 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- Unbalanced with a dead end --\n\n"); + printf("\n\n-- Unbalanced with a dead end --\n\n", "the_var"); - Block *b_a = new Block("// block A\n"); - Block *b_b = new Block("// block B\n"); - Block *b_c = new Block("return C;\n"); - Block *b_d = new Block("// block D\n"); + Block *b_a = new Block("// block A\n", "the_var"); + Block *b_b = new Block("// block B\n", "the_var"); + Block *b_c = new Block("return C;\n", "the_var"); + Block *b_d = new Block("// block D\n", "the_var"); b_a->AddBranchTo(b_b, "check == 10"); b_a->AddBranchTo(b_c, NULL); // c is a dead end @@ -185,7 +185,7 @@ int main() { r.AddBlock(b_d); r.Calculate(b_a); - printf("\n\n"); + printf("\n\n", "the_var"); r.Render(); puts(buffer); @@ -194,14 +194,14 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- if (expensive || expensive2) X else Y; Z --\n\n"); + printf("\n\n-- if (expensive || expensive2) X else Y; Z --\n\n", "the_var"); - Block *b_a = new Block("// block A\n"); - Block *b_b = new Block("// block B\n"); - Block *b_c = new Block("// block C;\n"); - Block *b_d = new Block("// block D\n"); - Block *b_e = new Block("// block E\n"); - Block *b_f = new Block("// block F\n"); + Block *b_a = new Block("// block A\n", "the_var"); + Block *b_b = new Block("// block B\n", "the_var"); + Block *b_c = new Block("// block C;\n", "the_var"); + Block *b_d = new Block("// block D\n", "the_var"); + Block *b_e = new Block("// block E\n", "the_var"); + Block *b_f = new Block("// block F\n", "the_var"); b_a->AddBranchTo(b_c, "expensive()"); b_a->AddBranchTo(b_b, NULL); @@ -226,7 +226,7 @@ int main() { r.AddBlock(b_f); r.Calculate(b_a); - printf("\n\n"); + printf("\n\n", "the_var"); r.Render(); puts(buffer); @@ -235,11 +235,11 @@ int main() { if (1) { Relooper::SetOutputBuffer(buffer, sizeof(buffer)); - printf("\n\n-- conditional loop --\n\n"); + printf("\n\n-- conditional loop --\n\n", "the_var"); - Block *b_a = new Block("// block A\n"); - Block *b_b = new Block("// block B\n"); - Block *b_c = new Block("// block C\n"); + Block *b_a = new Block("// block A\n", "the_var"); + Block *b_b = new Block("// block B\n", "the_var"); + Block *b_c = new Block("// block C\n", "the_var"); b_a->AddBranchTo(b_b, "shouldLoop()"); b_a->AddBranchTo(b_c, NULL); @@ -253,7 +253,7 @@ int main() { r.AddBlock(b_c); r.Calculate(b_a); - printf("\n\n"); + printf("\n\n", "the_var"); r.Render(); puts(buffer); diff --git a/src/relooper/test.txt b/src/relooper/test.txt index 6c910846..2c530567 100644 --- a/src/relooper/test.txt +++ b/src/relooper/test.txt @@ -5,13 +5,21 @@ // block A -if (check == 10) { +switch (the_var) { +check == 10 { atob(); // block B - btoc(); -} else { + switch (the_var) { + default: { + btoc(); + } + } + break; +} +default: { atoc(); } +} // block C @@ -21,10 +29,22 @@ if (check == 10) { // block A -if (check == 15) { +switch (the_var) { +check == 15 { // block B -} else { + switch (the_var) { + default: { + } + } + break; +} +default: { // block C + switch (the_var) { + default: { + } + } +} } // block D @@ -34,13 +54,22 @@ if (check == 15) { -while(1) { +L9: while(1) { // block A var check = maybe(); + switch (the_var) { + default: { + } + } // block B - if (!(check == 41)) { + switch (the_var) { + check == 41 { break; } + default: { + break L9; + } + } } // block C @@ -49,30 +78,56 @@ while(1) { -- Loop with phi to head // code 1 -var $i_0 = 0;var $x_0 = 5; -while(1) { +switch (the_var) { +default: { + var $i_0 = 0;var $x_0 = 5; +} +} +L14: while(1) { // code 2 - if (!($2)) { + switch (the_var) { + $2 { + break; + } + default: { var $x_1 = $x_0; label = 18; - break; + break L14; + } } // code 3 - if ($6) { + switch (the_var) { + $6 { + break L14; break; - } else { + } + default: { var $i_0 = $7;var $x_0 = $5; } + } } if (label == 18) { // code 7 } // code 4 -if ($10) { +switch (the_var) { +$10 { // code 5 + switch (the_var) { + default: { + } + } + break; +} +default: { +} } // code 6 -var $x_1 = $13; +switch (the_var) { +default: { + var $x_1 = $13; +} +} // code 7 @@ -82,17 +137,29 @@ var $x_1 = $13; // block A................................................................................................... -if (chak()) { +switch (the_var) { +chak() { atob(); // block B................................................................................................... - btod(); + switch (the_var) { + default: { + btod(); + } + } // block D -} else { + break; +} +default: { atoc(); // block C................................................................................................... - ctod2(); + switch (the_var) { + default: { + ctod2(); + } + } // block D } +} @@ -101,12 +168,25 @@ if (chak()) { // block A -if (!(check == 10)) { +switch (the_var) { +check == 10 { + break; +} +default: { return C; } +} while(1) { // block B + switch (the_var) { + default: { + } + } // block D + switch (the_var) { + default: { + } + } } @@ -116,24 +196,49 @@ while(1) { // block A -do { - if (expensive()) { +L37: do { + switch (the_var) { + expensive() { label = 33; - } else { + break; + } + default: { // block B - if (expensive2()) { + switch (the_var) { + expensive2() { label = 33; + break L37; break; } + default: { + } + } // block D + switch (the_var) { + default: { + } + } + } } } while(0); if (label == 33) { // block C; + switch (the_var) { + default: { + } + } } while(1) { // block E + switch (the_var) { + default: { + } + } // block F + switch (the_var) { + default: { + } + } } @@ -143,13 +248,25 @@ while(1) { // block A -if (shouldLoop()) { - while(1) { - // block B - if (!(moarLoop())) { - break; +L46: do { + switch (the_var) { + shouldLoop() { + while(1) { + // block B + switch (the_var) { + moarLoop() { + break; + } + default: { + break L46; + } + } } + break; } -} + default: { + } + } +} while(0); // block C diff --git a/src/relooper/test2.c b/src/relooper/test2.c index 118a2627..156945c3 100644 --- a/src/relooper/test2.c +++ b/src/relooper/test2.c @@ -6,20 +6,20 @@ int main() { rl_set_output_buffer(buffer, sizeof(buffer)); void *r = rl_new_relooper(); - void *ep = rl_new_block("ep"); + void *ep = rl_new_block("ep", "var"); rl_relooper_add_block(r, ep); - void *LBB1 = rl_new_block("LBB1"); + void *LBB1 = rl_new_block("LBB1", "the_var"); rl_relooper_add_block(r, LBB1); - void *LBB2 = rl_new_block("LBB2"); + void *LBB2 = rl_new_block("LBB2", "the_var"); rl_relooper_add_block(r, LBB2); - void *LBB3 = rl_new_block("LBB3"); + void *LBB3 = rl_new_block("LBB3", "the_var"); rl_relooper_add_block(r, LBB3); /* - void *LBB4 = rl_new_block("LBB4"); + void *LBB4 = rl_new_block("LBB4", "the_var"); rl_relooper_add_block(r, LBB4); - void *LBB5 = rl_new_block("LBB5"); + void *LBB5 = rl_new_block("LBB5", "the_var"); rl_relooper_add_block(r, LBB5); - void *LBB6 = rl_new_block("LBB6"); + void *LBB6 = rl_new_block("LBB6", "the_var"); rl_relooper_add_block(r, LBB6); */ rl_block_add_branch_to(ep, LBB1, "ep -> LBB1", NULL); @@ -27,13 +27,13 @@ int main() { rl_block_add_branch_to(LBB1, LBB2, "LBB1 -> LBB2", NULL); rl_block_add_branch_to(LBB1, LBB3, NULL, NULL); rl_block_add_branch_to(LBB2, LBB3, NULL, NULL); -// rl_block_add_branch_to(LBB3, LBB4, "LBB3 -> LBB4"); -// rl_block_add_branch_to(LBB3, LBB6, "LBB3 -> LBB6"); +// rl_block_add_branch_to(LBB3, LBB4, "LBB3 -> LBB4", "the_var"); +// rl_block_add_branch_to(LBB3, LBB6, "LBB3 -> LBB6", "the_var"); /* - rl_block_add_branch_to(LBB4, LBB5, "LBB4 -> LBB5"); - rl_block_add_branch_to(LBB4, LBB6, "LBB4 -> LBB6"); - rl_block_add_branch_to(LBB5, LBB6, "LBB5 -> LBB6"); - rl_block_add_branch_to(LBB5, LBB5, "LBB5 -> LBB5"); + rl_block_add_branch_to(LBB4, LBB5, "LBB4 -> LBB5", "the_var"); + rl_block_add_branch_to(LBB4, LBB6, "LBB4 -> LBB6", "the_var"); + rl_block_add_branch_to(LBB5, LBB6, "LBB5 -> LBB6", "the_var"); + rl_block_add_branch_to(LBB5, LBB5, "LBB5 -> LBB5", "the_var"); */ rl_relooper_calculate(r, ep); rl_relooper_render(r); diff --git a/src/relooper/test2.txt b/src/relooper/test2.txt index 2f3e5ca1..a558a8b7 100644 --- a/src/relooper/test2.txt +++ b/src/relooper/test2.txt @@ -1,11 +1,25 @@ ep -do { - if (ep -> LBB1) { +L1: do { + switch (var) { + ep -> LBB1 { LBB1 - if (!(LBB1 -> LBB2)) { + switch (the_var) { + LBB1 -> LBB2 { break; } + default: { + break L1; + } + } LBB2 + switch (the_var) { + default: { + } + } + break; + } + default: { + } } } while(0); LBB3 diff --git a/src/relooper/test3.c b/src/relooper/test3.c index 2cef14fb..f652a2bc 100644 --- a/src/relooper/test3.c +++ b/src/relooper/test3.c @@ -6,19 +6,19 @@ int main() { rl_set_output_buffer(buffer, sizeof(buffer)); void *r = rl_new_relooper(); - void *ep = rl_new_block("ep"); + void *ep = rl_new_block("ep", "the_var"); rl_relooper_add_block(r, ep); - void *LBB1 = rl_new_block("LBB1"); + void *LBB1 = rl_new_block("LBB1", "the_var"); rl_relooper_add_block(r, LBB1); - void *LBB2 = rl_new_block("LBB2"); + void *LBB2 = rl_new_block("LBB2", "the_var"); rl_relooper_add_block(r, LBB2); - void *LBB3 = rl_new_block("LBB3"); + void *LBB3 = rl_new_block("LBB3", "the_var"); rl_relooper_add_block(r, LBB3); - void *LBB4 = rl_new_block("LBB4"); + void *LBB4 = rl_new_block("LBB4", "the_var"); rl_relooper_add_block(r, LBB4); - void *LBB5 = rl_new_block("LBB5"); + void *LBB5 = rl_new_block("LBB5", "the_var"); rl_relooper_add_block(r, LBB5); - void *LBB6 = rl_new_block("LBB6"); + void *LBB6 = rl_new_block("LBB6", "the_var"); rl_relooper_add_block(r, LBB6); rl_block_add_branch_to(ep, LBB1, "ep -> LBB1", NULL); diff --git a/src/relooper/test3.txt b/src/relooper/test3.txt index 51199f72..f77e2618 100644 --- a/src/relooper/test3.txt +++ b/src/relooper/test3.txt @@ -1,26 +1,55 @@ ep -do { - if (ep -> LBB1) { +L1: do { + switch (the_var) { + ep -> LBB1 { LBB1 - if (!(LBB1 -> LBB2)) { + switch (the_var) { + LBB1 -> LBB2 { break; } + default: { + break L1; + } + } LBB2 + switch (the_var) { + default: { + } + } + break; + } + default: { + } } } while(0); LBB3 -do { - if (LBB3 -> LBB4) { +L5: do { + switch (the_var) { + LBB3 -> LBB4 { LBB4 - if (!(LBB4 -> LBB5)) { + switch (the_var) { + LBB4 -> LBB5 { break; } + default: { + break L5; + } + } while(1) { LBB5 - if (LBB5 -> LBB6) { + switch (the_var) { + LBB5 -> LBB6 { + break L5; break; } + default: { + } + } } + break; + } + default: { + } } } while(0); LBB6 diff --git a/src/relooper/test4.cpp b/src/relooper/test4.cpp index 76fc8ec0..8cbc024c 100644 --- a/src/relooper/test4.cpp +++ b/src/relooper/test4.cpp @@ -7,19 +7,19 @@ int main() { void *r = rl_new_relooper(); - void *b19 = rl_new_block("//19"); + void *b19 = rl_new_block("//19", "the_var"); rl_relooper_add_block(r, b19); - void *b20 = rl_new_block("//20"); + void *b20 = rl_new_block("//20", "the_var"); rl_relooper_add_block(r, b20); - void *b21 = rl_new_block("//21"); + void *b21 = rl_new_block("//21", "the_var"); rl_relooper_add_block(r, b21); - void *b22 = rl_new_block("//22"); + void *b22 = rl_new_block("//22", "the_var"); rl_relooper_add_block(r, b22); - void *b23 = rl_new_block("//23"); + void *b23 = rl_new_block("//23", "the_var"); rl_relooper_add_block(r, b23); - void *b24 = rl_new_block("//24"); + void *b24 = rl_new_block("//24", "the_var"); rl_relooper_add_block(r, b24); - void *b28 = rl_new_block("//28"); + void *b28 = rl_new_block("//28", "the_var"); rl_relooper_add_block(r, b28); rl_block_add_branch_to(b19, b20, " 1 ", NULL); diff --git a/src/relooper/test4.txt b/src/relooper/test4.txt index ab7051c1..1829e523 100644 --- a/src/relooper/test4.txt +++ b/src/relooper/test4.txt @@ -1,23 +1,44 @@ //19 -do { - if ( 1 ) { +L1: do { + switch (the_var) { + 1 { //20 - if (!( 1 )) { - label = 4; + switch (the_var) { + 1 { break; } + default: { + label = 4; + break L1; + } + } //21 - } else { + switch (the_var) { + default: { + } + } + break; + } + default: { label = 4; } + } } while(0); if (label == 4) { //22 + switch (the_var) { + default: { + } + } } //23 -if ( 1 ) { +switch (the_var) { + 1 { //24 -} else { + break; +} +default: { //28 } +} diff --git a/src/relooper/test5.cpp b/src/relooper/test5.cpp index f86da2b3..d04d157d 100644 --- a/src/relooper/test5.cpp +++ b/src/relooper/test5.cpp @@ -7,17 +7,17 @@ int main() { void *r = rl_new_relooper(); - void *b0 = rl_new_block("//0"); + void *b0 = rl_new_block("//0", "the_var"); rl_relooper_add_block(r, b0); - void *b1 = rl_new_block("//1"); + void *b1 = rl_new_block("//1", "the_var"); rl_relooper_add_block(r, b1); - void *b2 = rl_new_block("//2"); + void *b2 = rl_new_block("//2", "the_var"); rl_relooper_add_block(r, b2); - void *b3 = rl_new_block("//3"); + void *b3 = rl_new_block("//3", "the_var"); rl_relooper_add_block(r, b3); - void *b4 = rl_new_block("//4"); + void *b4 = rl_new_block("//4", "the_var"); rl_relooper_add_block(r, b4); - void *b5 = rl_new_block("//5"); + void *b5 = rl_new_block("//5", "the_var"); rl_relooper_add_block(r, b5); rl_block_add_branch_to(b0, b1, "check(0)", NULL); diff --git a/src/relooper/test5.txt b/src/relooper/test5.txt index 83755289..82ef5edf 100644 --- a/src/relooper/test5.txt +++ b/src/relooper/test5.txt @@ -1,32 +1,56 @@ //0 -if (check(0)) { - while(1) { +switch (the_var) { +check(0) { + L2: while(1) { //1 - if (!(check(1))) { + switch (the_var) { + check(1) { break; } + default: { + break L2; + } + } } - while(1) { + L4: while(1) { //2 - if (!(check(2))) { + switch (the_var) { + check(2) { break; } + default: { + break L4; + } + } } //3 -} else { + break; +} +default: { goingFrom0to4(); - while(1) { + L7: while(1) { //4 - if (!(check(4))) { + switch (the_var) { + check(4) { break; } + default: { + break L7; + } + } } - while(1) { + L9: while(1) { //5 - if (check(5)) { + switch (the_var) { + check(5) { + break L9; break; } + default: { + } + } } //3 } +} diff --git a/src/relooper/test6.cpp b/src/relooper/test6.cpp index 90453d4c..c292e79c 100644 --- a/src/relooper/test6.cpp +++ b/src/relooper/test6.cpp @@ -7,13 +7,13 @@ int main() { void *r = rl_new_relooper(); - void *b0 = rl_new_block("//0"); + void *b0 = rl_new_block("//0", "the_var"); rl_relooper_add_block(r, b0); - void *b1 = rl_new_block("//1"); + void *b1 = rl_new_block("//1", "the_var"); rl_relooper_add_block(r, b1); - void *b2 = rl_new_block("//2"); + void *b2 = rl_new_block("//2", "the_var"); rl_relooper_add_block(r, b2); - void *b3 = rl_new_block("//3"); + void *b3 = rl_new_block("//3", "the_var"); rl_relooper_add_block(r, b3); rl_block_add_branch_to(b0, b1, "check(0)", NULL); diff --git a/src/relooper/test6.txt b/src/relooper/test6.txt index 4f29f292..f9d6e93a 100644 --- a/src/relooper/test6.txt +++ b/src/relooper/test6.txt @@ -1,11 +1,25 @@ //0 -do { - if (check(0)) { +L1: do { + switch (the_var) { + check(0) { //1 - if (!(check(1))) { + switch (the_var) { + check(1) { break; } + default: { + break L1; + } + } //2 + switch (the_var) { + default: { + } + } + break; + } + default: { + } } } while(0); //3 diff --git a/src/relooper/test_dead.cpp b/src/relooper/test_dead.cpp index 887d254c..5c9fde1b 100644 --- a/src/relooper/test_dead.cpp +++ b/src/relooper/test_dead.cpp @@ -8,8 +8,8 @@ int main() { printf("\n\n-- If pattern --\n\n"); - Block *b_a = new Block("// block A\n"); - Block *b_b = new Block("// block B\n"); // never reached + Block *b_a = new Block("// block A\n", "the_var"); + Block *b_b = new Block("// block B\n", "waka"); // never reached b_b->AddBranchTo(b_b, NULL); diff --git a/src/relooper/test_debug.cpp b/src/relooper/test_debug.cpp index 14511b62..91b6c9d7 100644 --- a/src/relooper/test_debug.cpp +++ b/src/relooper/test_debug.cpp @@ -6,13 +6,13 @@ int main() { rl_set_output_buffer(buffer, sizeof(buffer)); void *r = rl_new_relooper(); - void *ep = rl_new_block("ep"); + void *ep = rl_new_block("ep", "the_var"); rl_relooper_add_block(r, ep); - void *LBB1 = rl_new_block("LBB1"); + void *LBB1 = rl_new_block("LBB1", "the_var"); rl_relooper_add_block(r, LBB1); - void *LBB2 = rl_new_block("LBB2"); + void *LBB2 = rl_new_block("LBB2", "the_var"); rl_relooper_add_block(r, LBB2); - void *LBB3 = rl_new_block("LBB3"); + void *LBB3 = rl_new_block("LBB3", "the_var"); rl_relooper_add_block(r, LBB3); rl_block_add_branch_to(ep, LBB1, "ep -> LBB1", NULL); diff --git a/src/relooper/test_debug.txt b/src/relooper/test_debug.txt index 4a42e642..eb33fdbc 100644 --- a/src/relooper/test_debug.txt +++ b/src/relooper/test_debug.txt @@ -115,13 +115,27 @@ int main() { // === Optimizing shapes === // Fusing Multiple to Simple ep -do { - if (ep -> LBB1) { +L1: do { + switch (the_var) { + ep -> LBB1 { LBB1 - if (!(LBB1 -> LBB2)) { + switch (the_var) { + LBB1 -> LBB2 { break; } + default: { + break L1; + } + } LBB2 + switch (the_var) { + default: { + } + } + break; + } + default: { + } } } while(0); LBB3 diff --git a/src/relooper/test_fuzz1.cpp b/src/relooper/test_fuzz1.cpp index 54205694..ef48ea93 100644 --- a/src/relooper/test_fuzz1.cpp +++ b/src/relooper/test_fuzz1.cpp @@ -8,15 +8,15 @@ int main() { char *buffer = (char*)malloc(SIZE); Relooper::SetOutputBuffer(buffer, SIZE); - Block *b0 = new Block("print('entry'); var label; var state; var decisions = [4, 1, 7, 2, 6, 6, 8]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }"); - Block *b1 = new Block("print(1); state = check();"); - Block *b2 = new Block("print(2); state = check();"); - Block *b3 = new Block("print(3); state = check();"); - Block *b4 = new Block("print(4); state = check();"); - Block *b5 = new Block("print(5); state = check();"); - Block *b6 = new Block("print(6); state = check();"); - Block *b7 = new Block("print(7); state = check();"); - Block *b8 = new Block("print(8); state = check();"); + Block *b0 = new Block("print('entry'); var label; var state; var decisions = [4, 1, 7, 2, 6, 6, 8]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var"); + Block *b1 = new Block("print(1); state = check();", "the_var"); + Block *b2 = new Block("print(2); state = check();", "the_var"); + Block *b3 = new Block("print(3); state = check();", "the_var"); + Block *b4 = new Block("print(4); state = check();", "the_var"); + Block *b5 = new Block("print(5); state = check();", "the_var"); + Block *b6 = new Block("print(6); state = check();", "the_var"); + Block *b7 = new Block("print(7); state = check();", "the_var"); + Block *b8 = new Block("print(8); state = check();", "the_var"); b0->AddBranchTo(b5, NULL); b1->AddBranchTo(b3, NULL); b2->AddBranchTo(b1, NULL); diff --git a/src/relooper/test_fuzz1.txt b/src/relooper/test_fuzz1.txt index becbc0d2..d887f5b8 100644 --- a/src/relooper/test_fuzz1.txt +++ b/src/relooper/test_fuzz1.txt @@ -1,32 +1,72 @@ print('entry'); var label; var state; var decisions = [4, 1, 7, 2, 6, 6, 8]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] } +switch (the_var) { +default: { +} +} print(5); state = check(); +switch (the_var) { +default: { +} +} print(6); state = check(); -if (state == 7) { +switch (the_var) { +state == 7 { print(7); state = check(); - label = 3; + switch (the_var) { + default: { + label = 3; + } + } + break; +} +default: { +} } L5: while(1) { if (label == 3) { label = 0; print(2); state = check(); + switch (the_var) { + default: { + } + } } print(1); state = check(); + switch (the_var) { + default: { + } + } while(1) { print(3); state = check(); - if (!(state == 8)) { + switch (the_var) { + state == 8 { + break; + } + default: { continue L5; } + } print(8); state = check(); - if (!(state == 4)) { + switch (the_var) { + state == 4 { + break; + } + default: { label = 3; continue L5; } + } print(4); state = check(); - if (!(state == 3)) { + switch (the_var) { + state == 3 { + break; + } + default: { continue L5; } + } } } diff --git a/src/relooper/test_fuzz2.cpp b/src/relooper/test_fuzz2.cpp index 00375340..8a66b113 100644 --- a/src/relooper/test_fuzz2.cpp +++ b/src/relooper/test_fuzz2.cpp @@ -8,10 +8,10 @@ int main() { char *buffer = (char*)malloc(SIZE); Relooper::SetOutputBuffer(buffer, SIZE); - Block *b0 = new Block("print('entry'); var label; var state; var decisions = [4, 1, 4, 3, 4, 1, 2, 5, 1, 3, 5, 5, 1, 5, 2, 4, 4, 3]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }"); - Block *b1 = new Block("print(1); state = check();"); - Block *b2 = new Block("print(2); state = check();"); - Block *b3 = new Block("print(3); state = check();"); + Block *b0 = new Block("print('entry'); var label; var state; var decisions = [4, 1, 4, 3, 4, 1, 2, 5, 1, 3, 5, 5, 1, 5, 2, 4, 4, 3]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var"); + Block *b1 = new Block("print(1); state = check();", "the_var"); + Block *b2 = new Block("print(2); state = check();", "the_var"); + Block *b3 = new Block("print(3); state = check();", "the_var"); b0->AddBranchTo(b1, "state == 1"); b0->AddBranchTo(b3, NULL); b1->AddBranchTo(b1, NULL); diff --git a/src/relooper/test_fuzz2.txt b/src/relooper/test_fuzz2.txt index 02b2c83b..69f4350c 100644 --- a/src/relooper/test_fuzz2.txt +++ b/src/relooper/test_fuzz2.txt @@ -1,13 +1,30 @@ print('entry'); var label; var state; var decisions = [4, 1, 4, 3, 4, 1, 2, 5, 1, 3, 5, 5, 1, 5, 2, 4, 4, 3]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] } -if (state == 1) { +switch (the_var) { +state == 1 { while(1) { print(1); state = check(); + switch (the_var) { + default: { + } + } } + break; +} +default: { +} } while(1) { print(3); state = check(); + switch (the_var) { + default: { + } + } print(2); state = check(); + switch (the_var) { + default: { + } + } } diff --git a/src/relooper/test_fuzz3.cpp b/src/relooper/test_fuzz3.cpp index 3f39f5da..cb37d50f 100644 --- a/src/relooper/test_fuzz3.cpp +++ b/src/relooper/test_fuzz3.cpp @@ -8,11 +8,11 @@ int main() { char *buffer = (char*)malloc(SIZE); Relooper::SetOutputBuffer(buffer, SIZE); - Block *b0 = new Block("print('entry'); var label; var state; var decisions = [3, 3, 4, 1, 2, 1, 2, 4, 4, 4, 2, 3, 3, 1, 2]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }"); - Block *b1 = new Block("print(1); state = check();"); - Block *b2 = new Block("print(2); state = check();"); - Block *b3 = new Block("print(3); state = check();"); - Block *b4 = new Block("print(4); state = check();"); + Block *b0 = new Block("print('entry'); var label; var state; var decisions = [3, 3, 4, 1, 2, 1, 2, 4, 4, 4, 2, 3, 3, 1, 2]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var"); + Block *b1 = new Block("print(1); state = check();", "the_var"); + Block *b2 = new Block("print(2); state = check();", "the_var"); + Block *b3 = new Block("print(3); state = check();", "the_var"); + Block *b4 = new Block("print(4); state = check();", "the_var"); b0->AddBranchTo(b1, NULL); b1->AddBranchTo(b3, NULL); b2->AddBranchTo(b1, NULL); diff --git a/src/relooper/test_fuzz3.txt b/src/relooper/test_fuzz3.txt index b4b1831d..398b4803 100644 --- a/src/relooper/test_fuzz3.txt +++ b/src/relooper/test_fuzz3.txt @@ -1,9 +1,25 @@ print('entry'); var label; var state; var decisions = [3, 3, 4, 1, 2, 1, 2, 4, 4, 4, 2, 3, 3, 1, 2]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] } +switch (the_var) { +default: { +} +} print(1); state = check(); +switch (the_var) { +default: { +} +} print(3); state = check(); +switch (the_var) { +default: { +} +} while(1) { print(4); state = check(); + switch (the_var) { + default: { + } + } } diff --git a/src/relooper/test_fuzz4.cpp b/src/relooper/test_fuzz4.cpp index 8f969386..8cd93984 100644 --- a/src/relooper/test_fuzz4.cpp +++ b/src/relooper/test_fuzz4.cpp @@ -8,11 +8,11 @@ int main() { char *buffer = (char*)malloc(SIZE); Relooper::SetOutputBuffer(buffer, SIZE); - Block *b0 = new Block("print('entry'); var label; var state; var decisions = [2, 2, 1, 3, 2, 2, 1, 3, 2, 3, 3, 1, 3, 2, 1]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }"); - Block *b1 = new Block("print(1); state = check();"); - Block *b2 = new Block("print(2); state = check();"); - Block *b3 = new Block("print(3); state = check();"); - Block *b4 = new Block("print(4); state = check();"); + Block *b0 = new Block("print('entry'); var label; var state; var decisions = [2, 2, 1, 3, 2, 2, 1, 3, 2, 3, 3, 1, 3, 2, 1]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var"); + Block *b1 = new Block("print(1); state = check();", "the_var"); + Block *b2 = new Block("print(2); state = check();", "the_var"); + Block *b3 = new Block("print(3); state = check();", "the_var"); + Block *b4 = new Block("print(4); state = check();", "the_var"); b0->AddBranchTo(b2, "state == 2"); b0->AddBranchTo(b4, NULL); b1->AddBranchTo(b1, NULL); diff --git a/src/relooper/test_fuzz4.txt b/src/relooper/test_fuzz4.txt index 766ebdb6..2e2f2c6f 100644 --- a/src/relooper/test_fuzz4.txt +++ b/src/relooper/test_fuzz4.txt @@ -1,19 +1,41 @@ print('entry'); var label; var state; var decisions = [2, 2, 1, 3, 2, 2, 1, 3, 2, 3, 3, 1, 3, 2, 1]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] } -if (state == 2) { +switch (the_var) { +state == 2 { while(1) { print(2); state = check(); + switch (the_var) { + default: { + } + } } + break; } -while(1) { +default: { +} +} +L4: while(1) { print(4); state = check(); - if (!(state == 4)) { + switch (the_var) { + state == 4 { break; } + default: { + break L4; + } + } } print(3); state = check(); +switch (the_var) { +default: { +} +} while(1) { print(1); state = check(); + switch (the_var) { + default: { + } + } } diff --git a/src/relooper/test_fuzz5.cpp b/src/relooper/test_fuzz5.cpp index f48c31ee..a58e19ba 100644 --- a/src/relooper/test_fuzz5.cpp +++ b/src/relooper/test_fuzz5.cpp @@ -8,16 +8,16 @@ int main() { char *buffer = (char*)malloc(SIZE); Relooper::SetOutputBuffer(buffer, SIZE); - Block *b0 = new Block("print('entry'); var label; var state; var decisions = [133, 98, 134, 143, 162, 187, 130, 87, 91, 49, 102, 47, 9, 132, 179, 176, 157, 25, 64, 161, 57, 107, 16, 167, 185, 45, 191, 180, 23, 131]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }"); - Block *b1 = new Block("print(1); state = check();"); - Block *b2 = new Block("print(2); state = check();"); - Block *b3 = new Block("print(3); state = check();"); - Block *b4 = new Block("print(4); state = check();"); - Block *b5 = new Block("print(5); state = check();"); - Block *b6 = new Block("print(6); state = check();"); - Block *b7 = new Block("print(7); state = check();"); - Block *b8 = new Block("print(8); state = check();"); - Block *b9 = new Block("print(9); state = check();"); + Block *b0 = new Block("print('entry'); var label; var state; var decisions = [133, 98, 134, 143, 162, 187, 130, 87, 91, 49, 102, 47, 9, 132, 179, 176, 157, 25, 64, 161, 57, 107, 16, 167, 185, 45, 191, 180, 23, 131]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var"); + Block *b1 = new Block("print(1); state = check();", "the_var"); + Block *b2 = new Block("print(2); state = check();", "the_var"); + Block *b3 = new Block("print(3); state = check();", "the_var"); + Block *b4 = new Block("print(4); state = check();", "the_var"); + Block *b5 = new Block("print(5); state = check();", "the_var"); + Block *b6 = new Block("print(6); state = check();", "the_var"); + Block *b7 = new Block("print(7); state = check();", "the_var"); + Block *b8 = new Block("print(8); state = check();", "the_var"); + Block *b9 = new Block("print(9); state = check();", "the_var"); b0->AddBranchTo(b7, NULL); b1->AddBranchTo(b4, "state % 2 == 0"); b1->AddBranchTo(b6, NULL); diff --git a/src/relooper/test_fuzz5.txt b/src/relooper/test_fuzz5.txt index 0f76d1ed..f87e5b79 100644 --- a/src/relooper/test_fuzz5.txt +++ b/src/relooper/test_fuzz5.txt @@ -1,52 +1,86 @@ print('entry'); var label; var state; var decisions = [133, 98, 134, 143, 162, 187, 130, 87, 91, 49, 102, 47, 9, 132, 179, 176, 157, 25, 64, 161, 57, 107, 16, 167, 185, 45, 191, 180, 23, 131]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] } +switch (the_var) { +default: { +} +} L1: while(1) { print(7); state = check(); - if (state % 3 == 1) { + switch (the_var) { + state % 3 == 1 { label = 3; - } else if (state % 3 == 0) { + break; + } + state % 3 == 0 { print(8); state = check(); - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { label = 5; - } else { + break; + } + default: { label = 7; } - } else { + } break; } - while(1) { + default: { + break L1; + } + } + L5: while(1) { if (label == 3) { label = 0; print(2); state = check(); + switch (the_var) { + default: { + } + } print(1); state = check(); - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { label = 5; - continue; - } else { + continue L5; + break; + } + default: { label = 7; - continue; + continue L5; + } } } else if (label == 5) { label = 0; print(4); state = check(); - label = 3; - continue; + switch (the_var) { + default: { + label = 3; + continue L5; + } + } } else if (label == 7) { label = 0; print(6); state = check(); - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { continue L1; - } else { + break; + } + default: { label = 7; - continue; + continue L5; + } } } } } while(1) { print(3); state = check(); + switch (the_var) { + default: { + } + } } diff --git a/src/relooper/test_fuzz6.cpp b/src/relooper/test_fuzz6.cpp index 76a016d6..bea834ae 100644 --- a/src/relooper/test_fuzz6.cpp +++ b/src/relooper/test_fuzz6.cpp @@ -8,98 +8,98 @@ int main() { char *buffer = (char*)malloc(SIZE); Relooper::SetOutputBuffer(buffer, SIZE); - Block *b0 = new Block("print('entry'); var label; var state; var decisions = [759, 1223, 618, 1805, 277, 512, 204, 1545, 606, 734, 585, 447, 1670, 1031, 665, 1728, 353, 634, 1033, 13, 658, 589, 474, 854, 405, 1111, 1640, 697, 1156, 1357, 317, 618, 990, 1401, 405, 564, 497, 829, 653, 1194, 25, 322, 1178, 198, 1565, 1419, 1608, 486, 368, 606, 813, 22, 148, 141, 261, 375, 472, 964, 1106, 694, 205, 771, 44, 675, 545, 1027, 1528, 240, 1289, 564, 792, 744, 366, 668, 823, 210, 428, 1009, 1662, 1317, 1183, 681, 14, 1334, 712, 506, 224, 695, 401, 1035, 384, 486, 1519, 122, 1186, 1487, 1819, 1702, 463, 1706, 660, 1642, 847, 991, 976, 940, 867, 46, 23, 1449, 56, 1711, 634, 404, 1558, 168, 710, 1581, 1302, 870, 997, 1295, 1739, 769, 1005, 291, 1638, 1771, 842, 659, 1695, 713, 935, 802, 1173, 1572, 850, 607, 996, 55, 1576, 321, 1815, 662, 1044, 1612, 1680, 1050, 844, 553, 278, 1447, 1662, 1094, 1797, 774, 1013, 1204, 907, 340, 1172, 1460, 869, 1264, 111, 1176, 484, 845, 258, 417, 1246, 1017, 745, 189, 333, 1658, 1395, 1764, 1786, 165, 404, 847, 1429, 1574, 403, 718, 1118, 1756, 94, 56, 1498, 1696, 1355, 840, 50, 82, 371, 1087, 875, 1337, 267, 958, 1209, 1167, 1025, 1684, 184, 962, 1496, 201, 127, 372, 1, 1005, 402, 1387, 213, 1143, 1271, 167, 10, 12, 1060, 1390, 1366, 893, 747, 1005, 481, 876, 227, 514, 589, 250, 273, 1188, 1052, 719, 219, 1006, 38, 120, 1454, 489, 672, 149, 534, 1081, 1721, 586, 330, 25, 356, 1743, 1607, 336, 981, 419, 1036, 1293, 1026, 1300, 1453, 792, 22, 45, 420, 409, 1027, 1437, 1421, 795, 136, 1276, 1610, 1593]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }"); - Block *b1 = new Block("print(1); state = check();// ..........................................................................."); - Block *b2 = new Block("print(2); state = check();// ........."); - Block *b3 = new Block("print(3); state = check();// .................................."); - Block *b4 = new Block("print(4); state = check();// ..........................................................................................................................."); - Block *b5 = new Block("print(5); state = check();// .........................................................................................................................................."); - Block *b6 = new Block("print(6); state = check();// ........."); - Block *b7 = new Block("print(7); state = check();// ............................................................................................................................................................................................."); - Block *b8 = new Block("print(8); state = check();// ...................................................................................................................................................................................................................................................."); - Block *b9 = new Block("print(9); state = check();// ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."); - Block *b10 = new Block("print(10); state = check();// ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."); - Block *b11 = new Block("print(11); state = check();// ........................................................"); - Block *b12 = new Block("print(12); state = check();// ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"); - Block *b13 = new Block("print(13); state = check();// ..................."); - Block *b14 = new Block("print(14); state = check();// ............................."); - Block *b15 = new Block("print(15); state = check();// .................................................."); - Block *b16 = new Block("print(16); state = check();// ................................................................................................................................................................................................................................................................................................................................................................"); - Block *b17 = new Block("print(17); state = check();// ................................................................"); - Block *b18 = new Block("print(18); state = check();// .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."); - Block *b19 = new Block("print(19); state = check();// ......................................................................................................................................................................................................................"); - Block *b20 = new Block("print(20); state = check();// .................................................................................................................................................................."); - Block *b21 = new Block("print(21); state = check();// ..........................."); - Block *b22 = new Block("print(22); state = check();// ........................................................................................................."); - Block *b23 = new Block("print(23); state = check();// ................................................................................................................................................................................................................."); - Block *b24 = new Block("print(24); state = check();// ..........................."); - Block *b25 = new Block("print(25); state = check();// ......................................................................................................................................................"); - Block *b26 = new Block("print(26); state = check();// ........................................................................................................................................................................................................................................................................."); - Block *b27 = new Block("print(27); state = check();// ............................................................................................................................................................................."); - Block *b28 = new Block("print(28); state = check();// .............................................................................................................."); - Block *b29 = new Block("print(29); state = check();// ..............."); - Block *b30 = new Block("print(30); state = check();// ................................................................................................................................................................................................................."); - Block *b31 = new Block("print(31); state = check();// .........................................................................................................................................................................................................."); - Block *b32 = new Block("print(32); state = check();// ......................................................................................................"); - Block *b33 = new Block("print(33); state = check();// ...."); - Block *b34 = new Block("print(34); state = check();// .........................................................................................................................................."); - Block *b35 = new Block("print(35); state = check();// ................................."); - Block *b36 = new Block("print(36); state = check();// ........................."); - Block *b37 = new Block("print(37); state = check();// ................................................................................................................................"); - Block *b38 = new Block("print(38); state = check();// ............................................................................................................................................................................................................................................................................................................................................"); - Block *b39 = new Block("print(39); state = check();// ................"); - Block *b40 = new Block("print(40); state = check();// ................................................................................................................................................"); - Block *b41 = new Block("print(41); state = check();// ..................................................................................................................................."); - Block *b42 = new Block("print(42); state = check();// ....................................................."); - Block *b43 = new Block("print(43); state = check();// ........."); - Block *b44 = new Block("print(44); state = check();// ....................................................................................................................................................."); - Block *b45 = new Block("print(45); state = check();// ............................"); - Block *b46 = new Block("print(46); state = check();// ............................................................................."); - Block *b47 = new Block("print(47); state = check();// ...................................................................................................................................."); - Block *b48 = new Block("print(48); state = check();// ............"); - Block *b49 = new Block("print(49); state = check();// ............................................................................................................................................................................................................................................................................................"); - Block *b50 = new Block("print(50); state = check();// ........................................"); - Block *b51 = new Block("print(51); state = check();// ............................................................................................."); - Block *b52 = new Block("print(52); state = check();// .............................................................................."); - Block *b53 = new Block("print(53); state = check();// .............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."); - Block *b54 = new Block("print(54); state = check();// ....................................."); - Block *b55 = new Block("print(55); state = check();// ..........................................................................................................................................................................................................."); - Block *b56 = new Block("print(56); state = check();// ...................................................................................................................................................................................................................."); - Block *b57 = new Block("print(57); state = check();// ..........................................................................................................................................................................................................................................................................................................................."); - Block *b58 = new Block("print(58); state = check();// ......................................................................................"); - Block *b59 = new Block("print(59); state = check();// ..................................."); - Block *b60 = new Block("print(60); state = check();// ......................................................................................................................................................................................................................................"); - Block *b61 = new Block("print(61); state = check();// ........................................................................................................................................................."); - Block *b62 = new Block("print(62); state = check();// ......................................................................................."); - Block *b63 = new Block("print(63); state = check();// ....................................................................................................................................................................."); - Block *b64 = new Block("print(64); state = check();// ......................................................................................................................................................................................................................................................................."); - Block *b65 = new Block("print(65); state = check();// ........................................................."); - Block *b66 = new Block("print(66); state = check();// ..............................................................................................................."); - Block *b67 = new Block("print(67); state = check();// ....................................................................................................................................................................................................................."); - Block *b68 = new Block("print(68); state = check();// ......................................................................................................................................................................................................................................................................................................................"); - Block *b69 = new Block("print(69); state = check();// ......................................................................................................................................................"); - Block *b70 = new Block("print(70); state = check();// .........................................................................................................................."); - Block *b71 = new Block("print(71); state = check();// ..........................................................................................................................................................................................................."); - Block *b72 = new Block("print(72); state = check();// .........................................................................................................."); - Block *b73 = new Block("print(73); state = check();// ."); - Block *b74 = new Block("print(74); state = check();// .............................................."); - Block *b75 = new Block("print(75); state = check();// ............................................."); - Block *b76 = new Block("print(76); state = check();// .............................................................................................................................................................................................................................................................................................................................................................................................................................."); - Block *b77 = new Block("print(77); state = check();// ..........................................................................................................................................................................................................................................................................................."); - Block *b78 = new Block("print(78); state = check();// .........................................................................................."); - Block *b79 = new Block("print(79); state = check();// ..................................................................................................................................................................................................................................................."); - Block *b80 = new Block("print(80); state = check();// ...................................."); - Block *b81 = new Block("print(81); state = check();// ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"); - Block *b82 = new Block("print(82); state = check();// ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."); - Block *b83 = new Block("print(83); state = check();// ........................................................................................"); - Block *b84 = new Block("print(84); state = check();// ..................."); - Block *b85 = new Block("print(85); state = check();// ........................................................................................................................................................................................................................................................................................................................................................."); - Block *b86 = new Block("print(86); state = check();// ................................................................................................................................................................................................................................................."); - Block *b87 = new Block("print(87); state = check();// ......"); - Block *b88 = new Block("print(88); state = check();// ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."); - Block *b89 = new Block("print(89); state = check();// ......................................................................................................................................................................................................................................................................................................................................................"); - Block *b90 = new Block("print(90); state = check();// ..........................................................................................................................................................................................................................."); - Block *b91 = new Block("print(91); state = check();// .............................................."); + Block *b0 = new Block("print('entry'); var label; var state; var decisions = [759, 1223, 618, 1805, 277, 512, 204, 1545, 606, 734, 585, 447, 1670, 1031, 665, 1728, 353, 634, 1033, 13, 658, 589, 474, 854, 405, 1111, 1640, 697, 1156, 1357, 317, 618, 990, 1401, 405, 564, 497, 829, 653, 1194, 25, 322, 1178, 198, 1565, 1419, 1608, 486, 368, 606, 813, 22, 148, 141, 261, 375, 472, 964, 1106, 694, 205, 771, 44, 675, 545, 1027, 1528, 240, 1289, 564, 792, 744, 366, 668, 823, 210, 428, 1009, 1662, 1317, 1183, 681, 14, 1334, 712, 506, 224, 695, 401, 1035, 384, 486, 1519, 122, 1186, 1487, 1819, 1702, 463, 1706, 660, 1642, 847, 991, 976, 940, 867, 46, 23, 1449, 56, 1711, 634, 404, 1558, 168, 710, 1581, 1302, 870, 997, 1295, 1739, 769, 1005, 291, 1638, 1771, 842, 659, 1695, 713, 935, 802, 1173, 1572, 850, 607, 996, 55, 1576, 321, 1815, 662, 1044, 1612, 1680, 1050, 844, 553, 278, 1447, 1662, 1094, 1797, 774, 1013, 1204, 907, 340, 1172, 1460, 869, 1264, 111, 1176, 484, 845, 258, 417, 1246, 1017, 745, 189, 333, 1658, 1395, 1764, 1786, 165, 404, 847, 1429, 1574, 403, 718, 1118, 1756, 94, 56, 1498, 1696, 1355, 840, 50, 82, 371, 1087, 875, 1337, 267, 958, 1209, 1167, 1025, 1684, 184, 962, 1496, 201, 127, 372, 1, 1005, 402, 1387, 213, 1143, 1271, 167, 10, 12, 1060, 1390, 1366, 893, 747, 1005, 481, 876, 227, 514, 589, 250, 273, 1188, 1052, 719, 219, 1006, 38, 120, 1454, 489, 672, 149, 534, 1081, 1721, 586, 330, 25, 356, 1743, 1607, 336, 981, 419, 1036, 1293, 1026, 1300, 1453, 792, 22, 45, 420, 409, 1027, 1437, 1421, 795, 136, 1276, 1610, 1593]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] }", "the_var"); + Block *b1 = new Block("print(1); state = check();// ...........................................................................", "the_var"); + Block *b2 = new Block("print(2); state = check();// .........", "the_var"); + Block *b3 = new Block("print(3); state = check();// ..................................", "the_var"); + Block *b4 = new Block("print(4); state = check();// ...........................................................................................................................", "the_var"); + Block *b5 = new Block("print(5); state = check();// ..........................................................................................................................................", "the_var"); + Block *b6 = new Block("print(6); state = check();// .........", "the_var"); + Block *b7 = new Block("print(7); state = check();// .............................................................................................................................................................................................", "the_var"); + Block *b8 = new Block("print(8); state = check();// ....................................................................................................................................................................................................................................................", "the_var"); + Block *b9 = new Block("print(9); state = check();// ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b10 = new Block("print(10); state = check();// ...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b11 = new Block("print(11); state = check();// ........................................................", "the_var"); + Block *b12 = new Block("print(12); state = check();// ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b13 = new Block("print(13); state = check();// ...................", "the_var"); + Block *b14 = new Block("print(14); state = check();// .............................", "the_var"); + Block *b15 = new Block("print(15); state = check();// ..................................................", "the_var"); + Block *b16 = new Block("print(16); state = check();// ................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b17 = new Block("print(17); state = check();// ................................................................", "the_var"); + Block *b18 = new Block("print(18); state = check();// ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b19 = new Block("print(19); state = check();// ......................................................................................................................................................................................................................", "the_var"); + Block *b20 = new Block("print(20); state = check();// ..................................................................................................................................................................", "the_var"); + Block *b21 = new Block("print(21); state = check();// ...........................", "the_var"); + Block *b22 = new Block("print(22); state = check();// .........................................................................................................", "the_var"); + Block *b23 = new Block("print(23); state = check();// .................................................................................................................................................................................................................", "the_var"); + Block *b24 = new Block("print(24); state = check();// ...........................", "the_var"); + Block *b25 = new Block("print(25); state = check();// ......................................................................................................................................................", "the_var"); + Block *b26 = new Block("print(26); state = check();// .........................................................................................................................................................................................................................................................................", "the_var"); + Block *b27 = new Block("print(27); state = check();// .............................................................................................................................................................................", "the_var"); + Block *b28 = new Block("print(28); state = check();// ..............................................................................................................", "the_var"); + Block *b29 = new Block("print(29); state = check();// ...............", "the_var"); + Block *b30 = new Block("print(30); state = check();// .................................................................................................................................................................................................................", "the_var"); + Block *b31 = new Block("print(31); state = check();// ..........................................................................................................................................................................................................", "the_var"); + Block *b32 = new Block("print(32); state = check();// ......................................................................................................", "the_var"); + Block *b33 = new Block("print(33); state = check();// ....", "the_var"); + Block *b34 = new Block("print(34); state = check();// ..........................................................................................................................................", "the_var"); + Block *b35 = new Block("print(35); state = check();// .................................", "the_var"); + Block *b36 = new Block("print(36); state = check();// .........................", "the_var"); + Block *b37 = new Block("print(37); state = check();// ................................................................................................................................", "the_var"); + Block *b38 = new Block("print(38); state = check();// ............................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b39 = new Block("print(39); state = check();// ................", "the_var"); + Block *b40 = new Block("print(40); state = check();// ................................................................................................................................................", "the_var"); + Block *b41 = new Block("print(41); state = check();// ...................................................................................................................................", "the_var"); + Block *b42 = new Block("print(42); state = check();// .....................................................", "the_var"); + Block *b43 = new Block("print(43); state = check();// .........", "the_var"); + Block *b44 = new Block("print(44); state = check();// .....................................................................................................................................................", "the_var"); + Block *b45 = new Block("print(45); state = check();// ............................", "the_var"); + Block *b46 = new Block("print(46); state = check();// .............................................................................", "the_var"); + Block *b47 = new Block("print(47); state = check();// ....................................................................................................................................", "the_var"); + Block *b48 = new Block("print(48); state = check();// ............", "the_var"); + Block *b49 = new Block("print(49); state = check();// ............................................................................................................................................................................................................................................................................................", "the_var"); + Block *b50 = new Block("print(50); state = check();// ........................................", "the_var"); + Block *b51 = new Block("print(51); state = check();// .............................................................................................", "the_var"); + Block *b52 = new Block("print(52); state = check();// ..............................................................................", "the_var"); + Block *b53 = new Block("print(53); state = check();// ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b54 = new Block("print(54); state = check();// .....................................", "the_var"); + Block *b55 = new Block("print(55); state = check();// ...........................................................................................................................................................................................................", "the_var"); + Block *b56 = new Block("print(56); state = check();// ....................................................................................................................................................................................................................", "the_var"); + Block *b57 = new Block("print(57); state = check();// ...........................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b58 = new Block("print(58); state = check();// ......................................................................................", "the_var"); + Block *b59 = new Block("print(59); state = check();// ...................................", "the_var"); + Block *b60 = new Block("print(60); state = check();// ......................................................................................................................................................................................................................................", "the_var"); + Block *b61 = new Block("print(61); state = check();// .........................................................................................................................................................", "the_var"); + Block *b62 = new Block("print(62); state = check();// .......................................................................................", "the_var"); + Block *b63 = new Block("print(63); state = check();// .....................................................................................................................................................................", "the_var"); + Block *b64 = new Block("print(64); state = check();// .......................................................................................................................................................................................................................................................................", "the_var"); + Block *b65 = new Block("print(65); state = check();// .........................................................", "the_var"); + Block *b66 = new Block("print(66); state = check();// ...............................................................................................................", "the_var"); + Block *b67 = new Block("print(67); state = check();// .....................................................................................................................................................................................................................", "the_var"); + Block *b68 = new Block("print(68); state = check();// ......................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b69 = new Block("print(69); state = check();// ......................................................................................................................................................", "the_var"); + Block *b70 = new Block("print(70); state = check();// ..........................................................................................................................", "the_var"); + Block *b71 = new Block("print(71); state = check();// ...........................................................................................................................................................................................................", "the_var"); + Block *b72 = new Block("print(72); state = check();// ..........................................................................................................", "the_var"); + Block *b73 = new Block("print(73); state = check();// .", "the_var"); + Block *b74 = new Block("print(74); state = check();// ..............................................", "the_var"); + Block *b75 = new Block("print(75); state = check();// .............................................", "the_var"); + Block *b76 = new Block("print(76); state = check();// ..............................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b77 = new Block("print(77); state = check();// ...........................................................................................................................................................................................................................................................................................", "the_var"); + Block *b78 = new Block("print(78); state = check();// ..........................................................................................", "the_var"); + Block *b79 = new Block("print(79); state = check();// ...................................................................................................................................................................................................................................................", "the_var"); + Block *b80 = new Block("print(80); state = check();// ....................................", "the_var"); + Block *b81 = new Block("print(81); state = check();// ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b82 = new Block("print(82); state = check();// ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b83 = new Block("print(83); state = check();// ........................................................................................", "the_var"); + Block *b84 = new Block("print(84); state = check();// ...................", "the_var"); + Block *b85 = new Block("print(85); state = check();// .........................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b86 = new Block("print(86); state = check();// .................................................................................................................................................................................................................................................", "the_var"); + Block *b87 = new Block("print(87); state = check();// ......", "the_var"); + Block *b88 = new Block("print(88); state = check();// ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b89 = new Block("print(89); state = check();// ......................................................................................................................................................................................................................................................................................................................................................", "the_var"); + Block *b90 = new Block("print(90); state = check();// ...........................................................................................................................................................................................................................", "the_var"); + Block *b91 = new Block("print(91); state = check();// ..............................................", "the_var"); b0->AddBranchTo(b30, NULL); b1->AddBranchTo(b66, NULL); b2->AddBranchTo(b51, NULL); diff --git a/src/relooper/test_fuzz6.txt b/src/relooper/test_fuzz6.txt index cd93958c..b9c1499a 100644 --- a/src/relooper/test_fuzz6.txt +++ b/src/relooper/test_fuzz6.txt @@ -1,108 +1,291 @@ print('entry'); var label; var state; var decisions = [759, 1223, 618, 1805, 277, 512, 204, 1545, 606, 734, 585, 447, 1670, 1031, 665, 1728, 353, 634, 1033, 13, 658, 589, 474, 854, 405, 1111, 1640, 697, 1156, 1357, 317, 618, 990, 1401, 405, 564, 497, 829, 653, 1194, 25, 322, 1178, 198, 1565, 1419, 1608, 486, 368, 606, 813, 22, 148, 141, 261, 375, 472, 964, 1106, 694, 205, 771, 44, 675, 545, 1027, 1528, 240, 1289, 564, 792, 744, 366, 668, 823, 210, 428, 1009, 1662, 1317, 1183, 681, 14, 1334, 712, 506, 224, 695, 401, 1035, 384, 486, 1519, 122, 1186, 1487, 1819, 1702, 463, 1706, 660, 1642, 847, 991, 976, 940, 867, 46, 23, 1449, 56, 1711, 634, 404, 1558, 168, 710, 1581, 1302, 870, 997, 1295, 1739, 769, 1005, 291, 1638, 1771, 842, 659, 1695, 713, 935, 802, 1173, 1572, 850, 607, 996, 55, 1576, 321, 1815, 662, 1044, 1612, 1680, 1050, 844, 553, 278, 1447, 1662, 1094, 1797, 774, 1013, 1204, 907, 340, 1172, 1460, 869, 1264, 111, 1176, 484, 845, 258, 417, 1246, 1017, 745, 189, 333, 1658, 1395, 1764, 1786, 165, 404, 847, 1429, 1574, 403, 718, 1118, 1756, 94, 56, 1498, 1696, 1355, 840, 50, 82, 371, 1087, 875, 1337, 267, 958, 1209, 1167, 1025, 1684, 184, 962, 1496, 201, 127, 372, 1, 1005, 402, 1387, 213, 1143, 1271, 167, 10, 12, 1060, 1390, 1366, 893, 747, 1005, 481, 876, 227, 514, 589, 250, 273, 1188, 1052, 719, 219, 1006, 38, 120, 1454, 489, 672, 149, 534, 1081, 1721, 586, 330, 25, 356, 1743, 1607, 336, 981, 419, 1036, 1293, 1026, 1300, 1453, 792, 22, 45, 420, 409, 1027, 1437, 1421, 795, 136, 1276, 1610, 1593]; var index = 0; function check() { if (index == decisions.length) throw 'HALT'; return decisions[index++] } -while(1) { +switch (the_var) { +default: { +} +} +L1: while(1) { print(30); state = check();// ................................................................................................................................................................................................................. - if (state % 3 == 1) { - label = 67; + switch (the_var) { + state % 3 == 0 { break; - } else if (!(state % 3 == 0)) { + } + state % 3 == 1 { + label = 67; + break L1; break; } + default: { + break L1; + } + } print(58); state = check();// ...................................................................................... + switch (the_var) { + default: { + } + } } if (label == 67) { print(66); state = check();// ............................................................................................................... + switch (the_var) { + default: { + } + } } print(6); state = check();// ......... +switch (the_var) { +default: { +} +} while(1) { print(88); state = check();// .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(70); state = check();// .......................................................................................................................... + switch (the_var) { + default: { + } + } L10: while(1) { print(47); state = check();// .................................................................................................................................... + switch (the_var) { + default: { + } + } print(28); state = check();// .............................................................................................................. - while(1) { + switch (the_var) { + default: { + } + } + L13: while(1) { print(75); state = check();// ............................................. + switch (the_var) { + default: { + } + } print(7); state = check();// ............................................................................................................................................................................................. - if (!(state % 2 == 0)) { + switch (the_var) { + state % 2 == 0 { break; } + default: { + break L13; + } + } } print(89); state = check();// ...................................................................................................................................................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(68); state = check();// ...................................................................................................................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } L18: while(1) { print(51); state = check();// ............................................................................................. + switch (the_var) { + default: { + } + } L20: while(1) { print(36); state = check();// ......................... - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { + break L20; break; } + default: { + } + } print(16); state = check();// ................................................................................................................................................................................................................................................................................................................................................................ + switch (the_var) { + default: { + } + } print(57); state = check();// ........................................................................................................................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(39); state = check();// ................ - if (state % 3 == 1) { + switch (the_var) { + state % 3 == 0 { + break; + } + state % 3 == 1 { label = 74; - } else if (!(state % 3 == 0)) { - label = 32; break; } - while(1) { + default: { + label = 32; + break L20; + } + } + L25: while(1) { if (label == 74) { label = 0; print(73); state = check();// . - if (state % 3 == 1) { + switch (the_var) { + state % 3 == 1 { label = 32; break L20; - } else if (state % 3 == 0) { break; } + state % 3 == 0 { + break L25; + break; + } + default: { + } + } print(43); state = check();// ......... + switch (the_var) { + default: { + } + } print(32); state = check();// ...................................................................................................... + switch (the_var) { + default: { + } + } print(83); state = check();// ........................................................................................ + switch (the_var) { + default: { + } + } print(77); state = check();// ........................................................................................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(76); state = check();// .............................................................................................................................................................................................................................................................................................................................................................................................................................. + switch (the_var) { + default: { + } + } print(22); state = check();// ......................................................................................................... + switch (the_var) { + default: { + } + } } print(72); state = check();// .......................................................................................................... - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { label = 92; break L20; + break; + } + default: { + } } print(80); state = check();// .................................... - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { continue L18; + break; + } + default: { + } } print(50); state = check();// ........................................ + switch (the_var) { + default: { + } + } print(29); state = check();// ............... + switch (the_var) { + default: { + } + } print(8); state = check();// .................................................................................................................................................................................................................................................... - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { continue L10; + break; + } + default: { + } } print(19); state = check();// ...................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(56); state = check();// .................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(34); state = check();// .......................................................................................................................................... - label = 74; + switch (the_var) { + default: { + label = 74; + } + } } print(62); state = check();// ....................................................................................... + switch (the_var) { + default: { + } + } } if (label == 32) { label = 0; print(31); state = check();// .......................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } } else if (label == 92) { label = 0; print(91); state = check();// .............................................. + switch (the_var) { + default: { + } + } print(33); state = check();// .... + switch (the_var) { + default: { + } + } } print(60); state = check();// ...................................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(10); state = check();// ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... + switch (the_var) { + default: { + } + } print(52); state = check();// .............................................................................. - if (state % 2 == 0) { + switch (the_var) { + state % 2 == 0 { break L10; + break; + } + default: { + } } print(2); state = check();// ......... + switch (the_var) { + default: { + } + } } } print(61); state = check();// ......................................................................................................................................................... + switch (the_var) { + default: { + } + } } diff --git a/src/relooper/test_inf.cpp b/src/relooper/test_inf.cpp index 66e712ed..1363bf4b 100644 --- a/src/relooper/test_inf.cpp +++ b/src/relooper/test_inf.cpp @@ -4,556 +4,556 @@ int main() { void *rl = rl_new_relooper(); char buffer[100000]; rl_set_output_buffer(buffer, sizeof(buffer)); - void *b0 = rl_new_block("code 0"); + void *b0 = rl_new_block("code 0", "the_var"); block_map[0] = b0; rl_relooper_add_block(rl, block_map[0]); - void *b1 = rl_new_block("code 1"); + void *b1 = rl_new_block("code 1", "the_var"); block_map[1] = b1; rl_relooper_add_block(rl, block_map[1]); - void *b2 = rl_new_block("code 2"); + void *b2 = rl_new_block("code 2", "the_var"); block_map[2] = b2; rl_relooper_add_block(rl, block_map[2]); - void *b3 = rl_new_block("code 3"); + void *b3 = rl_new_block("code 3", "the_var"); block_map[3] = b3; rl_relooper_add_block(rl, block_map[3]); - void *b4 = rl_new_block("code 4"); + void *b4 = rl_new_block("code 4", "the_var"); block_map[4] = b4; rl_relooper_add_block(rl, block_map[4]); - void *b5 = rl_new_block("code 5"); + void *b5 = rl_new_block("code 5", "the_var"); block_map[5] = b5; rl_relooper_add_block(rl, block_map[5]); - void *b6 = rl_new_block("code 6"); + void *b6 = rl_new_block("code 6", "the_var"); block_map[6] = b6; rl_relooper_add_block(rl, block_map[6]); - void *b7 = rl_new_block("code 7"); + void *b7 = rl_new_block("code 7", "the_var"); block_map[7] = b7; rl_relooper_add_block(rl, block_map[7]); - void *b8 = rl_new_block("code 8"); + void *b8 = rl_new_block("code 8", "the_var"); block_map[8] = b8; rl_relooper_add_block(rl, block_map[8]); - void *b9 = rl_new_block("code 9"); + void *b9 = rl_new_block("code 9", "the_var"); block_map[9] = b9; rl_relooper_add_block(rl, block_map[9]); - void *b10 = rl_new_block("code 10"); + void *b10 = rl_new_block("code 10", "the_var"); block_map[10] = b10; rl_relooper_add_block(rl, block_map[10]); - void *b11 = rl_new_block("code 11"); + void *b11 = rl_new_block("code 11", "the_var"); block_map[11] = b11; rl_relooper_add_block(rl, block_map[11]); - void *b12 = rl_new_block("code 12"); + void *b12 = rl_new_block("code 12", "the_var"); block_map[12] = b12; rl_relooper_add_block(rl, block_map[12]); - void *b13 = rl_new_block("code 13"); + void *b13 = rl_new_block("code 13", "the_var"); block_map[13] = b13; rl_relooper_add_block(rl, block_map[13]); - void *b14 = rl_new_block("code 14"); + void *b14 = rl_new_block("code 14", "the_var"); block_map[14] = b14; rl_relooper_add_block(rl, block_map[14]); - void *b15 = rl_new_block("code 15"); + void *b15 = rl_new_block("code 15", "the_var"); block_map[15] = b15; rl_relooper_add_block(rl, block_map[15]); - void *b16 = rl_new_block("code 16"); + void *b16 = rl_new_block("code 16", "the_var"); block_map[16] = b16; rl_relooper_add_block(rl, block_map[16]); - void *b17 = rl_new_block("code 17"); + void *b17 = rl_new_block("code 17", "the_var"); block_map[17] = b17; rl_relooper_add_block(rl, block_map[17]); - void *b18 = rl_new_block("code 18"); + void *b18 = rl_new_block("code 18", "the_var"); block_map[18] = b18; rl_relooper_add_block(rl, block_map[18]); - void *b19 = rl_new_block("code 19"); + void *b19 = rl_new_block("code 19", "the_var"); block_map[19] = b19; rl_relooper_add_block(rl, block_map[19]); - void *b20 = rl_new_block("code 20"); + void *b20 = rl_new_block("code 20", "the_var"); block_map[20] = b20; rl_relooper_add_block(rl, block_map[20]); - void *b21 = rl_new_block("code 21"); + void *b21 = rl_new_block("code 21", "the_var"); block_map[21] = b21; rl_relooper_add_block(rl, block_map[21]); - void *b22 = rl_new_block("code 22"); + void *b22 = rl_new_block("code 22", "the_var"); block_map[22] = b22; rl_relooper_add_block(rl, block_map[22]); - void *b23 = rl_new_block("code 23"); + void *b23 = rl_new_block("code 23", "the_var"); block_map[23] = b23; rl_relooper_add_block(rl, block_map[23]); - void *b24 = rl_new_block("code 24"); + void *b24 = rl_new_block("code 24", "the_var"); block_map[24] = b24; rl_relooper_add_block(rl, block_map[24]); - void *b25 = rl_new_block("code 25"); + void *b25 = rl_new_block("code 25", "the_var"); block_map[25] = b25; rl_relooper_add_block(rl, block_map[25]); - void *b26 = rl_new_block("code 26"); + void *b26 = rl_new_block("code 26", "the_var"); block_map[26] = b26; rl_relooper_add_block(rl, block_map[26]); - void *b27 = rl_new_block("code 27"); + void *b27 = rl_new_block("code 27", "the_var"); block_map[27] = b27; rl_relooper_add_block(rl, block_map[27]); - void *b28 = rl_new_block("code 28"); + void *b28 = rl_new_block("code 28", "the_var"); block_map[28] = b28; rl_relooper_add_block(rl, block_map[28]); - void *b29 = rl_new_block("code 29"); + void *b29 = rl_new_block("code 29", "the_var"); block_map[29] = b29; rl_relooper_add_block(rl, block_map[29]); - void *b30 = rl_new_block("code 30"); + void *b30 = rl_new_block("code 30", "the_var"); block_map[30] = b30; rl_relooper_add_block(rl, block_map[30]); - void *b31 = rl_new_block("code 31"); + void *b31 = rl_new_block("code 31", "the_var"); block_map[31] = b31; rl_relooper_add_block(rl, block_map[31]); - void *b32 = rl_new_block("code 32"); + void *b32 = rl_new_block("code 32", "the_var"); block_map[32] = b32; rl_relooper_add_block(rl, block_map[32]); - void *b33 = rl_new_block("code 33"); + void *b33 = rl_new_block("code 33", "the_var"); block_map[33] = b33; rl_relooper_add_block(rl, block_map[33]); - void *b34 = rl_new_block("code 34"); + void *b34 = rl_new_block("code 34", "the_var"); block_map[34] = b34; rl_relooper_add_block(rl, block_map[34]); - void *b35 = rl_new_block("code 35"); + void *b35 = rl_new_block("code 35", "the_var"); block_map[35] = b35; rl_relooper_add_block(rl, block_map[35]); - void *b36 = rl_new_block("code 36"); + void *b36 = rl_new_block("code 36", "the_var"); block_map[36] = b36; rl_relooper_add_block(rl, block_map[36]); - void *b37 = rl_new_block("code 37"); + void *b37 = rl_new_block("code 37", "the_var"); block_map[37] = b37; rl_relooper_add_block(rl, block_map[37]); - void *b38 = rl_new_block("code 38"); + void *b38 = rl_new_block("code 38", "the_var"); block_map[38] = b38; rl_relooper_add_block(rl, block_map[38]); - void *b39 = rl_new_block("code 39"); + void *b39 = rl_new_block("code 39", "the_var"); block_map[39] = b39; rl_relooper_add_block(rl, block_map[39]); - void *b40 = rl_new_block("code 40"); + void *b40 = rl_new_block("code 40", "the_var"); block_map[40] = b40; rl_relooper_add_block(rl, block_map[40]); - void *b41 = rl_new_block("code 41"); + void *b41 = rl_new_block("code 41", "the_var"); block_map[41] = b41; rl_relooper_add_block(rl, block_map[41]); - void *b42 = rl_new_block("code 42"); + void *b42 = rl_new_block("code 42", "the_var"); block_map[42] = b42; rl_relooper_add_block(rl, block_map[42]); - void *b43 = rl_new_block("code 43"); + void *b43 = rl_new_block("code 43", "the_var"); block_map[43] = b43; rl_relooper_add_block(rl, block_map[43]); - void *b44 = rl_new_block("code 44"); + void *b44 = rl_new_block("code 44", "the_var"); block_map[44] = b44; rl_relooper_add_block(rl, block_map[44]); - void *b45 = rl_new_block("code 45"); + void *b45 = rl_new_block("code 45", "the_var"); block_map[45] = b45; rl_relooper_add_block(rl, block_map[45]); - void *b46 = rl_new_block("code 46"); + void *b46 = rl_new_block("code 46", "the_var"); block_map[46] = b46; rl_relooper_add_block(rl, block_map[46]); - void *b47 = rl_new_block("code 47"); + void *b47 = rl_new_block("code 47", "the_var"); block_map[47] = b47; rl_relooper_add_block(rl, block_map[47]); - void *b48 = rl_new_block("code 48"); + void *b48 = rl_new_block("code 48", "the_var"); block_map[48] = b48; rl_relooper_add_block(rl, block_map[48]); - void *b49 = rl_new_block("code 49"); + void *b49 = rl_new_block("code 49", "the_var"); block_map[49] = b49; rl_relooper_add_block(rl, block_map[49]); - void *b50 = rl_new_block("code 50"); + void *b50 = rl_new_block("code 50", "the_var"); block_map[50] = b50; rl_relooper_add_block(rl, block_map[50]); - void *b51 = rl_new_block("code 51"); + void *b51 = rl_new_block("code 51", "the_var"); block_map[51] = b51; rl_relooper_add_block(rl, block_map[51]); - void *b52 = rl_new_block("code 52"); + void *b52 = rl_new_block("code 52", "the_var"); block_map[52] = b52; rl_relooper_add_block(rl, block_map[52]); - void *b53 = rl_new_block("code 53"); + void *b53 = rl_new_block("code 53", "the_var"); block_map[53] = b53; rl_relooper_add_block(rl, block_map[53]); - void *b54 = rl_new_block("code 54"); + void *b54 = rl_new_block("code 54", "the_var"); block_map[54] = b54; rl_relooper_add_block(rl, block_map[54]); - void *b55 = rl_new_block("code 55"); + void *b55 = rl_new_block("code 55", "the_var"); block_map[55] = b55; rl_relooper_add_block(rl, block_map[55]); - void *b56 = rl_new_block("code 56"); + void *b56 = rl_new_block("code 56", "the_var"); block_map[56] = b56; rl_relooper_add_block(rl, block_map[56]); - void *b57 = rl_new_block("code 57"); + void *b57 = rl_new_block("code 57", "the_var"); block_map[57] = b57; rl_relooper_add_block(rl, block_map[57]); - void *b58 = rl_new_block("code 58"); + void *b58 = rl_new_block("code 58", "the_var"); block_map[58] = b58; rl_relooper_add_block(rl, block_map[58]); - void *b59 = rl_new_block("code 59"); + void *b59 = rl_new_block("code 59", "the_var"); block_map[59] = b59; rl_relooper_add_block(rl, block_map[59]); - void *b60 = rl_new_block("code 60"); + void *b60 = rl_new_block("code 60", "the_var"); block_map[60] = b60; rl_relooper_add_block(rl, block_map[60]); - void *b61 = rl_new_block("code 61"); + void *b61 = rl_new_block("code 61", "the_var"); block_map[61] = b61; rl_relooper_add_block(rl, block_map[61]); - void *b62 = rl_new_block("code 62"); + void *b62 = rl_new_block("code 62", "the_var"); block_map[62] = b62; rl_relooper_add_block(rl, block_map[62]); - void *b63 = rl_new_block("code 63"); + void *b63 = rl_new_block("code 63", "the_var"); block_map[63] = b63; rl_relooper_add_block(rl, block_map[63]); - void *b64 = rl_new_block("code 64"); + void *b64 = rl_new_block("code 64", "the_var"); block_map[64] = b64; rl_relooper_add_block(rl, block_map[64]); - void *b65 = rl_new_block("code 65"); + void *b65 = rl_new_block("code 65", "the_var"); block_map[65] = b65; rl_relooper_add_block(rl, block_map[65]); - void *b66 = rl_new_block("code 66"); + void *b66 = rl_new_block("code 66", "the_var"); block_map[66] = b66; rl_relooper_add_block(rl, block_map[66]); - void *b67 = rl_new_block("code 67"); + void *b67 = rl_new_block("code 67", "the_var"); block_map[67] = b67; rl_relooper_add_block(rl, block_map[67]); - void *b68 = rl_new_block("code 68"); + void *b68 = rl_new_block("code 68", "the_var"); block_map[68] = b68; rl_relooper_add_block(rl, block_map[68]); - void *b69 = rl_new_block("code 69"); + void *b69 = rl_new_block("code 69", "the_var"); block_map[69] = b69; rl_relooper_add_block(rl, block_map[69]); - void *b70 = rl_new_block("code 70"); + void *b70 = rl_new_block("code 70", "the_var"); block_map[70] = b70; rl_relooper_add_block(rl, block_map[70]); - void *b71 = rl_new_block("code 71"); + void *b71 = rl_new_block("code 71", "the_var"); block_map[71] = b71; rl_relooper_add_block(rl, block_map[71]); - void *b72 = rl_new_block("code 72"); + void *b72 = rl_new_block("code 72", "the_var"); block_map[72] = b72; rl_relooper_add_block(rl, block_map[72]); - void *b73 = rl_new_block("code 73"); + void *b73 = rl_new_block("code 73", "the_var"); block_map[73] = b73; rl_relooper_add_block(rl, block_map[73]); - void *b74 = rl_new_block("code 74"); + void *b74 = rl_new_block("code 74", "the_var"); block_map[74] = b74; rl_relooper_add_block(rl, block_map[74]); - void *b75 = rl_new_block("code 75"); + void *b75 = rl_new_block("code 75", "the_var"); block_map[75] = b75; rl_relooper_add_block(rl, block_map[75]); - void *b76 = rl_new_block("code 76"); + void *b76 = rl_new_block("code 76", "the_var"); block_map[76] = b76; rl_relooper_add_block(rl, block_map[76]); - void *b77 = rl_new_block("code 77"); + void *b77 = rl_new_block("code 77", "the_var"); block_map[77] = b77; rl_relooper_add_block(rl, block_map[77]); - void *b78 = rl_new_block("code 78"); + void *b78 = rl_new_block("code 78", "the_var"); block_map[78] = b78; rl_relooper_add_block(rl, block_map[78]); - void *b79 = rl_new_block("code 79"); + void *b79 = rl_new_block("code 79", "the_var"); block_map[79] = b79; rl_relooper_add_block(rl, block_map[79]); - void *b80 = rl_new_block("code 80"); + void *b80 = rl_new_block("code 80", "the_var"); block_map[80] = b80; rl_relooper_add_block(rl, block_map[80]); - void *b81 = rl_new_block("code 81"); + void *b81 = rl_new_block("code 81", "the_var"); block_map[81] = b81; rl_relooper_add_block(rl, block_map[81]); - void *b82 = rl_new_block("code 82"); + void *b82 = rl_new_block("code 82", "the_var"); block_map[82] = b82; rl_relooper_add_block(rl, block_map[82]); - void *b83 = rl_new_block("code 83"); + void *b83 = rl_new_block("code 83", "the_var"); block_map[83] = b83; rl_relooper_add_block(rl, block_map[83]); - void *b84 = rl_new_block("code 84"); + void *b84 = rl_new_block("code 84", "the_var"); block_map[84] = b84; rl_relooper_add_block(rl, block_map[84]); - void *b85 = rl_new_block("code 85"); + void *b85 = rl_new_block("code 85", "the_var"); block_map[85] = b85; rl_relooper_add_block(rl, block_map[85]); - void *b86 = rl_new_block("code 86"); + void *b86 = rl_new_block("code 86", "the_var"); block_map[86] = b86; rl_relooper_add_block(rl, block_map[86]); - void *b87 = rl_new_block("code 87"); + void *b87 = rl_new_block("code 87", "the_var"); block_map[87] = b87; rl_relooper_add_block(rl, block_map[87]); - void *b88 = rl_new_block("code 88"); + void *b88 = rl_new_block("code 88", "the_var"); block_map[88] = b88; rl_relooper_add_block(rl, block_map[88]); - void *b89 = rl_new_block("code 89"); + void *b89 = rl_new_block("code 89", "the_var"); block_map[89] = b89; rl_relooper_add_block(rl, block_map[89]); - void *b90 = rl_new_block("code 90"); + void *b90 = rl_new_block("code 90", "the_var"); block_map[90] = b90; rl_relooper_add_block(rl, block_map[90]); - void *b91 = rl_new_block("code 91"); + void *b91 = rl_new_block("code 91", "the_var"); block_map[91] = b91; rl_relooper_add_block(rl, block_map[91]); - void *b92 = rl_new_block("code 92"); + void *b92 = rl_new_block("code 92", "the_var"); block_map[92] = b92; rl_relooper_add_block(rl, block_map[92]); - void *b93 = rl_new_block("code 93"); + void *b93 = rl_new_block("code 93", "the_var"); block_map[93] = b93; rl_relooper_add_block(rl, block_map[93]); - void *b94 = rl_new_block("code 94"); + void *b94 = rl_new_block("code 94", "the_var"); block_map[94] = b94; rl_relooper_add_block(rl, block_map[94]); - void *b95 = rl_new_block("code 95"); + void *b95 = rl_new_block("code 95", "the_var"); block_map[95] = b95; rl_relooper_add_block(rl, block_map[95]); - void *b96 = rl_new_block("code 96"); + void *b96 = rl_new_block("code 96", "the_var"); block_map[96] = b96; rl_relooper_add_block(rl, block_map[96]); - void *b97 = rl_new_block("code 97"); + void *b97 = rl_new_block("code 97", "the_var"); block_map[97] = b97; rl_relooper_add_block(rl, block_map[97]); - void *b98 = rl_new_block("code 98"); + void *b98 = rl_new_block("code 98", "the_var"); block_map[98] = b98; rl_relooper_add_block(rl, block_map[98]); - void *b99 = rl_new_block("code 99"); + void *b99 = rl_new_block("code 99", "the_var"); block_map[99] = b99; rl_relooper_add_block(rl, block_map[99]); - void *b100 = rl_new_block("code 100"); + void *b100 = rl_new_block("code 100", "the_var"); block_map[100] = b100; rl_relooper_add_block(rl, block_map[100]); - void *b101 = rl_new_block("code 101"); + void *b101 = rl_new_block("code 101", "the_var"); block_map[101] = b101; rl_relooper_add_block(rl, block_map[101]); - void *b102 = rl_new_block("code 102"); + void *b102 = rl_new_block("code 102", "the_var"); block_map[102] = b102; rl_relooper_add_block(rl, block_map[102]); - void *b103 = rl_new_block("code 103"); + void *b103 = rl_new_block("code 103", "the_var"); block_map[103] = b103; rl_relooper_add_block(rl, block_map[103]); - void *b104 = rl_new_block("code 104"); + void *b104 = rl_new_block("code 104", "the_var"); block_map[104] = b104; rl_relooper_add_block(rl, block_map[104]); - void *b105 = rl_new_block("code 105"); + void *b105 = rl_new_block("code 105", "the_var"); block_map[105] = b105; rl_relooper_add_block(rl, block_map[105]); - void *b106 = rl_new_block("code 106"); + void *b106 = rl_new_block("code 106", "the_var"); block_map[106] = b106; rl_relooper_add_block(rl, block_map[106]); - void *b107 = rl_new_block("code 107"); + void *b107 = rl_new_block("code 107", "the_var"); block_map[107] = b107; rl_relooper_add_block(rl, block_map[107]); - void *b108 = rl_new_block("code 108"); + void *b108 = rl_new_block("code 108", "the_var"); block_map[108] = b108; rl_relooper_add_block(rl, block_map[108]); - void *b109 = rl_new_block("code 109"); + void *b109 = rl_new_block("code 109", "the_var"); block_map[109] = b109; rl_relooper_add_block(rl, block_map[109]); - void *b110 = rl_new_block("code 110"); + void *b110 = rl_new_block("code 110", "the_var"); block_map[110] = b110; rl_relooper_add_block(rl, block_map[110]); - void *b111 = rl_new_block("code 111"); + void *b111 = rl_new_block("code 111", "the_var"); block_map[111] = b111; rl_relooper_add_block(rl, block_map[111]); - void *b112 = rl_new_block("code 112"); + void *b112 = rl_new_block("code 112", "the_var"); block_map[112] = b112; rl_relooper_add_block(rl, block_map[112]); - void *b113 = rl_new_block("code 113"); + void *b113 = rl_new_block("code 113", "the_var"); block_map[113] = b113; rl_relooper_add_block(rl, block_map[113]); - void *b114 = rl_new_block("code 114"); + void *b114 = rl_new_block("code 114", "the_var"); block_map[114] = b114; rl_relooper_add_block(rl, block_map[114]); - void *b115 = rl_new_block("code 115"); + void *b115 = rl_new_block("code 115", "the_var"); block_map[115] = b115; rl_relooper_add_block(rl, block_map[115]); - void *b116 = rl_new_block("code 116"); + void *b116 = rl_new_block("code 116", "the_var"); block_map[116] = b116; rl_relooper_add_block(rl, block_map[116]); - void *b117 = rl_new_block("code 117"); + void *b117 = rl_new_block("code 117", "the_var"); block_map[117] = b117; rl_relooper_add_block(rl, block_map[117]); - void *b118 = rl_new_block("code 118"); + void *b118 = rl_new_block("code 118", "the_var"); block_map[118] = b118; rl_relooper_add_block(rl, block_map[118]); - void *b119 = rl_new_block("code 119"); + void *b119 = rl_new_block("code 119", "the_var"); block_map[119] = b119; rl_relooper_add_block(rl, block_map[119]); - void *b120 = rl_new_block("code 120"); + void *b120 = rl_new_block("code 120", "the_var"); block_map[120] = b120; rl_relooper_add_block(rl, block_map[120]); - void *b121 = rl_new_block("code 121"); + void *b121 = rl_new_block("code 121", "the_var"); block_map[121] = b121; rl_relooper_add_block(rl, block_map[121]); - void *b122 = rl_new_block("code 122"); + void *b122 = rl_new_block("code 122", "the_var"); block_map[122] = b122; rl_relooper_add_block(rl, block_map[122]); - void *b123 = rl_new_block("code 123"); + void *b123 = rl_new_block("code 123", "the_var"); block_map[123] = b123; rl_relooper_add_block(rl, block_map[123]); - void *b124 = rl_new_block("code 124"); + void *b124 = rl_new_block("code 124", "the_var"); block_map[124] = b124; rl_relooper_add_block(rl, block_map[124]); - void *b125 = rl_new_block("code 125"); + void *b125 = rl_new_block("code 125", "the_var"); block_map[125] = b125; rl_relooper_add_block(rl, block_map[125]); - void *b126 = rl_new_block("code 126"); + void *b126 = rl_new_block("code 126", "the_var"); block_map[126] = b126; rl_relooper_add_block(rl, block_map[126]); - void *b127 = rl_new_block("code 127"); + void *b127 = rl_new_block("code 127", "the_var"); block_map[127] = b127; rl_relooper_add_block(rl, block_map[127]); - void *b128 = rl_new_block("code 128"); + void *b128 = rl_new_block("code 128", "the_var"); block_map[128] = b128; rl_relooper_add_block(rl, block_map[128]); - void *b129 = rl_new_block("code 129"); + void *b129 = rl_new_block("code 129", "the_var"); block_map[129] = b129; rl_relooper_add_block(rl, block_map[129]); - void *b130 = rl_new_block("code 130"); + void *b130 = rl_new_block("code 130", "the_var"); block_map[130] = b130; rl_relooper_add_block(rl, block_map[130]); - void *b131 = rl_new_block("code 131"); + void *b131 = rl_new_block("code 131", "the_var"); block_map[131] = b131; rl_relooper_add_block(rl, block_map[131]); - void *b132 = rl_new_block("code 132"); + void *b132 = rl_new_block("code 132", "the_var"); block_map[132] = b132; rl_relooper_add_block(rl, block_map[132]); - void *b133 = rl_new_block("code 133"); + void *b133 = rl_new_block("code 133", "the_var"); block_map[133] = b133; rl_relooper_add_block(rl, block_map[133]); - void *b134 = rl_new_block("code 134"); + void *b134 = rl_new_block("code 134", "the_var"); block_map[134] = b134; rl_relooper_add_block(rl, block_map[134]); - void *b135 = rl_new_block("code 135"); + void *b135 = rl_new_block("code 135", "the_var"); block_map[135] = b135; rl_relooper_add_block(rl, block_map[135]); - void *b136 = rl_new_block("code 136"); + void *b136 = rl_new_block("code 136", "the_var"); block_map[136] = b136; rl_relooper_add_block(rl, block_map[136]); - void *b137 = rl_new_block("code 137"); + void *b137 = rl_new_block("code 137", "the_var"); block_map[137] = b137; rl_relooper_add_block(rl, block_map[137]); - void *b138 = rl_new_block("code 138"); + void *b138 = rl_new_block("code 138", "the_var"); block_map[138] = b138; rl_relooper_add_block(rl, block_map[138]); - void *b139 = rl_new_block("code 139"); + void *b139 = rl_new_block("code 139", "the_var"); block_map[139] = b139; rl_relooper_add_block(rl, block_map[139]); - void *b140 = rl_new_block("code 140"); + void *b140 = rl_new_block("code 140", "the_var"); block_map[140] = b140; rl_relooper_add_block(rl, block_map[140]); - void *b141 = rl_new_block("code 141"); + void *b141 = rl_new_block("code 141", "the_var"); block_map[141] = b141; rl_relooper_add_block(rl, block_map[141]); - void *b142 = rl_new_block("code 142"); + void *b142 = rl_new_block("code 142", "the_var"); block_map[142] = b142; rl_relooper_add_block(rl, block_map[142]); - void *b143 = rl_new_block("code 143"); + void *b143 = rl_new_block("code 143", "the_var"); block_map[143] = b143; rl_relooper_add_block(rl, block_map[143]); - void *b144 = rl_new_block("code 144"); + void *b144 = rl_new_block("code 144", "the_var"); block_map[144] = b144; rl_relooper_add_block(rl, block_map[144]); - void *b145 = rl_new_block("code 145"); + void *b145 = rl_new_block("code 145", "the_var"); block_map[145] = b145; rl_relooper_add_block(rl, block_map[145]); - void *b146 = rl_new_block("code 146"); + void *b146 = rl_new_block("code 146", "the_var"); block_map[146] = b146; rl_relooper_add_block(rl, block_map[146]); - void *b147 = rl_new_block("code 147"); + void *b147 = rl_new_block("code 147", "the_var"); block_map[147] = b147; rl_relooper_add_block(rl, block_map[147]); - void *b148 = rl_new_block("code 148"); + void *b148 = rl_new_block("code 148", "the_var"); block_map[148] = b148; rl_relooper_add_block(rl, block_map[148]); - void *b149 = rl_new_block("code 149"); + void *b149 = rl_new_block("code 149", "the_var"); block_map[149] = b149; rl_relooper_add_block(rl, block_map[149]); - void *b150 = rl_new_block("code 150"); + void *b150 = rl_new_block("code 150", "the_var"); block_map[150] = b150; rl_relooper_add_block(rl, block_map[150]); - void *b151 = rl_new_block("code 151"); + void *b151 = rl_new_block("code 151", "the_var"); block_map[151] = b151; rl_relooper_add_block(rl, block_map[151]); - void *b152 = rl_new_block("code 152"); + void *b152 = rl_new_block("code 152", "the_var"); block_map[152] = b152; rl_relooper_add_block(rl, block_map[152]); - void *b153 = rl_new_block("code 153"); + void *b153 = rl_new_block("code 153", "the_var"); block_map[153] = b153; rl_relooper_add_block(rl, block_map[153]); - void *b154 = rl_new_block("code 154"); + void *b154 = rl_new_block("code 154", "the_var"); block_map[154] = b154; rl_relooper_add_block(rl, block_map[154]); - void *b155 = rl_new_block("code 155"); + void *b155 = rl_new_block("code 155", "the_var"); block_map[155] = b155; rl_relooper_add_block(rl, block_map[155]); - void *b156 = rl_new_block("code 156"); + void *b156 = rl_new_block("code 156", "the_var"); block_map[156] = b156; rl_relooper_add_block(rl, block_map[156]); - void *b157 = rl_new_block("code 157"); + void *b157 = rl_new_block("code 157", "the_var"); block_map[157] = b157; rl_relooper_add_block(rl, block_map[157]); - void *b158 = rl_new_block("code 158"); + void *b158 = rl_new_block("code 158", "the_var"); block_map[158] = b158; rl_relooper_add_block(rl, block_map[158]); - void *b159 = rl_new_block("code 159"); + void *b159 = rl_new_block("code 159", "the_var"); block_map[159] = b159; rl_relooper_add_block(rl, block_map[159]); - void *b160 = rl_new_block("code 160"); + void *b160 = rl_new_block("code 160", "the_var"); block_map[160] = b160; rl_relooper_add_block(rl, block_map[160]); - void *b161 = rl_new_block("code 161"); + void *b161 = rl_new_block("code 161", "the_var"); block_map[161] = b161; rl_relooper_add_block(rl, block_map[161]); - void *b162 = rl_new_block("code 162"); + void *b162 = rl_new_block("code 162", "the_var"); block_map[162] = b162; rl_relooper_add_block(rl, block_map[162]); - void *b163 = rl_new_block("code 163"); + void *b163 = rl_new_block("code 163", "the_var"); block_map[163] = b163; rl_relooper_add_block(rl, block_map[163]); - void *b164 = rl_new_block("code 164"); + void *b164 = rl_new_block("code 164", "the_var"); block_map[164] = b164; rl_relooper_add_block(rl, block_map[164]); - void *b165 = rl_new_block("code 165"); + void *b165 = rl_new_block("code 165", "the_var"); block_map[165] = b165; rl_relooper_add_block(rl, block_map[165]); - void *b166 = rl_new_block("code 166"); + void *b166 = rl_new_block("code 166", "the_var"); block_map[166] = b166; rl_relooper_add_block(rl, block_map[166]); - void *b167 = rl_new_block("code 167"); + void *b167 = rl_new_block("code 167", "the_var"); block_map[167] = b167; rl_relooper_add_block(rl, block_map[167]); - void *b168 = rl_new_block("code 168"); + void *b168 = rl_new_block("code 168", "the_var"); block_map[168] = b168; rl_relooper_add_block(rl, block_map[168]); - void *b169 = rl_new_block("code 169"); + void *b169 = rl_new_block("code 169", "the_var"); block_map[169] = b169; rl_relooper_add_block(rl, block_map[169]); - void *b170 = rl_new_block("code 170"); + void *b170 = rl_new_block("code 170", "the_var"); block_map[170] = b170; rl_relooper_add_block(rl, block_map[170]); - void *b171 = rl_new_block("code 171"); + void *b171 = rl_new_block("code 171", "the_var"); block_map[171] = b171; rl_relooper_add_block(rl, block_map[171]); - void *b172 = rl_new_block("code 172"); + void *b172 = rl_new_block("code 172", "the_var"); block_map[172] = b172; rl_relooper_add_block(rl, block_map[172]); - void *b173 = rl_new_block("code 173"); + void *b173 = rl_new_block("code 173", "the_var"); block_map[173] = b173; rl_relooper_add_block(rl, block_map[173]); - void *b174 = rl_new_block("code 174"); + void *b174 = rl_new_block("code 174", "the_var"); block_map[174] = b174; rl_relooper_add_block(rl, block_map[174]); - void *b175 = rl_new_block("code 175"); + void *b175 = rl_new_block("code 175", "the_var"); block_map[175] = b175; rl_relooper_add_block(rl, block_map[175]); - void *b176 = rl_new_block("code 176"); + void *b176 = rl_new_block("code 176", "the_var"); block_map[176] = b176; rl_relooper_add_block(rl, block_map[176]); - void *b177 = rl_new_block("code 177"); + void *b177 = rl_new_block("code 177", "the_var"); block_map[177] = b177; rl_relooper_add_block(rl, block_map[177]); - void *b178 = rl_new_block("code 178"); + void *b178 = rl_new_block("code 178", "the_var"); block_map[178] = b178; rl_relooper_add_block(rl, block_map[178]); - void *b179 = rl_new_block("code 179"); + void *b179 = rl_new_block("code 179", "the_var"); block_map[179] = b179; rl_relooper_add_block(rl, block_map[179]); - void *b180 = rl_new_block("code 180"); + void *b180 = rl_new_block("code 180", "the_var"); block_map[180] = b180; rl_relooper_add_block(rl, block_map[180]); - void *b181 = rl_new_block("code 181"); + void *b181 = rl_new_block("code 181", "the_var"); block_map[181] = b181; rl_relooper_add_block(rl, block_map[181]); - void *b182 = rl_new_block("code 182"); + void *b182 = rl_new_block("code 182", "the_var"); block_map[182] = b182; rl_relooper_add_block(rl, block_map[182]); - void *b183 = rl_new_block("code 183"); + void *b183 = rl_new_block("code 183", "the_var"); block_map[183] = b183; rl_relooper_add_block(rl, block_map[183]); rl_block_add_branch_to(block_map[0], block_map[2], "uint(i4) >= uint(i5)", NULL); diff --git a/src/relooper/test_inf.txt b/src/relooper/test_inf.txt index bc2fad3e..6db32edb 100644 --- a/src/relooper/test_inf.txt +++ b/src/relooper/test_inf.txt @@ -1,385 +1,1131 @@ code 0 -if (uint(i4) >= uint(i5)) { +switch (the_var) { +uint(i4) >= uint(i5) { code 2 -} else { + switch (the_var) { + default: { + } + } + break; +} +default: { code 1 + switch (the_var) { + default: { + } + } +} } code 3 -if (!(i2 == 0)) { - code 4 - while(1) { - code 5 - if (uint(i6) >= uint(i7)) { - code 7 - } else { - code 6 - } - code 8 - if (uint(i6) >= uint(i7)) { - code 10 - } else { - code 9 +L5: do { + switch (the_var) { + i2 == 0 { + break; + } + default: { + code 4 + switch (the_var) { + default: { } - code 11 - if (uint(i5) >= uint(i6)) { - code 13 - } else { - code 12 } - code 14 - if (!(i2 != 0)) { - break; + while(1) { + code 5 + switch (the_var) { + uint(i6) >= uint(i7) { + code 7 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 6 + switch (the_var) { + default: { + } + } + } + } + code 8 + switch (the_var) { + uint(i6) >= uint(i7) { + code 10 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 9 + switch (the_var) { + default: { + } + } + } + } + code 11 + switch (the_var) { + uint(i5) >= uint(i6) { + code 13 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 12 + switch (the_var) { + default: { + } + } + } + } + code 14 + switch (the_var) { + i2 != 0 { + break; + } + default: { + break L5; + } + } } } -} + } +} while(0); code 15 -if (uint(i4) >= uint(i5)) { +switch (the_var) { +uint(i4) >= uint(i5) { code 17 -} else { + switch (the_var) { + default: { + } + } + break; +} +default: { code 16 + switch (the_var) { + default: { + } + } +} } code 18 -if (!(i2 == 0)) { - code 19 - while(1) { - code 20 - if (uint(i5) >= uint(i6)) { - code 22 - } else { - code 21 - } - code 23 - if (uint(i5) >= uint(i6)) { - code 25 - } else { - code 24 - } - code 26 - if (uint(i5) >= uint(i6)) { - code 28 - } else { - code 27 - } - code 29 - if (uint(i5) >= uint(i6)) { - code 31 - } else { - code 30 - } - code 32 - if (uint(i5) >= uint(i6)) { - code 34 - } else { - code 33 - } - code 35 - if (uint(i5) >= uint(i6)) { - code 37 - } else { - code 36 - } - code 38 - if (uint(i5) >= uint(i6)) { - code 40 - } else { - code 39 - } - code 41 - if (uint(i5) >= uint(i6)) { - code 43 - } else { - code 42 - } - code 44 - if (uint(i5) >= uint(i6)) { - code 46 - } else { - code 45 - } - code 47 - if (uint(i5) >= uint(i6)) { - code 49 - } else { - code 48 - } - code 50 - if (uint(i5) >= uint(i6)) { - code 52 - } else { - code 51 - } - code 53 - if (uint(i5) >= uint(i6)) { - code 55 - } else { - code 54 - } - code 56 - if (uint(i5) >= uint(i6)) { - code 58 - } else { - code 57 - } - code 59 - if (uint(i5) >= uint(i6)) { - code 61 - } else { - code 60 - } - code 62 - if (uint(i5) >= uint(i6)) { - code 64 - } else { - code 63 - } - code 65 - if (uint(i5) >= uint(i6)) { - code 67 - } else { - code 66 - } - code 68 - if (uint(i5) >= uint(i6)) { - code 70 - } else { - code 69 - } - code 71 - if (uint(i5) >= uint(i6)) { - code 73 - } else { - code 72 - } - code 74 - if (uint(i5) >= uint(i6)) { - code 76 - } else { - code 75 - } - code 77 - if (uint(i5) >= uint(i6)) { - code 79 - } else { - code 78 - } - code 80 - if (uint(i5) >= uint(i6)) { - code 82 - } else { - code 81 - } - code 83 - if (uint(i5) >= uint(i6)) { - code 85 - } else { - code 84 - } - code 86 - if (uint(i5) >= uint(i6)) { - code 88 - } else { - code 87 - } - code 89 - if (uint(i5) >= uint(i6)) { - code 91 - } else { - code 90 - } - code 92 - if (uint(i5) >= uint(i6)) { - code 94 - } else { - code 93 - } - code 95 - if (uint(i5) >= uint(i6)) { - code 97 - } else { - code 96 +L26: do { + switch (the_var) { + i2 == 0 { + break; + } + default: { + code 19 + switch (the_var) { + default: { } - code 98 - if (uint(i5) >= uint(i6)) { - code 100 - } else { - code 99 } - code 101 - if (!(i2 != 0)) { - break; + while(1) { + code 20 + switch (the_var) { + uint(i5) >= uint(i6) { + code 22 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 21 + switch (the_var) { + default: { + } + } + } + } + code 23 + switch (the_var) { + uint(i5) >= uint(i6) { + code 25 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 24 + switch (the_var) { + default: { + } + } + } + } + code 26 + switch (the_var) { + uint(i5) >= uint(i6) { + code 28 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 27 + switch (the_var) { + default: { + } + } + } + } + code 29 + switch (the_var) { + uint(i5) >= uint(i6) { + code 31 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 30 + switch (the_var) { + default: { + } + } + } + } + code 32 + switch (the_var) { + uint(i5) >= uint(i6) { + code 34 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 33 + switch (the_var) { + default: { + } + } + } + } + code 35 + switch (the_var) { + uint(i5) >= uint(i6) { + code 37 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 36 + switch (the_var) { + default: { + } + } + } + } + code 38 + switch (the_var) { + uint(i5) >= uint(i6) { + code 40 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 39 + switch (the_var) { + default: { + } + } + } + } + code 41 + switch (the_var) { + uint(i5) >= uint(i6) { + code 43 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 42 + switch (the_var) { + default: { + } + } + } + } + code 44 + switch (the_var) { + uint(i5) >= uint(i6) { + code 46 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 45 + switch (the_var) { + default: { + } + } + } + } + code 47 + switch (the_var) { + uint(i5) >= uint(i6) { + code 49 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 48 + switch (the_var) { + default: { + } + } + } + } + code 50 + switch (the_var) { + uint(i5) >= uint(i6) { + code 52 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 51 + switch (the_var) { + default: { + } + } + } + } + code 53 + switch (the_var) { + uint(i5) >= uint(i6) { + code 55 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 54 + switch (the_var) { + default: { + } + } + } + } + code 56 + switch (the_var) { + uint(i5) >= uint(i6) { + code 58 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 57 + switch (the_var) { + default: { + } + } + } + } + code 59 + switch (the_var) { + uint(i5) >= uint(i6) { + code 61 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 60 + switch (the_var) { + default: { + } + } + } + } + code 62 + switch (the_var) { + uint(i5) >= uint(i6) { + code 64 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 63 + switch (the_var) { + default: { + } + } + } + } + code 65 + switch (the_var) { + uint(i5) >= uint(i6) { + code 67 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 66 + switch (the_var) { + default: { + } + } + } + } + code 68 + switch (the_var) { + uint(i5) >= uint(i6) { + code 70 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 69 + switch (the_var) { + default: { + } + } + } + } + code 71 + switch (the_var) { + uint(i5) >= uint(i6) { + code 73 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 72 + switch (the_var) { + default: { + } + } + } + } + code 74 + switch (the_var) { + uint(i5) >= uint(i6) { + code 76 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 75 + switch (the_var) { + default: { + } + } + } + } + code 77 + switch (the_var) { + uint(i5) >= uint(i6) { + code 79 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 78 + switch (the_var) { + default: { + } + } + } + } + code 80 + switch (the_var) { + uint(i5) >= uint(i6) { + code 82 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 81 + switch (the_var) { + default: { + } + } + } + } + code 83 + switch (the_var) { + uint(i5) >= uint(i6) { + code 85 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 84 + switch (the_var) { + default: { + } + } + } + } + code 86 + switch (the_var) { + uint(i5) >= uint(i6) { + code 88 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 87 + switch (the_var) { + default: { + } + } + } + } + code 89 + switch (the_var) { + uint(i5) >= uint(i6) { + code 91 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 90 + switch (the_var) { + default: { + } + } + } + } + code 92 + switch (the_var) { + uint(i5) >= uint(i6) { + code 94 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 93 + switch (the_var) { + default: { + } + } + } + } + code 95 + switch (the_var) { + uint(i5) >= uint(i6) { + code 97 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 96 + switch (the_var) { + default: { + } + } + } + } + code 98 + switch (the_var) { + uint(i5) >= uint(i6) { + code 100 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 99 + switch (the_var) { + default: { + } + } + } + } + code 101 + switch (the_var) { + i2 != 0 { + break; + } + default: { + break L26; + } + } } } -} + } +} while(0); code 102 -if (uint(i4) >= uint(i5)) { +switch (the_var) { +uint(i4) >= uint(i5) { code 104 -} else { + switch (the_var) { + default: { + } + } + break; +} +default: { code 103 + switch (the_var) { + default: { + } + } +} } code 105 -if (!(i2 == 0)) { - code 106 - while(1) { - code 107 - if (uint(i5) >= uint(i6)) { - code 109 - } else { - code 108 - } - code 110 - if (uint(i5) >= uint(i6)) { - code 112 - } else { - code 111 - } - code 113 - if (uint(i5) >= uint(i6)) { - code 115 - } else { - code 114 - } - code 116 - if (uint(i5) >= uint(i6)) { - code 118 - } else { - code 117 - } - code 119 - if (uint(i5) >= uint(i6)) { - code 121 - } else { - code 120 - } - code 122 - if (uint(i5) >= uint(i6)) { - code 124 - } else { - code 123 - } - code 125 - if (uint(i5) >= uint(i6)) { - code 127 - } else { - code 126 - } - code 128 - if (uint(i5) >= uint(i6)) { - code 130 - } else { - code 129 - } - code 131 - if (uint(i5) >= uint(i6)) { - code 133 - } else { - code 132 - } - code 134 - if (uint(i5) >= uint(i6)) { - code 136 - } else { - code 135 - } - code 137 - if (uint(i5) >= uint(i6)) { - code 139 - } else { - code 138 - } - code 140 - if (uint(i5) >= uint(i6)) { - code 142 - } else { - code 141 - } - code 143 - if (uint(i5) >= uint(i6)) { - code 145 - } else { - code 144 - } - code 146 - if (uint(i5) >= uint(i6)) { - code 148 - } else { - code 147 - } - code 149 - if (uint(i5) >= uint(i6)) { - code 151 - } else { - code 150 - } - code 152 - if (uint(i5) >= uint(i6)) { - code 154 - } else { - code 153 - } - code 155 - if (uint(i5) >= uint(i6)) { - code 157 - } else { - code 156 - } - code 158 - if (uint(i5) >= uint(i6)) { - code 160 - } else { - code 159 - } - code 161 - if (uint(i5) >= uint(i6)) { - code 163 - } else { - code 162 +L143: do { + switch (the_var) { + i2 == 0 { + break; + } + default: { + code 106 + switch (the_var) { + default: { } - code 164 - if (uint(i5) >= uint(i6)) { - code 166 - } else { - code 165 } - code 167 - if (!(i2 != 0)) { - break; + while(1) { + code 107 + switch (the_var) { + uint(i5) >= uint(i6) { + code 109 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 108 + switch (the_var) { + default: { + } + } + } + } + code 110 + switch (the_var) { + uint(i5) >= uint(i6) { + code 112 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 111 + switch (the_var) { + default: { + } + } + } + } + code 113 + switch (the_var) { + uint(i5) >= uint(i6) { + code 115 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 114 + switch (the_var) { + default: { + } + } + } + } + code 116 + switch (the_var) { + uint(i5) >= uint(i6) { + code 118 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 117 + switch (the_var) { + default: { + } + } + } + } + code 119 + switch (the_var) { + uint(i5) >= uint(i6) { + code 121 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 120 + switch (the_var) { + default: { + } + } + } + } + code 122 + switch (the_var) { + uint(i5) >= uint(i6) { + code 124 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 123 + switch (the_var) { + default: { + } + } + } + } + code 125 + switch (the_var) { + uint(i5) >= uint(i6) { + code 127 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 126 + switch (the_var) { + default: { + } + } + } + } + code 128 + switch (the_var) { + uint(i5) >= uint(i6) { + code 130 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 129 + switch (the_var) { + default: { + } + } + } + } + code 131 + switch (the_var) { + uint(i5) >= uint(i6) { + code 133 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 132 + switch (the_var) { + default: { + } + } + } + } + code 134 + switch (the_var) { + uint(i5) >= uint(i6) { + code 136 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 135 + switch (the_var) { + default: { + } + } + } + } + code 137 + switch (the_var) { + uint(i5) >= uint(i6) { + code 139 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 138 + switch (the_var) { + default: { + } + } + } + } + code 140 + switch (the_var) { + uint(i5) >= uint(i6) { + code 142 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 141 + switch (the_var) { + default: { + } + } + } + } + code 143 + switch (the_var) { + uint(i5) >= uint(i6) { + code 145 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 144 + switch (the_var) { + default: { + } + } + } + } + code 146 + switch (the_var) { + uint(i5) >= uint(i6) { + code 148 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 147 + switch (the_var) { + default: { + } + } + } + } + code 149 + switch (the_var) { + uint(i5) >= uint(i6) { + code 151 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 150 + switch (the_var) { + default: { + } + } + } + } + code 152 + switch (the_var) { + uint(i5) >= uint(i6) { + code 154 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 153 + switch (the_var) { + default: { + } + } + } + } + code 155 + switch (the_var) { + uint(i5) >= uint(i6) { + code 157 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 156 + switch (the_var) { + default: { + } + } + } + } + code 158 + switch (the_var) { + uint(i5) >= uint(i6) { + code 160 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 159 + switch (the_var) { + default: { + } + } + } + } + code 161 + switch (the_var) { + uint(i5) >= uint(i6) { + code 163 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 162 + switch (the_var) { + default: { + } + } + } + } + code 164 + switch (the_var) { + uint(i5) >= uint(i6) { + code 166 + switch (the_var) { + default: { + } + } + break; + } + default: { + code 165 + switch (the_var) { + default: { + } + } + } + } + code 167 + switch (the_var) { + i2 != 0 { + break; + } + default: { + break L143; + } + } } } -} + } +} while(0); code 168 -if (uint(i4) >= uint(i5)) { +switch (the_var) { +uint(i4) >= uint(i5) { code 170 -} else { + switch (the_var) { + default: { + } + } + break; +} +default: { code 169 + switch (the_var) { + default: { + } + } +} } code 171 -if (i2 == 0) { +switch (the_var) { +i2 == 0 { code 183 + break; +} +default: { +} } code 172 -while(1) { +switch (the_var) { +default: { +} +} +L235: while(1) { code 173 - if (uint(i5) >= uint(i6)) { + switch (the_var) { + uint(i5) >= uint(i6) { code 175 - } else { + switch (the_var) { + default: { + } + } + break; + } + default: { code 174 + switch (the_var) { + default: { + } + } + } } code 176 - if (uint(i5) >= uint(i6)) { + switch (the_var) { + uint(i5) >= uint(i6) { code 178 - } else { + switch (the_var) { + default: { + } + } + break; + } + default: { code 177 + switch (the_var) { + default: { + } + } + } } code 179 - if (uint(i4) >= uint(i5)) { + switch (the_var) { + uint(i4) >= uint(i5) { code 181 - } else { + switch (the_var) { + default: { + } + } + break; + } + default: { code 180 + switch (the_var) { + default: { + } + } + } } code 182 - if (!(i2 != 0)) { + switch (the_var) { + i2 != 0 { break; } + default: { + break L235; + } + } } code 183 |