Ejemplo n.º 1
0
int main(int argc, char** args){
	_DECL_1DARRAY(a);
	_DECL_DEALLOC(a);
	_DECL_1DARRAY(b);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(r);
	_DECL_DEALLOC(r);
	int64_t _4;
	int64_t _5;
	_DECL_1DARRAY(_6);
	_DECL_DEALLOC(_6);
	int64_t _7;
	int64_t _8;
	_DECL_1DARRAY(_9);
	_DECL_DEALLOC(_9);
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	//const %4 = 2 : int
	_4 = 2;
	//const %5 = 2 : int
	_5 = 2;
	//arraygen %6 = [4; 5] : int[]
	_NEW1DARRAY_DEALLOC(_6, _4, _5, int64_t);
	//assign %1 = %6  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(a, _6);
	//const %7 = 2 : int
	_7 = 2;
	//const %8 = 2 : int
	_8 = 2;
	//arraygen %9 = [7; 8] : int[]
	_NEW1DARRAY_DEALLOC(_9, _7, _8, int64_t);
	//assign %2 = %9  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(b, _9);
	//invoke (%10) = (%1, %2) 2parameter_test79:func : function(int[],int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_10, b, "true-NEVER_RETURN-false" , "func");
		_FUNCTIONCALL_NO_COPY_PRE(_10, a, "false-ALWAYS_RETURN-false" , "func");
		_DEALLOC(_10);
		// isCopyEliminated of '_1' = true
		// isCopyEliminated of '_2' = true
		_10 = _func_(a, a_size, b, b_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_10));
		_10_dealloc = a_dealloc;
		a_dealloc = false;
	}
	//assign %3 = %10  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(r, _10);
	//return
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(r);
	_DEALLOC(_6);
	_DEALLOC(_9);
	_DEALLOC(_10);
	exit(0);
}
Ejemplo n.º 2
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t ra;
	int64_t rc;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	_DECL_1DARRAY(_14);
	_DECL_DEALLOC(_14);
	//const %6 = 0 : int
	_6 = 0;
	//indexof %7 = %0, %6 : int[]
	_7=a[_6];
	//assign %4 = %7  : int
	// isCopyEliminated = true
	ra = _7;
	//const %8 = 0 : int
	_8 = 0;
	//const %9 = 0 : int
	_9 = 0;
	//update %1[%9] = %8 : int[] -> int[]
	b[_9] = _8;
	//const %10 = 0 : int
	_10 = 0;
	//indexof %11 = %2, %10 : int[]
	_11=c[_10];
	//assign %5 = %11  : int
	// isCopyEliminated = true
	rc = _11;
	//const %12 = 3 : int
	_12 = 3;
	//const %13 = 3 : int
	_13 = 3;
	//arraygen %14 = [12; 13] : int[]
	_NEW1DARRAY_DEALLOC(_14, _12, _13, int64_t);
	//return %14
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_14);
	return _14;
	//return
}
Ejemplo n.º 3
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t rb;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	_DECL_1DARRAY(_13);
	_DECL_DEALLOC(_13);
	//const %5 = 0 : int
	_5 = 0;
	//const %6 = 0 : int
	_6 = 0;
	//update %0[%6] = %5 : int[] -> int[]
	a[_6] = _5;
	//const %7 = 0 : int
	_7 = 0;
	//indexof %8 = %1, %7 : int[]
	_8=b[_7];
	//assign %4 = %8  : int
	// isCopyEliminated = true
	rb = _8;
	//const %9 = 0 : int
	_9 = 0;
	//const %10 = 0 : int
	_10 = 0;
	//update %2[%10] = %9 : int[] -> int[]
	c[_10] = _9;
	//const %11 = 3 : int
	_11 = 3;
	//const %12 = 3 : int
	_12 = 3;
	//arraygen %13 = [11; 12] : int[]
	_NEW1DARRAY_DEALLOC(_13, _11, _12, int64_t);
	//return %13
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_13);
	return _13;
	//return
}
Ejemplo n.º 4
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t _4;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	_DECL_1DARRAY(_12);
	_DECL_DEALLOC(_12);
	//const %4 = 0 : int
	_4 = 0;
	//const %5 = 0 : int
	_5 = 0;
	//update %0[%5] = %4 : int[] -> int[]
	a[_5] = _4;
	//const %6 = 0 : int
	_6 = 0;
	//const %7 = 0 : int
	_7 = 0;
	//update %1[%7] = %6 : int[] -> int[]
	b[_7] = _6;
	//const %8 = 0 : int
	_8 = 0;
	//const %9 = 0 : int
	_9 = 0;
	//update %2[%9] = %8 : int[] -> int[]
	c[_9] = _8;
	//const %10 = 3 : int
	_10 = 3;
	//const %11 = 3 : int
	_11 = 3;
	//arraygen %12 = [10; 11] : int[]
	_NEW1DARRAY_DEALLOC(_12, _10, _11, int64_t);
	//return %12
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_12);
	return _12;
	//return
}
Ejemplo n.º 5
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(_2);
	_DECL_DEALLOC(_2);
	int64_t _3;
	int64_t _4;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	_DECL_1DARRAY(_9);
	_DECL_DEALLOC(_9);
	//const %3 = 0 : int
	_3 = 0;
	//const %4 = 0 : int
	_4 = 0;
	//update %0[%4] = %3 : int[] -> int[]
	a[_4] = _3;
	//const %5 = 0 : int
	_5 = 0;
	//const %6 = 0 : int
	_6 = 0;
	//update %1[%6] = %5 : int[] -> int[]
	b[_6] = _5;
	//const %7 = 3 : int
	_7 = 3;
	//const %8 = 3 : int
	_8 = 3;
	//arraygen %9 = [7; 8] : int[]
	_NEW1DARRAY_DEALLOC(_9, _7, _8, int64_t);
	//return %9
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(_2);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_9);
	return _9;
	//return
}
Ejemplo n.º 6
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t rb;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	int64_t _16;
	_DECL_1DARRAY(_17);
	_DECL_DEALLOC(_17);
	//const %5 = 0 : int
	_5 = 0;
	//const %6 = 0 : int
	_6 = 0;
	//update %0[%6] = %5 : int[] -> int[]
	a[_6] = _5;
	//const %7 = 0 : int
	_7 = 0;
	//indexof %8 = %1, %7 : int[]
	_8=b[_7];
	//assign %4 = %8  : int
	// isCopyEliminated = true
	rb = _8;
	//const %9 = 0 : int
	_9 = 0;
	//const %10 = 0 : int
	_10 = 0;
	//update %2[%10] = %9 : int[] -> int[]
	c[_10] = _9;
	//const %11 = 0 : int
	_11 = 0;
	//indexof %12 = %0, %11 : int[]
	_12=a[_11];
	//const %13 = 0 : int
	_13 = 0;
	//indexof %14 = %1, %13 : int[]
	_14=b[_13];
	//ifne %12, %14 goto blklab0 : int
	if(_12!=_14){goto blklab0;}
	//const %15 = 3 : int
	_15 = 3;
	//const %16 = 3 : int
	_16 = 3;
	//arraygen %17 = [15; 16] : int[]
	_NEW1DARRAY_DEALLOC(_17, _15, _16, int64_t);
	//return %17
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_17);
	return _17;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//return %1
	_DEALLOC(a);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_17);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(b);
	return b;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 7
0
int64_t* _reverse_(_DECL_1DARRAY_PARAM(arr), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(arr);
	_DECL_1DARRAY(_1);
	_DECL_DEALLOC(_1);
	int64_t i;
	_DECL_1DARRAY(r);
	_DECL_DEALLOC(r);
	int64_t item;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	_DECL_1DARRAY(_8);
	_DECL_DEALLOC(_8);
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	int64_t _16;
	int64_t _17;
	//lengthof %5 = %0 : int[]
	_5 = arr_size;
	//assign %2 = %5  : int
	// isCopyEliminated = true
	i = _5;
	//const %6 = 0 : int
	_6 = 0;
	//lengthof %7 = %0 : int[]
	_7 = arr_size;
	//arraygen %8 = [6; 7] : int[]
	_NEW1DARRAY_DEALLOC(_8, _6, _7, int64_t);
	//assign %3 = %8  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(r, _8);
	//loop (%2, %3, %4, %9, %10, %11, %12, %13, %14, %15, %16, %17)
	while(true){
		//const %12 = 0 : int
		_12 = 0;
		//ifle %2, %12 goto blklab0 : int
		if(i<=_12){goto blklab0;}
		//lengthof %13 = %0 : int[]
		_13 = arr_size;
		//sub %14 = %13, %2 : int
		_14=_13-i;
		//indexof %15 = %0, %14 : int[]
		_15=arr[_14];
		//assign %4 = %15  : int
		// isCopyEliminated = true
		item = _15;
		//const %16 = 1 : int
		_16 = 1;
		//sub %17 = %2, %16 : int
		_17=i-_16;
		//assign %2 = %17  : int
		// isCopyEliminated = true
		i = _17;
		//update %3[%2] = %4 : int[] -> int[]
		r[i] = item;
//.blklab1
blklab1:;
	}
//.blklab0
blklab0:;
	//return %3
	_DEALLOC(arr);
	_DEALLOC(_1);
	_DEALLOC(_8);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(r);
	return r;
	//return
}
Ejemplo n.º 8
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t ra;
	int64_t rb;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	int64_t _16;
	int64_t _17;
	_DECL_1DARRAY(_18);
	_DECL_DEALLOC(_18);
	int64_t _19;
	int64_t _20;
	_DECL_1DARRAY(_21);
	_DECL_DEALLOC(_21);
	//const %6 = 0 : int
	_6 = 0;
	//indexof %7 = %0, %6 : int[]
	_7=a[_6];
	//assign %4 = %7  : int
	// isCopyEliminated = true
	ra = _7;
	//const %8 = 0 : int
	_8 = 0;
	//indexof %9 = %1, %8 : int[]
	_9=b[_8];
	//assign %5 = %9  : int
	// isCopyEliminated = true
	rb = _9;
	//const %10 = 0 : int
	_10 = 0;
	//const %11 = 0 : int
	_11 = 0;
	//update %2[%11] = %10 : int[] -> int[]
	c[_11] = _10;
	//const %12 = 0 : int
	_12 = 0;
	//indexof %13 = %0, %12 : int[]
	_13=a[_12];
	//const %14 = 0 : int
	_14 = 0;
	//indexof %15 = %1, %14 : int[]
	_15=b[_14];
	//ifne %13, %15 goto blklab0 : int
	if(_13!=_15){goto blklab0;}
	//const %16 = 3 : int
	_16 = 3;
	//const %17 = 3 : int
	_17 = 3;
	//arraygen %18 = [16; 17] : int[]
	_NEW1DARRAY_DEALLOC(_18, _16, _17, int64_t);
	//return %18
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_21);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_18);
	return _18;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//const %19 = 3 : int
	_19 = 3;
	//const %20 = 3 : int
	_20 = 3;
	//arraygen %21 = [19; 20] : int[]
	_NEW1DARRAY_DEALLOC(_21, _19, _20, int64_t);
	//return %21
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_18);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_21);
	return _21;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 9
