Beispiel #1
0
int main(int argc, char** args){
	_DECL_1DARRAY_BYTE(input);
	_DECL_1DARRAY_BYTE(arr);
	_DECL_1DARRAY_BYTE(arr1);
	BYTE _4;
	BYTE _5;
	BYTE _6;
	_DECL_1DARRAY_BYTE(_7);
	_DECL_1DARRAY_BYTE(_8);
	_DECL_1DARRAY_BYTE(_9);
	void* _10;
	void* _12;
	//const %4 = 01100001b : byte
	_4 = 0b01100001;
	//const %5 = 01100010b : byte
	_5 = 0b01100010;
	//const %6 = 01100011b : byte
	_6 = 0b01100011;
	//newlist %7 = (%4, %5, %6) : byte[]
	_NEW_1DARRAY_BYTE(_7, 3, 0b0);
	_7[0] = _4; _7[1] = _5; _7[2] = _6; 
	//assign %1 = %7  : byte[]
	_COPY_1DARRAY_BYTE(input, _7);
	//invoke (%8) = (%1) appendarray1:f_append : function(byte[])->(byte[])
	{
		void* tmp_input;
		_COPY_1DARRAY_PARAM(input, tmp_input, BYTE);
		_8 = _f_append_(tmp_input, input_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_8));
	}
	//assign %2 = %8  : byte[]
	_COPY_1DARRAY_BYTE(arr, _8);
	//invoke (%9) = (%1) appendarray1:f_resize : function(byte[])->(byte[])
	{
		void* tmp_input;
		_COPY_1DARRAY_PARAM(input, tmp_input, BYTE);
		_9 = _f_resize_(tmp_input, input_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_9));
	}
	//assign %3 = %9  : byte[]
	_COPY_1DARRAY_BYTE(arr1, _9);
	//fieldload %10 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %11 = %10 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %11 (%2) : method(any)->()
	{
		_PRINT_1DARRAY_BYTE(arr);
	}
	//fieldload %12 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %13 = %12 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %13 (%3) : method(any)->()
	{
		_PRINT_1DARRAY_BYTE(arr1);
	}
	//return
	exit(0);
}
Beispiel #2
0
int main(int argc, char** args){
	_DECL_1DARRAY_BYTE(data);
	_DECL_1DARRAY_BYTE(arr);
	BYTE _3;
	BYTE _4;
	BYTE _5;
	_DECL_1DARRAY_BYTE(_6);
	_DECL_1DARRAY_BYTE(_7);
	BYTE _8;
	BYTE _9;
	BYTE _10;
	BYTE _11;
	BYTE _12;
	BYTE _13;
	_DECL_1DARRAY_BYTE(_14);
	void* _15;
	int64_t _17;
	//const %3 = 01100001b : byte
	_3 = 0b01100001;
	//const %4 = 01100010b : byte
	_4 = 0b01100010;
	//const %5 = 01100011b : byte
	_5 = 0b01100011;
	//newlist %6 = (%3, %4, %5) : byte[]
	_NEW_1DARRAY_BYTE(_6, 3, 0b0);
	_6[0] = _3; _6[1] = _4; _6[2] = _5; 
	//assign %1 = %6  : byte[]
	_COPY_1DARRAY_BYTE(data, _6);
	//invoke (%7) = (%1) appendarray:f : function(byte[])->(byte[])
	{
		void* tmp_data;
		_COPY_1DARRAY_PARAM(data, tmp_data, BYTE);
		_7 = _f_(tmp_data, data_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_7));
	}
	//assign %2 = %7  : byte[]
	_COPY_1DARRAY_BYTE(arr, _7);
	//fieldload %15 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %16 = %15 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//lengthof %17 = %2 : byte[]
	_17 = arr_size;
	//indirectinvoke () = %16 (%17) : method(any)->()
	{
		printf("%"PRId64, _17);
	}
	//return
	exit(0);
}
Beispiel #3
0
BYTE* _append_(BYTE* items, size_t items_size, BYTE item, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_1DARRAY_BYTE(nitems);
	int64_t i;
	BYTE _4;
	int64_t _5;
	int64_t _6;
	int64_t _7;
	_DECL_1DARRAY_BYTE(_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[]
	_NEW_1DARRAY_BYTE(_8, _7, _4);
	//assign %2 = %8  : byte[]
	_COPY_1DARRAY_BYTE(nitems, _8);
	//const %9 = 0 : int
	_9 = 0;
	//assign %3 = %9  : int
	i = _9;
	//loop (%2, %3, %10, %11, %12, %13)
	while(true){
		//lengthof %10 = %0 : byte[]
		_10 = items_size;
		//ifge %3, %10 goto blklab1 : int
		if(i>=_10){goto blklab1;}
		//indexof %11 = %0, %3 : byte[]
		_11=items[i];
		//update %2[%3] = %11 : byte[] -> byte[]
		nitems[i] = _11;
		//const %12 = 1 : int
		_12 = 1;
		//add %13 = %3, %12 : int
		_13=i+_12;
		//assign %3 = %13  : int
		i = _13;
//.blklab2
blklab2:;
	}
//.blklab1
blklab1:;
	//update %2[%3] = %1 : byte[] -> byte[]
	nitems[i] = item;
	//return %2
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(nitems);
	return nitems;
	//return
}
Beispiel #4
0
BYTE* _resize_(BYTE* items, size_t items_size, _DECL_DEALLOC_PARAM(items), int64_t size, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_1DARRAY_BYTE(nitems);
	_DECL_DEALLOC(nitems);
	int64_t i;
	BYTE _4;
	_DECL_1DARRAY_BYTE(_5);
	_DECL_DEALLOC(_5);
	int64_t _6;
	BYTE _7;
	int64_t _8;
	int64_t _9;
	//const %4 = 00000000b : byte
	_4 = 0b00000000;
	//arraygen %5 = [4; 1] : byte[]
	_DEALLOC(_5);
	_NEW_1DARRAY_BYTE(_5, size, _4);
	_ADD_DEALLOC(_5);
	//assign %2 = %5  : byte[]
	_DEALLOC(nitems);
	_COPY_1DARRAY_BYTE(nitems, _5);
	_ADD_DEALLOC(nitems);
	//const %6 = 0 : int
	_6 = 0;
	//assign %3 = %6  : int
	i = _6;
	//loop (%2, %3, %7, %8, %9)
	while(true){
		//ifge %3, %1 goto blklab5 : int
		if(i>=size){goto blklab5;}
		//indexof %7 = %0, %3 : byte[]
		_7=items[i];
		//update %2[%3] = %7 : byte[] -> byte[]
		nitems[i] = _7;
		//const %8 = 1 : int
		_8 = 1;
		//add %9 = %3, %8 : int
		_9=i+_8;
		//assign %3 = %9  : int
		i = _9;
//.blklab6
blklab6:;
	}
//.blklab5
blklab5:;
	//return %2
	_DEALLOC(items);
	_DEALLOC(_5);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(nitems);
	return nitems;
	//return
}
Beispiel #5
0
BYTE* _f_(BYTE* data, size_t data_size, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_1DARRAY_BYTE(output);
	int64_t pos;
	BYTE item;
	BYTE length;
	int64_t _5;
	BYTE _6;
	int64_t _7;
	_DECL_1DARRAY_BYTE(_8);
	int64_t _9;
	BYTE _10;
	BYTE _11;
	int64_t _12;
	int64_t _13;
	_DECL_1DARRAY_BYTE(_14);
	_DECL_1DARRAY_BYTE(_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;
	_DECL_1DARRAY_BYTE(_25);
	//const %5 = 0 : int
	_5 = 0;
	//assign %2 = %5  : int
	pos = _5;
	//const %6 = 00000000b : byte
	_6 = 0b00000000;
	//const %7 = 0 : int
	_7 = 0;
	//const %16 = 2 : int
	_16 = 2;
	//lengthof %17 = %0 : byte[]
	_17 = data_size;
	//mul %18 = %16, %17 : int
	_18=_16*_17;
	//arraygen %8 = [6; 18] : byte[]
	_NEW_1DARRAY_BYTE(_8, _18, _6);
	//const %19 = 0 : int
	_19 = 0;
	//assign %20 = %19  : int
	_20 = _19;
	//assign %1 = %8  : byte[]
	_COPY_1DARRAY_BYTE(output, _8);
	//loop (%1, %2, %3, %4, %9, %10, %11, %12, %13, %14, %15, %20)
	while(true){
		//lengthof %9 = %0 : byte[]
		_9 = data_size;
		//ifge %2, %9 goto blklab7 : int
		if(pos>=_9){goto blklab7;}
		//indexof %10 = %0, %2 : byte[]
		_10=data[pos];
		//assign %3 = %10  : byte
		item = _10;
		//invoke (%11) = (%2) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte)
		{
			_11 = (BYTE)pos;
		}
		//assign %4 = %11  : byte
		length = _11;
		//const %12 = 1 : int
		_12 = 1;
		//add %13 = %2, %12 : int
		_13=pos+_12;
		//assign %2 = %13  : int
		pos = _13;
		//update %1[%20] = %4 : byte[] -> byte[]
		output[_20] = length;
		//const %21 = 1 : int
		_21 = 1;
		//add %22 = %20, %21 : int
		_22=_20+_21;
		//assign %20 = %22  : int
		_20 = _22;
		//update %1[%20] = %3 : byte[] -> byte[]
		output[_20] = item;
		//const %23 = 1 : int
		_23 = 1;
		//add %24 = %20, %23 : int
		_24=_20+_23;
		//assign %20 = %24  : int
		_20 = _24;
//.blklab8
blklab8:;
	}
//.blklab7
blklab7:;
	//invoke (%25) = (%1, %20) appendarray:resize : function(byte[],int)->(byte[])
	{
		void* tmp_items;
		_COPY_1DARRAY_PARAM(output, tmp_items, BYTE);
		_25 = _resize_(tmp_items, output_size, _20, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_25));
	}
	//assign %1 = %25  : byte[]
	_COPY_1DARRAY_BYTE(output, _25);
	//return %1
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output);
	return output;
	//return
}
Beispiel #6
0
int main(int argc, char** args){
	_DECL_1DARRAY_BYTE(input);
	_DECL_DEALLOC(input);
	_DECL_1DARRAY_BYTE(arr);
	_DECL_DEALLOC(arr);
	_DECL_1DARRAY_BYTE(arr1);
	_DECL_DEALLOC(arr1);
	BYTE _4;
	BYTE _5;
	BYTE _6;
	_DECL_1DARRAY_BYTE(_7);
	_DECL_DEALLOC(_7);
	_DECL_1DARRAY_BYTE(_8);
	_DECL_DEALLOC(_8);
	_DECL_1DARRAY_BYTE(_9);
	_DECL_DEALLOC(_9);
	void* _10;
	void* _12;
	//const %4 = 01100001b : byte
	_4 = 0b01100001;
	//const %5 = 01100010b : byte
	_5 = 0b01100010;
	//const %6 = 01100011b : byte
	_6 = 0b01100011;
	//newlist %7 = (%4, %5, %6) : byte[]
	_DEALLOC(_7);
	_NEW_1DARRAY_BYTE(_7, 3, 0b0);
	_7[0] = _4; _7[1] = _5; _7[2] = _6; 
	_ADD_DEALLOC(_7);
	//assign %1 = %7  : byte[]
	_DEALLOC(input);
	_COPY_1DARRAY_BYTE(input, _7);
	_ADD_DEALLOC(input);
	//invoke (%8) = (%1) appendarray1:f_append : function(byte[])->(byte[])
	{
		void* input_tmp;
		_DEALLOC(_8);
		_8 = _f_append_(_COPY_1DARRAY_PARAM_BYTE(input), true, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_8));
		_CALLEE_DEALLOC(input, "false-false-true" , "f_append");
		_8_dealloc = true;
	}
	//assign %2 = %8  : byte[]
	_DEALLOC(arr);
	_COPY_1DARRAY_BYTE(arr, _8);
	_ADD_DEALLOC(arr);
	//invoke (%9) = (%1) appendarray1:f_resize : function(byte[])->(byte[])
	{
		void* input_tmp;
		_DEALLOC(_9);
		_9 = _f_resize_(_COPY_1DARRAY_PARAM_BYTE(input), true, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_9));
		_CALLEE_DEALLOC(input, "false-false-false" , "f_resize");
		_9_dealloc = true;
	}
	//assign %3 = %9  : byte[]
	_DEALLOC(arr1);
	_COPY_1DARRAY_BYTE(arr1, _9);
	_ADD_DEALLOC(arr1);
	//assert
	{
		//ifeq %2, %3 goto blklab12 : byte[]
		_IFEQ_ARRAY_BYTE(arr, arr1, blklab12);
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab12
blklab12:;
	//assert
	}
	//fieldload %10 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %11 = %10 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %11 (%2) : method(any)->()
	{
		_PRINT_1DARRAY_BYTE(arr);
	}
	//fieldload %12 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %13 = %12 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//indirectinvoke () = %13 (%3) : method(any)->()
	{
		_PRINT_1DARRAY_BYTE(arr1);
	}
	//return
	_DEALLOC(input);
	_DEALLOC(arr);
	_DEALLOC(arr1);
	_DEALLOC(_7);
	_DEALLOC(_8);
	_DEALLOC(_9);
	exit(0);
}
Beispiel #7
0
BYTE* _f_resize_(BYTE* input, size_t input_size, _DECL_DEALLOC_PARAM(input), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_1DARRAY_BYTE(output);
	_DECL_DEALLOC(output);
	int64_t pos;
	int64_t size;
	BYTE index;
	BYTE item;
	int64_t _6;
	BYTE _7;
	int64_t _8;
	int64_t _9;
	int64_t _10;
	_DECL_1DARRAY_BYTE(_11);
	_DECL_DEALLOC(_11);
	int64_t _12;
	int64_t _13;
	BYTE _14;
	BYTE _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;
	_DECL_1DARRAY_BYTE(_25);
	_DECL_DEALLOC(_25);
	//const %6 = 0 : int
	_6 = 0;
	//assign %2 = %6  : int
	pos = _6;
	//const %7 = 00000000b : byte
	_7 = 0b00000000;
	//const %8 = 2 : int
	_8 = 2;
	//lengthof %9 = %0 : byte[]
	_9 = input_size;
	//mul %10 = %8, %9 : int
	_10=_8*_9;
	//arraygen %11 = [7; 10] : byte[]
	_DEALLOC(_11);
	_NEW_1DARRAY_BYTE(_11, _10, _7);
	_ADD_DEALLOC(_11);
	//assign %1 = %11  : byte[]
	_DEALLOC(output);
	_COPY_1DARRAY_BYTE(output, _11);
	_ADD_DEALLOC(output);
	//const %12 = 0 : int
	_12 = 0;
	//assign %3 = %12  : int
	size = _12;
	//loop (%1, %2, %3, %4, %5, %13, %14, %15, %16, %17, %18, %19, %20, %21)
	while(true){
		//lengthof %13 = %0 : byte[]
		_13 = input_size;
		//ifge %2, %13 goto blklab9 : int
		if(pos>=_13){goto blklab9;}
		//invoke (%14) = (%2) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte)
		{
			_14 = (BYTE)pos;
		}
		//assign %4 = %14  : byte
		index = _14;
		//indexof %15 = %0, %2 : byte[]
		_15=input[pos];
		//assign %5 = %15  : byte
		item = _15;
		//update %1[%3] = %4 : byte[] -> byte[]
		output[size] = index;
		//const %16 = 1 : int
		_16 = 1;
		//add %17 = %3, %16 : int
		_17=size+_16;
		//assign %3 = %17  : int
		size = _17;
		//update %1[%3] = %5 : byte[] -> byte[]
		output[size] = item;
		//const %18 = 1 : int
		_18 = 1;
		//add %19 = %3, %18 : int
		_19=size+_18;
		//assign %3 = %19  : int
		size = _19;
		//const %20 = 1 : int
		_20 = 1;
		//add %21 = %2, %20 : int
		_21=pos+_20;
		//assign %2 = %21  : int
		pos = _21;
//.blklab10
blklab10:;
	}
//.blklab9
blklab9:;
	//assert
	{
		//const %22 = 2 : int
		_22 = 2;
		//lengthof %23 = %0 : byte[]
		_23 = input_size;
		//mul %24 = %22, %23 : int
		_24=_22*_23;
		//ifle %3, %24 goto blklab11 : int
		if(size<=_24){goto blklab11;}
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab11
blklab11:;
	//assert
	}
	//invoke (%25) = (%1, %3) appendarray1:resize : function(byte[],int)->(byte[])
	{
		void* output_tmp;
		_DEALLOC(_25);
		_25 = _resize_(_COPY_1DARRAY_PARAM_BYTE(output), true, size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_25));
		_CALLEE_DEALLOC(output, "false-false-false" , "resize");
		_25_dealloc = true;
	}
	//assign %1 = %25  : byte[]
	_DEALLOC(output);
	_COPY_1DARRAY_BYTE(output, _25);
	_ADD_DEALLOC(output);
	//return %1
	_DEALLOC(input);
	_DEALLOC(_11);
	_DEALLOC(_25);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output);
	return output;
	//return
}
Beispiel #8
0
BYTE* _f_append_(BYTE* input, size_t input_size, _DECL_DEALLOC_PARAM(input), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_1DARRAY_BYTE(output);
	_DECL_DEALLOC(output);
	int64_t pos;
	BYTE index;
	BYTE item;
	int64_t _5;
	BYTE _6;
	int64_t _7;
	_DECL_1DARRAY_BYTE(_8);
	_DECL_DEALLOC(_8);
	int64_t _9;
	BYTE _10;
	BYTE _11;
	_DECL_1DARRAY_BYTE(_12);
	_DECL_DEALLOC(_12);
	_DECL_1DARRAY_BYTE(_13);
	_DECL_DEALLOC(_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;
	int64_t _24;
	_DECL_1DARRAY_BYTE(_25);
	_DECL_DEALLOC(_25);
	//const %5 = 0 : int
	_5 = 0;
	//assign %2 = %5  : int
	pos = _5;
	//const %6 = 00000000b : byte
	_6 = 0b00000000;
	//const %7 = 0 : int
	_7 = 0;
	//const %16 = 2 : int
	_16 = 2;
	//lengthof %17 = %0 : byte[]
	_17 = input_size;
	//mul %18 = %16, %17 : int
	_18=_16*_17;
	//arraygen %8 = [6; 18] : byte[]
	_DEALLOC(_8);
	_NEW_1DARRAY_BYTE(_8, _18, _6);
	_ADD_DEALLOC(_8);
	//const %19 = 0 : int
	_19 = 0;
	//assign %20 = %19  : int
	_20 = _19;
	//assign %1 = %8  : byte[]
	_DEALLOC(output);
	_COPY_1DARRAY_BYTE(output, _8);
	_ADD_DEALLOC(output);
	//loop (%1, %2, %3, %4, %9, %10, %11, %12, %13, %14, %15, %20)
	while(true){
		//lengthof %9 = %0 : byte[]
		_9 = input_size;
		//ifge %2, %9 goto blklab7 : int
		if(pos>=_9){goto blklab7;}
		//invoke (%10) = (%2) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte)
		{
			_10 = (BYTE)pos;
		}
		//assign %3 = %10  : byte
		index = _10;
		//indexof %11 = %0, %2 : byte[]
		_11=input[pos];
		//assign %4 = %11  : byte
		item = _11;
		//update %1[%20] = %3 : byte[] -> byte[]
		output[_20] = index;
		//const %21 = 1 : int
		_21 = 1;
		//add %22 = %20, %21 : int
		_22=_20+_21;
		//assign %20 = %22  : int
		_20 = _22;
		//update %1[%20] = %4 : byte[] -> byte[]
		output[_20] = item;
		//const %23 = 1 : int
		_23 = 1;
		//add %24 = %20, %23 : int
		_24=_20+_23;
		//assign %20 = %24  : int
		_20 = _24;
		//const %14 = 1 : int
		_14 = 1;
		//add %15 = %2, %14 : int
		_15=pos+_14;
		//assign %2 = %15  : int
		pos = _15;
//.blklab8
blklab8:;
	}
//.blklab7
blklab7:;
	//assert
	{
		//ifle %20, %18 goto blklab13 : int
		if(_20<=_18){goto blklab13;}
		//fail
		fprintf(stderr,"fail");
		exit(-1);
//.blklab13
blklab13:;
	//assert
	}
	//invoke (%25) = (%1, %20) appendarray1:resize : function(byte[],int)->(byte[])
	{
		void* output_tmp;
		_DEALLOC(_25);
		_25 = _resize_(_COPY_1DARRAY_PARAM_BYTE(output), true, _20, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_25));
		_CALLEE_DEALLOC(output, "false-false-false" , "resize");
		_25_dealloc = true;
	}
	//assign %1 = %25  : byte[]
	_DEALLOC(output);
	_COPY_1DARRAY_BYTE(output, _25);
	_ADD_DEALLOC(output);
	//return %1
	_DEALLOC(input);
	_DEALLOC(_8);
	_DEALLOC(_12);
	_DEALLOC(_13);
	_DEALLOC(_25);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output);
	return output;
	//return
}
Beispiel #9
0
int main(int argc, char** args){
	FILE* file;
	_DECL_1DARRAY_BYTE(data);
	_DECL_DEALLOC(data);
	_DECL_1DARRAY_BYTE(compress_data);
	_DECL_DEALLOC(compress_data);
	FILE* writer;
	_DECL_1DARRAY_BYTE(decompress_data);
	_DECL_DEALLOC(decompress_data);
	void* _6;
	_DECL_DEALLOC(_6);
	_DECL_1DARRAY(_7);
	_DECL_DEALLOC(_7);
	_DECL_1DARRAY_BYTE(_8);
	_DECL_DEALLOC(_8);
	void* _10;
	_DECL_1DARRAY(_12);
	_DECL_DEALLOC(_12);
	void* _13;
	_DECL_1DARRAY(_15);
	_DECL_DEALLOC(_15);
	void* _16;
	int64_t _18;
	void* _19;
	_DECL_1DARRAY(_21);
	_DECL_DEALLOC(_21);
	_DECL_1DARRAY_BYTE(_22);
	_DECL_DEALLOC(_22);
	void* _23;
	_DECL_1DARRAY(_25);
	_DECL_DEALLOC(_25);
	void* _26;
	int64_t _28;
	void* _29;
	_DECL_1DARRAY(_31);
	_DECL_DEALLOC(_31);
	void* _32;
	_DECL_DEALLOC(_32);
	_DECL_1DARRAY(_33);
	_DECL_DEALLOC(_33);
	int64_t _34;
	_DECL_1DARRAY_BYTE(_37);
	_DECL_DEALLOC(_37);
	void* _38;
	_DECL_1DARRAY(_40);
	_DECL_DEALLOC(_40);
	void* _41;
	_DECL_1DARRAY(_43);
	_DECL_DEALLOC(_43);
	void* _44;
	int64_t _46;
	void* _47;
	_DECL_1DARRAY(_49);
	_DECL_DEALLOC(_49);
	//const %7 = [105,110,112,117,116,50,120,46,105,110] : int[]
	_DEALLOC(_7);
	_NEW_1DARRAY_int64_t(_7, 10, 0);
	_7[0] = 105; _7[1] = 110; _7[2] = 112; _7[3] = 117; _7[4] = 116; _7[5] = 50; _7[6] = 120; _7[7] = 46; _7[8] = 105; _7[9] = 110; 
	_ADD_DEALLOC(_7);
	//invoke (%6) = (%7) whiley/io/File:Reader : method(whiley/lang/ASCII:string)->(whiley/io/File:Reader)
	{
		_6 = Reader(_7, _7_size);
	}
	//assign %1 = %6  : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll}
	file = _6;
	//fieldload %9 = %1 readAll : {method()->(int) available,method()->() close,method()->(bool) hasMore,method(int)->(byte[]) read,method()->(byte[]) readAll}
	//indirectinvoke (%8) = %9 () : method()->(byte[])
	{
		_8 = readAll(file, &_8_size);
		_ADD_DEALLOC(_8);
	}
	//assign %2 = %8  : byte[]
	_DEALLOC(data);
	_COPY_1DARRAY_BYTE(data, _8);
	_ADD_DEALLOC(data);
	//fieldload %10 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %11 = %10 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %12 = [68,97,116,97,58,32,32,32,32,32,32,32,32,32] : int[]
	_DEALLOC(_12);
	_NEW_1DARRAY_int64_t(_12, 14, 0);
	_12[0] = 68; _12[1] = 97; _12[2] = 116; _12[3] = 97; _12[4] = 58; _12[5] = 32; _12[6] = 32; _12[7] = 32; _12[8] = 32; _12[9] = 32; _12[10] = 32; _12[11] = 32; _12[12] = 32; _12[13] = 32; 
	_ADD_DEALLOC(_12);
	//indirectinvoke () = %11 (%12) : method(int[])->()
	{
		println_s(_12, _12_size);
	}
	//fieldload %13 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %14 = %13 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//invoke (%15) = (%2) whiley/lang/ASCII:fromBytes : function(byte[])->(whiley/lang/ASCII:string)
	{
		_DEALLOC(_15);
		_15 = fromBytes(data, data_size);
		_15_size = data_size;
		_ADD_DEALLOC(_15);
	}
	//indirectinvoke () = %14 (%15) : method(int[])->()
	{
		println_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 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//lengthof %18 = %2 : byte[]
	_18 = data_size;
	//indirectinvoke () = %17 (%18) : method(any)->()
	{
		printf("%"PRId64, _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 = [32,98,121,116,101,115] : int[]
	_DEALLOC(_21);
	_NEW_1DARRAY_int64_t(_21, 6, 0);
	_21[0] = 32; _21[1] = 98; _21[2] = 121; _21[3] = 116; _21[4] = 101; _21[5] = 115; 
	_ADD_DEALLOC(_21);
	//indirectinvoke () = %20 (%21) : method(int[])->()
	{
		println_s(_21, _21_size);
	}
	//invoke (%22) = (%2) lz77_compress:compress : function(byte[])->(byte[])
	{
		void* tmp_data;
		_COPY_1DARRAY_PARAM(data, tmp_data, BYTE);
		_DEALLOC(_22);
		_22 = _compress_(tmp_data, data_size, true, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_22));
		_CALLEE_DEALLOC(data, "false-false-false" , "compress");
		_CALLEE_DEALLOC_POST(_22, data);
	}
	//assign %3 = %22  : byte[]
	_DEALLOC(compress_data);
	_COPY_1DARRAY_BYTE(compress_data, _22);
	_ADD_DEALLOC(compress_data);
	//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_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %25 = [67,79,77,80,82,69,83,83,69,68,32,68,97,116,97,58,32,32,32] : int[]
	_DEALLOC(_25);
	_NEW_1DARRAY_int64_t(_25, 19, 0);
	_25[0] = 67; _25[1] = 79; _25[2] = 77; _25[3] = 80; _25[4] = 82; _25[5] = 69; _25[6] = 83; _25[7] = 83; _25[8] = 69; _25[9] = 68; _25[10] = 32; _25[11] = 68; _25[12] = 97; _25[13] = 116; _25[14] = 97; _25[15] = 58; _25[16] = 32; _25[17] = 32; _25[18] = 32; 
	_ADD_DEALLOC(_25);
	//indirectinvoke () = %24 (%25) : method(int[])->()
	{
		println_s(_25, _25_size);
	}
	//fieldload %26 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %27 = %26 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//lengthof %28 = %3 : byte[]
	_28 = compress_data_size;
	//indirectinvoke () = %27 (%28) : method(any)->()
	{
		printf("%"PRId64, _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_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %31 = [32,98,121,116,101,115] : int[]
	_DEALLOC(_31);
	_NEW_1DARRAY_int64_t(_31, 6, 0);
	_31[0] = 32; _31[1] = 98; _31[2] = 121; _31[3] = 116; _31[4] = 101; _31[5] = 115; 
	_ADD_DEALLOC(_31);
	//indirectinvoke () = %30 (%31) : method(int[])->()
	{
		println_s(_31, _31_size);
	}
	//const %33 = [115,109,97,108,108,46,100,97,116] : int[]
	_DEALLOC(_33);
	_NEW_1DARRAY_int64_t(_33, 9, 0);
	_33[0] = 115; _33[1] = 109; _33[2] = 97; _33[3] = 108; _33[4] = 108; _33[5] = 46; _33[6] = 100; _33[7] = 97; _33[8] = 116; 
	_ADD_DEALLOC(_33);
	//invoke (%32) = (%33) whiley/io/File:Writer : method(whiley/lang/ASCII:string)->(whiley/io/File:Writer)
	{
		_32 = Writer(_33, _33_size);
	}
	//assign %4 = %32  : {method()->() close,method()->() flush,method(byte[])->(int) write,...}
	writer = _32;
	//fieldload %35 = %4 write : {method()->() close,method()->() flush,method(byte[])->(int) write,...}
	//indirectinvoke (%34) = %35 (%3) : method(byte[])->(int)
	{
		writeAll(writer, compress_data, compress_data_size);
	}
	//fieldload %36 = %4 close : {method()->() close,method()->() flush,method(byte[])->(int) write,...}
	//indirectinvoke () = %36 () : method()->()
	{
		fclose(writer);
		writer = NULL;
	}
	//invoke (%37) = (%3) lz77_compress:decompress : function(byte[])->(byte[])
	{
		void* tmp_data;
		_COPY_1DARRAY_PARAM(compress_data, tmp_data, BYTE);
		_DEALLOC(_37);
		_37 = _decompress_(tmp_data, compress_data_size, true, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_37));
		_CALLEE_DEALLOC(compress_data, "false-false-false" , "decompress");
		_CALLEE_DEALLOC_POST(_37, compress_data);
	}
	//assign %5 = %37  : byte[]
	_DEALLOC(decompress_data);
	_COPY_1DARRAY_BYTE(decompress_data, _37);
	_ADD_DEALLOC(decompress_data);
	//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 = [68,69,67,79,77,80,82,69,83,83,69,68,58,32,32,32] : int[]
	_DEALLOC(_40);
	_NEW_1DARRAY_int64_t(_40, 16, 0);
	_40[0] = 68; _40[1] = 69; _40[2] = 67; _40[3] = 79; _40[4] = 77; _40[5] = 80; _40[6] = 82; _40[7] = 69; _40[8] = 83; _40[9] = 83; _40[10] = 69; _40[11] = 68; _40[12] = 58; _40[13] = 32; _40[14] = 32; _40[15] = 32; 
	_ADD_DEALLOC(_40);
	//indirectinvoke () = %39 (%40) : method(int[])->()
	{
		println_s(_40, _40_size);
	}
	//fieldload %41 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %42 = %41 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//invoke (%43) = (%5) whiley/lang/ASCII:fromBytes : function(byte[])->(whiley/lang/ASCII:string)
	{
		_DEALLOC(_43);
		_43 = fromBytes(decompress_data, decompress_data_size);
		_43_size = decompress_data_size;
		_ADD_DEALLOC(_43);
	}
	//indirectinvoke () = %42 (%43) : method(int[])->()
	{
		println_s(_43, _43_size);
	}
	//fieldload %44 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %45 = %44 print : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//lengthof %46 = %5 : byte[]
	_46 = decompress_data_size;
	//indirectinvoke () = %45 (%46) : method(any)->()
	{
		printf("%"PRId64, _46);
	}
	//fieldload %47 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	//fieldload %48 = %47 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s}
	//const %49 = [32,98,121,116,101,115] : int[]
	_DEALLOC(_49);
	_NEW_1DARRAY_int64_t(_49, 6, 0);
	_49[0] = 32; _49[1] = 98; _49[2] = 121; _49[3] = 116; _49[4] = 101; _49[5] = 115; 
	_ADD_DEALLOC(_49);
	//indirectinvoke () = %48 (%49) : method(int[])->()
	{
		println_s(_49, _49_size);
	}
	//return
	if(file != NULL){fclose(file); file = NULL;}
	_DEALLOC(data);
	_DEALLOC(compress_data);
	if(writer != NULL){fclose(writer); writer = NULL;}
	_DEALLOC(decompress_data);
	_DEALLOC(_7);
	_DEALLOC(_8);
	_DEALLOC(_12);
	_DEALLOC(_15);
	_DEALLOC(_21);
	_DEALLOC(_22);
	_DEALLOC(_25);
	_DEALLOC(_31);
	_DEALLOC(_33);
	_DEALLOC(_37);
	_DEALLOC(_40);
	_DEALLOC(_43);
	_DEALLOC(_49);
	exit(0);
}
Beispiel #10
0
BYTE* _decompress_(BYTE* data, size_t data_size, _DECL_DEALLOC_PARAM(data), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_1DARRAY_BYTE(output);
	_DECL_DEALLOC(output);
	int64_t pos;
	BYTE header;
	BYTE item;
	int64_t offset;
	int64_t len;
	int64_t start;
	int64_t i;
	BYTE _9;
	int64_t _10;
	_DECL_1DARRAY_BYTE(_11);
	_DECL_DEALLOC(_11);
	int64_t _12;
	int64_t _13;
	int64_t _14;
	int64_t _15;
	BYTE _16;
	int64_t _17;
	int64_t _18;
	BYTE _19;
	int64_t _20;
	int64_t _21;
	BYTE _22;
	_DECL_1DARRAY_BYTE(_23);
	_DECL_DEALLOC(_23);
	int64_t _24;
	int64_t _25;
	int64_t _26;
	int64_t _27;
	int64_t _28;
	BYTE _29;
	_DECL_1DARRAY_BYTE(_30);
	_DECL_DEALLOC(_30);
	int64_t _31;
	int64_t _32;
	//const %9 = 00000000b : byte
	_9 = 0b00000000;
	//const %10 = 0 : int
	_10 = 0;
	//arraygen %11 = [9; 10] : byte[]
	_DEALLOC(_11);
	_NEW_1DARRAY_BYTE(_11, _10, _9);
	_ADD_DEALLOC(_11);
	//assign %1 = %11  : byte[]
	_DEALLOC(output);
	_COPY_1DARRAY_BYTE(output, _11);
	_ADD_DEALLOC(output);
	//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 blklab16 : int
		if(_14>=_15){goto blklab16;}
		//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 blklab18 : byte
		if(header!=_22){goto blklab18;}
		//invoke (%23) = (%1, %4) lz77_compress:append : function(byte[],byte)->(byte[])
		{
			void* tmp_items;
			_COPY_1DARRAY_PARAM(output, tmp_items, BYTE);
			_DEALLOC(_23);
			_23 = _append_(tmp_items, output_size, true, item, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_23));
			_CALLEE_DEALLOC(output, "false-false-false" , "append");
			_CALLEE_DEALLOC_POST(_23, output);
		}
		//assign %1 = %23  : byte[]
		_DEALLOC(output);
		_COPY_1DARRAY_BYTE(output, _23);
		_ADD_DEALLOC(output);
		//goto blklab19
		goto blklab19;
//.blklab18
blklab18:;
		//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 blklab20 : int
			if(i>=_28){goto blklab20;}
			//indexof %29 = %1, %8 : byte[]
			_29=output[i];
			//assign %4 = %29  : byte
			item = _29;
			//invoke (%30) = (%1, %4) lz77_compress:append : function(byte[],byte)->(byte[])
			{
				void* tmp_items;
				_COPY_1DARRAY_PARAM(output, tmp_items, BYTE);
				_DEALLOC(_30);
				_30 = _append_(tmp_items, output_size, true, item, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_30));
				_CALLEE_DEALLOC(output, "false-false-false" , "append");
				_CALLEE_DEALLOC_POST(_30, output);
			}
			//assign %1 = %30  : byte[]
			_DEALLOC(output);
			_COPY_1DARRAY_BYTE(output, _30);
			_ADD_DEALLOC(output);
			//const %31 = 1 : int
			_31 = 1;
			//add %32 = %8, %31 : int
			_32=i+_31;
			//assign %8 = %32  : int
			i = _32;
//.blklab21
blklab21:;
		}
//.blklab20
blklab20:;
//.blklab19
blklab19:;
//.blklab17
blklab17:;
	}
