Beispiel #1
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);
}
Beispiel #2
0
int main(int argc, char** args){
	FILE* file;
	int64_t width;
	int64_t height;
	_DECL_1DARRAY_BYTE(pixels);
	_DECL_DEALLOC(pixels);
	_DECL_1DARRAY_BYTE(newPixels);
	_DECL_DEALLOC(newPixels);
	void* _6;
	_DECL_DEALLOC(_6);
	_DECL_1DARRAY(_7);
	_DECL_DEALLOC(_7);
	int64_t _8;
	int64_t _9;
	_DECL_1DARRAY_BYTE(_10);
	_DECL_DEALLOC(_10);
	_DECL_1DARRAY_BYTE(_12);
	_DECL_DEALLOC(_12);
	//const %7 = [46,46,47,46,46,47,46,46,47,73,110,112,117,116,102,105,108,101,115,47,105,109,97,103,101,54,52,120,54,52,46,112,98,109] : int[]
	_DEALLOC(_7);
	_NEW_1DARRAY_int64_t(_7, 34, 0);
	_7[0] = 46; _7[1] = 46; _7[2] = 47; _7[3] = 46; _7[4] = 46; _7[5] = 47; _7[6] = 46; _7[7] = 46; _7[8] = 47; _7[9] = 73; _7[10] = 110; _7[11] = 112; _7[12] = 117; _7[13] = 116; _7[14] = 102; _7[15] = 105; _7[16] = 108; _7[17] = 101; _7[18] = 115; _7[19] = 47; _7[20] = 105; _7[21] = 109; _7[22] = 97; _7[23] = 103; _7[24] = 101; _7[25] = 54; _7[26] = 52; _7[27] = 120; _7[28] = 54; _7[29] = 52; _7[30] = 46; _7[31] = 112; _7[32] = 98; _7[33] = 109; 
	_7_dealloc = true;
	//invoke (%6) = (%7) whiley/io/File:Reader : method(whiley/lang/ASCII:string)->(whiley/io/File:Reader)
	{
		_6 = Reader(_7, _7_size);
	}
	//assign %1 = %6  : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll}
	file = _6;
	//const %8 = 64 : int
	_8 = 64;
	//assign %2 = %8  : int
	width = _8;
	//const %9 = 64 : int
	_9 = 64;
	//assign %3 = %9  : int
	height = _9;
	//fieldload %11 = %1 readAll : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll}
	//indirectinvoke (%10) = %11 () : method()->(byte[])
	{
		_10 = readAll(file, &_10_size);
		_10_dealloc = true;
	}
	//assign %4 = %10  : byte[]
	_ADD_DEALLOC(pixels, _10, BYTE);
	//invoke (%12) = (%4, %2, %3) SobelEdge:sobelEdgeDetection : function(byte[],int,int)->(byte[])
	{
		_FUNCTIONCALL_COPY_PRE(_12, pixels, 0, "liveness: pixels = false, readonly: pixels = true, return:pixels = NEVER_RETURN" , "sobelEdgeDetection");
		_DEALLOC(_12);
		void* tmp_pixels;
		_COPY_1DARRAY_PARAM(pixels, tmp_pixels, BYTE);
		_12 = _sobelEdgeDetection_(tmp_pixels, pixels_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_12));
		_12_dealloc = true;
		free(tmp_pixels);
	}
	//assign %5 = %12  : byte[]
	_ADD_DEALLOC(newPixels, _12, BYTE);
	//invoke () = (%0, %2, %3, %5) SobelEdge:print_pbm : method(whiley/lang/System:Console,int,int,byte[])->()
	{
		_FUNCTIONCALL_COPY_PRE(, newPixels, 3, "liveness: newPixels = false, readonly: newPixels = true, return:newPixels = NEVER_RETURN" , "print_pbm");
		void* tmp_pixels;
		_COPY_1DARRAY_PARAM(newPixels, tmp_pixels, BYTE);
		_print_pbm_(stdout, width, height, tmp_pixels, newPixels_size);
		free(tmp_pixels);
	}
	//return
	if(file != NULL){fclose(file); file = NULL;}
	_DEALLOC(pixels);
	_DEALLOC(newPixels);
	_DEALLOC(_7);
	_DEALLOC(_10);
	_DEALLOC(_12);
	exit(0);
}
Beispiel #3
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);
}