0
int64_t* _findMoves_(_DECL_1DARRAY_PARAM(moves), int64_t n, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(moves);
	_DECL_1DARRAY(_2);
	_DECL_DEALLOC(_2);
	_DECL_1DARRAY(x);
	_DECL_DEALLOC(x);
	_DECL_1DARRAY(y);
	_DECL_DEALLOC(y);
	_DECL_1DARRAY(z);
	_DECL_DEALLOC(z);
	int64_t s;
	int64_t j;
	int64_t i;
	int64_t _9;
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	int64_t _11;
	_DECL_1DARRAY(_12);
	_DECL_DEALLOC(_12);
	int64_t _13;
	_DECL_1DARRAY(_14);
	_DECL_DEALLOC(_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;
	int64_t _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;
	int64_t _46;
	int64_t _47;
	int64_t _48;
	int64_t _49;
	int64_t _50;
	int64_t _51;
	int64_t _52;
	int64_t _53;
	int64_t _54;
	int64_t _55;
	int64_t _56;
	int64_t _57;
	int64_t _58;
	int64_t _59;
	int64_t _60;
	int64_t _61;
	int64_t _62;
	int64_t _63;
	int64_t _64;
	int64_t _65;
	int64_t _66;
	int64_t _67;
	int64_t _68;
	int64_t _69;
	//const %9 = 0 : int
	_9 = 0;
	//arraygen %10 = [9; 1] : int[]
	_NEW1DARRAY_DEALLOC(_10, _9, n, int64_t);
	//assign %3 = %10  : int[]
	_ADD_DEALLOC(x, _10, int64_t);
	//const %11 = 0 : int
	_11 = 0;
	//arraygen %12 = [11; 1] : int[]
	_NEW1DARRAY_DEALLOC(_12, _11, n, int64_t);
	//assign %4 = %12  : int[]
	_ADD_DEALLOC(y, _12, int64_t);
	//const %13 = 0 : int
	_13 = 0;
	//arraygen %14 = [13; 1] : int[]
	_NEW1DARRAY_DEALLOC(_14, _13, n, int64_t);
	//assign %5 = %14  : int[]
	_ADD_DEALLOC(z, _14, int64_t);
	//const %15 = 0 : int
	_15 = 0;
	//assign %6 = %15  : int
	s = _15;
	//loop (%0, %3, %4, %5, %6, %7, %8, %16, %17, %18, %19, %20, %21, %22, %23, %24, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37, %38, %39, %40, %41, %42, %43, %44, %45, %46, %47, %48, %49, %50, %51, %52, %53, %54, %55, %56, %57, %58, %59, %60, %61, %62, %63, %64, %65, %66, %67, %68, %69)
	while(true){
		//ifge %6, %1 goto blklab0 : int
		if(s>=n){goto blklab0;}
		//assign %7 = %6  : int
		j = s;
		//const %16 = 0 : int
		_16 = 0;
		//assign %8 = %16  : int
		i = _16;
		//loop (%0, %3, %4, %5, %7, %8, %17, %18, %19, %20, %21, %22, %23, %24, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37, %38, %39, %40, %41, %42, %43, %44, %45, %46, %47, %48, %49, %50, %51, %52, %53, %54, %55, %56, %57, %58, %59, %60, %61, %62, %63, %64, %65, %66, %67)
		while(true){
			//ifge %7, %1 goto blklab2 : int
			if(j>=n){goto blklab2;}
			//const %17 = 0 : int
			_17 = 0;
			//update %4[%8] = %17 : int[] -> int[]
			y[i] = _17;
			//const %18 = 1 : int
			_18 = 1;
			//add %19 = %8, %18 : int
			_19=i+_18;
			//ifge %19, %1 goto blklab4 : int
			if(_19>=n){goto blklab4;}
			//const %20 = 1 : int
			_20 = 1;
			//sub %21 = %7, %20 : int
			_21=j-_20;
			//const %22 = 0 : int
			_22 = 0;
			//iflt %21, %22 goto blklab4 : int
			if(_21<_22){goto blklab4;}
			//indexof %23 = %4, %8 : int[]
			_23=y[i];
			//const %24 = 1 : int
			_24 = 1;
			//add %25 = %8, %24 : int
			_25=i+_24;
			//mul %26 = %25, %1 : int
			_26=_25*n;
			//add %27 = %26, %7 : int
			_27=_26+j;
			//const %28 = 1 : int
			_28 = 1;
			//sub %29 = %27, %28 : int
			_29=_27-_28;
			//indexof %30 = %0, %29 : int[]
			_30=moves[_29];
			//add %31 = %23, %30 : int
			_31=_23+_30;
			//update %4[%8] = %31 : int[] -> int[]
			y[i] = _31;
//.blklab4
blklab4:;
			//const %32 = 0 : int
			_32 = 0;
			//update %3[%8] = %32 : int[] -> int[]
			x[i] = _32;
			//const %33 = 2 : int
			_33 = 2;
			//add %34 = %8, %33 : int
			_34=i+_33;
			//ifge %34, %1 goto blklab5 : int
			if(_34>=n){goto blklab5;}
			//indexof %35 = %3, %8 : int[]
			_35=x[i];
			//const %36 = 2 : int
			_36 = 2;
			//add %37 = %8, %36 : int
			_37=i+_36;
			//mul %38 = %37, %1 : int
			_38=_37*n;
			//add %39 = %38, %7 : int
			_39=_38+j;
			//indexof %40 = %0, %39 : int[]
			_40=moves[_39];
			//add %41 = %35, %40 : int
			_41=_35+_40;
			//update %3[%8] = %41 : int[] -> int[]
			x[i] = _41;
//.blklab5
blklab5:;
			//const %42 = 0 : int
			_42 = 0;
			//update %5[%8] = %42 : int[] -> int[]
			z[i] = _42;
			//const %43 = 1 : int
			_43 = 1;
			//sub %44 = %7, %43 : int
			_44=j-_43;
			//const %45 = 0 : int
			_45 = 0;
			//ifle %44, %45 goto blklab6 : int
			if(_44<=_45){goto blklab6;}
			//indexof %46 = %5, %8 : int[]
			_46=z[i];
			//mul %47 = %8, %1 : int
			_47=i*n;
			//add %48 = %47, %7 : int
			_48=_47+j;
			//const %49 = 2 : int
			_49 = 2;
			//sub %50 = %48, %49 : int
			_50=_48-_49;
			//indexof %51 = %0, %50 : int[]
			_51=moves[_50];
			//add %52 = %46, %51 : int
			_52=_46+_51;
			//update %5[%8] = %52 : int[] -> int[]
			z[i] = _52;
//.blklab6
blklab6:;
			//indexof %55 = %3, %8 : int[]
			_55=x[i];
			//indexof %56 = %4, %8 : int[]
			_56=y[i];
			//invoke (%54) = (%55, %56) whiley/lang/Math:min : function(int,int)->(int)
			{
				_54 = min(_55, _56);
			}
			//add %57 = %8, %54 : int
			_57=i+_54;
			//indexof %59 = %4, %8 : int[]
			_59=y[i];
			//indexof %60 = %5, %8 : int[]
			_60=z[i];
			//invoke (%58) = (%59, %60) whiley/lang/Math:min : function(int,int)->(int)
			{
				_58 = min(_59, _60);
			}
			//add %61 = %7, %58 : int
			_61=j+_58;
			//invoke (%53) = (%57, %61) whiley/lang/Math:max : function(int,int)->(int)
			{
				_53 = max(_57, _61);
			}
			//mul %62 = %8, %1 : int
			_62=i*n;
			//add %63 = %62, %7 : int
			_63=_62+j;
			//update %0[%63] = %53 : int[] -> int[]
			moves[_63] = _53;
			//const %64 = 1 : int
			_64 = 1;
			//add %65 = %7, %64 : int
			_65=j+_64;
			//assign %7 = %65  : int
			j = _65;
			//const %66 = 1 : int
			_66 = 1;
			//add %67 = %8, %66 : int
			_67=i+_66;
			//assign %8 = %67  : int
			i = _67;
//.blklab3
blklab3:;
		}
//.blklab2
blklab2:;
		//const %68 = 1 : int
		_68 = 1;
		//add %69 = %6, %68 : int
		_69=s+_68;
		//assign %6 = %69  : int
		s = _69;
//.blklab1
blklab1:;
	}
//.blklab0
blklab0:;
	//return %0
	_DEALLOC(_2);
	_DEALLOC(x);
	_DEALLOC(y);
	_DEALLOC(z);
	_DEALLOC(_10);
	_DEALLOC(_12);
	_DEALLOC(_14);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(moves);
	return moves;
	//return
}
Ejemplo n.º 10
0
int main(int argc, char** args){
	_DECL_1DARRAY(a);
	_DECL_DEALLOC(a);
	_DECL_1DARRAY(b);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(c);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(r);
	_DECL_DEALLOC(r);
	int64_t _5;
	int64_t _6;
	_DECL_1DARRAY(_7);
	_DECL_DEALLOC(_7);
	int64_t _8;
	int64_t _9;
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	int64_t _11;
	int64_t _12;
	_DECL_1DARRAY(_13);
	_DECL_DEALLOC(_13);
	_DECL_1DARRAY(_14);
	_DECL_DEALLOC(_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;
	int64_t _24;
	int64_t _25;
	int64_t _26;
	//const %5 = 1 : int
	_5 = 1;
	//const %6 = 2 : int
	_6 = 2;
	//arraygen %7 = [5; 6] : int[]
	_NEW1DARRAY_DEALLOC(_7, _5, _6, int64_t);
	//assign %1 = %7  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(a, _7);
	//const %8 = 2 : int
	_8 = 2;
	//const %9 = 2 : int
	_9 = 2;
	//arraygen %10 = [8; 9] : int[]
	_NEW1DARRAY_DEALLOC(_10, _8, _9, int64_t);
	//assign %2 = %10  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(b, _10);
	//const %11 = 3 : int
	_11 = 3;
	//const %12 = 2 : int
	_12 = 2;
	//arraygen %13 = [11; 12] : int[]
	_NEW1DARRAY_DEALLOC(_13, _11, _12, int64_t);
	//assign %3 = %13  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(c, _13);
	//invoke (%14) = (%1, %2, %3) specialcase1:func : function(int[],int[],int[])->(int[])
	{
		_FUNCTIONCALL_COPY_PRE(_14, c, 2, "liveness: c = true, readonly: c = false, return:c = MAYBE_RETURN" , "func");
		_FUNCTIONCALL_COPY_PRE(_14, b, 1, "liveness: b = true, readonly: b = false, return:b = MAYBE_RETURN" , "func");
		_FUNCTIONCALL_COPY_PRE(_14, a, 0, "liveness: a = true, readonly: a = false, return:a = MAYBE_RETURN" , "func");
		_DEALLOC(_14);
		void* tmp_a;
		_COPY_1DARRAY_PARAM(a, tmp_a, int64_t);
		void* tmp_b;
		_COPY_1DARRAY_PARAM(b, tmp_b, int64_t);
		void* tmp_c;
		_COPY_1DARRAY_PARAM(c, tmp_c, int64_t);
		// isCopyEliminated of 'a at 0' = false
		// isCopyEliminated of 'b at 1' = false
		// isCopyEliminated of 'c at 2' = false
		_14 = _func_(tmp_a, a_size, tmp_b, b_size, tmp_c, c_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_14));
		if( _14 == tmp_a ){
			_14_dealloc = true;
			free(tmp_b);
			free(tmp_c);
		} else if( _14 == tmp_b ){
			_14_dealloc = true;
			free(tmp_a);
			free(tmp_c);
		} else if( _14 == tmp_c ){
			_14_dealloc = true;
			free(tmp_a);
			free(tmp_b);
		} else {
			_14_dealloc = true;
			free(tmp_a);
			free(tmp_b);
			free(tmp_c);
		}
	}
	//assign %4 = %14  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(r, _14);
	//assert
	{
		//const %15 = 0 : int
		_15 = 0;
		//indexof %16 = %1, %15 : int[]
		_16=a[_15];
		//const %17 = 1 : int
		_17 = 1;
		//ifeq %16, %17 goto blklab2 : int
		if(_16==_17){goto blklab2;}
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab2
blklab2:;
	//assert
	}
	//assert
	{
		//const %18 = 0 : int
		_18 = 0;
		//indexof %19 = %2, %18 : int[]
		_19=b[_18];
		//const %20 = 2 : int
		_20 = 2;
		//ifeq %19, %20 goto blklab3 : int
		if(_19==_20){goto blklab3;}
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab3
blklab3:;
	//assert
	}
	//assert
	{
		//const %21 = 0 : int
		_21 = 0;
		//indexof %22 = %3, %21 : int[]
		_22=c[_21];
		//const %23 = 3 : int
		_23 = 3;
		//ifeq %22, %23 goto blklab4 : int
		if(_22==_23){goto blklab4;}
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab4
blklab4:;
	//assert
	}
	//assert
	{
		//const %24 = 0 : int
		_24 = 0;
		//indexof %25 = %4, %24 : int[]
		_25=r[_24];
		//const %26 = 3 : int
		_26 = 3;
		//ifeq %25, %26 goto blklab5 : int
		if(_25==_26){goto blklab5;}
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab5
blklab5:;
	//assert
	}
	//return
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(r);
	_DEALLOC(_7);
	_DEALLOC(_10);
	_DEALLOC(_13);
	_DEALLOC(_14);
	exit(0);
}
Ejemplo n.º 11
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(_2);
	_DECL_DEALLOC(_2);
	int64_t ra;
	int64_t _4;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	_DECL_1DARRAY(_14);
	_DECL_DEALLOC(_14);
	//const %4 = 0 : int
	_4 = 0;
	//indexof %5 = %0, %4 : int[]
	_5=a[_4];
	//assign %3 = %5  : int
	// isCopyEliminated = true
	ra = _5;
	//const %6 = 0 : int
	_6 = 0;
	//const %7 = 0 : int
	_7 = 0;
	//update %1[%7] = %6 : int[] -> int[]
	b[_7] = _6;
	//const %8 = 0 : int
	_8 = 0;
	//indexof %9 = %0, %8 : int[]
	_9=a[_8];
	//const %10 = 0 : int
	_10 = 0;
	//indexof %11 = %1, %10 : int[]
	_11=b[_10];
	//ifne %9, %11 goto blklab0 : int
	if(_9!=_11){goto blklab0;}
	//const %12 = 3 : int
	_12 = 3;
	//const %13 = 3 : int
	_13 = 3;
	//arraygen %14 = [12; 13] : int[]
	_NEW1DARRAY_DEALLOC(_14, _12, _13, int64_t);
	//return %14
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(_2);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_14);
	return _14;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//return %1
	_DEALLOC(a);
	_DEALLOC(_2);
	_DEALLOC(_14);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(b);
	return b;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 12
