Example #1
0
int main(int argc, char** args){
	int64_t* n;
	_DECL_DEALLOC(n);
	int64_t max;
	int64_t size;
	int64_t repeats;
	int64_t index;
	_DECL_1DARRAY(arr);
	_DECL_DEALLOC(arr);
	int64_t* _7;
	_DECL_DEALLOC(_7);
	_DECL_2DARRAY(_8);
	_DECL_DEALLOC(_8);
	int64_t _9;
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	_DECL_1DARRAY(_15);
	_DECL_DEALLOC(_15);
	int64_t _16;
	int64_t _17;
	int64_t _18;
	_DECL_1DARRAY(_19);
	_DECL_DEALLOC(_19);
	void* _20;
	int64_t _22;
	int64_t _23;
	int64_t _24;
	void* _25;
	int64_t _27;
	int64_t _28;
	void* _29;
	_DECL_1DARRAY(_31);
	_DECL_DEALLOC(_31);
	void* _32;
	void* _34;
	_DECL_1DARRAY(_36);
	_DECL_DEALLOC(_36);
	//fieldload %8 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	_DEALLOC_2DARRAY(_8);
	_CONV_ARGS(_8);
	_8_dealloc = true;
	//const %9 = 0 : int
	_9 = 0;
	//indexof %10 = %8, %9 : int[][]
	_10=_8[_9];
	_10_size = _8_size_size;
	_10_dealloc = false;
	//invoke (%7) = (%10) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int)
	{
		_STR_TO_INT(_7, _10);
		_7_dealloc = true;
		_10_dealloc = false;
	}
	//assign %1 = %7  : null|int
	// isCopyEliminated = true
	_DEALLOC(n);
	n = _7;
	_TRANSFER_DEALLOC_POST(n, _7);
	//ifis %1, null goto blklab4 : null|int
	if(n == NULL) { goto blklab4;}
	//const %11 = 1 : int
	_11 = 1;
	//assign %2 = %11  : int
	// isCopyEliminated = true
	max = _11;
	//assign %3 = %1  : int
	// isCopyEliminated = true
	size = *n;
	//const %12 = 0 : int
	_12 = 0;
	//assign %4 = %12  : int
	// isCopyEliminated = true
	repeats = _12;
	//loop (%4, %5, %6, %13, %14, %15, %16, %17, %18, %19, %20, %21, %22, %23, %24, %25, %26, %27, %28)
	while(true){
		//ifge %4, %2 goto blklab5 : int
		if(repeats>=max){goto blklab5;}
		//const %13 = 0 : int
		_13 = 0;
		//assign %5 = %13  : int
		// isCopyEliminated = true
		index = _13;
		//const %14 = 0 : int
		_14 = 0;
		//arraygen %15 = [14; 3] : int[]
		_NEW1DARRAY_DEALLOC(_15, _14, size, int64_t);
		//assign %6 = %15  : int[]
		// isCopyEliminated = true
		_TRANSFER_DEALLOC(arr, _15);
		//loop (%5, %6, %16, %17, %18)
		while(true){
			//ifge %5, %3 goto blklab7 : int
			if(index>=size){goto blklab7;}
			//sub %16 = %3, %5 : int
			_16=size-index;
			//update %6[%5] = %16 : int[] -> int[]
			arr[index] = _16;
			//const %17 = 1 : int
			_17 = 1;
			//add %18 = %5, %17 : int
			_18=index+_17;
			//assign %5 = %18  : int
			// isCopyEliminated = true
			index = _18;
//.blklab8
blklab8:;
		}
//.blklab7
blklab7:;
		//invoke (%19) = (%6) Reverse_original:reverse : function(int[])->(int[])
		{
			_FUNCTIONCALL_NO_COPY_PRE(_19, arr, 0, "liveness: arr = false, readonly: arr = true, return:arr = NEVER_RETURN" , "reverse");
			_DEALLOC(_19);
			// isCopyEliminated of 'arr at 0' = true
			_19 = _reverse_(arr, arr_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_19));
			_19_dealloc = true;
		}
		//assign %6 = %19  : int[]
		// isCopyEliminated = true
		_TRANSFER_DEALLOC(arr, _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 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
		//const %22 = 1 : int
		_22 = 1;
		//sub %23 = %3, %22 : int
		_23=size-_22;
		//indexof %24 = %6, %23 : int[]
		_24=arr[_23];
		//indirectinvoke () = %21 (%24) : method(any)->()
		{
			printf("%"PRId64"\n", _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 : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
		//indirectinvoke () = %26 (%4) : method(any)->()
		{
			printf("%"PRId64"\n", repeats);
		}
		//const %27 = 1 : int
		_27 = 1;
		//add %28 = %4, %27 : int
		_28=repeats+_27;
		//assign %4 = %28  : int
		// isCopyEliminated = true
		repeats = _28;
//.blklab6
blklab6:;
	}
//.blklab5
blklab5:;
	//fieldload %29 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %30 = %29 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %31 = [78,117,109,98,101,114,32,111,102,32,114,101,112,101,97,116,115,58,32] : int[]
	_DEALLOC(_31);
	_NEW_1DARRAY_int64_t(_31, 19, 0);
	_31[0] = 78; _31[1] = 117; _31[2] = 109; _31[3] = 98; _31[4] = 101; _31[5] = 114; _31[6] = 32; _31[7] = 111; _31[8] = 102; _31[9] = 32; _31[10] = 114; _31[11] = 101; _31[12] = 112; _31[13] = 101; _31[14] = 97; _31[15] = 116; _31[16] = 115; _31[17] = 58; _31[18] = 32; 
	_31_dealloc = true;
	//indirectinvoke () = %30 (%31) : method(int[])->()
	{
		printf_s(_31, _31_size);
	}
	//fieldload %32 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %33 = %32 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %33 (%4) : method(any)->()
	{
		printf("%"PRId64"\n", repeats);
	}
	//fieldload %34 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %35 = %34 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %36 = [80,97,115,115,32,82,101,118,101,114,115,101,32,116,101,115,116,32,99,97,115,101,32] : int[]
	_DEALLOC(_36);
	_NEW_1DARRAY_int64_t(_36, 23, 0);
	_36[0] = 80; _36[1] = 97; _36[2] = 115; _36[3] = 115; _36[4] = 32; _36[5] = 82; _36[6] = 101; _36[7] = 118; _36[8] = 101; _36[9] = 114; _36[10] = 115; _36[11] = 101; _36[12] = 32; _36[13] = 116; _36[14] = 101; _36[15] = 115; _36[16] = 116; _36[17] = 32; _36[18] = 99; _36[19] = 97; _36[20] = 115; _36[21] = 101; _36[22] = 32; 
	_36_dealloc = true;
	//indirectinvoke () = %35 (%36) : method(int[])->()
	{
		println_s(_36, _36_size);
	}
//.blklab4
blklab4:;
	//return
	_DEALLOC(n);
	_DEALLOC(arr);
	_DEALLOC(_7);
	_FREE_ARGS(_8);
	_DEALLOC(_10);
	_DEALLOC(_15);
	_DEALLOC(_19);
	_DEALLOC(_31);
	_DEALLOC(_36);
	exit(0);
}
Example #2
0
int main(int argc, char** args){
	int64_t* n;
	int64_t size;
	int64_t width;
	int64_t height;
	_DECL_1DARRAY(A);
	_DECL_1DARRAY(B);
	_DECL_1DARRAY(C);
	int64_t* _8;
	_DECL_2DARRAY(_9);
	int64_t _10;
	_DECL_1DARRAY(_11);
	void* _12;
	_DECL_1DARRAY(_14);
	void* _15;
	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;
	_DECL_1DARRAY(_27);
	_DECL_1DARRAY(_28);
	void* _29;
	int64_t _31;
	int64_t _32;
	int64_t _33;
	int64_t _34;
	int64_t _35;
	int64_t _36;
	int64_t _37;
	void* _38;
	_DECL_1DARRAY(_40);
	//fieldload %9 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	_CONV_ARGS(_9);
	//const %10 = 0 : int
	_10 = 0;
	//indexof %11 = %9, %10 : int[][]
	_11=_9[_10];
	_11_size = _9_size_size;
	//invoke (%8) = (%11) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int)
	{
		_STR_TO_INT(_8, _11);
	}
	//assign %1 = %8  : null|int
	_NEW_INTEGER_POINTER(n, _8);
	//ifis %1, null goto blklab10 : null|int
	if(n == NULL) { goto blklab10;}
	//assign %2 = %1  : int
	size = *n;
	//assign %3 = %2  : int
	width = size;
	//assign %4 = %2  : int
	height = size;
	//fieldload %12 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %13 = %12 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %14 = [115,105,122,101,32,61,32] : int[]
	_NEW_1DARRAY_int64_t(_14, 7, 0);
	_14[0] = 115; _14[1] = 105; _14[2] = 122; _14[3] = 101; _14[4] = 32; _14[5] = 61; _14[6] = 32; 
	//indirectinvoke () = %13 (%14) : method(int[])->()
	{
		printf_s(_14, _14_size);
	}
	//fieldload %15 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %16 = %15 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %16 (%2) : method(any)->()
	{
		printf("%"PRId64"\n", size);
	}
	//const %17 = 0 : int
	_17 = 0;
	//mul %18 = %3, %4 : int
	_18=width*height;
	//arraygen %19 = [17; 18] : int[]
	_NEW_1DARRAY_int64_t(_19, _18, _17);
	//assign %5 = %19  : int[]
	_COPY_1DARRAY_int64_t(A, _19);
	//invoke (%20) = (%5, %3, %4) MatrixMult_original:init : function(int[],int,int)->(int[])
	{
		void* tmp_data;
		_COPY_1DARRAY_PARAM(A, tmp_data, int64_t);
		_20 = _init_(tmp_data, A_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_20));
	}
	//assign %5 = %20  : int[]
	_COPY_1DARRAY_int64_t(A, _20);
	//const %21 = 0 : int
	_21 = 0;
	//mul %22 = %3, %4 : int
	_22=width*height;
	//arraygen %23 = [21; 22] : int[]
	_NEW_1DARRAY_int64_t(_23, _22, _21);
	//assign %6 = %23  : int[]
	_COPY_1DARRAY_int64_t(B, _23);
	//invoke (%24) = (%6, %3, %4) MatrixMult_original:init : function(int[],int,int)->(int[])
	{
		void* tmp_data;
		_COPY_1DARRAY_PARAM(B, tmp_data, int64_t);
		_24 = _init_(tmp_data, B_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_24));
	}
	//assign %6 = %24  : int[]
	_COPY_1DARRAY_int64_t(B, _24);
	//const %25 = 0 : int
	_25 = 0;
	//mul %26 = %3, %4 : int
	_26=width*height;
	//arraygen %27 = [25; 26] : int[]
	_NEW_1DARRAY_int64_t(_27, _26, _25);
	//assign %7 = %27  : int[]
	_COPY_1DARRAY_int64_t(C, _27);
	//invoke (%28) = (%5, %6, %7, %3, %4) MatrixMult_original:mat_mult : function(int[],int[],int[],int,int)->(int[])
	{
		void* tmp_a;
		_COPY_1DARRAY_PARAM(A, tmp_a, int64_t);
		void* tmp_b;
		_COPY_1DARRAY_PARAM(B, tmp_b, int64_t);
		void* tmp_data;
		_COPY_1DARRAY_PARAM(C, tmp_data, int64_t);
		_28 = _mat_mult_(tmp_a, A_size, tmp_b, B_size, tmp_data, C_size, width, height, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_28));
	}
	//assign %7 = %28  : int[]
	_COPY_1DARRAY_int64_t(C, _28);
	//fieldload %29 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %30 = %29 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %31 = 1 : int
	_31 = 1;
	//sub %32 = %2, %31 : int
	_32=size-_31;
	//mul %33 = %32, %2 : int
	_33=_32*size;
	//add %34 = %33, %2 : int
	_34=_33+size;
	//const %35 = 1 : int
	_35 = 1;
	//sub %36 = %34, %35 : int
	_36=_34-_35;
	//indexof %37 = %7, %36 : int[]
	_37=C[_36];
	//indirectinvoke () = %30 (%37) : method(any)->()
	{
		printf("%"PRId64"\n", _37);
	}
	//fieldload %38 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %39 = %38 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %40 = [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(_40, 25, 0);
	_40[0] = 80; _40[1] = 97; _40[2] = 115; _40[3] = 115; _40[4] = 32; _40[5] = 77; _40[6] = 97; _40[7] = 116; _40[8] = 114; _40[9] = 105; _40[10] = 120; _40[11] = 77; _40[12] = 117; _40[13] = 108; _40[14] = 116; _40[15] = 32; _40[16] = 116; _40[17] = 101; _40[18] = 115; _40[19] = 116; _40[20] = 32; _40[21] = 99; _40[22] = 97; _40[23] = 115; _40[24] = 101; 
	//indirectinvoke () = %39 (%40) : method(int[])->()
	{
		println_s(_40, _40_size);
	}
