![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/emscripten/src/relooper/ |
Upload File : |
#include <stdlib.h> #include "Relooper.h" int main() { #define SIZE (10*1024*1024) 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++] }", "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); b3->AddBranchTo(b4, NULL); b4->AddBranchTo(b4, NULL); Relooper r; r.AddBlock(b0); r.AddBlock(b1); r.AddBlock(b2); r.AddBlock(b3); r.AddBlock(b4); r.Calculate(b0); printf("\n\n"); r.Render(); puts(buffer); return 1; }