0
BYTE* _sobelEdgeDetection_(BYTE* pixels, size_t pixels_size, int64_t width, int64_t height, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(pixels);
	_DECL_1DARRAY_BYTE(_3);
	_DECL_DEALLOC(_3);
	int64_t size;
	_DECL_1DARRAY_BYTE(newPixels);
	_DECL_DEALLOC(newPixels);
	_DECL_1DARRAY(v_sobel);
	_DECL_DEALLOC(v_sobel);
	_DECL_1DARRAY(h_sobel);
	_DECL_DEALLOC(h_sobel);
	int64_t x;
	int64_t y;
	int64_t pos;
	int64_t v_g;
	int64_t h_g;
	int64_t t_g;
	int64_t _14;
	BYTE _15;
	_DECL_1DARRAY_BYTE(_16);
	_DECL_DEALLOC(_16);
	int64_t _17;
	int64_t _18;
	int64_t _19;
	int64_t _20;
	int64_t _21;
	int64_t _22;
	int64_t _23;
	int64_t _24;
	int64_t _25;
	int64_t _26;
	int64_t _27;
	int64_t _28;
	_DECL_1DARRAY(_29);
	_DECL_DEALLOC(_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;
	_DECL_1DARRAY(_42);
	_DECL_DEALLOC(_42);
	int64_t _43;
	int64_t _44;
	int64_t _45;
	int64_t _46;
	int64_t _47;
	int64_t _48;
	int64_t _49;
	int64_t _50;
	int64_t _51;
	int64_t _52;
	BYTE _53;
	int64_t _54;
	int64_t _55;
	int64_t _56;
	int64_t _57;
	//mul %14 = %1, %2 : int
	_14=width*height;
	//assign %4 = %14  : int
	size = _14;
	//const %15 = 00100000b : byte
	_15 = 0b00100000;
	//arraygen %16 = [15; 4] : byte[]
	_NEW1DARRAY_DEALLOC(_16, _15, size, BYTE);
	//assign %5 = %16  : byte[]
	_ADD_DEALLOC(newPixels, _16, BYTE);
	//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; 
	_29_dealloc = true;
	//assign %6 = %29  : int[]
	_ADD_DEALLOC(v_sobel, _29, int64_t);
	//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; 
	_42_dealloc = true;
	//assign %7 = %42  : int[]
	_ADD_DEALLOC(h_sobel, _42, int64_t);
	//const %43 = 0 : int
	_43 = 0;
	//assign %8 = %43  : int
	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
		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
			pos = _46;
			//invoke (%47) = (%0, %1, %2, %8, %9, %6) SobelEdge:convolution : function(byte[],int,int,int,int,int[])->(int)
			{
				_FUNCTIONCALL_COPY_PRE(_47, v_sobel, 5, "liveness: v_sobel = true, readonly: v_sobel = true, return:v_sobel = NEVER_RETURN" , "convolution");
				_FUNCTIONCALL_COPY_PRE(_47, pixels, 0, "liveness: pixels = true, readonly: pixels = true, return:pixels = NEVER_RETURN" , "convolution");
				void* tmp_pixels;
				_COPY_1DARRAY_PARAM(pixels, tmp_pixels, BYTE);
				void* tmp_kernel;
				_COPY_1DARRAY_PARAM(v_sobel, tmp_kernel, int64_t);
				_47 = _convolution_(tmp_pixels, pixels_size, width, height, x, y, tmp_kernel, v_sobel_size);
				free(tmp_pixels);
				free(tmp_kernel);
			}
			//assign %11 = %47  : int
			v_g = _47;
			//invoke (%48) = (%0, %1, %2, %8, %9, %7) SobelEdge:convolution : function(byte[],int,int,int,int,int[])->(int)
			{
				_FUNCTIONCALL_COPY_PRE(_48, h_sobel, 5, "liveness: h_sobel = true, readonly: h_sobel = true, return:h_sobel = NEVER_RETURN" , "convolution");
				_FUNCTIONCALL_COPY_PRE(_48, pixels, 0, "liveness: pixels = true, readonly: pixels = true, return:pixels = NEVER_RETURN" , "convolution");
				void* tmp_pixels;
				_COPY_1DARRAY_PARAM(pixels, tmp_pixels, BYTE);
				void* tmp_kernel;
				_COPY_1DARRAY_PARAM(h_sobel, tmp_kernel, int64_t);
				_48 = _convolution_(tmp_pixels, pixels_size, width, height, x, y, tmp_kernel, h_sobel_size);
				free(tmp_pixels);
				free(tmp_kernel);
			}
			//assign %12 = %48  : int
			h_g = _48;
			//invoke (%49) = (%11) whiley/lang/Math:abs : function(int)->(int)
			{
				_49 = abs(v_g);
			}
			//invoke (%50) = (%12) whiley/lang/Math:abs : function(int)->(int)
			{
				_50 = abs(h_g);
			}
			//add %51 = %49, %50 : int
			_51=_49+_50;
			//assign %13 = %51  : int
			t_g = _51;
			//const %52 = 800 : int
			_52 = 800;
			//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
			y = _55;
//.blklab11
blklab11:;
		}
//.blklab10
blklab10:;
		//const %56 = 1 : int
		_56 = 1;
		//add %57 = %8, %56 : int
		_57=x+_56;
		//assign %8 = %57  : int
		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
}
Ejemplo n.º 13
0
int64_t* _findMoves_(_DECL_1DARRAY_PARAM(moves), int64_t n, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(moves);
	_DECL_1DARRAY(_2);
	_DECL_DEALLOC(_2);
	int64_t s;
	_DECL_1DARRAY(x);
	_DECL_DEALLOC(x);
	_DECL_1DARRAY(y);
	_DECL_DEALLOC(y);
	_DECL_1DARRAY(z);
	_DECL_DEALLOC(z);
	int64_t j;
	int64_t i;
	int64_t _9;
	int64_t _10;
	_DECL_1DARRAY(_11);
	_DECL_DEALLOC(_11);
	int64_t _12;
	_DECL_1DARRAY(_13);
	_DECL_DEALLOC(_13);
	int64_t _14;
	_DECL_1DARRAY(_15);
	_DECL_DEALLOC(_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;
	int64_t _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;
	int64_t _46;
	int64_t _47;
	int64_t _48;
	int64_t _49;
	int64_t _50;
	int64_t _51;
	int64_t _52;
	int64_t _53;
	int64_t _54;
	int64_t _55;
	int64_t _56;
	int64_t _57;
	int64_t _58;
	int64_t _59;
	int64_t _60;
	int64_t _61;
	int64_t _62;
	int64_t _63;
	int64_t _64;
	int64_t _65;
	int64_t _66;
	int64_t _67;
	int64_t _68;
	int64_t _69;
	int64_t _70;
	//const %9 = 0 : int
	_9 = 0;
	//assign %3 = %9  : int
	s = _9;
	//loop (%0, %3, %4, %5, %6, %7, %8, %10, %11, %12, %13, %14, %15, %16, %17, %18, %19, %20, %21, %22, %23, %24, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37, %38, %39, %40, %41, %42, %43, %44, %45, %46, %47, %48, %49, %50, %51, %52, %53, %54, %55, %56, %57, %58, %59, %60, %61, %62, %63, %64, %65, %66, %67, %68, %69, %70)
	while(true){
		//ifge %3, %1 goto blklab0 : int
		if(s>=n){goto blklab0;}
		//const %10 = 0 : int
		_10 = 0;
		//arraygen %11 = [10; 1] : int[]
		_NEW1DARRAY_DEALLOC(_11, _10, n, int64_t);
		//assign %4 = %11  : int[]
		_ADD_DEALLOC(x, _11, int64_t);
		//const %12 = 0 : int
		_12 = 0;
		//arraygen %13 = [12; 1] : int[]
		_NEW1DARRAY_DEALLOC(_13, _12, n, int64_t);
		//assign %5 = %13  : int[]
		_ADD_DEALLOC(y, _13, int64_t);
		//const %14 = 0 : int
		_14 = 0;
		//arraygen %15 = [14; 1] : int[]
		_NEW1DARRAY_DEALLOC(_15, _14, n, int64_t);
		//assign %6 = %15  : int[]
		_ADD_DEALLOC(z, _15, int64_t);
		//assign %7 = %3  : int
		j = s;
		//const %16 = 0 : int
		_16 = 0;
		//assign %8 = %16  : int
		i = _16;
		//loop (%0, %4, %5, %6, %7, %8, %17, %18, %19, %20, %21, %22, %23, %24, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37, %38, %39, %40, %41, %42, %43, %44, %45, %46, %47, %48, %49, %50, %51, %52, %53, %54, %55, %56, %57, %58, %59, %60, %61, %62, %63, %64, %65, %66, %67, %68)
		while(true){
			//ifge %7, %1 goto blklab2 : int
			if(j>=n){goto blklab2;}
			//const %17 = 0 : int
			_17 = 0;
			//update %5[%8] = %17 : int[] -> int[]
			y[i] = _17;
			//const %18 = 1 : int
			_18 = 1;
			//add %19 = %8, %18 : int
			_19=i+_18;
			//ifge %19, %1 goto blklab4 : int
			if(_19>=n){goto blklab4;}
			//const %20 = 1 : int
			_20 = 1;
			//sub %21 = %7, %20 : int
			_21=j-_20;
			//const %22 = 0 : int
			_22 = 0;
			//iflt %21, %22 goto blklab4 : int
			if(_21<_22){goto blklab4;}
			//const %23 = 1 : int
			_23 = 1;
			//add %24 = %8, %23 : int
			_24=i+_23;
			//mul %25 = %24, %1 : int
			_25=_24*n;
			//add %26 = %25, %7 : int
			_26=_25+j;
			//const %27 = 1 : int
			_27 = 1;
			//sub %28 = %26, %27 : int
			_28=_26-_27;
			//indexof %29 = %0, %28 : int[]
			_29=moves[_28];
			//update %5[%8] = %29 : int[] -> int[]
			y[i] = _29;
//.blklab4
blklab4:;
			//const %30 = 0 : int
			_30 = 0;
			//update %4[%8] = %30 : int[] -> int[]
			x[i] = _30;
			//const %31 = 2 : int
			_31 = 2;
			//add %32 = %8, %31 : int
			_32=i+_31;
			//ifge %32, %1 goto blklab5 : int
			if(_32>=n){goto blklab5;}
			//const %33 = 2 : int
			_33 = 2;
			//add %34 = %8, %33 : int
			_34=i+_33;
			//mul %35 = %34, %1 : int
			_35=_34*n;
			//add %36 = %35, %7 : int
			_36=_35+j;
			//indexof %37 = %0, %36 : int[]
			_37=moves[_36];
			//update %4[%8] = %37 : int[] -> int[]
			x[i] = _37;
//.blklab5
blklab5:;
			//const %38 = 0 : int
			_38 = 0;
			//update %6[%8] = %38 : int[] -> int[]
			z[i] = _38;
			//const %39 = 1 : int
			_39 = 1;
			//sub %40 = %7, %39 : int
			_40=j-_39;
			//const %41 = 0 : int
			_41 = 0;
			//ifle %40, %41 goto blklab6 : int
			if(_40<=_41){goto blklab6;}
			//mul %42 = %8, %1 : int
			_42=i*n;
			//add %43 = %42, %7 : int
			_43=_42+j;
			//const %44 = 2 : int
			_44 = 2;
			//sub %45 = %43, %44 : int
			_45=_43-_44;
			//indexof %46 = %0, %45 : int[]
			_46=moves[_45];
			//update %6[%8] = %46 : int[] -> int[]
			z[i] = _46;
//.blklab6
blklab6:;
			//indexof %47 = %4, %8 : int[]
			_47=x[i];
			//indexof %48 = %5, %8 : int[]
			_48=y[i];
			//ifle %47, %48 goto blklab7 : int
			if(_47<=_48){goto blklab7;}
			//indexof %49 = %5, %8 : int[]
			_49=y[i];
			//update %4[%8] = %49 : int[] -> int[]
			x[i] = _49;
//.blklab7
blklab7:;
			//indexof %50 = %6, %8 : int[]
			_50=z[i];
			//indexof %51 = %5, %8 : int[]
			_51=y[i];
			//ifle %50, %51 goto blklab8 : int
			if(_50<=_51){goto blklab8;}
			//indexof %52 = %5, %8 : int[]
			_52=y[i];
			//update %6[%8] = %52 : int[] -> int[]
			z[i] = _52;
//.blklab8
blklab8:;
			//indexof %53 = %4, %8 : int[]
			_53=x[i];
			//add %54 = %8, %53 : int
			_54=i+_53;
			//indexof %55 = %6, %8 : int[]
			_55=z[i];
			//add %56 = %7, %55 : int
			_56=j+_55;
			//ifle %54, %56 goto blklab9 : int
			if(_54<=_56){goto blklab9;}
			//indexof %57 = %4, %8 : int[]
			_57=x[i];
			//add %58 = %8, %57 : int
			_58=i+_57;
			//mul %59 = %8, %1 : int
			_59=i*n;
			//add %60 = %59, %7 : int
			_60=_59+j;
			//update %0[%60] = %58 : int[] -> int[]
			moves[_60] = _58;
			//goto blklab10
			goto blklab10;
//.blklab9
blklab9:;
			//indexof %61 = %6, %8 : int[]
			_61=z[i];
			//add %62 = %7, %61 : int
			_62=j+_61;
			//mul %63 = %8, %1 : int
			_63=i*n;
			//add %64 = %63, %7 : int
			_64=_63+j;
			//update %0[%64] = %62 : int[] -> int[]
			moves[_64] = _62;
//.blklab10
blklab10:;
			//const %65 = 1 : int
			_65 = 1;
			//add %66 = %7, %65 : int
			_66=j+_65;
			//assign %7 = %66  : int
			j = _66;
			//const %67 = 1 : int
			_67 = 1;
			//add %68 = %8, %67 : int
			_68=i+_67;
			//assign %8 = %68  : int
			i = _68;
//.blklab3
blklab3:;
		}
//.blklab2
blklab2:;
		//const %69 = 1 : int
		_69 = 1;
		//add %70 = %3, %69 : int
		_70=s+_69;
		//assign %3 = %70  : int
		s = _70;
//.blklab1
blklab1:;
	}
//.blklab0
blklab0:;
	//return %0
	_DEALLOC(_2);
	_DEALLOC(x);
	_DEALLOC(y);
	_DEALLOC(z);
	_DEALLOC(_11);
	_DEALLOC(_13);
	_DEALLOC(_15);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(moves);
	return moves;
	//return
}
Ejemplo n.º 14
0
BYTE* _decompress_(BYTE* data, size_t data_size, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(data);
	_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[]
	_NEW1DARRAY_DEALLOC(_11, _9, _10, BYTE);
	//assign %1 = %11  : byte[]
	_ADD_DEALLOC(output, _11, BYTE);
	//const %12 = 0 : int
	_12 = 0;
	//assign %2 = %12  : int
	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
		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
		item = _19;
		//const %20 = 2 : int
		_20 = 2;
		//add %21 = %2, %20 : int
		_21=pos+_20;
		//assign %2 = %21  : int
		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[])
		{
			_FUNCTIONCALL_COPY_PRE(_23, output, 0, "liveness: output = false, readonly: output = true, return:output = NEVER_RETURN" , "append");
			_DEALLOC(_23);
			void* tmp_items;
			_COPY_1DARRAY_PARAM(output, tmp_items, BYTE);
			_23 = _append_(tmp_items, output_size, item, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_23));
			_23_dealloc = true;
			free(tmp_items);
		}
		//assign %1 = %23  : byte[]
		_ADD_DEALLOC(output, _23, BYTE);
		//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
		offset = _24;
		//invoke (%25) = (%4) whiley/lang/Byte:toUnsignedInt : function(byte)->(whiley/lang/Int:uint)
		{
			_25 = (unsigned int)item;
		}
		//assign %6 = %25  : int
		len = _25;
		//lengthof %26 = %1 : byte[]
		_26 = output_size;
		//sub %27 = %26, %5 : int
		_27=_26-offset;
		//assign %7 = %27  : int
		start = _27;
		//assign %8 = %7  : int
		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
			item = _29;
			//invoke (%30) = (%1, %4) lz77_decompress:append : function(byte[],byte)->(byte[])
			{
				_FUNCTIONCALL_COPY_PRE(_30, output, 0, "liveness: output = false, readonly: output = true, return:output = NEVER_RETURN" , "append");
				_DEALLOC(_30);
				void* tmp_items;
				_COPY_1DARRAY_PARAM(output, tmp_items, BYTE);
				_30 = _append_(tmp_items, output_size, item, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_30));
				_30_dealloc = true;
				free(tmp_items);
			}
			//assign %1 = %30  : byte[]
			_ADD_DEALLOC(output, _30, BYTE);
			//const %31 = 1 : int
			_31 = 1;
			//add %32 = %8, %31 : int
			_32=i+_31;
			//assign %8 = %32  : int
			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
}
Ejemplo n.º 15
0
BYTE* _append_(BYTE* items, size_t items_size, BYTE item, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(items);
	_DECL_1DARRAY_BYTE(nitems);
	_DECL_DEALLOC(nitems);
	int64_t i;
	BYTE _4;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	_DECL_1DARRAY_BYTE(_8);
	_DECL_DEALLOC(_8);
	int64_t _9;
	int64_t _10;
	BYTE _11;
	int64_t _12;
	int64_t _13;
	//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[]
	_NEW1DARRAY_DEALLOC(_8, _4, _7, BYTE);
	//assign %2 = %8  : byte[]
	_ADD_DEALLOC(nitems, _8, BYTE);
	//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
}
Ejemplo n.º 16
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(_2);
	_DECL_DEALLOC(_2);
	int64_t ra;
	int64_t rb;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	_DECL_1DARRAY(_15);
	_DECL_DEALLOC(_15);
	//const %5 = 0 : int
	_5 = 0;
	//indexof %6 = %0, %5 : int[]
	_6=a[_5];
	//assign %3 = %6  : int
	// isCopyEliminated = true
	ra = _6;
	//const %7 = 0 : int
	_7 = 0;
	//indexof %8 = %1, %7 : int[]
	_8=b[_7];
	//assign %4 = %8  : int
	// isCopyEliminated = true
	rb = _8;
	//const %9 = 0 : int
	_9 = 0;
	//indexof %10 = %0, %9 : int[]
	_10=a[_9];
	//const %11 = 0 : int
	_11 = 0;
	//indexof %12 = %1, %11 : int[]
	_12=b[_11];
	//ifne %10, %12 goto blklab0 : int
	if(_10!=_12){goto blklab0;}
	//return %0
	_DEALLOC(b);
	_DEALLOC(_2);
	_DEALLOC(_15);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(a);
	return a;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//const %13 = 3 : int
	_13 = 3;
	//const %14 = 3 : int
	_14 = 3;
	//arraygen %15 = [13; 14] : int[]
	_NEW1DARRAY_DEALLOC(_15, _13, _14, int64_t);
	//return %15
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(_2);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_15);
	return _15;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 17