//.blklab10
blklab10:;
	//return
	exit(0);
}
Example #3
0
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);
}
int main(int argc, char** args){
	int64_t* max;
	int64_t n;
	_DECL_1DARRAY(coins);
	int64_t i;
	_DECL_1DARRAY(moves);
	int64_t sum_alice;
	int64_t* _7;
	_DECL_2DARRAY(_8);
	int64_t _9;
	_DECL_1DARRAY(_10);
	int64_t _11;
	_DECL_1DARRAY(_12);
	int64_t _13;
	int64_t _14;
	int64_t _15;
	int64_t _16;
	int64_t _17;
	int64_t _18;
	int64_t _19;
	int64_t _20;
	int64_t _21;
	int64_t _22;
	int64_t _23;
	_DECL_1DARRAY(_24);
	_DECL_1DARRAY(_25);
	int64_t _26;
	int64_t _27;
	int64_t _28;
	void* _29;
	_DECL_1DARRAY(_31);
	void* _32;
	void* _34;
	_DECL_1DARRAY(_36);
	//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
	_NEW_INTEGER_POINTER(max, _7);
	//ifis %1, null goto blklab4 : null|int
	if(max == NULL) { goto blklab4;}
	//assign %2 = %1  : int
	n = *max;
	//const %11 = 0 : int
	_11 = 0;
	//arraygen %12 = [11; 2] : int[]
	_NEW_1DARRAY_int64_t(_12, n, _11);
	//assign %3 = %12  : int[]
	_COPY_1DARRAY_int64_t(coins, _12);
	//const %13 = 0 : int
	_13 = 0;
	//assign %4 = %13  : int
	i = _13;
	//loop (%3, %4, %14, %15, %16, %17)
	while(true){
		//ifge %4, %2 goto blklab5 : int
		if(i>=n){goto blklab5;}
		//const %14 = 5 : int
		_14 = 5;
		//rem %15 = %4, %14 : int
		_15=i%_14;
		//update %3[%4] = %15 : int[] -> int[]
		coins[i] = _15;
		//const %16 = 1 : int
		_16 = 1;
		//add %17 = %4, %16 : int
		_17=i+_16;
		//assign %4 = %17  : int
		i = _17;
//.blklab6
blklab6:;
	}
//.blklab5
blklab5:;
	//const %18 = 0 : int
	_18 = 0;
	//const %19 = 2 : int
	_19 = 2;
	//add %20 = %2, %19 : int
	_20=n+_19;
	//const %21 = 2 : int
	_21 = 2;
	//add %22 = %2, %21 : int
	_22=n+_21;
	//mul %23 = %20, %22 : int
	_23=_20*_22;
	//arraygen %24 = [18; 23] : int[]
	_NEW_1DARRAY_int64_t(_24, _23, _18);
	//assign %5 = %24  : int[]
	_COPY_1DARRAY_int64_t(moves, _24);
	//invoke (%25) = (%5, %2, %3) CoinGame_original:findMoves : function(int[],int,int[])->(int[])
	{
		void* tmp_moves;
		_COPY_1DARRAY_PARAM(moves, tmp_moves, int64_t);
		void* tmp_coins;
		_COPY_1DARRAY_PARAM(coins, tmp_coins, int64_t);
		_25 = _findMoves_(tmp_moves, moves_size, n, tmp_coins, coins_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_25));
	}
	//assign %5 = %25  : int[]
	_COPY_1DARRAY_int64_t(moves, _25);
	//const %26 = 1 : int
	_26 = 1;
	//sub %27 = %2, %26 : int
	_27=n-_26;
	//indexof %28 = %5, %27 : int[]
	_28=moves[_27];
	//assign %6 = %28  : int
	sum_alice = _28;
	//fieldload %29 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %30 = %29 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %31 = [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[]
	_NEW_1DARRAY_int64_t(_31, 50, 0);
	_31[0] = 84; _31[1] = 104; _31[2] = 101; _31[3] = 32; _31[4] = 116; _31[5] = 111; _31[6] = 116; _31[7] = 97; _31[8] = 108; _31[9] = 32; _31[10] = 97; _31[11] = 109; _31[12] = 111; _31[13] = 117; _31[14] = 110; _31[15] = 116; _31[16] = 32; _31[17] = 111; _31[18] = 102; _31[19] = 32; _31[20] = 109; _31[21] = 111; _31[22] = 110; _31[23] = 101; _31[24] = 121; _31[25] = 32; _31[26] = 40; _31[27] = 109; _31[28] = 97; _31[29] = 120; _31[30] = 105; _31[31] = 109; _31[32] = 117; _31[33] = 109; _31[34] = 41; _31[35] = 32; _31[36] = 65; _31[37] = 108; _31[38] = 105; _31[39] = 99; _31[40] = 101; _31[41] = 32; _31[42] = 103; _31[43] = 101; _31[44] = 116; _31[45] = 115; _31[46] = 32; _31[47] = 105; _31[48] = 115; _31[49] = 32; 
	//indirectinvoke () = %30 (%31) : method(int[])->()
	{
		printf_s(_31, _31_size);
	}
	//fieldload %32 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %33 = %32 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %33 (%6) : method(any)->()
	{
		printf("%"PRId64"\n", sum_alice);
	}
	//fieldload %34 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %35 = %34 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %36 = [80,97,115,115,32,67,111,105,110,71,97,109,101,32,116,101,115,116,32,99,97,115,101] : int[]
	_NEW_1DARRAY_int64_t(_36, 23, 0);
	_36[0] = 80; _36[1] = 97; _36[2] = 115; _36[3] = 115; _36[4] = 32; _36[5] = 67; _36[6] = 111; _36[7] = 105; _36[8] = 110; _36[9] = 71; _36[10] = 97; _36[11] = 109; _36[12] = 101; _36[13] = 32; _36[14] = 116; _36[15] = 101; _36[16] = 115; _36[17] = 116; _36[18] = 32; _36[19] = 99; _36[20] = 97; _36[21] = 115; _36[22] = 101; 
	//indirectinvoke () = %35 (%36) : method(int[])->()
	{
		println_s(_36, _36_size);
	}
//.blklab4
blklab4:;
	//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);
}
Example #6
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);
}
Example #7
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);
}
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);
	_NEW_INTEGER_POINTER(n, _5);
	_ADD_DEALLOC(n);
	//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);
	_COPY_1DARRAY_BYTE(data, _10);
	_ADD_DEALLOC(data);
	//invoke (%11) = (%3) AppendArrayPattern_original:comp : function(byte[])->(byte[])
	{
		void* data_tmp;
		_DEALLOC(_11);
		_11 = _comp_(_COPY_1DARRAY_PARAM_BYTE(data), true, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_11));
		_CALLEE_DEALLOC(data, "false-false-false" , "comp");
		_ADD_DEALLOC(_11);
	}
	//assign %4 = %11  : byte[]
	_DEALLOC(arr);
	_COPY_1DARRAY_BYTE(arr, _11);
	_ADD_DEALLOC(arr);
	//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);
}