int main(int argc, char** args){ FILE* file; _DECL_1DARRAY_BYTE(input_data); _DECL_DEALLOC(input_data); _DECL_1DARRAY_BYTE(decompress_data); _DECL_DEALLOC(decompress_data); void* _4; _DECL_DEALLOC(_4); _DECL_2DARRAY(_5); _DECL_DEALLOC(_5); int64_t _6; _DECL_1DARRAY(_7); _DECL_DEALLOC(_7); _DECL_1DARRAY_BYTE(_8); _DECL_DEALLOC(_8); _DECL_1DARRAY_BYTE(_10); _DECL_DEALLOC(_10); void* _11; _DECL_1DARRAY(_13); _DECL_DEALLOC(_13); void* _14; int64_t _16; void* _17; _DECL_1DARRAY(_19); _DECL_DEALLOC(_19); //fieldload %5 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _DEALLOC_2DARRAY_int64_t(_5); _CONV_ARGS(_5); _ADD_DEALLOC(_5); //const %6 = 0 : int _6 = 0; //indexof %7 = %5, %6 : int[][] _7=_5[_6]; _7_size = _5_size_size; _REMOVE_DEALLOC(_7); //invoke (%4) = (%7) whiley/io/File:Reader : method(whiley/lang/ASCII:string)->(whiley/io/File:Reader) { _4 = Reader(_7, _7_size); } //assign %1 = %4 : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll} // isCopyEliminated = true file = _4; //fieldload %9 = %1 readAll : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll} //indirectinvoke (%8) = %9 () : method()->(byte[]) { _8 = readAll(file, &_8_size); _ADD_DEALLOC(_8); } //assign %2 = %8 : byte[] _DEALLOC(input_data); // isCopyEliminated = true _UPDATE_1DARRAY(input_data, _8); _TRANSFER_DEALLOC(input_data, _8); //invoke (%10) = (%2) LZ77_decompress:decompress : function(byte[])->(byte[]) { // isCopyEliminated of '_2' = true _10 = _decompress_(input_data, input_data_size, false, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_10)); _RETAIN_DEALLOC(input_data, "false-false-false" , "decompress"); _RETAIN_DEALLOC_POST(_10, input_data); } //assign %3 = %10 : byte[] _DEALLOC(decompress_data); // isCopyEliminated = true _UPDATE_1DARRAY(decompress_data, _10); _TRANSFER_DEALLOC(decompress_data, _10); //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_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %13 = [68,69,67,79,77,80,82,69,83,83,69,68,58,32,32,32] : int[] _DEALLOC(_13); _NEW_1DARRAY_int64_t(_13, 16, 0); _13[0] = 68; _13[1] = 69; _13[2] = 67; _13[3] = 79; _13[4] = 77; _13[5] = 80; _13[6] = 82; _13[7] = 69; _13[8] = 83; _13[9] = 83; _13[10] = 69; _13[11] = 68; _13[12] = 58; _13[13] = 32; _13[14] = 32; _13[15] = 32; _ADD_DEALLOC(_13); //indirectinvoke () = %12 (%13) : method(int[])->() { println_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 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //lengthof %16 = %3 : byte[] _16 = decompress_data_size; //indirectinvoke () = %15 (%16) : method(any)->() { printf("%"PRId64, _16); } //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_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %19 = [32,98,121,116,101,115] : int[] _DEALLOC(_19); _NEW_1DARRAY_int64_t(_19, 6, 0); _19[0] = 32; _19[1] = 98; _19[2] = 121; _19[3] = 116; _19[4] = 101; _19[5] = 115; _ADD_DEALLOC(_19); //indirectinvoke () = %18 (%19) : method(int[])->() { println_s(_19, _19_size); } //fieldload %20 = %1 close : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll} //indirectinvoke () = %20 () : method()->() { fclose(file); file = NULL; } //return if(file != NULL){fclose(file); file = NULL;} _DEALLOC(input_data); _DEALLOC(decompress_data); _FREE_ARGS(_5); _DEALLOC(_7); _DEALLOC(_8); _DEALLOC(_10); _DEALLOC(_13); _DEALLOC(_19); exit(0); }
BYTE* _decompress_(BYTE* data, size_t data_size, _DECL_DEALLOC_PARAM(data), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY_BYTE(output); _DECL_DEALLOC(output); int64_t pos; BYTE header; BYTE item; int64_t offset; int64_t len; int64_t start; int64_t i; BYTE _9; int64_t _10; _DECL_1DARRAY_BYTE(_11); _DECL_DEALLOC(_11); int64_t _12; int64_t _13; int64_t _14; int64_t _15; BYTE _16; int64_t _17; int64_t _18; BYTE _19; int64_t _20; int64_t _21; BYTE _22; _DECL_1DARRAY_BYTE(_23); _DECL_DEALLOC(_23); int64_t _24; int64_t _25; int64_t _26; int64_t _27; int64_t _28; BYTE _29; _DECL_1DARRAY_BYTE(_30); _DECL_DEALLOC(_30); int64_t _31; int64_t _32; //const %9 = 00000000b : byte _9 = 0b00000000; //const %10 = 0 : int _10 = 0; //arraygen %11 = [9; 10] : byte[] _DEALLOC(_11); _NEW_1DARRAY_BYTE(_11, _10, _9); _ADD_DEALLOC(_11); //assign %1 = %11 : byte[] _DEALLOC(output); // isCopyEliminated = true _UPDATE_1DARRAY(output, _11); _TRANSFER_DEALLOC(output, _11); //const %12 = 0 : int _12 = 0; //assign %2 = %12 : int // isCopyEliminated = true pos = _12; //loop (%1, %2, %3, %4, %5, %6, %7, %8, %13, %14, %15, %16, %17, %18, %19, %20, %21, %22, %23, %24, %25, %26, %27, %28, %29, %30, %31, %32) while(true){ //const %13 = 1 : int _13 = 1; //add %14 = %2, %13 : int _14=pos+_13; //lengthof %15 = %0 : byte[] _15 = data_size; //ifge %14, %15 goto blklab3 : int if(_14>=_15){goto blklab3;} //indexof %16 = %0, %2 : byte[] _16=data[pos]; //assign %3 = %16 : byte // isCopyEliminated = true header = _16; //const %17 = 1 : int _17 = 1; //add %18 = %2, %17 : int _18=pos+_17; //indexof %19 = %0, %18 : byte[] _19=data[_18]; //assign %4 = %19 : byte // isCopyEliminated = true item = _19; //const %20 = 2 : int _20 = 2; //add %21 = %2, %20 : int _21=pos+_20; //assign %2 = %21 : int // isCopyEliminated = true pos = _21; //const %22 = 00000000b : byte _22 = 0b00000000; //ifne %3, %22 goto blklab5 : byte if(header!=_22){goto blklab5;} //invoke (%23) = (%1, %4) LZ77_decompress:append : function(byte[],byte)->(byte[]) { // isCopyEliminated of '_1' = true _23 = _append_(output, output_size, false, item, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_23)); _RETAIN_DEALLOC(output, "false-false-false" , "append"); _RETAIN_DEALLOC_POST(_23, output); } //assign %1 = %23 : byte[] _DEALLOC(output); // isCopyEliminated = true _UPDATE_1DARRAY(output, _23); _TRANSFER_DEALLOC(output, _23); //goto blklab6 goto blklab6; //.blklab5 blklab5:; //invoke (%24) = (%3) whiley/lang/Byte:toUnsignedInt : function(byte)->(whiley/lang/Int:uint) { _24 = (unsigned int)header; } //assign %5 = %24 : int // isCopyEliminated = true offset = _24; //invoke (%25) = (%4) whiley/lang/Byte:toUnsignedInt : function(byte)->(whiley/lang/Int:uint) { _25 = (unsigned int)item; } //assign %6 = %25 : int // isCopyEliminated = true len = _25; //lengthof %26 = %1 : byte[] _26 = output_size; //sub %27 = %26, %5 : int _27=_26-offset; //assign %7 = %27 : int // isCopyEliminated = true start = _27; //assign %8 = %7 : int // isCopyEliminated = false i = start; //loop (%1, %4, %8, %28, %29, %30, %31, %32) while(true){ //add %28 = %7, %6 : int _28=start+len; //ifge %8, %28 goto blklab7 : int if(i>=_28){goto blklab7;} //indexof %29 = %1, %8 : byte[] _29=output[i]; //assign %4 = %29 : byte // isCopyEliminated = true item = _29; //invoke (%30) = (%1, %4) LZ77_decompress:append : function(byte[],byte)->(byte[]) { // isCopyEliminated of '_1' = true _30 = _append_(output, output_size, false, item, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_30)); _RETAIN_DEALLOC(output, "false-false-false" , "append"); _RETAIN_DEALLOC_POST(_30, output); } //assign %1 = %30 : byte[] _DEALLOC(output); // isCopyEliminated = true _UPDATE_1DARRAY(output, _30); _TRANSFER_DEALLOC(output, _30); //const %31 = 1 : int _31 = 1; //add %32 = %8, %31 : int _32=i+_31; //assign %8 = %32 : int // isCopyEliminated = true i = _32; //.blklab8 blklab8:; } //.blklab7 blklab7:; //.blklab6 blklab6:; //.blklab4 blklab4:; } //.blklab3 blklab3:; //return %1 _DEALLOC(data); _DEALLOC(_11); _DEALLOC(_23); _DEALLOC(_30); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output); return output; //return }
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); }