0
int main(int argc, char** args){
	_DECL_1DARRAY(a);
	_DECL_DEALLOC(a);
	_DECL_1DARRAY(b);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(r);
	_DECL_DEALLOC(r);
	int64_t _4;
	int64_t _5;
	_DECL_1DARRAY(_6);
	_DECL_DEALLOC(_6);
	int64_t _7;
	int64_t _8;
	_DECL_1DARRAY(_9);
	_DECL_DEALLOC(_9);
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	void* _11;
	int64_t _13;
	int64_t _14;
	void* _15;
	int64_t _17;
	int64_t _18;
	//const %4 = 2 : int
	_4 = 2;
	//const %5 = 2 : int
	_5 = 2;
	//arraygen %6 = [4; 5] : int[]
	_NEW1DARRAY_DEALLOC(_6, _4, _5, int64_t);
	//assign %1 = %6  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(a, _6);
	//const %7 = 2 : int
	_7 = 2;
	//const %8 = 2 : int
	_8 = 2;
	//arraygen %9 = [7; 8] : int[]
	_NEW1DARRAY_DEALLOC(_9, _7, _8, int64_t);
	//assign %2 = %9  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(b, _9);
	//invoke (%10) = (%1, %2) 2parameter_test4:func : function(int[],int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_10, b, "false-NEVER_RETURN-true" , "func");
		_FUNCTIONCALL_COPY_PRE(_10, a, "false-MAYBE_RETURN-true" , "func");
		_DEALLOC(_10);
		void* tmp_a;
		_COPY_1DARRAY_PARAM(a, tmp_a, int64_t);
		// isCopyEliminated of '_1' = false
		// isCopyEliminated of '_2' = true
		_10 = _func_(tmp_a, a_size, b, b_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_10));
		if( _10 == tmp_a ){
			_10_dealloc = true;
		} else {
			_10_dealloc = true;
			free(tmp_a);
		}
	}
	//assign %3 = %10  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(r, _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 : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %13 = 0 : int
	_13 = 0;
	//indexof %14 = %1, %13 : int[]
	_14=a[_13];
	//indirectinvoke () = %12 (%14) : method(any)->()
	{
		printf("%"PRId64"\n", _14);
	}
	//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}
	//const %17 = 0 : int
	_17 = 0;
	//indexof %18 = %2, %17 : int[]
	_18=b[_17];
	//indirectinvoke () = %16 (%18) : method(any)->()
	{
		printf("%"PRId64"\n", _18);
	}
	//return
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(r);
	_DEALLOC(_6);
	_DEALLOC(_9);
	_DEALLOC(_10);
	exit(0);
}
Ejemplo n.º 18
0
int main(int argc, char** args){
	int64_t n;
	_DECL_1DARRAY(moves);
	_DECL_DEALLOC(moves);
	int64_t sum_alice;
	int64_t _4;
	int64_t _5;
	int64_t _6;
	_DECL_1DARRAY(_7);
	_DECL_DEALLOC(_7);
	_DECL_1DARRAY(_8);
	_DECL_DEALLOC(_8);
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	void* _13;
	_DECL_1DARRAY(_15);
	_DECL_DEALLOC(_15);
	void* _16;
	void* _18;
	_DECL_1DARRAY(_20);
	_DECL_DEALLOC(_20);
	//const %4 = 10 : int
	_4 = 10;
	//assign %1 = %4  : int
	n = _4;
	//const %5 = 0 : int
	_5 = 0;
	//mul %6 = %1, %1 : int
	_6=n*n;
	//arraygen %7 = [5; 6] : int[]
	_NEW1DARRAY_DEALLOC(_7, _5, _6, int64_t);
	//assign %2 = %7  : int[]
	_ADD_DEALLOC(moves, _7, int64_t);
	//invoke (%8) = (%2, %1) CoinGame3:findMoves : function(int[],int)->(int[])
	{
		_FUNCTIONCALL_COPY_PRE(_8, moves, 0, "liveness: moves = false, readonly: moves = false, return:moves = ALWAYS_RETURN" , "findMoves");
		_DEALLOC(_8);
		void* tmp_moves;
		_COPY_1DARRAY_PARAM(moves, tmp_moves, int64_t);
		_8 = _findMoves_(tmp_moves, moves_size, n, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_8));
		_8_dealloc = true;
	}
	//assign %2 = %8  : int[]
	_ADD_DEALLOC(moves, _8, int64_t);
	//const %9 = 1 : int
	_9 = 1;
	//sub %10 = %1, %9 : int
	_10=n-_9;
	//indexof %11 = %2, %10 : int[]
	_11=moves[_10];
	//assign %3 = %11  : int
	sum_alice = _11;
	//assert
	{
		//const %12 = 25 : int
		_12 = 25;
		//ifeq %3, %12 goto blklab7 : int
		if(sum_alice==_12){goto blklab7;}
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab7
blklab7:;
	//assert
	}
	//fieldload %13 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %14 = %13 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %15 = [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(_15);
	_NEW_1DARRAY_int64_t(_15, 50, 0);
	_15[0] = 84; _15[1] = 104; _15[2] = 101; _15[3] = 32; _15[4] = 116; _15[5] = 111; _15[6] = 116; _15[7] = 97; _15[8] = 108; _15[9] = 32; _15[10] = 97; _15[11] = 109; _15[12] = 111; _15[13] = 117; _15[14] = 110; _15[15] = 116; _15[16] = 32; _15[17] = 111; _15[18] = 102; _15[19] = 32; _15[20] = 109; _15[21] = 111; _15[22] = 110; _15[23] = 101; _15[24] = 121; _15[25] = 32; _15[26] = 40; _15[27] = 109; _15[28] = 97; _15[29] = 120; _15[30] = 105; _15[31] = 109; _15[32] = 117; _15[33] = 109; _15[34] = 41; _15[35] = 32; _15[36] = 65; _15[37] = 108; _15[38] = 105; _15[39] = 99; _15[40] = 101; _15[41] = 32; _15[42] = 103; _15[43] = 101; _15[44] = 116; _15[45] = 115; _15[46] = 32; _15[47] = 105; _15[48] = 115; _15[49] = 32; 
	_15_dealloc = true;
	//indirectinvoke () = %14 (%15) : method(int[])->()
	{
		printf_s(_15, _15_size);
	}
	//fieldload %16 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %17 = %16 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %17 (%3) : method(any)->()
	{
		printf("%"PRId64"\n", sum_alice);
	}
	//fieldload %18 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %19 = %18 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %20 = [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(_20);
	_NEW_1DARRAY_int64_t(_20, 23, 0);
	_20[0] = 80; _20[1] = 97; _20[2] = 115; _20[3] = 115; _20[4] = 32; _20[5] = 67; _20[6] = 111; _20[7] = 105; _20[8] = 110; _20[9] = 71; _20[10] = 97; _20[11] = 109; _20[12] = 101; _20[13] = 32; _20[14] = 116; _20[15] = 101; _20[16] = 115; _20[17] = 116; _20[18] = 32; _20[19] = 99; _20[20] = 97; _20[21] = 115; _20[22] = 101; 
	_20_dealloc = true;
	//indirectinvoke () = %19 (%20) : method(int[])->()
	{
		println_s(_20, _20_size);
	}
	//return
	_DEALLOC(moves);
	_DEALLOC(_7);
	_DEALLOC(_8);
	_DEALLOC(_15);
	_DEALLOC(_20);
	exit(0);
}
Ejemplo n.º 19
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t ra;
	int64_t rb;
	int64_t rc;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	int64_t _16;
	int64_t _17;
	int64_t _18;
	_DECL_1DARRAY(_19);
	_DECL_DEALLOC(_19);
	//const %7 = 0 : int
	_7 = 0;
	//indexof %8 = %0, %7 : int[]
	_8=a[_7];
	//assign %4 = %8  : int
	// isCopyEliminated = true
	ra = _8;
	//const %9 = 0 : int
	_9 = 0;
	//indexof %10 = %1, %9 : int[]
	_10=b[_9];
	//assign %5 = %10  : int
	// isCopyEliminated = true
	rb = _10;
	//const %11 = 0 : int
	_11 = 0;
	//indexof %12 = %2, %11 : int[]
	_12=c[_11];
	//assign %6 = %12  : int
	// isCopyEliminated = true
	rc = _12;
	//const %13 = 0 : int
	_13 = 0;
	//indexof %14 = %0, %13 : int[]
	_14=a[_13];
	//const %15 = 0 : int
	_15 = 0;
	//indexof %16 = %1, %15 : int[]
	_16=b[_15];
	//ifne %14, %16 goto blklab0 : int
	if(_14!=_16){goto blklab0;}
	//return %0
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_19);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(a);
	return a;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//const %17 = 3 : int
	_17 = 3;
	//const %18 = 3 : int
	_18 = 3;
	//arraygen %19 = [17; 18] : int[]
	_NEW1DARRAY_DEALLOC(_19, _17, _18, int64_t);
	//return %19
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_19);
	return _19;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 20
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(_2);
	_DECL_DEALLOC(_2);
	int64_t _3;
	int64_t _4;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	_DECL_1DARRAY(_13);
	_DECL_DEALLOC(_13);
	//const %3 = 0 : int
	_3 = 0;
	//const %4 = 0 : int
	_4 = 0;
	//update %0[%4] = %3 : int[] -> int[]
	a[_4] = _3;
	//const %5 = 0 : int
	_5 = 0;
	//const %6 = 0 : int
	_6 = 0;
	//update %1[%6] = %5 : int[] -> int[]
	b[_6] = _5;
	//const %7 = 0 : int
	_7 = 0;
	//indexof %8 = %0, %7 : int[]
	_8=a[_7];
	//const %9 = 0 : int
	_9 = 0;
	//indexof %10 = %1, %9 : int[]
	_10=b[_9];
	//ifne %8, %10 goto blklab0 : int
	if(_8!=_10){goto blklab0;}
	//return %0
	_DEALLOC(b);
	_DEALLOC(_2);
	_DEALLOC(_13);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(a);
	return a;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//const %11 = 3 : int
	_11 = 3;
	//const %12 = 3 : int
	_12 = 3;
	//arraygen %13 = [11; 12] : int[]
	_NEW1DARRAY_DEALLOC(_13, _11, _12, int64_t);
	//return %13
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(_2);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_13);
	return _13;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 21
