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); }
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); }
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); }
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); }
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); }
int main(int argc, char** args){ _DECL_1DARRAY(a); _DECL_DEALLOC(a); _DECL_1DARRAY(b); _DECL_DEALLOC(b); _DECL_1DARRAY(c); _DECL_DEALLOC(c); int64_t _4; int64_t _5; int64_t _6; int64_t _7; int64_t _8; _DECL_1DARRAY(_9); _DECL_DEALLOC(_9); _DECL_1DARRAY(_10); _DECL_DEALLOC(_10); int64_t _11; int64_t _12; int64_t _13; void* _14; _DECL_1DARRAY(_16); _DECL_DEALLOC(_16); void* _17; int64_t _19; int64_t _20; int64_t _21; int64_t _22; int64_t _23; int64_t _24; int64_t _25; _DECL_1DARRAY(_26); _DECL_DEALLOC(_26); _DECL_1DARRAY(_27); _DECL_DEALLOC(_27); int64_t _28; int64_t _29; int64_t _30; int64_t _31; int64_t _32; int64_t _33; void* _34; _DECL_1DARRAY(_36); _DECL_DEALLOC(_36); void* _37; int64_t _39; int64_t _40; void* _41; _DECL_1DARRAY(_43); _DECL_DEALLOC(_43); void* _44; int64_t _46; int64_t _47; //const %4 = 0 : int _4 = 0; //const %5 = 0 : int _5 = 0; //const %6 = 0 : int _6 = 0; //const %7 = 0 : int _7 = 0; //const %8 = 0 : int _8 = 0; //newlist %9 = (%4, %5, %6, %7, %8) : int[] _DEALLOC(_9); _NEW_1DARRAY_int64_t(_9, 5, 0); _9[0] = _4; _9[1] = _5; _9[2] = _6; _9[3] = _7; _9[4] = _8; _9_dealloc = true; //assign %1 = %9 : int[] // isCopyEliminated = true _TRANSFER_DEALLOC(a, _9); //invoke (%10) = (%1) FunctionCall3:func : function(int[])->(int[]) { _FUNCTIONCALL_NO_COPY_PRE(_10, a, 0, "liveness: a = false, readonly: a = false, return:a = MAYBE_RETURN" , "func"); _DEALLOC(_10); // isCopyEliminated of 'a at 0' = true _10 = _func_(a, a_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_10)); if( _10 == a ){ _10_dealloc = a_dealloc; a_dealloc = false; } else { _10_dealloc = true; } } //assign %1 = %10 : int[] // isCopyEliminated = true _TRANSFER_DEALLOC(a, _10); //assert { //const %11 = 2 : int _11 = 2; //indexof %12 = %1, %11 : int[] _12=a[_11]; //const %13 = 0 : int _13 = 0; //ifeq %12, %13 goto blklab0 : int if(_12==_13){goto blklab0;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab0 blklab0:; //assert } //fieldload %14 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %15 = %14 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %16 = [97,91,50,93,61] : int[] _DEALLOC(_16); _NEW_1DARRAY_int64_t(_16, 5, 0); _16[0] = 97; _16[1] = 91; _16[2] = 50; _16[3] = 93; _16[4] = 61; _16_dealloc = true; //indirectinvoke () = %15 (%16) : method(int[])->() { printf_s(_16, _16_size); } //fieldload %17 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %18 = %17 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %19 = 2 : int _19 = 2; //indexof %20 = %1, %19 : int[] _20=a[_19]; //indirectinvoke () = %18 (%20) : method(any)->() { printf("%"PRId64"\n", _20); } //const %21 = 0 : int _21 = 0; //const %22 = 0 : int _22 = 0; //const %23 = 0 : int _23 = 0; //const %24 = 0 : int _24 = 0; //const %25 = 0 : int _25 = 0; //newlist %26 = (%21, %22, %23, %24, %25) : int[] _DEALLOC(_26); _NEW_1DARRAY_int64_t(_26, 5, 0); _26[0] = _21; _26[1] = _22; _26[2] = _23; _26[3] = _24; _26[4] = _25; _26_dealloc = true; //assign %2 = %26 : int[] // isCopyEliminated = true _TRANSFER_DEALLOC(b, _26); //invoke (%27) = (%2) FunctionCall3:func : function(int[])->(int[]) { _FUNCTIONCALL_COPY_PRE(_27, b, 0, "liveness: b = true, readonly: b = false, return:b = MAYBE_RETURN" , "func"); _DEALLOC(_27); void* tmp_s; _COPY_1DARRAY_PARAM(b, tmp_s, int64_t); // isCopyEliminated of 'b at 0' = false _27 = _func_(tmp_s, b_size, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_27)); if( _27 == tmp_s ){ _27_dealloc = true; } else { _27_dealloc = true; free(tmp_s); } } //assign %3 = %27 : int[] // isCopyEliminated = true _TRANSFER_DEALLOC(c, _27); //assert { //const %28 = 2 : int _28 = 2; //indexof %29 = %2, %28 : int[] _29=b[_28]; //const %30 = 0 : int _30 = 0; //ifeq %29, %30 goto blklab1 : int if(_29==_30){goto blklab1;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab1 blklab1:; //assert } //assert { //const %31 = 2 : int _31 = 2; //indexof %32 = %3, %31 : int[] _32=c[_31]; //const %33 = 0 : int _33 = 0; //ifeq %32, %33 goto blklab2 : int if(_32==_33){goto blklab2;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab2 blklab2:; //assert } //fieldload %34 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %35 = %34 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %36 = [98,91,50,93,61] : int[] _DEALLOC(_36); _NEW_1DARRAY_int64_t(_36, 5, 0); _36[0] = 98; _36[1] = 91; _36[2] = 50; _36[3] = 93; _36[4] = 61; _36_dealloc = true; //indirectinvoke () = %35 (%36) : method(int[])->() { printf_s(_36, _36_size); } //fieldload %37 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %38 = %37 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %39 = 2 : int _39 = 2; //indexof %40 = %2, %39 : int[] _40=b[_39]; //indirectinvoke () = %38 (%40) : method(any)->() { printf("%"PRId64"\n", _40); } //fieldload %41 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %42 = %41 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %43 = [99,91,50,93,61] : int[] _DEALLOC(_43); _NEW_1DARRAY_int64_t(_43, 5, 0); _43[0] = 99; _43[1] = 91; _43[2] = 50; _43[3] = 93; _43[4] = 61; _43_dealloc = true; //indirectinvoke () = %42 (%43) : method(int[])->() { printf_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 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %46 = 2 : int _46 = 2; //indexof %47 = %3, %46 : int[] _47=c[_46]; //indirectinvoke () = %45 (%47) : method(any)->() { printf("%"PRId64"\n", _47); } //return _DEALLOC(a); _DEALLOC(b); _DEALLOC(c); _DEALLOC(_9); _DEALLOC(_10); _DEALLOC(_16); _DEALLOC(_26); _DEALLOC(_27); _DEALLOC(_36); _DEALLOC(_43); exit(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); }