int main(int argc, char** args){ int64_t* n; _DECL_DEALLOC(n); int64_t max = 0; int64_t index = 0; _DECL_1DARRAY(arr); _DECL_DEALLOC(arr); int64_t* _5; _DECL_DEALLOC(_5); _DECL_2DARRAY(_6); _DECL_DEALLOC(_6); int64_t _7 = 0; _DECL_1DARRAY(_8); _DECL_DEALLOC(_8); int64_t _9 = 0; int64_t _10 = 0; _DECL_1DARRAY(_11); _DECL_DEALLOC(_11); int64_t _12 = 0; int64_t _13 = 0; int64_t _14 = 0; _DECL_1DARRAY(_15); _DECL_DEALLOC(_15); int64_t _16 = 0; void* _17; int64_t _19 = 0; int64_t _20 = 0; void* _21; int64_t _23 = 0; int64_t _24 = 0; int64_t _25 = 0; void* _26; _DECL_1DARRAY(_28); _DECL_DEALLOC(_28); //fieldload %6 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _DEALLOC_2DARRAY_int64_t(_6); _CONV_ARGS(_6); _ADD_DEALLOC(_6); //const %7 = 0 : int _7 = 0; //indexof %8 = %6, %7 : int[][] _8=_6[_7]; _8_size = _6_size_size; _REMOVE_DEALLOC(_8); //invoke (%5) = (%8) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int) { _STR_TO_INT(_5, _8); _ADD_DEALLOC(_5); _REMOVE_DEALLOC(_8); } //assign %1 = %5 : null|int _DEALLOC(n); // isCopyEliminated = true n = _5; _TRANSFER_DEALLOC(n, _5); //ifis %1, null goto blklab9 : null|int if(n == NULL) { goto blklab9;} //assign %2 = %1 : int // isCopyEliminated = true max = *n; //const %9 = 0 : int _9 = 0; //assign %3 = %9 : int // isCopyEliminated = true index = _9; //const %10 = 0 : int _10 = 0; //arraygen %11 = [10; 2] : int[] _DEALLOC(_11); _NEW_1DARRAY_int64_t(_11, max, _10); _ADD_DEALLOC(_11); //assign %4 = %11 : int[] _DEALLOC(arr); // isCopyEliminated = true _UPDATE_1DARRAY(arr, _11); _TRANSFER_DEALLOC(arr, _11); //loop (%3, %4, %12, %13, %14) while(true){ //ifge %3, %2 goto blklab10 : int if(index>=max){goto blklab10;} //sub %12 = %2, %3 : int _12=max-index; //update %4[%3] = %12 : int[] -> int[] // isCopyEliminated = false arr[index] = _12; //const %13 = 1 : int _13 = 1; //add %14 = %3, %13 : int _14=index+_13; //assign %3 = %14 : int // isCopyEliminated = true index = _14; //.blklab11 blklab11:; } //.blklab10 blklab10:; //const %16 = 0 : int _16 = 0; //invoke (%15) = (%4, %16, %2) MergeSort_original:sortV1 : function(int[],int,int)->(int[]) { _DEALLOC(_15); // isCopyEliminated of '_4' = true _15 = _sortV1_(_1DARRAY_PARAM(arr), false, _16, max, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_15)); _RESET_DEALLOC(arr, "true-true-false" , "sortV1"); _ADD_DEALLOC(_15); } //assign %4 = %15 : int[] _DEALLOC(arr); // isCopyEliminated = true _UPDATE_1DARRAY(arr, _15); _TRANSFER_DEALLOC(arr, _15); //fieldload %17 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %18 = %17 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %19 = 0 : int _19 = 0; //indexof %20 = %4, %19 : int[] _20=arr[_19]; //indirectinvoke () = %18 (%20) : method(any)->() { printf("%"PRId64"\n", _20); } //fieldload %21 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %22 = %21 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %23 = 1 : int _23 = 1; //sub %24 = %2, %23 : int _24=max-_23; //indexof %25 = %4, %24 : int[] _25=arr[_24]; //indirectinvoke () = %22 (%25) : method(any)->() { printf("%"PRId64"\n", _25); } //fieldload %26 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %27 = %26 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %28 = [80,97,115,115,32,77,101,114,103,101,115,111,114,116,32,116,101,115,116,32,99,97,115,101] : int[] _DEALLOC(_28); _NEW_1DARRAY_int64_t(_28, 24, 0); _28[0] = 80; _28[1] = 97; _28[2] = 115; _28[3] = 115; _28[4] = 32; _28[5] = 77; _28[6] = 101; _28[7] = 114; _28[8] = 103; _28[9] = 101; _28[10] = 115; _28[11] = 111; _28[12] = 114; _28[13] = 116; _28[14] = 32; _28[15] = 116; _28[16] = 101; _28[17] = 115; _28[18] = 116; _28[19] = 32; _28[20] = 99; _28[21] = 97; _28[22] = 115; _28[23] = 101; _ADD_DEALLOC(_28); //indirectinvoke () = %27 (%28) : method(int[])->() { println_s(_28, _28_size); } //.blklab9 blklab9:; //return _DEALLOC(n); _DEALLOC(arr); _DEALLOC(_5); _DEALLOC_2DARRAY_int64_t(_6); _DEALLOC(_8); _DEALLOC(_11); _DEALLOC(_15); _DEALLOC(_28); exit(0); }
int64_t* _sortV1_(_DECL_1DARRAY_PARAM(items), _DECL_DEALLOC_PARAM(items), int64_t start, int64_t end, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY(_3); _DECL_DEALLOC(_3); int64_t pivot = 0; _DECL_1DARRAY(lhs); _DECL_DEALLOC(lhs); _DECL_1DARRAY(rhs); _DECL_DEALLOC(rhs); int64_t l = 0; int64_t r = 0; int64_t i = 0; int64_t _10 = 0; int64_t _11 = 0; int64_t _12 = 0; int64_t _13 = 0; int64_t _14 = 0; _DECL_1DARRAY(_15); _DECL_DEALLOC(_15); _DECL_1DARRAY(_16); _DECL_DEALLOC(_16); int64_t _17 = 0; _DECL_1DARRAY(_18); _DECL_DEALLOC(_18); _DECL_1DARRAY(_19); _DECL_DEALLOC(_19); int64_t _20 = 0; int64_t _21 = 0; int64_t _22 = 0; int64_t _23 = 0; int64_t _24 = 0; int64_t _25 = 0; int64_t _26 = 0; int64_t _27 = 0; int64_t _28 = 0; int64_t _29 = 0; int64_t _30 = 0; int64_t _31 = 0; int64_t _32 = 0; int64_t _33 = 0; int64_t _34 = 0; int64_t _35 = 0; int64_t _36 = 0; int64_t _37 = 0; int64_t _38 = 0; int64_t _39 = 0; int64_t _40 = 0; int64_t _41 = 0; int64_t _42 = 0; int64_t _43 = 0; int64_t _44 = 0; int64_t _45 = 0; int64_t _46 = 0; int64_t _47 = 0; int64_t _48 = 0; int64_t _49 = 0; //const %10 = 1 : int _10 = 1; //add %11 = %1, %10 : int _11=start+_10; //ifge %11, %2 goto blklab0 : int if(_11>=end){goto blklab0;} //add %12 = %1, %2 : int _12=start+end; //const %13 = 2 : int _13 = 2; //div %14 = %12, %13 : int _14=_12/_13; //assign %4 = %14 : int // isCopyEliminated = true pivot = _14; //invoke (%15) = (%0, %1, %4) whiley/lang/Array:slice : function(int[],int,int)->(int[]) { _DEALLOC(_15); _SLICE_ARRAY(_15, items, start, pivot); _ADD_DEALLOC(_15); } //assign %5 = %15 : int[] _DEALLOC(lhs); // isCopyEliminated = true _UPDATE_1DARRAY(lhs, _15); _TRANSFER_DEALLOC(lhs, _15); //const %17 = 0 : int _17 = 0; //invoke (%16) = (%5, %17, %4) MergeSort_original:sortV1 : function(int[],int,int)->(int[]) { lhs = cilk_spawn _sortV1_(_1DARRAY_PARAM(lhs), false, _17, pivot, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(lhs)); } //invoke (%18) = (%0, %4, %2) whiley/lang/Array:slice : function(int[],int,int)->(int[]) { _DEALLOC(_18); _SLICE_ARRAY(_18, items, pivot, end); _ADD_DEALLOC(_18); } //assign %6 = %18 : int[] _DEALLOC(rhs); // isCopyEliminated = true _UPDATE_1DARRAY(rhs, _18); _TRANSFER_DEALLOC(rhs, _18); //const %20 = 0 : int _20 = 0; //sub %21 = %2, %4 : int _21=end-pivot; //invoke (%19) = (%6, %20, %21) MergeSort_original:sortV1 : function(int[],int,int)->(int[]) { rhs = cilk_spawn _sortV1_(_1DARRAY_PARAM(rhs), false, _20, _21, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(rhs)); } cilk_sync; //const %22 = 0 : int _22 = 0; //assign %7 = %22 : int // isCopyEliminated = true l = _22; //const %23 = 0 : int _23 = 0; //assign %8 = %23 : int // isCopyEliminated = true r = _23; //const %24 = 0 : int _24 = 0; //assign %9 = %24 : int // isCopyEliminated = true i = _24; //loop (%0, %7, %8, %9, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37) while(true){ //sub %25 = %2, %1 : int _25=end-start; //ifge %9, %25 goto blklab1 : int if(i>=_25){goto blklab1;} //sub %26 = %4, %1 : int _26=pivot-start; //ifge %7, %26 goto blklab1 : int if(l>=_26){goto blklab1;} //sub %27 = %2, %4 : int _27=end-pivot; //ifge %8, %27 goto blklab1 : int if(r>=_27){goto blklab1;} //indexof %28 = %5, %7 : int[] _28=lhs[l]; //indexof %29 = %6, %8 : int[] _29=rhs[r]; //ifgt %28, %29 goto blklab3 : int if(_28>_29){goto blklab3;} //indexof %30 = %5, %7 : int[] _30=lhs[l]; //update %0[%9] = %30 : int[] -> int[] // isCopyEliminated = false items[i] = _30; //const %31 = 1 : int _31 = 1; //add %32 = %7, %31 : int _32=l+_31; //assign %7 = %32 : int // isCopyEliminated = true l = _32; //goto blklab4 goto blklab4; //.blklab3 blklab3:; //indexof %33 = %6, %8 : int[] _33=rhs[r]; //update %0[%9] = %33 : int[] -> int[] // isCopyEliminated = false items[i] = _33; //const %34 = 1 : int _34 = 1; //add %35 = %8, %34 : int _35=r+_34; //assign %8 = %35 : int // isCopyEliminated = true r = _35; //.blklab4 blklab4:; //const %36 = 1 : int _36 = 1; //add %37 = %9, %36 : int _37=i+_36; //assign %9 = %37 : int // isCopyEliminated = true i = _37; //.blklab2 blklab2:; } //.blklab1 blklab1:; //loop (%0, %7, %9, %38, %39, %40, %41, %42, %43) while(true){ //sub %38 = %4, %1 : int _38=pivot-start; //ifge %7, %38 goto blklab5 : int if(l>=_38){goto blklab5;} //indexof %39 = %5, %7 : int[] _39=lhs[l]; //update %0[%9] = %39 : int[] -> int[] // isCopyEliminated = false items[i] = _39; //const %40 = 1 : int _40 = 1; //add %41 = %9, %40 : int _41=i+_40; //assign %9 = %41 : int // isCopyEliminated = true i = _41; //const %42 = 1 : int _42 = 1; //add %43 = %7, %42 : int _43=l+_42; //assign %7 = %43 : int // isCopyEliminated = true l = _43; //.blklab6 blklab6:; } //.blklab5 blklab5:; //loop (%0, %8, %9, %44, %45, %46, %47, %48, %49) while(true){ //sub %44 = %2, %4 : int _44=end-pivot; //ifge %8, %44 goto blklab7 : int if(r>=_44){goto blklab7;} //indexof %45 = %6, %8 : int[] _45=rhs[r]; //update %0[%9] = %45 : int[] -> int[] // isCopyEliminated = false items[i] = _45; //const %46 = 1 : int _46 = 1; //add %47 = %9, %46 : int _47=i+_46; //assign %9 = %47 : int // isCopyEliminated = true i = _47; //const %48 = 1 : int _48 = 1; //add %49 = %8, %48 : int _49=r+_48; //assign %8 = %49 : int // isCopyEliminated = true r = _49; //.blklab8 blklab8:; } //.blklab7 blklab7:; //.blklab0 blklab0:; //return %0 _DEALLOC(_3); _DEALLOC(lhs); _DEALLOC(rhs); _DEALLOC(_15); _DEALLOC(_16); _DEALLOC(_18); _DEALLOC(_19); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(items); return items; //return }
int main(int argc, char** args){ int64_t* max; _DECL_DEALLOC(max); int64_t n = 0; _DECL_1DARRAY(moves); _DECL_DEALLOC(moves); int64_t sum_alice = 0; int64_t* _5; _DECL_DEALLOC(_5); _DECL_2DARRAY(_6); _DECL_DEALLOC(_6); int64_t _7 = 0; _DECL_1DARRAY(_8); _DECL_DEALLOC(_8); int64_t _9 = 0; int64_t _10 = 0; int64_t _11 = 0; int64_t _12 = 0; int64_t _13 = 0; int64_t _14 = 0; _DECL_1DARRAY(_15); _DECL_DEALLOC(_15); _DECL_1DARRAY(_16); _DECL_DEALLOC(_16); int64_t _17 = 0; int64_t _18 = 0; int64_t _19 = 0; void* _20; _DECL_1DARRAY(_22); _DECL_DEALLOC(_22); void* _23; void* _25; _DECL_1DARRAY(_27); _DECL_DEALLOC(_27); //fieldload %6 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _DEALLOC_2DARRAY_int64_t(_6); _CONV_ARGS(_6); _ADD_DEALLOC(_6); //const %7 = 0 : int _7 = 0; //indexof %8 = %6, %7 : int[][] _8=_6[_7]; _8_size = _6_size_size; _REMOVE_DEALLOC(_8); //invoke (%5) = (%8) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int) { _STR_TO_INT(_5, _8); _ADD_DEALLOC(_5); _REMOVE_DEALLOC(_8); } //assign %1 = %5 : null|int _DEALLOC(max); // isCopyEliminated = true max = _5; _TRANSFER_DEALLOC(max, _5); //ifis %1, null goto blklab4 : null|int if(max == NULL) { goto blklab4;} //assign %2 = %1 : int // isCopyEliminated = true n = *max; //const %9 = 0 : int _9 = 0; //const %10 = 2 : int _10 = 2; //add %11 = %2, %10 : int _11=n+_10; //const %12 = 2 : int _12 = 2; //add %13 = %2, %12 : int _13=n+_12; //mul %14 = %11, %13 : int _14=_11*_13; //arraygen %15 = [9; 14] : int[] _DEALLOC(_15); _NEW_1DARRAY_int64_t(_15, _14, _9); _ADD_DEALLOC(_15); //assign %3 = %15 : int[] _DEALLOC(moves); // isCopyEliminated = true _UPDATE_1DARRAY(moves, _15); _TRANSFER_DEALLOC(moves, _15); //invoke (%16) = (%3, %2) CoinGame_original:findMoves : function(int[],int)->(int[]) { _DEALLOC(_16); // isCopyEliminated of '_3' = true _16 = _findMoves_(_1DARRAY_PARAM(moves), false, n, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_16)); _RESET_DEALLOC(moves, "true-true-false" , "findMoves"); _ADD_DEALLOC(_16); } //assign %3 = %16 : int[] _DEALLOC(moves); // isCopyEliminated = true _UPDATE_1DARRAY(moves, _16); _TRANSFER_DEALLOC(moves, _16); //const %17 = 1 : int _17 = 1; //sub %18 = %2, %17 : int _18=n-_17; //indexof %19 = %3, %18 : int[] _19=moves[_18]; //assign %4 = %19 : int // isCopyEliminated = true sum_alice = _19; //fieldload %20 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %21 = %20 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %22 = [84,104,101,32,116,111,116,97,108,32,97,109,111,117,110,116,32,111,102,32,109,111,110,101,121,32,40,109,97,120,105,109,117,109,41,32,65,108,105,99,101,32,103,101,116,115,32,105,115,32] : int[] _DEALLOC(_22); _NEW_1DARRAY_int64_t(_22, 50, 0); _22[0] = 84; _22[1] = 104; _22[2] = 101; _22[3] = 32; _22[4] = 116; _22[5] = 111; _22[6] = 116; _22[7] = 97; _22[8] = 108; _22[9] = 32; _22[10] = 97; _22[11] = 109; _22[12] = 111; _22[13] = 117; _22[14] = 110; _22[15] = 116; _22[16] = 32; _22[17] = 111; _22[18] = 102; _22[19] = 32; _22[20] = 109; _22[21] = 111; _22[22] = 110; _22[23] = 101; _22[24] = 121; _22[25] = 32; _22[26] = 40; _22[27] = 109; _22[28] = 97; _22[29] = 120; _22[30] = 105; _22[31] = 109; _22[32] = 117; _22[33] = 109; _22[34] = 41; _22[35] = 32; _22[36] = 65; _22[37] = 108; _22[38] = 105; _22[39] = 99; _22[40] = 101; _22[41] = 32; _22[42] = 103; _22[43] = 101; _22[44] = 116; _22[45] = 115; _22[46] = 32; _22[47] = 105; _22[48] = 115; _22[49] = 32; _ADD_DEALLOC(_22); //indirectinvoke () = %21 (%22) : method(int[])->() { printf_s(_1DARRAY_PARAM(_22)); } //fieldload %23 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %24 = %23 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //indirectinvoke () = %24 (%4) : method(any)->() { printf("%"PRId64"\n", sum_alice); } //fieldload %25 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %26 = %25 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %27 = [80,97,115,115,32,67,111,105,110,71,97,109,101,32,116,101,115,116,32,99,97,115,101] : int[] _DEALLOC(_27); _NEW_1DARRAY_int64_t(_27, 23, 0); _27[0] = 80; _27[1] = 97; _27[2] = 115; _27[3] = 115; _27[4] = 32; _27[5] = 67; _27[6] = 111; _27[7] = 105; _27[8] = 110; _27[9] = 71; _27[10] = 97; _27[11] = 109; _27[12] = 101; _27[13] = 32; _27[14] = 116; _27[15] = 101; _27[16] = 115; _27[17] = 116; _27[18] = 32; _27[19] = 99; _27[20] = 97; _27[21] = 115; _27[22] = 101; _ADD_DEALLOC(_27); //indirectinvoke () = %26 (%27) : method(int[])->() { println_s(_27, _27_size); } //.blklab4 blklab4:; //return _DEALLOC(max); _DEALLOC(moves); _DEALLOC(_5); _DEALLOC_2DARRAY_int64_t(_6); _DEALLOC(_8); _DEALLOC(_15); _DEALLOC(_16); _DEALLOC(_22); _DEALLOC(_27); exit(0); }
int main(int argc, char** args){ int64_t* n; _DECL_DEALLOC(n); int64_t max = 0; _DECL_1DARRAY_BYTE(data); _DECL_DEALLOC(data); _DECL_1DARRAY_BYTE(arr); _DECL_DEALLOC(arr); int64_t* _5; _DECL_DEALLOC(_5); _DECL_2DARRAY(_6); _DECL_DEALLOC(_6); int64_t _7 = 0; _DECL_1DARRAY(_8); _DECL_DEALLOC(_8); BYTE _9; _DECL_1DARRAY_BYTE(_10); _DECL_DEALLOC(_10); _DECL_1DARRAY_BYTE(_11); _DECL_DEALLOC(_11); int64_t _12 = 0; int64_t _13 = 0; int64_t _14 = 0; int64_t _15 = 0; void* _16; int64_t _18 = 0; //fieldload %6 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _DEALLOC_2DARRAY_int64_t(_6); _CONV_ARGS(_6); _ADD_DEALLOC(_6); //const %7 = 0 : int _7 = 0; //indexof %8 = %6, %7 : int[][] _8=_6[_7]; _8_size = _6_size_size; _REMOVE_DEALLOC(_8); //invoke (%5) = (%8) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int) { _STR_TO_INT(_5, _8); _ADD_DEALLOC(_5); _REMOVE_DEALLOC(_8); } //assign %1 = %5 : null|int _DEALLOC(n); n = _5; _TRANSFER_DEALLOC(n, _5); //ifis %1, null goto blklab9 : null|int if(n == NULL) { goto blklab9;} //assign %2 = %1 : int max = *n; //const %9 = 01100001b : byte _9 = 0b01100001; //arraygen %10 = [9; 2] : byte[] _DEALLOC(_10); _NEW_1DARRAY_BYTE(_10, max, _9); _ADD_DEALLOC(_10); //assign %3 = %10 : byte[] _DEALLOC(data); _UPDATE_1DARRAY(data, _10); _TRANSFER_DEALLOC(data, _10); //invoke (%11) = (%3) AppendArrayPattern_original:comp : function(byte[])->(byte[]) { _DEALLOC(_11); _11 = _comp_(_1DARRAY_PARAM(data), false, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_11)); _RETAIN_DEALLOC(data, "false-false-false" , "comp"); _ADD_DEALLOC(_11); } //assign %4 = %11 : byte[] _DEALLOC(arr); _UPDATE_1DARRAY(arr, _11); _TRANSFER_DEALLOC(arr, _11); //assert { //lengthof %12 = %4 : byte[] _12 = arr_size; //const %13 = 2 : int _13 = 2; //lengthof %14 = %3 : byte[] _14 = data_size; //mul %15 = %13, %14 : int _15=_13*_14; //ifeq %12, %15 goto blklab10 : int if(_12==_15){goto blklab10;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab10 blklab10:; //assert } //fieldload %16 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %17 = %16 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //lengthof %18 = %4 : byte[] _18 = arr_size; //indirectinvoke () = %17 (%18) : method(any)->() { printf("%"PRId64, _18); } //.blklab9 blklab9:; //return _DEALLOC(n); _DEALLOC(data); _DEALLOC(arr); _DEALLOC(_5); _DEALLOC_2DARRAY_int64_t(_6); _DEALLOC(_8); _DEALLOC(_10); _DEALLOC(_11); exit(0); }
BYTE* _comp_(BYTE* data, size_t data_size, _DECL_DEALLOC_PARAM(data), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY_BYTE(output); _DECL_DEALLOC(output); int64_t pos = 0; BYTE item; BYTE length; int64_t _5 = 0; BYTE _6; int64_t _7 = 0; _DECL_1DARRAY_BYTE(_8); _DECL_DEALLOC(_8); int64_t _9 = 0; BYTE _10; BYTE _11; int64_t _12 = 0; int64_t _13 = 0; _DECL_1DARRAY_BYTE(_14); _DECL_DEALLOC(_14); _DECL_1DARRAY_BYTE(_15); _DECL_DEALLOC(_15); //const %5 = 0 : int _5 = 0; //assign %2 = %5 : int pos = _5; //const %6 = 00000000b : byte _6 = 0b00000000; //const %7 = 0 : int _7 = 0; //arraygen %8 = [6; 7] : byte[] _DEALLOC(_8); _NEW_1DARRAY_BYTE(_8, _7, _6); _ADD_DEALLOC(_8); //assign %1 = %8 : byte[] _DEALLOC(output); _UPDATE_1DARRAY(output, _8); _TRANSFER_DEALLOC(output, _8); //loop (%1, %2, %3, %4, %9, %10, %11, %12, %13, %14, %15) while(true){ //lengthof %9 = %0 : byte[] _9 = data_size; //ifge %2, %9 goto blklab7 : int if(pos>=_9){goto blklab7;} //indexof %10 = %0, %2 : byte[] _10=data[pos]; //assign %3 = %10 : byte item = _10; //invoke (%11) = (%2) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte) { _11 = (BYTE)pos; } //assign %4 = %11 : byte length = _11; //const %12 = 1 : int _12 = 1; //add %13 = %2, %12 : int _13=pos+_12; //assign %2 = %13 : int pos = _13; //invoke (%14) = (%1, %4) AppendArrayPattern_original:append : function(byte[],byte)->(byte[]) { _DEALLOC(_14); _14 = _append_(_1DARRAY_PARAM(output), false, length, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_14)); _RETAIN_DEALLOC(output, "false-false-false" , "append"); _ADD_DEALLOC(_14); } //assign %1 = %14 : byte[] _DEALLOC(output); _UPDATE_1DARRAY(output, _14); _TRANSFER_DEALLOC(output, _14); //invoke (%15) = (%1, %3) AppendArrayPattern_original:append : function(byte[],byte)->(byte[]) { _DEALLOC(_15); _15 = _append_(_1DARRAY_PARAM(output), false, item, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_15)); _RETAIN_DEALLOC(output, "false-false-false" , "append"); _ADD_DEALLOC(_15); } //assign %1 = %15 : byte[] _DEALLOC(output); _UPDATE_1DARRAY(output, _15); _TRANSFER_DEALLOC(output, _15); //.blklab8 blklab8:; } //.blklab7 blklab7:; //return %1 _DEALLOC(data); _DEALLOC(_8); _DEALLOC(_14); _DEALLOC(_15); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output); return output; //return }
BYTE* _comp_(BYTE* data, size_t data_size, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY_BYTE(output); int64_t pos = 0; BYTE item; BYTE length; int64_t _5 = 0; BYTE _6; int64_t _7 = 0; _DECL_1DARRAY_BYTE(_8); int64_t _9 = 0; BYTE _10; BYTE _11; int64_t _12 = 0; int64_t _13 = 0; _DECL_1DARRAY_BYTE(_14); _DECL_1DARRAY_BYTE(_15); int64_t _16 = 0; int64_t _17 = 0; int64_t _18 = 0; int64_t _19 = 0; int64_t _20 = 0; int64_t _21 = 0; int64_t _22 = 0; int64_t _23 = 0; int64_t _24 = 0; _DECL_1DARRAY_BYTE(_25); //const %5 = 0 : int _5 = 0; //assign %2 = %5 : int pos = _5; //const %6 = 00000000b : byte _6 = 0b00000000; //const %7 = 0 : int _7 = 0; //const %16 = 2 : int _16 = 2; //lengthof %17 = %0 : byte[] _17 = data_size; //mul %18 = %16, %17 : int _18=_16*_17; //arraygen %8 = [6; 18] : byte[] _NEW_1DARRAY_BYTE(_8, _18, _6); //const %19 = 0 : int _19 = 0; //assign %20 = %19 : int _20 = _19; //assign %1 = %8 : byte[] _UPDATE_1DARRAY(output, _8); //loop (%1, %2, %3, %4, %9, %10, %11, %12, %13, %14, %15, %20) while(true){ //lengthof %9 = %0 : byte[] _9 = data_size; //ifge %2, %9 goto blklab7 : int if(pos>=_9){goto blklab7;} //indexof %10 = %0, %2 : byte[] _10=data[pos]; //assign %3 = %10 : byte item = _10; //invoke (%11) = (%2) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte) { _11 = (BYTE)pos; } //assign %4 = %11 : byte length = _11; //const %12 = 1 : int _12 = 1; //add %13 = %2, %12 : int _13=pos+_12; //assign %2 = %13 : int pos = _13; //update %1[%20] = %4 : byte[] -> byte[] output[_20] = length; //const %21 = 1 : int _21 = 1; //add %22 = %20, %21 : int _22=_20+_21; //assign %20 = %22 : int _20 = _22; //update %1[%20] = %3 : byte[] -> byte[] output[_20] = item; //const %23 = 1 : int _23 = 1; //add %24 = %20, %23 : int _24=_20+_23; //assign %20 = %24 : int _20 = _24; //.blklab8 blklab8:; } //.blklab7 blklab7:; //assert { //ifle %20, %18 goto blklab11 : int if(_20<=_18){goto blklab11;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab11 blklab11:; //assert } //invoke (%25) = (%1, %20) AppendArrayPattern_original:resize : function(byte[],int)->(byte[]) { _25 = _resize_(_1DARRAY_PARAM(output), _20, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_25)); } //assign %1 = %25 : byte[] _UPDATE_1DARRAY(output, _25); //return %1 _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output); return output; //return }