0
int main(int argc, char** args){
	_DECL_1DARRAY(a);
	_DECL_DEALLOC(a);
	_DECL_1DARRAY(b);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(c);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(r);
	_DECL_DEALLOC(r);
	int64_t _5;
	int64_t _6;
	_DECL_1DARRAY(_7);
	_DECL_DEALLOC(_7);
	int64_t _8;
	int64_t _9;
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	int64_t _11;
	int64_t _12;
	_DECL_1DARRAY(_13);
	_DECL_DEALLOC(_13);
	_DECL_1DARRAY(_14);
	_DECL_DEALLOC(_14);
	//const %5 = 2 : int
	_5 = 2;
	//const %6 = 2 : int
	_6 = 2;
	//arraygen %7 = [5; 6] : int[]
	_NEW1DARRAY_DEALLOC(_7, _5, _6, int64_t);
	//assign %1 = %7  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(a, _7);
	//const %8 = 2 : int
	_8 = 2;
	//const %9 = 2 : int
	_9 = 2;
	//arraygen %10 = [8; 9] : int[]
	_NEW1DARRAY_DEALLOC(_10, _8, _9, int64_t);
	//assign %2 = %10  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(b, _10);
	//const %11 = 2 : int
	_11 = 2;
	//const %12 = 2 : int
	_12 = 2;
	//arraygen %13 = [11; 12] : int[]
	_NEW1DARRAY_DEALLOC(_13, _11, _12, int64_t);
	//assign %3 = %13  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(c, _13);
	//invoke (%14) = (%1, %2, %3) 3parameter_test637:func : function(int[],int[],int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_14, c, "true-NEVER_RETURN-false" , "func");
		_FUNCTIONCALL_NO_COPY_PRE(_14, b, "false-NEVER_RETURN-false" , "func");
		_FUNCTIONCALL_NO_COPY_PRE(_14, a, "false-NEVER_RETURN-false" , "func");
		_DEALLOC(_14);
		// isCopyEliminated of '_1' = true
		// isCopyEliminated of '_2' = true
		// isCopyEliminated of '_3' = true
		_14 = _func_(a, a_size, b, b_size, c, c_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_14));
		_14_dealloc = true;
	}
	//assign %4 = %14  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(r, _14);
	//return
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(r);
	_DEALLOC(_7);
	_DEALLOC(_10);
	_DEALLOC(_13);
	_DEALLOC(_14);
	exit(0);
}
Ejemplo n.º 22
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t ra;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	int64_t _16;
	_DECL_1DARRAY(_17);
	_DECL_DEALLOC(_17);
	int64_t _18;
	int64_t _19;
	_DECL_1DARRAY(_20);
	_DECL_DEALLOC(_20);
	//const %5 = 0 : int
	_5 = 0;
	//indexof %6 = %0, %5 : int[]
	_6=a[_5];
	//assign %4 = %6  : int
	// isCopyEliminated = true
	ra = _6;
	//const %7 = 0 : int
	_7 = 0;
	//const %8 = 0 : int
	_8 = 0;
	//update %1[%8] = %7 : int[] -> int[]
	b[_8] = _7;
	//const %9 = 0 : int
	_9 = 0;
	//const %10 = 0 : int
	_10 = 0;
	//update %2[%10] = %9 : int[] -> int[]
	c[_10] = _9;
	//const %11 = 0 : int
	_11 = 0;
	//indexof %12 = %0, %11 : int[]
	_12=a[_11];
	//const %13 = 0 : int
	_13 = 0;
	//indexof %14 = %1, %13 : int[]
	_14=b[_13];
	//ifne %12, %14 goto blklab0 : int
	if(_12!=_14){goto blklab0;}
	//const %15 = 3 : int
	_15 = 3;
	//const %16 = 3 : int
	_16 = 3;
	//arraygen %17 = [15; 16] : int[]
	_NEW1DARRAY_DEALLOC(_17, _15, _16, int64_t);
	//return %17
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_20);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_17);
	return _17;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//const %18 = 3 : int
	_18 = 3;
	//const %19 = 3 : int
	_19 = 3;
	//arraygen %20 = [18; 19] : int[]
	_NEW1DARRAY_DEALLOC(_20, _18, _19, int64_t);
	//return %20
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_17);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_20);
	return _20;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 23
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);
}
Ejemplo n.º 24
0
int64_t* _func_(_DECL_1DARRAY_PARAM(a), _DECL_1DARRAY_PARAM(b), _DECL_1DARRAY_PARAM(c), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_DEALLOC(a);
	_DECL_DEALLOC(b);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(_3);
	_DECL_DEALLOC(_3);
	int64_t _4;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	int64_t _11;
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	_DECL_1DARRAY(_16);
	_DECL_DEALLOC(_16);
	int64_t _17;
	int64_t _18;
	_DECL_1DARRAY(_19);
	_DECL_DEALLOC(_19);
	//const %4 = 0 : int
	_4 = 0;
	//const %5 = 0 : int
	_5 = 0;
	//update %0[%5] = %4 : int[] -> int[]
	a[_5] = _4;
	//const %6 = 0 : int
	_6 = 0;
	//const %7 = 0 : int
	_7 = 0;
	//update %1[%7] = %6 : int[] -> int[]
	b[_7] = _6;
	//const %8 = 0 : int
	_8 = 0;
	//const %9 = 0 : int
	_9 = 0;
	//update %2[%9] = %8 : int[] -> int[]
	c[_9] = _8;
	//const %10 = 0 : int
	_10 = 0;
	//indexof %11 = %0, %10 : int[]
	_11=a[_10];
	//const %12 = 0 : int
	_12 = 0;
	//indexof %13 = %1, %12 : int[]
	_13=b[_12];
	//ifne %11, %13 goto blklab0 : int
	if(_11!=_13){goto blklab0;}
	//const %14 = 3 : int
	_14 = 3;
	//const %15 = 3 : int
	_15 = 3;
	//arraygen %16 = [14; 15] : int[]
	_NEW1DARRAY_DEALLOC(_16, _14, _15, int64_t);
	//return %16
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_19);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_16);
	return _16;
	//goto blklab1
	goto blklab1;
