int main(int argc, char** args){ int64_t size; int64_t width; int64_t height; _DECL_1DARRAY(A); _DECL_1DARRAY(B); _DECL_1DARRAY(C); int64_t _7; void* _8; _DECL_1DARRAY(_10); void* _11; int64_t _13; int64_t _14; _DECL_1DARRAY(_15); _DECL_1DARRAY(_16); int64_t _17; int64_t _18; _DECL_1DARRAY(_19); _DECL_1DARRAY(_20); int64_t _21; int64_t _22; _DECL_1DARRAY(_23); _DECL_1DARRAY(_24); int64_t _25; int64_t _26; int64_t _27; int64_t _28; int64_t _29; int64_t _30; int64_t _31; int64_t _32; int64_t _33; int64_t _34; int64_t _35; int64_t _36; int64_t _37; int64_t _38; int64_t _39; int64_t _40; int64_t _41; int64_t _42; int64_t _43; int64_t _44; int64_t _45; void* _46; _DECL_1DARRAY(_48); void* _49; int64_t _51; int64_t _52; int64_t _53; int64_t _54; int64_t _55; int64_t _56; int64_t _57; void* _58; _DECL_1DARRAY(_60); //const %7 = 20 : int _7 = 20; //assign %1 = %7 : int // isCopyEliminated = true size = _7; //assign %2 = %1 : int // isCopyEliminated = false width = size; //assign %3 = %1 : int // isCopyEliminated = false height = size; //fieldload %8 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %9 = %8 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %10 = [115,105,122,101,32,61,32] : int[] _NEW_1DARRAY_int64_t(_10, 7, 0); _10[0] = 115; _10[1] = 105; _10[2] = 122; _10[3] = 101; _10[4] = 32; _10[5] = 61; _10[6] = 32; //indirectinvoke () = %9 (%10) : method(int[])->() { printf_s(_10, _10_size); } //fieldload %11 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %12 = %11 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //indirectinvoke () = %12 (%1) : method(any)->() { printf("%"PRId64"\n", size); } //const %13 = 0 : int _13 = 0; //mul %14 = %2, %3 : int _14=width*height; //arraygen %15 = [13; 14] : int[] _NEW_1DARRAY_int64_t(_15, _14, _13); //assign %4 = %15 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(A, _15); //invoke (%16) = (%4, %2, %3) MatrixMult:init : function(int[],int,int)->(int[]) { // isCopyEliminated of 'A at 0' = true _16 = _init_(A, A_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_16)); } //assign %4 = %16 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(A, _16); //const %17 = 0 : int _17 = 0; //mul %18 = %2, %3 : int _18=width*height; //arraygen %19 = [17; 18] : int[] _NEW_1DARRAY_int64_t(_19, _18, _17); //assign %5 = %19 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(B, _19); //invoke (%20) = (%5, %2, %3) MatrixMult:init : function(int[],int,int)->(int[]) { // isCopyEliminated of 'B at 0' = true _20 = _init_(B, B_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_20)); } //assign %5 = %20 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(B, _20); //const %21 = 0 : int _21 = 0; //mul %22 = %2, %3 : int _22=width*height; //arraygen %23 = [21; 22] : int[] _NEW_1DARRAY_int64_t(_23, _22, _21); //assign %6 = %23 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(C, _23); //invoke (%24) = (%4, %5, %6, %2, %3) MatrixMult:mat_mult : function(int[],int[],int[],int,int)->(int[]) { // isCopyEliminated of 'A at 0' = true // isCopyEliminated of 'B at 1' = true // isCopyEliminated of 'C at 2' = true _24 = _mat_mult_(A, A_size, B, B_size, C, C_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_24)); } //assign %6 = %24 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(C, _24); //assert { //const %25 = 19 : int _25 = 19; //const %26 = 20 : int _26 = 20; //mul %27 = %25, %26 : int _27=_25*_26; //const %28 = 19 : int _28 = 19; //add %29 = %27, %28 : int _29=_27+_28; //indexof %30 = %4, %29 : int[] _30=A[_29]; //const %31 = 19 : int _31 = 19; //ifeq %30, %31 goto blklab10 : int if(_30==_31){goto blklab10;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab10 blklab10:; //assert } //assert { //const %32 = 19 : int _32 = 19; //const %33 = 20 : int _33 = 20; //mul %34 = %32, %33 : int _34=_32*_33; //const %35 = 19 : int _35 = 19; //add %36 = %34, %35 : int _36=_34+_35; //indexof %37 = %5, %36 : int[] _37=B[_36]; //const %38 = 19 : int _38 = 19; //ifeq %37, %38 goto blklab11 : int if(_37==_38){goto blklab11;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab11 blklab11:; //assert } //assert { //const %39 = 19 : int _39 = 19; //const %40 = 20 : int _40 = 20; //mul %41 = %39, %40 : int _41=_39*_40; //const %42 = 19 : int _42 = 19; //add %43 = %41, %42 : int _43=_41+_42; //indexof %44 = %6, %43 : int[] _44=C[_43]; //const %45 = 3610 : int _45 = 3610; //ifeq %44, %45 goto blklab12 : int if(_44==_45){goto blklab12;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab12 blklab12:; //assert } //fieldload %46 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %47 = %46 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %48 = [77,97,116,114,105,120,32,67,91,115,105,122,101,45,49,93,91,115,105,122,101,45,49,93,32,61,32] : int[] _NEW_1DARRAY_int64_t(_48, 27, 0); _48[0] = 77; _48[1] = 97; _48[2] = 116; _48[3] = 114; _48[4] = 105; _48[5] = 120; _48[6] = 32; _48[7] = 67; _48[8] = 91; _48[9] = 115; _48[10] = 105; _48[11] = 122; _48[12] = 101; _48[13] = 45; _48[14] = 49; _48[15] = 93; _48[16] = 91; _48[17] = 115; _48[18] = 105; _48[19] = 122; _48[20] = 101; _48[21] = 45; _48[22] = 49; _48[23] = 93; _48[24] = 32; _48[25] = 61; _48[26] = 32; //indirectinvoke () = %47 (%48) : method(int[])->() { printf_s(_48, _48_size); } //fieldload %49 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %50 = %49 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %51 = 1 : int _51 = 1; //sub %52 = %1, %51 : int _52=size-_51; //mul %53 = %52, %1 : int _53=_52*size; //add %54 = %53, %1 : int _54=_53+size; //const %55 = 1 : int _55 = 1; //sub %56 = %54, %55 : int _56=_54-_55; //indexof %57 = %6, %56 : int[] _57=C[_56]; //indirectinvoke () = %50 (%57) : method(any)->() { printf("%"PRId64"\n", _57); } //fieldload %58 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %59 = %58 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %60 = [80,97,115,115,32,77,97,116,114,105,120,77,117,108,116,32,116,101,115,116,32,99,97,115,101] : int[] _NEW_1DARRAY_int64_t(_60, 25, 0); _60[0] = 80; _60[1] = 97; _60[2] = 115; _60[3] = 115; _60[4] = 32; _60[5] = 77; _60[6] = 97; _60[7] = 116; _60[8] = 114; _60[9] = 105; _60[10] = 120; _60[11] = 77; _60[12] = 117; _60[13] = 108; _60[14] = 116; _60[15] = 32; _60[16] = 116; _60[17] = 101; _60[18] = 115; _60[19] = 116; _60[20] = 32; _60[21] = 99; _60[22] = 97; _60[23] = 115; _60[24] = 101; //indirectinvoke () = %59 (%60) : method(int[])->() { println_s(_60, _60_size); } //return exit(0); }
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){ int* n; _DECL_DEALLOC(n); int width; int height; int size; _DECL_1DARRAY_BYTE(pixels); _DECL_DEALLOC(pixels); int i; _DECL_1DARRAY_BYTE(newPixels); _DECL_DEALLOC(newPixels); int* _8; _DECL_DEALLOC(_8); _DECL_2DARRAY(_9); _DECL_DEALLOC(_9); int _10; _DECL_1DARRAY(_11); _DECL_DEALLOC(_11); int _12; int _13; BYTE _14; _DECL_1DARRAY_BYTE(_15); _DECL_DEALLOC(_15); int _16; BYTE _17; int _18; int _19; int _20; int _21; void* _22; _DECL_1DARRAY(_24); _DECL_DEALLOC(_24); void* _25; int _27; BYTE _28; _DECL_1DARRAY_BYTE(_29); _DECL_DEALLOC(_29); void* _30; _DECL_1DARRAY(_32); _DECL_DEALLOC(_32); void* _33; int _35; void* _36; _DECL_1DARRAY(_38); _DECL_DEALLOC(_38); void* _39; _DECL_1DARRAY(_41); _DECL_DEALLOC(_41); void* _42; int _44; BYTE _45; //fieldload %9 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _DEALLOC_2DARRAY_int64_t(_9); _CONV_ARGS(_9); _ADD_DEALLOC(_9); //const %10 = 0 : int _10 = 0; //indexof %11 = %9, %10 : int[][] _11=_9[_10]; _11_size = _9_size_size; _REMOVE_DEALLOC(_11); //invoke (%8) = (%11) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int) { _STR_TO_INT(_8, _11); _ADD_DEALLOC(_8); _REMOVE_DEALLOC(_11); } //assign %1 = %8 : null|int _DEALLOC(n); // isCopyEliminated = true n = _8; _TRANSFER_DEALLOC(n, _8); //ifis %1, null goto blklab19 : null|int if(n == NULL) { goto blklab19;} //const %12 = 2000 : int _12 = 2000; //assign %2 = %12 : int // isCopyEliminated = true width = _12; //assign %3 = %1 : int // isCopyEliminated = true height = *n; //mul %13 = %2, %3 : int _13=width*height; //assign %4 = %13 : int // isCopyEliminated = true size = _13; //const %14 = 00100000b : byte _14 = 0b00100000; //arraygen %15 = [14; 4] : byte[] _DEALLOC(_15); _NEW_1DARRAY_BYTE(_15, size, _14); _ADD_DEALLOC(_15); //assign %5 = %15 : byte[] _DEALLOC(pixels); // isCopyEliminated = true _UPDATE_1DARRAY(pixels, _15); _TRANSFER_DEALLOC(pixels, _15); //const %16 = 0 : int _16 = 0; //assign %6 = %16 : int // isCopyEliminated = true i = _16; //loop (%5, %6, %17, %18, %19, %20, %21) while(true){ //ifge %6, %4 goto blklab20 : int if(i>=size){goto blklab20;} //const %18 = 256 : int _18 = 256; //rem %19 = %6, %18 : int _19=i%_18; //invoke (%17) = (%19) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte) { _17 = (BYTE)_19; } //update %5[%6] = %17 : byte[] -> byte[] pixels[i] = _17; //const %20 = 1 : int _20 = 1; //add %21 = %6, %20 : int _21=i+_20; //assign %6 = %21 : int // isCopyEliminated = true i = _21; //.blklab21 blklab21:; } //.blklab20 blklab20:; //fieldload %22 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %23 = %22 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %24 = [112,105,120,101,108,115,91,49,48,48,48,93,61] : int[] _DEALLOC(_24); _NEW_1DARRAY_int64_t(_24, 13, 0); _24[0] = 112; _24[1] = 105; _24[2] = 120; _24[3] = 101; _24[4] = 108; _24[5] = 115; _24[6] = 91; _24[7] = 49; _24[8] = 48; _24[9] = 48; _24[10] = 48; _24[11] = 93; _24[12] = 61; _ADD_DEALLOC(_24); //indirectinvoke () = %23 (%24) : method(int[])->() { printf_s(_24, _24_size); } //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 : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %27 = 1000 : int _27 = 1000; //indexof %28 = %5, %27 : byte[] _28=pixels[_27]; //indirectinvoke () = %26 (%28) : method(any)->() { printf("%"PRIu8"\n", _28); } //invoke (%29) = (%5, %2, %3) SobelEdge_large:sobelEdgeDetection : function(byte[],int,int)->(byte[]) { _DEALLOC(_29); // isCopyEliminated of '_5' = true _29 = _sobelEdgeDetection_(pixels, pixels_size, false, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_29)); _RETAIN_DEALLOC(pixels, "false-false-false" , "sobelEdgeDetection"); _RETAIN_DEALLOC_POST(_29, pixels); } //assign %7 = %29 : byte[] _DEALLOC(newPixels); // isCopyEliminated = true _UPDATE_1DARRAY(newPixels, _29); _TRANSFER_DEALLOC(newPixels, _29); //fieldload %30 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %31 = %30 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %32 = [66,108,117,114,114,101,100,32,73,109,97,103,101,32,115,105,122,101,115,58,32,32,32] : int[] _DEALLOC(_32); _NEW_1DARRAY_int64_t(_32, 23, 0); _32[0] = 66; _32[1] = 108; _32[2] = 117; _32[3] = 114; _32[4] = 114; _32[5] = 101; _32[6] = 100; _32[7] = 32; _32[8] = 73; _32[9] = 109; _32[10] = 97; _32[11] = 103; _32[12] = 101; _32[13] = 32; _32[14] = 115; _32[15] = 105; _32[16] = 122; _32[17] = 101; _32[18] = 115; _32[19] = 58; _32[20] = 32; _32[21] = 32; _32[22] = 32; _ADD_DEALLOC(_32); //indirectinvoke () = %31 (%32) : method(int[])->() { println_s(_32, _32_size); } //fieldload %33 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %34 = %33 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //lengthof %35 = %7 : byte[] _35 = newPixels_size; //indirectinvoke () = %34 (%35) : method(any)->() { printf("%d", _35); } //fieldload %36 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %37 = %36 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %38 = [32,98,121,116,101,115] : int[] _DEALLOC(_38); _NEW_1DARRAY_int64_t(_38, 6, 0); _38[0] = 32; _38[1] = 98; _38[2] = 121; _38[3] = 116; _38[4] = 101; _38[5] = 115; _ADD_DEALLOC(_38); //indirectinvoke () = %37 (%38) : method(int[])->() { println_s(_38, _38_size); } //fieldload %39 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %40 = %39 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %41 = [110,101,119,80,105,120,101,108,115,91,49,48,48,48,93,61] : int[] _DEALLOC(_41); _NEW_1DARRAY_int64_t(_41, 16, 0); _41[0] = 110; _41[1] = 101; _41[2] = 119; _41[3] = 80; _41[4] = 105; _41[5] = 120; _41[6] = 101; _41[7] = 108; _41[8] = 115; _41[9] = 91; _41[10] = 49; _41[11] = 48; _41[12] = 48; _41[13] = 48; _41[14] = 93; _41[15] = 61; _ADD_DEALLOC(_41); //indirectinvoke () = %40 (%41) : method(int[])->() { printf_s(_41, _41_size); } //fieldload %42 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %43 = %42 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %44 = 1000 : int _44 = 1000; //indexof %45 = %7, %44 : byte[] _45=newPixels[_44]; //indirectinvoke () = %43 (%45) : method(any)->() { printf("%d", _45); } //.blklab19 blklab19:; //return _DEALLOC(n); _DEALLOC(pixels); _DEALLOC(newPixels); _DEALLOC(_8); _FREE_ARGS(_9); _DEALLOC(_11); _DEALLOC(_15); _DEALLOC(_24); _DEALLOC(_29); _DEALLOC(_32); _DEALLOC(_38); _DEALLOC(_41); exit(0); }
int main(int argc, char** args){ _DECL_1DARRAY(x); _DECL_1DARRAY(tmp); int64_t _3; int64_t _4; _DECL_1DARRAY(_5); _DECL_1DARRAY(_6); int64_t _7; int64_t _8; int64_t _9; int64_t _10; void* _11; _DECL_1DARRAY(_13); void* _14; int64_t _16; int64_t _17; //const %3 = 2 : int _3 = 2; //const %4 = 3 : int _4 = 3; //arraygen %5 = [3; 4] : int[] _NEW_1DARRAY_int64_t(_5, _4, _3); //assign %1 = %5 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(x, _5); //const %7 = 11 : int _7 = 11; //invoke (%6) = (%1, %7) ResetMacro1:func : function(int[],int)->(int[]) { // isCopyEliminated of 'x at 0' = true _6 = _func_(x, x_size, _7, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_6)); } //assign %2 = %6 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(tmp, _6); //assign %1 = %2 : int[] // isCopyEliminated = true _UPDATE_1DARRAY(x, tmp); //assert { //const %8 = 0 : int _8 = 0; //indexof %9 = %1, %8 : int[] _9=x[_8]; //const %10 = 11 : int _10 = 11; //ifeq %9, %10 goto blklab0 : int if(_9==_10){goto blklab0;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab0 blklab0:; //assert } //fieldload %11 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %12 = %11 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %13 = [120,91,48,93,32,61,32] : int[] _NEW_1DARRAY_int64_t(_13, 7, 0); _13[0] = 120; _13[1] = 91; _13[2] = 48; _13[3] = 93; _13[4] = 32; _13[5] = 61; _13[6] = 32; //indirectinvoke () = %12 (%13) : method(int[])->() { printf_s(_13, _13_size); } //fieldload %14 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %15 = %14 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %16 = 0 : int _16 = 0; //indexof %17 = %1, %16 : int[] _17=x[_16]; //indirectinvoke () = %15 (%17) : method(any)->() { printf("%"PRId64"\n", _17); } //return exit(0); }
int main(int argc, char** args){ int64_t* n; FILE* file; int64_t width; int64_t height; _DECL_1DARRAY_BYTE(pixels); _DECL_1DARRAY_BYTE(newPixels); int64_t* _7; _DECL_2DARRAY(_8); int64_t _9; _DECL_1DARRAY(_10); void* _11; _DECL_2DARRAY(_12); int64_t _13; _DECL_1DARRAY(_14); int64_t _15; _DECL_1DARRAY_BYTE(_16); _DECL_1DARRAY_BYTE(_18); void* _19; _DECL_1DARRAY(_21); void* _22; int64_t _24; void* _25; _DECL_1DARRAY(_27); //fieldload %8 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _CONV_ARGS(_8); //const %9 = 0 : int _9 = 0; //indexof %10 = %8, %9 : int[][] _10=_8[_9]; _10_size = _8_size_size; //invoke (%7) = (%10) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int) { _STR_TO_INT(_7, _10); } //assign %1 = %7 : null|int // isCopyEliminated = true n = _7; //fieldload %12 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _CONV_ARGS(_12); //const %13 = 1 : int _13 = 1; //indexof %14 = %12, %13 : int[][] _14=_12[_13]; _14_size = _12_size_size; //invoke (%11) = (%14) whiley/io/File:Reader : method(whiley/lang/ASCII:string)->(whiley/io/File:Reader) { _11 = Reader(_14, _14_size); } //assign %2 = %11 : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll} // isCopyEliminated = true file = _11; //ifis %1, null goto blklab19 : null|int if(n == NULL) { goto blklab19;} //const %15 = 64 : int _15 = 64; //assign %3 = %15 : int // isCopyEliminated = true width = _15; //assign %4 = %1 : int // isCopyEliminated = true height = *n; //fieldload %17 = %2 readAll : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll} //indirectinvoke (%16) = %17 () : method()->(byte[]) { _16 = readAll(file, &_16_size); } //assign %5 = %16 : byte[] // isCopyEliminated = true _UPDATE_1DARRAY(pixels, _16); //invoke (%18) = (%5, %3, %4) SobelEdge_small:sobelEdgeDetection : function(byte[],int,int)->(byte[]) { // isCopyEliminated of '_5' = true _18 = _sobelEdgeDetection_(pixels, pixels_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_18)); } //assign %6 = %18 : byte[] // isCopyEliminated = true _UPDATE_1DARRAY(newPixels, _18); //fieldload %19 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %20 = %19 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %21 = [66,108,117,114,114,101,100,32,73,109,97,103,101,32,115,105,122,101,115,58,32,32,32] : int[] _NEW_1DARRAY_int64_t(_21, 23, 0); _21[0] = 66; _21[1] = 108; _21[2] = 117; _21[3] = 114; _21[4] = 114; _21[5] = 101; _21[6] = 100; _21[7] = 32; _21[8] = 73; _21[9] = 109; _21[10] = 97; _21[11] = 103; _21[12] = 101; _21[13] = 32; _21[14] = 115; _21[15] = 105; _21[16] = 122; _21[17] = 101; _21[18] = 115; _21[19] = 58; _21[20] = 32; _21[21] = 32; _21[22] = 32; //indirectinvoke () = %20 (%21) : method(int[])->() { println_s(_21, _21_size); } //fieldload %22 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %23 = %22 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //lengthof %24 = %6 : byte[] _24 = newPixels_size; //indirectinvoke () = %23 (%24) : method(any)->() { printf("%"PRId64, _24); } //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 = [32,98,121,116,101,115] : int[] _NEW_1DARRAY_int64_t(_27, 6, 0); _27[0] = 32; _27[1] = 98; _27[2] = 121; _27[3] = 116; _27[4] = 101; _27[5] = 115; //indirectinvoke () = %26 (%27) : method(int[])->() { println_s(_27, _27_size); } //.blklab19 blklab19:; //return exit(0); }
BYTE* _sobelEdgeDetection_(BYTE* pixels, size_t pixels_size, _DECL_DEALLOC_PARAM(pixels), int width, int height, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY_BYTE(_3); _DECL_DEALLOC(_3); int size; _DECL_1DARRAY_BYTE(newPixels); _DECL_DEALLOC(newPixels); _DECL_1DARRAY(v_sobel); _DECL_DEALLOC(v_sobel); _DECL_1DARRAY(h_sobel); _DECL_DEALLOC(h_sobel); int x; int y; int pos; int v_g; int h_g; int t_g; int _14; BYTE _15; _DECL_1DARRAY_BYTE(_16); _DECL_DEALLOC(_16); int _17; int _18; int _19; int _20; int _21; int _22; int _23; int _24; int _25; int _26; int _27; int _28; _DECL_1DARRAY(_29); _DECL_DEALLOC(_29); int _30; int _31; int _32; int _33; int _34; int _35; int _36; int _37; int _38; int _39; int _40; int _41; _DECL_1DARRAY(_42); _DECL_DEALLOC(_42); int _43; int _44; int _45; int _46; int _47; int _48; int _49; int _50; int _51; int _52; BYTE _53; int _54; int _55; int _56; int _57; //mul %14 = %1, %2 : int _14=width*height; //assign %4 = %14 : int // isCopyEliminated = true size = _14; //const %15 = 00100000b : byte _15 = 0b00100000; //arraygen %16 = [15; 4] : byte[] _DEALLOC(_16); _NEW_1DARRAY_BYTE(_16, size, _15); _ADD_DEALLOC(_16); //assign %5 = %16 : byte[] _DEALLOC(newPixels); // isCopyEliminated = true _UPDATE_1DARRAY(newPixels, _16); _TRANSFER_DEALLOC(newPixels, _16); //const %17 = 1 : int _17 = 1; //neg %18 = %17 : int _18= -_17; //const %19 = 0 : int _19 = 0; //const %20 = 1 : int _20 = 1; //const %21 = 2 : int _21 = 2; //neg %22 = %21 : int _22= -_21; //const %23 = 0 : int _23 = 0; //const %24 = 2 : int _24 = 2; //const %25 = 1 : int _25 = 1; //neg %26 = %25 : int _26= -_25; //const %27 = 0 : int _27 = 0; //const %28 = 1 : int _28 = 1; //newlist %29 = (%18, %19, %20, %22, %23, %24, %26, %27, %28) : int[] _DEALLOC(_29); _NEW_1DARRAY_int64_t(_29, 9, 0); _29[0] = _18; _29[1] = _19; _29[2] = _20; _29[3] = _22; _29[4] = _23; _29[5] = _24; _29[6] = _26; _29[7] = _27; _29[8] = _28; _ADD_DEALLOC(_29); //assign %6 = %29 : int[] _DEALLOC(v_sobel); // isCopyEliminated = true _UPDATE_1DARRAY(v_sobel, _29); _TRANSFER_DEALLOC(v_sobel, _29); //const %30 = 1 : int _30 = 1; //const %31 = 2 : int _31 = 2; //const %32 = 1 : int _32 = 1; //const %33 = 0 : int _33 = 0; //const %34 = 0 : int _34 = 0; //const %35 = 0 : int _35 = 0; //const %36 = 1 : int _36 = 1; //neg %37 = %36 : int _37= -_36; //const %38 = 2 : int _38 = 2; //neg %39 = %38 : int _39= -_38; //const %40 = 1 : int _40 = 1; //neg %41 = %40 : int _41= -_40; //newlist %42 = (%30, %31, %32, %33, %34, %35, %37, %39, %41) : int[] _DEALLOC(_42); _NEW_1DARRAY_int64_t(_42, 9, 0); _42[0] = _30; _42[1] = _31; _42[2] = _32; _42[3] = _33; _42[4] = _34; _42[5] = _35; _42[6] = _37; _42[7] = _39; _42[8] = _41; _ADD_DEALLOC(_42); //assign %7 = %42 : int[] _DEALLOC(h_sobel); // isCopyEliminated = true _UPDATE_1DARRAY(h_sobel, _42); _TRANSFER_DEALLOC(h_sobel, _42); //const %43 = 0 : int _43 = 0; //assign %8 = %43 : int // isCopyEliminated = true x = _43; //loop (%5, %8, %9, %10, %11, %12, %13, %44, %45, %46, %47, %48, %49, %50, %51, %52, %53, %54, %55, %56, %57) while(true){ //ifge %8, %1 goto blklab8 : int if(x>=width){goto blklab8;} //const %44 = 0 : int _44 = 0; //assign %9 = %44 : int // isCopyEliminated = true y = _44; //loop (%5, %9, %10, %11, %12, %13, %45, %46, %47, %48, %49, %50, %51, %52, %53, %54, %55) while(true){ //ifge %9, %2 goto blklab10 : int if(y>=height){goto blklab10;} //mul %45 = %9, %1 : int _45=y*width; //add %46 = %45, %8 : int _46=_45+x; //assign %10 = %46 : int // isCopyEliminated = true pos = _46; //invoke (%47) = (%0, %1, %2, %8, %9, %6) SobelEdge_large:convolution : function(byte[],int,int,int,int,int[])->(int) { // isCopyEliminated of '_0' = true // isCopyEliminated of '_6' = true _47 = _convolution_(pixels, pixels_size, false, width, height, x, y, v_sobel, v_sobel_size, false); _RETAIN_DEALLOC(pixels, "false-false-true" , "convolution"); _RETAIN_DEALLOC(v_sobel, "false-false-true" , "convolution"); } //assign %11 = %47 : int // isCopyEliminated = true v_g = _47; //invoke (%48) = (%0, %1, %2, %8, %9, %7) SobelEdge_large:convolution : function(byte[],int,int,int,int,int[])->(int) { // isCopyEliminated of '_0' = true // isCopyEliminated of '_7' = true _48 = _convolution_(pixels, pixels_size, false, width, height, x, y, h_sobel, h_sobel_size, false); _RETAIN_DEALLOC(pixels, "false-false-true" , "convolution"); _RETAIN_DEALLOC(h_sobel, "false-false-true" , "convolution"); } //assign %12 = %48 : int // isCopyEliminated = true h_g = _48; //mul %49 = %11, %11 : int _49=v_g*v_g; //mul %50 = %12, %12 : int _50=h_g*h_g; //add %51 = %49, %50 : int _51=_49+_50; //assign %13 = %51 : int // isCopyEliminated = true t_g = _51; //const %52 = 640000 : int _52 = 640000; //ifle %13, %52 goto blklab12 : int if(t_g<=_52){goto blklab12;} //const %53 = 01100010b : byte _53 = 0b01100010; //update %5[%10] = %53 : byte[] -> byte[] newPixels[pos] = _53; //.blklab12 blklab12:; //const %54 = 1 : int _54 = 1; //add %55 = %9, %54 : int _55=y+_54; //assign %9 = %55 : int // isCopyEliminated = true y = _55; //.blklab11 blklab11:; } //.blklab10 blklab10:; //const %56 = 1 : int _56 = 1; //add %57 = %8, %56 : int _57=x+_56; //assign %8 = %57 : int // isCopyEliminated = true x = _57; //.blklab9 blklab9:; } //.blklab8 blklab8:; //return %5 _DEALLOC(pixels); _DEALLOC(_3); _DEALLOC(v_sobel); _DEALLOC(h_sobel); _DEALLOC(_16); _DEALLOC(_29); _DEALLOC(_42); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(newPixels); return newPixels; //return }
int64_t* Array_Append(_DECL_1DARRAY_PARAM(lhs), _DECL_1DARRAY_PARAM(rhs), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY(_2); _DECL_DEALLOC(_2); _DECL_1DARRAY(rs); _DECL_DEALLOC(rs); int64_t i = 0; int64_t _5 = 0; int64_t _6 = 0; int64_t _7 = 0; int64_t _8 = 0; _DECL_1DARRAY(_9); _DECL_DEALLOC(_9); int64_t _10 = 0; int64_t _11 = 0; int64_t _12 = 0; int64_t _13 = 0; int64_t _14 = 0; int64_t _15 = 0; int64_t _16 = 0; int64_t _17 = 0; int64_t _18 = 0; int64_t _19 = 0; int64_t _20 = 0; //const %5 = 0 : int _5 = 0; //lengthof %6 = %0 : int[] _6 = lhs_size; //lengthof %7 = %1 : int[] _7 = rhs_size; //add %8 = %6, %7 : int _8=_6+_7; //arraygen %9 = [5; 8] : int[] _DEALLOC(_9); _NEW_1DARRAY_int64_t(_9, _8, _5); _ADD_DEALLOC(_9); //assign %3 = %9 : int[] _DEALLOC(rs); _UPDATE_1DARRAY(rs, _9); _TRANSFER_DEALLOC(rs, _9); //lengthof %10 = %0 : int[] _10 = lhs_size; //assign %4 = %10 : int i = _10; //loop (%3, %4, %11, %12, %13, %14) while(true){ //const %11 = 0 : int _11 = 0; //ifle %4, %11 goto blklab0 : int if(i<=_11){goto blklab0;} //const %12 = 1 : int _12 = 1; //sub %13 = %4, %12 : int _13=i-_12; //assign %4 = %13 : int i = _13; //indexof %14 = %0, %4 : int[] _14=lhs[i]; //update %3[%4] = %14 : int[] -> int[] rs[i] = _14; //.blklab1 blklab1:; } //.blklab0 blklab0:; //loop (%3, %4, %15, %16, %17, %18, %19, %20) while(true){ //lengthof %15 = %1 : int[] _15 = rhs_size; //ifge %4, %15 goto blklab2 : int if(i>=_15){goto blklab2;} //indexof %16 = %1, %4 : int[] _16=rhs[i]; //lengthof %17 = %0 : int[] _17 = lhs_size; //add %18 = %4, %17 : int _18=i+_17; //update %3[%18] = %16 : int[] -> int[] rs[_18] = _16; //const %19 = 1 : int _19 = 1; //add %20 = %4, %19 : int _20=i+_19; //assign %4 = %20 : int i = _20; //.blklab3 blklab3:; } //.blklab2 blklab2:; //return %3 _DEALLOC(_2); _DEALLOC(_9); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(rs); return rs; //return }
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* _append_(BYTE* items, size_t items_size, _DECL_DEALLOC_PARAM(items), BYTE item, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY_BYTE(nitems); _DECL_DEALLOC(nitems); int64_t i = 0; BYTE _4; int64_t _5 = 0; int64_t _6 = 0; int64_t _7 = 0; _DECL_1DARRAY_BYTE(_8); _DECL_DEALLOC(_8); int64_t _9 = 0; int64_t _10 = 0; BYTE _11; int64_t _12 = 0; int64_t _13 = 0; //const %4 = 00000000b : byte _4 = 0b00000000; //lengthof %5 = %0 : byte[] _5 = items_size; //const %6 = 1 : int _6 = 1; //add %7 = %5, %6 : int _7=_5+_6; //arraygen %8 = [4; 7] : byte[] _DEALLOC(_8); _NEW_1DARRAY_BYTE(_8, _7, _4); _ADD_DEALLOC(_8); //assign %2 = %8 : byte[] _DEALLOC(nitems); _UPDATE_1DARRAY(nitems, _8); _TRANSFER_DEALLOC(nitems, _8); //const %9 = 0 : int _9 = 0; //assign %3 = %9 : int i = _9; //loop (%2, %3, %10, %11, %12, %13) while(true){ //lengthof %10 = %0 : byte[] _10 = items_size; //ifge %3, %10 goto blklab1 : int if(i>=_10){goto blklab1;} //indexof %11 = %0, %3 : byte[] _11=items[i]; //update %2[%3] = %11 : byte[] -> byte[] nitems[i] = _11; //const %12 = 1 : int _12 = 1; //add %13 = %3, %12 : int _13=i+_12; //assign %3 = %13 : int i = _13; //.blklab2 blklab2:; } //.blklab1 blklab1:; //update %2[%3] = %1 : byte[] -> byte[] nitems[i] = item; //return %2 _DEALLOC(items); _DEALLOC(_8); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(nitems); return nitems; //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 }