//.blklab16
blklab16:;
	//return %1
	_DEALLOC(data);
	_DEALLOC(_11);
	_DEALLOC(_23);
	_DEALLOC(_30);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output);
	return output;
	//return
}
Beispiel #11
0
BYTE* _compress_(BYTE* data, size_t data_size, _DECL_DEALLOC_PARAM(data), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){
	_DECL_1DARRAY_BYTE(output);
	_DECL_DEALLOC(output);
	int64_t pos;
	Match* m;
	_DECL_DEALLOC(m);
	BYTE offset;
	BYTE length;
	int64_t _6;
	BYTE _7;
	int64_t _8;
	_DECL_1DARRAY_BYTE(_9);
	_DECL_DEALLOC(_9);
	int64_t _10;
	Match* _11;
	_DECL_DEALLOC(_11);
	BYTE _12;
	int64_t _13;
	BYTE _14;
	int64_t _15;
	BYTE _16;
	BYTE _17;
	int64_t _18;
	int64_t _19;
	int64_t _20;
	int64_t _21;
	_DECL_1DARRAY_BYTE(_22);
	_DECL_DEALLOC(_22);
	_DECL_1DARRAY_BYTE(_23);
	_DECL_DEALLOC(_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;
	_DECL_1DARRAY_BYTE(_33);
	_DECL_DEALLOC(_33);
	//const %6 = 0 : int
	_6 = 0;
	//assign %2 = %6  : int
	pos = _6;
	//const %7 = 00000000b : byte
	_7 = 0b00000000;
	//const %8 = 0 : int
	_8 = 0;
	//const %24 = 2 : int
	_24 = 2;
	//lengthof %25 = %0 : byte[]
	_25 = data_size;
	//mul %26 = %24, %25 : int
	_26=_24*_25;
	//arraygen %9 = [7; 26] : byte[]
	_DEALLOC(_9);
	_NEW_1DARRAY_BYTE(_9, _26, _7);
	_ADD_DEALLOC(_9);
	//const %27 = 0 : int
	_27 = 0;
	//assign %28 = %27  : int
	_28 = _27;
	//assign %1 = %9  : byte[]
	_DEALLOC(output);
	_COPY_1DARRAY_BYTE(output, _9);
	_ADD_DEALLOC(output);
	//loop (%1, %2, %3, %4, %5, %10, %11, %12, %13, %14, %15, %16, %17, %18, %19, %20, %21, %22, %23, %28)
	while(true){
		//lengthof %10 = %0 : byte[]
		_10 = data_size;
		//ifge %2, %10 goto blklab12 : int
		if(pos>=_10){goto blklab12;}
		//invoke (%11) = (%0, %2) lz77_compress:findLongestMatch : function(byte[],lz77_compress:nat)->(lz77_compress:Match)
		{
			void* tmp_data;
			_COPY_1DARRAY_PARAM(data, tmp_data, BYTE);
			_DEALLOC_STRUCT(_11, Match);
			_11 = _findLongestMatch_(tmp_data, data_size, true, pos);
			_CALLEE_DEALLOC(data, "false-false-true" , "findLongestMatch");
			_CALLEE_DEALLOC_POST(_11, data);
		}
		//assign %3 = %11  : {int len,int offset}
		_DEALLOC_STRUCT(m, Match);
		m = copy_Match(_11);
		_ADD_DEALLOC(m);
		//fieldload %13 = %3 offset : {int len,int offset}
		_13 = m->offset;
		//invoke (%12) = (%13) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte)
		{
			_12 = (BYTE)_13;
		}
		//assign %4 = %12  : byte
		offset = _12;
		//fieldload %15 = %3 len : {int len,int offset}
		_15 = m->len;
		//invoke (%14) = (%15) whiley/lang/Int:toUnsignedByte : function(whiley/lang/Int:u8)->(byte)
		{
			_14 = (BYTE)_15;
		}
		//assign %5 = %14  : byte
		length = _14;
		//const %16 = 00000000b : byte
		_16 = 0b00000000;
		//ifne %4, %16 goto blklab14 : byte
		if(offset!=_16){goto blklab14;}
		//indexof %17 = %0, %2 : byte[]
		_17=data[pos];
		//assign %5 = %17  : byte
		length = _17;
		//const %18 = 1 : int
		_18 = 1;
		//add %19 = %2, %18 : int
		_19=pos+_18;
		//assign %2 = %19  : int
		pos = _19;
		//goto blklab15
		goto blklab15;
//.blklab14
blklab14:;
		//fieldload %20 = %3 len : {int len,int offset}
		_20 = m->len;
		//add %21 = %2, %20 : int
		_21=pos+_20;
		//assign %2 = %21  : int
		pos = _21;
//.blklab15
blklab15:;
		//update %1[%28] = %4 : byte[] -> byte[]
		output[_28] = offset;
		//const %29 = 1 : int
		_29 = 1;
		//add %30 = %28, %29 : int
		_30=_28+_29;
		//assign %28 = %30  : int
		_28 = _30;
		//update %1[%28] = %5 : byte[] -> byte[]
		output[_28] = length;
		//const %31 = 1 : int
		_31 = 1;
		//add %32 = %28, %31 : int
		_32=_28+_31;
		//assign %28 = %32  : int
		_28 = _32;
//.blklab13
blklab13:;
	}
//.blklab12
blklab12:;
	//invoke (%33) = (%1, %28) lz77_compress:resize : function(byte[],int)->(byte[])
	{
		void* tmp_items;
		_COPY_1DARRAY_PARAM(output, tmp_items, BYTE);
		_DEALLOC(_33);
		_33 = _resize_(tmp_items, output_size, true, _28, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_33));
		_CALLEE_DEALLOC(output, "false-false-false" , "resize");
		_CALLEE_DEALLOC_POST(_33, output);
	}
	//assign %1 = %33  : byte[]
	_DEALLOC(output);
	_COPY_1DARRAY_BYTE(output, _33);
	_ADD_DEALLOC(output);
	//return %1
	_DEALLOC(data);
	_DEALLOC_STRUCT(m, Match);
	_DEALLOC(_9);
	_DEALLOC_STRUCT(_11, Match);
	_DEALLOC(_22);
	_DEALLOC(_23);
	_DEALLOC(_33);
	_UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(output);
	return output;
	//return
}
int main(int argc, char** args){
	int64_t* n;
	_DECL_DEALLOC(n);
	int64_t max = 0;
	_DECL_1DARRAY_BYTE(data);
	_DECL_DEALLOC(data);
	_DECL_1DARRAY_BYTE(arr);
	_DECL_DEALLOC(arr);
	int64_t* _5;
	_DECL_DEALLOC(_5);
	_DECL_2DARRAY(_6);
	_DECL_DEALLOC(_6);
	int64_t _7 = 0;
	_DECL_1DARRAY(_8);
	_DECL_DEALLOC(_8);
	BYTE _9;
	_DECL_1DARRAY_BYTE(_10);
	_DECL_DEALLOC(_10);
	_DECL_1DARRAY_BYTE(_11);
	_DECL_DEALLOC(_11);
	int64_t _12 = 0;
	int64_t _13 = 0;
	int64_t _14 = 0;
	int64_t _15 = 0;
	void* _16;
	int64_t _18 = 0;
	//fieldload %6 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out}
	_DEALLOC_2DARRAY_int64_t(_6);
	_CONV_ARGS(_6);
	_ADD_DEALLOC(_6);
	//const %7 = 0 : int
	_7 = 0;
	//indexof %8 = %6, %7 : int[][]
	_8=_6[_7];
	_8_size = _6_size_size;
	_REMOVE_DEALLOC(_8);
	//invoke (%5) = (%8) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int)
	{
		_STR_TO_INT(_5, _8);
		_ADD_DEALLOC(_5);
		_REMOVE_DEALLOC(_8);
	}
	//assign %1 = %5  : null|int
	_DEALLOC(n);
	_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);
}