//.blklab0
blklab0:;
	//const %17 = 3 : int
	_17 = 3;
	//const %18 = 3 : int
	_18 = 3;
	//arraygen %19 = [17; 18] : int[]
	_NEW1DARRAY_DEALLOC(_19, _17, _18, int64_t);
	//return %19
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(_3);
	_DEALLOC(_16);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(_19);
	return _19;
//.blklab1
blklab1:;
	//return
}
Ejemplo n.º 25
0
int main(int argc, char** args){
	_DECL_1DARRAY(a);
	_DECL_DEALLOC(a);
	_DECL_1DARRAY(b);
	_DECL_DEALLOC(b);
	_DECL_1DARRAY(c);
	_DECL_DEALLOC(c);
	_DECL_1DARRAY(r);
	_DECL_DEALLOC(r);
	int64_t _5;
	int64_t _6;
	_DECL_1DARRAY(_7);
	_DECL_DEALLOC(_7);
	int64_t _8;
	int64_t _9;
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	int64_t _11;
	int64_t _12;
	_DECL_1DARRAY(_13);
	_DECL_DEALLOC(_13);
	_DECL_1DARRAY(_14);
	_DECL_DEALLOC(_14);
	void* _15;
	int64_t _17;
	int64_t _18;
	void* _19;
	int64_t _21;
	int64_t _22;
	//const %5 = 2 : int
	_5 = 2;
	//const %6 = 2 : int
	_6 = 2;
	//arraygen %7 = [5; 6] : int[]
	_NEW1DARRAY_DEALLOC(_7, _5, _6, int64_t);
	//assign %1 = %7  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(a, _7);
	//const %8 = 2 : int
	_8 = 2;
	//const %9 = 2 : int
	_9 = 2;
	//arraygen %10 = [8; 9] : int[]
	_NEW1DARRAY_DEALLOC(_10, _8, _9, int64_t);
	//assign %2 = %10  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(b, _10);
	//const %11 = 2 : int
	_11 = 2;
	//const %12 = 2 : int
	_12 = 2;
	//arraygen %13 = [11; 12] : int[]
	_NEW1DARRAY_DEALLOC(_13, _11, _12, int64_t);
	//assign %3 = %13  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(c, _13);
	//invoke (%14) = (%1, %2, %3) 3parameter_test397:func : function(int[],int[],int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_14, c, "false-NEVER_RETURN-true" , "func");
		_FUNCTIONCALL_NO_COPY_PRE(_14, b, "false-NEVER_RETURN-true" , "func");
		_FUNCTIONCALL_NO_COPY_PRE(_14, a, "true-ALWAYS_RETURN-false" , "func");
		_DEALLOC(_14);
		// isCopyEliminated of '_1' = true
		// isCopyEliminated of '_2' = true
		// isCopyEliminated of '_3' = true
		_14 = _func_(a, a_size, b, b_size, c, c_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_14));
		_14_dealloc = a_dealloc;
		a_dealloc = false;
	}
	//assign %4 = %14  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(r, _14);
	//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}
	//const %17 = 0 : int
	_17 = 0;
	//indexof %18 = %2, %17 : int[]
	_18=b[_17];
	//indirectinvoke () = %16 (%18) : method(any)->()
	{
		printf("%"PRId64"\n", _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 : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %21 = 0 : int
	_21 = 0;
	//indexof %22 = %3, %21 : int[]
	_22=c[_21];
	//indirectinvoke () = %20 (%22) : method(any)->()
	{
		printf("%"PRId64"\n", _22);
	}
	//return
	_DEALLOC(a);
	_DEALLOC(b);
	_DEALLOC(c);
	_DEALLOC(r);
	_DEALLOC(_7);
	_DEALLOC(_10);
	_DEALLOC(_13);
	_DEALLOC(_14);
	exit(0);
}
Ejemplo n.º 26
0
int main(int argc, char** args){
	_DECL_1DARRAY(ys);
	_DECL_DEALLOC(ys);
	int64_t max;
	int64_t index;
	_DECL_1DARRAY(arr);
	_DECL_DEALLOC(arr);
	int64_t _5;
	int64_t _6;
	int64_t _7;
	int64_t _8;
	int64_t _9;
	_DECL_1DARRAY(_10);
	_DECL_DEALLOC(_10);
	_DECL_1DARRAY(_11);
	_DECL_DEALLOC(_11);
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	int64_t _16;
	_DECL_1DARRAY(_17);
	_DECL_DEALLOC(_17);
	void* _18;
	int64_t _20;
	int64_t _21;
	int64_t _22;
	int64_t _23;
	_DECL_1DARRAY(_24);
	_DECL_DEALLOC(_24);
	_DECL_1DARRAY(_25);
	_DECL_DEALLOC(_25);
	int64_t _26;
	int64_t _27;
	int64_t _28;
	int64_t _29;
	_DECL_1DARRAY(_30);
	_DECL_DEALLOC(_30);
	void* _31;
	int64_t _33;
	int64_t _34;
	int64_t _35;
	int64_t _36;
	_DECL_1DARRAY(_37);
	_DECL_DEALLOC(_37);
	_DECL_1DARRAY(_38);
	_DECL_DEALLOC(_38);
	int64_t _39;
	int64_t _40;
	int64_t _41;
	int64_t _42;
	_DECL_1DARRAY(_43);
	_DECL_DEALLOC(_43);
	void* _44;
	int64_t _46;
	int64_t _47;
	int64_t _48;
	int64_t _49;
	int64_t _50;
	_DECL_1DARRAY(_51);
	_DECL_DEALLOC(_51);
	_DECL_1DARRAY(_52);
	_DECL_DEALLOC(_52);
	int64_t _53;
	int64_t _54;
	int64_t _55;
	int64_t _56;
	int64_t _57;
	_DECL_1DARRAY(_58);
	_DECL_DEALLOC(_58);
	void* _59;
	int64_t _61;
	int64_t _62;
	int64_t _63;
	_DECL_1DARRAY(_64);
	_DECL_DEALLOC(_64);
	int64_t _65;
	int64_t _66;
	int64_t _67;
	_DECL_1DARRAY(_68);
	_DECL_DEALLOC(_68);
	int64_t _69;
	int64_t _70;
	int64_t _71;
	int64_t _72;
	int64_t _73;
	int64_t _74;
	int64_t _75;
	int64_t _76;
	int64_t _77;
	int64_t _78;
	_DECL_1DARRAY(_79);
	_DECL_DEALLOC(_79);
	void* _80;
	void* _82;
	_DECL_1DARRAY(_84);
	_DECL_DEALLOC(_84);
	//const %5 = 3 : int
	_5 = 3;
	//const %6 = 4 : int
	_6 = 4;
	//const %7 = 7 : int
	_7 = 7;
	//const %8 = 1 : int
	_8 = 1;
	//const %9 = 2 : int
	_9 = 2;
	//newlist %10 = (%5, %6, %7, %8, %9) : int[]
	_DEALLOC(_10);
	_NEW_1DARRAY_int64_t(_10, 5, 0);
	_10[0] = _5; _10[1] = _6; _10[2] = _7; _10[3] = _8; _10[4] = _9; 
	_10_dealloc = true;
	//assign %1 = %10  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _10);
	//invoke (%11) = (%1) bubblesort:bubbleSort : function(int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_11, ys, 0, "liveness: ys = false, readonly: ys = false, return:ys = ALWAYS_RETURN" , "bubbleSort");
		_DEALLOC(_11);
		// isCopyEliminated of 'ys at 0' = true
		_11 = _bubbleSort_(ys, ys_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_11));
		_11_dealloc = ys_dealloc;
		ys_dealloc = false;
	}
	//assign %1 = %11  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _11);
	//assert
	{
		//const %12 = 1 : int
		_12 = 1;
		//const %13 = 2 : int
		_13 = 2;
		//const %14 = 3 : int
		_14 = 3;
		//const %15 = 4 : int
		_15 = 4;
		//const %16 = 7 : int
		_16 = 7;
		//newlist %17 = (%12, %13, %14, %15, %16) : int[]
		_DEALLOC(_17);
		_NEW_1DARRAY_int64_t(_17, 5, 0);
		_17[0] = _12; _17[1] = _13; _17[2] = _14; _17[3] = _15; _17[4] = _16; 
		_17_dealloc = true;
		//ifeq %1, %17 goto blklab5 : int[]
		_IFEQ_ARRAY_int64_t(ys, _17, blklab5);
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab5
blklab5:;
	//assert
	}
	//fieldload %18 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %19 = %18 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %19 (%1) : method(any)->()
	{
		_PRINT_1DARRAY_int64_t(ys);
	}
	//const %20 = 3 : int
	_20 = 3;
	//const %21 = 4 : int
	_21 = 4;
	//const %22 = 7 : int
	_22 = 7;
	//const %23 = 2 : int
	_23 = 2;
	//newlist %24 = (%20, %21, %22, %23) : int[]
	_DEALLOC(_24);
	_NEW_1DARRAY_int64_t(_24, 4, 0);
	_24[0] = _20; _24[1] = _21; _24[2] = _22; _24[3] = _23; 
	_24_dealloc = true;
	//assign %1 = %24  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _24);
	//invoke (%25) = (%1) bubblesort:bubbleSort : function(int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_25, ys, 0, "liveness: ys = false, readonly: ys = false, return:ys = ALWAYS_RETURN" , "bubbleSort");
		_DEALLOC(_25);
		// isCopyEliminated of 'ys at 0' = true
		_25 = _bubbleSort_(ys, ys_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_25));
		_25_dealloc = ys_dealloc;
		ys_dealloc = false;
	}
	//assign %1 = %25  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _25);
	//assert
	{
		//const %26 = 2 : int
		_26 = 2;
		//const %27 = 3 : int
		_27 = 3;
		//const %28 = 4 : int
		_28 = 4;
		//const %29 = 7 : int
		_29 = 7;
		//newlist %30 = (%26, %27, %28, %29) : int[]
		_DEALLOC(_30);
		_NEW_1DARRAY_int64_t(_30, 4, 0);
		_30[0] = _26; _30[1] = _27; _30[2] = _28; _30[3] = _29; 
		_30_dealloc = true;
		//ifeq %1, %30 goto blklab6 : int[]
		_IFEQ_ARRAY_int64_t(ys, _30, blklab6);
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab6
blklab6:;
	//assert
	}
	//fieldload %31 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %32 = %31 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %32 (%1) : method(any)->()
	{
		_PRINT_1DARRAY_int64_t(ys);
	}
	//const %33 = 1 : int
	_33 = 1;
	//const %34 = 2 : int
	_34 = 2;
	//const %35 = 3 : int
	_35 = 3;
	//const %36 = 4 : int
	_36 = 4;
	//newlist %37 = (%33, %34, %35, %36) : int[]
	_DEALLOC(_37);
	_NEW_1DARRAY_int64_t(_37, 4, 0);
	_37[0] = _33; _37[1] = _34; _37[2] = _35; _37[3] = _36; 
	_37_dealloc = true;
	//assign %1 = %37  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _37);
	//invoke (%38) = (%1) bubblesort:bubbleSort : function(int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_38, ys, 0, "liveness: ys = false, readonly: ys = false, return:ys = ALWAYS_RETURN" , "bubbleSort");
		_DEALLOC(_38);
		// isCopyEliminated of 'ys at 0' = true
		_38 = _bubbleSort_(ys, ys_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_38));
		_38_dealloc = ys_dealloc;
		ys_dealloc = false;
	}
	//assign %1 = %38  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _38);
	//assert
	{
		//const %39 = 1 : int
		_39 = 1;
		//const %40 = 2 : int
		_40 = 2;
		//const %41 = 3 : int
		_41 = 3;
		//const %42 = 4 : int
		_42 = 4;
		//newlist %43 = (%39, %40, %41, %42) : int[]
		_DEALLOC(_43);
		_NEW_1DARRAY_int64_t(_43, 4, 0);
		_43[0] = _39; _43[1] = _40; _43[2] = _41; _43[3] = _42; 
		_43_dealloc = true;
		//ifeq %1, %43 goto blklab7 : int[]
		_IFEQ_ARRAY_int64_t(ys, _43, blklab7);
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab7
blklab7:;
	//assert
	}
	//fieldload %44 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %45 = %44 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %45 (%1) : method(any)->()
	{
		_PRINT_1DARRAY_int64_t(ys);
	}
	//const %46 = 1 : int
	_46 = 1;
	//const %47 = 2 : int
	_47 = 2;
	//const %48 = 3 : int
	_48 = 3;
	//const %49 = 4 : int
	_49 = 4;
	//const %50 = 5 : int
	_50 = 5;
	//newlist %51 = (%46, %47, %48, %49, %50) : int[]
	_DEALLOC(_51);
	_NEW_1DARRAY_int64_t(_51, 5, 0);
	_51[0] = _46; _51[1] = _47; _51[2] = _48; _51[3] = _49; _51[4] = _50; 
	_51_dealloc = true;
	//assign %1 = %51  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _51);
	//invoke (%52) = (%1) bubblesort:bubbleSort : function(int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_52, ys, 0, "liveness: ys = false, readonly: ys = false, return:ys = ALWAYS_RETURN" , "bubbleSort");
		_DEALLOC(_52);
		// isCopyEliminated of 'ys at 0' = true
		_52 = _bubbleSort_(ys, ys_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_52));
		_52_dealloc = ys_dealloc;
		ys_dealloc = false;
	}
	//assign %1 = %52  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(ys, _52);
	//assert
	{
		//const %53 = 1 : int
		_53 = 1;
		//const %54 = 2 : int
		_54 = 2;
		//const %55 = 3 : int
		_55 = 3;
		//const %56 = 4 : int
		_56 = 4;
		//const %57 = 5 : int
		_57 = 5;
		//newlist %58 = (%53, %54, %55, %56, %57) : int[]
		_DEALLOC(_58);
		_NEW_1DARRAY_int64_t(_58, 5, 0);
		_58[0] = _53; _58[1] = _54; _58[2] = _55; _58[3] = _56; _58[4] = _57; 
		_58_dealloc = true;
		//ifeq %1, %58 goto blklab8 : int[]
		_IFEQ_ARRAY_int64_t(ys, _58, blklab8);
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab8
blklab8:;
	//assert
	}
	//fieldload %59 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %60 = %59 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %60 (%1) : method(any)->()
	{
		_PRINT_1DARRAY_int64_t(ys);
	}
	//const %61 = 10 : int
	_61 = 10;
	//assign %2 = %61  : int
	// isCopyEliminated = true
	max = _61;
	//const %62 = 0 : int
	_62 = 0;
	//assign %3 = %62  : int
	// isCopyEliminated = true
	index = _62;
	//const %63 = 0 : int
	_63 = 0;
	//arraygen %64 = [63; 2] : int[]
	_NEW1DARRAY_DEALLOC(_64, _63, max, int64_t);
	//assign %4 = %64  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(arr, _64);
	//loop (%3, %4, %65, %66, %67)
	while(true){
		//ifge %3, %2 goto blklab9 : int
		if(index>=max){goto blklab9;}
		//sub %65 = %2, %3 : int
		_65=max-index;
		//update %4[%3] = %65 : int[] -> int[]
		arr[index] = _65;
		//const %66 = 1 : int
		_66 = 1;
		//add %67 = %3, %66 : int
		_67=index+_66;
		//assign %3 = %67  : int
		// isCopyEliminated = true
		index = _67;
//.blklab10
blklab10:;
	}
//.blklab9
blklab9:;
	//invoke (%68) = (%4) bubblesort:bubbleSort : function(int[])->(int[])
	{
		_FUNCTIONCALL_NO_COPY_PRE(_68, arr, 0, "liveness: arr = false, readonly: arr = false, return:arr = ALWAYS_RETURN" , "bubbleSort");
		_DEALLOC(_68);
		// isCopyEliminated of 'arr at 0' = true
		_68 = _bubbleSort_(arr, arr_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_68));
		_68_dealloc = arr_dealloc;
		arr_dealloc = false;
	}
	//assign %4 = %68  : int[]
	// isCopyEliminated = true
	_TRANSFER_DEALLOC(arr, _68);
	//assert
	{
		//const %69 = 1 : int
		_69 = 1;
		//const %70 = 2 : int
		_70 = 2;
		//const %71 = 3 : int
		_71 = 3;
		//const %72 = 4 : int
		_72 = 4;
		//const %73 = 5 : int
		_73 = 5;
		//const %74 = 6 : int
		_74 = 6;
		//const %75 = 7 : int
		_75 = 7;
		//const %76 = 8 : int
		_76 = 8;
		//const %77 = 9 : int
		_77 = 9;
		//const %78 = 10 : int
		_78 = 10;
		//newlist %79 = (%69, %70, %71, %72, %73, %74, %75, %76, %77, %78) : int[]
		_DEALLOC(_79);
		_NEW_1DARRAY_int64_t(_79, 10, 0);
		_79[0] = _69; _79[1] = _70; _79[2] = _71; _79[3] = _72; _79[4] = _73; _79[5] = _74; _79[6] = _75; _79[7] = _76; _79[8] = _77; _79[9] = _78; 
		_79_dealloc = true;
		//ifeq %4, %79 goto blklab11 : int[]
		_IFEQ_ARRAY_int64_t(arr, _79, blklab11);
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab11
blklab11:;
	//assert
	}
	//fieldload %80 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %81 = %80 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %81 (%4) : method(any)->()
	{
		_PRINT_1DARRAY_int64_t(arr);
	}
	//fieldload %82 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %83 = %82 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %84 = [80,97,115,115,32,66,117,98,98,108,101,83,111,114,116,32,116,101,115,116,32,99,97,115,101] : int[]
	_DEALLOC(_84);
	_NEW_1DARRAY_int64_t(_84, 25, 0);
	_84[0] = 80; _84[1] = 97; _84[2] = 115; _84[3] = 115; _84[4] = 32; _84[5] = 66; _84[6] = 117; _84[7] = 98; _84[8] = 98; _84[9] = 108; _84[10] = 101; _84[11] = 83; _84[12] = 111; _84[13] = 114; _84[14] = 116; _84[15] = 32; _84[16] = 116; _84[17] = 101; _84[18] = 115; _84[19] = 116; _84[20] = 32; _84[21] = 99; _84[22] = 97; _84[23] = 115; _84[24] = 101; 
	_84_dealloc = true;
	//indirectinvoke () = %83 (%84) : method(int[])->()
	{
		println_s(_84, _84_size);
	}
	//return
	_DEALLOC(ys);
	_DEALLOC(arr);
	_DEALLOC(_10);
	_DEALLOC(_11);
	_DEALLOC(_17);
	_DEALLOC(_24);
	_DEALLOC(_25);
	_DEALLOC(_30);
	_DEALLOC(_37);
	_DEALLOC(_38);
	_DEALLOC(_43);
	_DEALLOC(_51);
	_DEALLOC(_52);
	_DEALLOC(_58);
	_DEALLOC(_64);
	_DEALLOC(_68);
	_DEALLOC(_79);
	_DEALLOC(_84);
	exit(0);
}