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; //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; //return %1 _DEALLOC(a); _DEALLOC(_2); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(b); return b; //return }
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; //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; //return %0 _DEALLOC(b); _DEALLOC(_2); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(a); return a; //return }
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 rb; int64_t _4; int64_t _5; int64_t _6; int64_t _7; //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; //indexof %7 = %1, %6 : int[] _7=b[_6]; //assign %3 = %7 : int // isCopyEliminated = true rb = _7; //return %1 _DEALLOC(a); _DEALLOC(_2); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(b); return b; //return }
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; //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;} //return %0 _DEALLOC(b); _DEALLOC(_2); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(a); return a; //goto blklab1 goto blklab1; //.blklab0 blklab0:; //return %1 _DEALLOC(a); _DEALLOC(_2); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(b); return b; //.blklab1 blklab1:; //return }
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 }
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 }
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 }
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 }
//#include <pthread.h> //#include <cilk/reducer.h> int64_t* _findMoves_(_DECL_1DARRAY_PARAM(moves), _DECL_DEALLOC_PARAM(moves), int64_t n, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY(_2); _DECL_DEALLOC(_2); // int64_t s = 0; // while(s<n){ // int64_t i = 0; // while(i<n-s){ // int64_t j = i+s; // int64_t y = moves[(i+1)*n+j-1]; // int64_t x = moves[(i+2)*n+j]; // int64_t z = moves[(i*n)+j-2]; // moves[(i*n)+j] = max(i+(min(x, y)), j+ (min(y, z))); // i = i+1; // } // s = s+1; // } for(int64_t s = 0; s<n; s++){ // Use the Intel Cilk Plus for cilk_for(int64_t i = 0;i<n-s; i++){ int64_t j = i+s; int64_t y = moves[(i+1)*n+j-1]; int64_t x = moves[(i+2)*n+j]; int64_t z = moves[(i*n)+j-2]; moves[(i*n)+j] = max(i+(min(x, y)), j+ (min(y, z))); } } //return %0 _DEALLOC(_2); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(moves); return moves; //return }
int64_t* _func_(_DECL_1DARRAY_PARAM(s), _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_DEALLOC(s); _DECL_1DARRAY(_1); _DECL_DEALLOC(_1); _DECL_1DARRAY(t); _DECL_DEALLOC(t); //assign %2 = %0 : int[] // isCopyEliminated = true _TRANSFER_DEALLOC(t, s); //return %2 _DEALLOC(s); _DEALLOC(_1); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(t); return t; //return }
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; //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; //return %2 _DEALLOC(a); _DEALLOC(b); _DEALLOC(_3); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(c); return c; //return }
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 rc; int64_t _6; int64_t _7; int64_t _8; int64_t _9; int64_t _10; int64_t _11; //const %6 = 0 : int _6 = 0; //const %7 = 0 : int _7 = 0; //update %0[%7] = %6 : int[] -> int[] a[_7] = _6; //const %8 = 0 : int _8 = 0; //indexof %9 = %1, %8 : int[] _9=b[_8]; //assign %4 = %9 : int // isCopyEliminated = true rb = _9; //const %10 = 0 : int _10 = 0; //indexof %11 = %2, %10 : int[] _11=c[_10]; //assign %5 = %11 : int // isCopyEliminated = true rc = _11; //return %0 _DEALLOC(b); _DEALLOC(c); _DEALLOC(_3); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(a); return a; //return }
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; //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; //return %2 _DEALLOC(a); _DEALLOC(b); _DEALLOC(_3); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(c); return c; //return }
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 rc; int64_t _5; int64_t _6; int64_t _7; int64_t _8; int64_t _9; int64_t _10; //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; //const %8 = 0 : int _8 = 0; //update %1[%8] = %7 : int[] -> int[] b[_8] = _7; //const %9 = 0 : int _9 = 0; //indexof %10 = %2, %9 : int[] _10=c[_9]; //assign %4 = %10 : int // isCopyEliminated = true rc = _10; //return %0 _DEALLOC(b); _DEALLOC(c); _DEALLOC(_3); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(a); return a; //return }
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; //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; //return %2 _DEALLOC(a); _DEALLOC(b); _DEALLOC(_3); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(c); return c; //return }
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 }
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); }
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; //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; //return %2 _DEALLOC(a); _DEALLOC(b); _DEALLOC(_3); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(c); return c; //return }
int main(int argc, char** args){ int64_t f; int64_t _2; int64_t _3; int64_t _4; void* _5; _DECL_1DARRAY(_7); _DECL_DEALLOC(_7); //const %3 = 5 : int _3 = 5; //invoke (%2) = (%3) factorial:factorial : function(int)->(int) { _2 = _factorial_(_3); } //assign %1 = %2 : int // isCopyEliminated = true f = _2; //assert { //const %4 = 120 : int _4 = 120; //ifeq %1, %4 goto blklab2 : int if(f==_4){goto blklab2;} //fail fprintf(stderr,"fail"); exit(-1); //.blklab2 blklab2:; //assert } //fieldload %5 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %6 = %5 print_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %7 = [80,97,115,115,32,102,97,99,116,111,114,105,97,108,32,116,101,115,116,32,99,97,115,101] : int[] _DEALLOC(_7); _NEW_1DARRAY_int64_t(_7, 24, 0); _7[0] = 80; _7[1] = 97; _7[2] = 115; _7[3] = 115; _7[4] = 32; _7[5] = 102; _7[6] = 97; _7[7] = 99; _7[8] = 116; _7[9] = 111; _7[10] = 114; _7[11] = 105; _7[12] = 97; _7[13] = 108; _7[14] = 32; _7[15] = 116; _7[16] = 101; _7[17] = 115; _7[18] = 116; _7[19] = 32; _7[20] = 99; _7[21] = 97; _7[22] = 115; _7[23] = 101; _7_dealloc = true; //indirectinvoke () = %6 (%7) : method(int[])->() { printf_s(_7, _7_size); } //return _DEALLOC(_7); exit(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 }
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); }
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 }
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 }
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); }
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 }
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); }
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 }
int64_t* _sortV1_(_DECL_1DARRAY_PARAM(items), _DECL_DEALLOC_PARAM(items), int64_t start, int64_t end, _DECL_1DARRAYSIZE_PARAM_CALLBYREFERENCE){ _DECL_1DARRAY(_3); _DECL_DEALLOC(_3); int64_t pivot = 0; _DECL_1DARRAY(lhs); _DECL_DEALLOC(lhs); _DECL_1DARRAY(rhs); _DECL_DEALLOC(rhs); int64_t l = 0; int64_t r = 0; int64_t i = 0; int64_t _10 = 0; int64_t _11 = 0; int64_t _12 = 0; int64_t _13 = 0; int64_t _14 = 0; _DECL_1DARRAY(_15); _DECL_DEALLOC(_15); _DECL_1DARRAY(_16); _DECL_DEALLOC(_16); int64_t _17 = 0; _DECL_1DARRAY(_18); _DECL_DEALLOC(_18); _DECL_1DARRAY(_19); _DECL_DEALLOC(_19); int64_t _20 = 0; int64_t _21 = 0; int64_t _22 = 0; int64_t _23 = 0; int64_t _24 = 0; int64_t _25 = 0; int64_t _26 = 0; int64_t _27 = 0; int64_t _28 = 0; int64_t _29 = 0; int64_t _30 = 0; int64_t _31 = 0; int64_t _32 = 0; int64_t _33 = 0; int64_t _34 = 0; int64_t _35 = 0; int64_t _36 = 0; int64_t _37 = 0; int64_t _38 = 0; int64_t _39 = 0; int64_t _40 = 0; int64_t _41 = 0; int64_t _42 = 0; int64_t _43 = 0; int64_t _44 = 0; int64_t _45 = 0; int64_t _46 = 0; int64_t _47 = 0; int64_t _48 = 0; int64_t _49 = 0; //const %10 = 1 : int _10 = 1; //add %11 = %1, %10 : int _11=start+_10; //ifge %11, %2 goto blklab0 : int if(_11>=end){goto blklab0;} //add %12 = %1, %2 : int _12=start+end; //const %13 = 2 : int _13 = 2; //div %14 = %12, %13 : int _14=_12/_13; //assign %4 = %14 : int // isCopyEliminated = true pivot = _14; //invoke (%15) = (%0, %1, %4) whiley/lang/Array:slice : function(int[],int,int)->(int[]) { _DEALLOC(_15); _SLICE_ARRAY(_15, items, start, pivot); _ADD_DEALLOC(_15); } //assign %5 = %15 : int[] _DEALLOC(lhs); // isCopyEliminated = true _UPDATE_1DARRAY(lhs, _15); _TRANSFER_DEALLOC(lhs, _15); //const %17 = 0 : int _17 = 0; //invoke (%16) = (%5, %17, %4) MergeSort_original:sortV1 : function(int[],int,int)->(int[]) { lhs = cilk_spawn _sortV1_(_1DARRAY_PARAM(lhs), false, _17, pivot, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(lhs)); } //invoke (%18) = (%0, %4, %2) whiley/lang/Array:slice : function(int[],int,int)->(int[]) { _DEALLOC(_18); _SLICE_ARRAY(_18, items, pivot, end); _ADD_DEALLOC(_18); } //assign %6 = %18 : int[] _DEALLOC(rhs); // isCopyEliminated = true _UPDATE_1DARRAY(rhs, _18); _TRANSFER_DEALLOC(rhs, _18); //const %20 = 0 : int _20 = 0; //sub %21 = %2, %4 : int _21=end-pivot; //invoke (%19) = (%6, %20, %21) MergeSort_original:sortV1 : function(int[],int,int)->(int[]) { rhs = cilk_spawn _sortV1_(_1DARRAY_PARAM(rhs), false, _20, _21, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(rhs)); } cilk_sync; //const %22 = 0 : int _22 = 0; //assign %7 = %22 : int // isCopyEliminated = true l = _22; //const %23 = 0 : int _23 = 0; //assign %8 = %23 : int // isCopyEliminated = true r = _23; //const %24 = 0 : int _24 = 0; //assign %9 = %24 : int // isCopyEliminated = true i = _24; //loop (%0, %7, %8, %9, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37) while(true){ //sub %25 = %2, %1 : int _25=end-start; //ifge %9, %25 goto blklab1 : int if(i>=_25){goto blklab1;} //sub %26 = %4, %1 : int _26=pivot-start; //ifge %7, %26 goto blklab1 : int if(l>=_26){goto blklab1;} //sub %27 = %2, %4 : int _27=end-pivot; //ifge %8, %27 goto blklab1 : int if(r>=_27){goto blklab1;} //indexof %28 = %5, %7 : int[] _28=lhs[l]; //indexof %29 = %6, %8 : int[] _29=rhs[r]; //ifgt %28, %29 goto blklab3 : int if(_28>_29){goto blklab3;} //indexof %30 = %5, %7 : int[] _30=lhs[l]; //update %0[%9] = %30 : int[] -> int[] // isCopyEliminated = false items[i] = _30; //const %31 = 1 : int _31 = 1; //add %32 = %7, %31 : int _32=l+_31; //assign %7 = %32 : int // isCopyEliminated = true l = _32; //goto blklab4 goto blklab4; //.blklab3 blklab3:; //indexof %33 = %6, %8 : int[] _33=rhs[r]; //update %0[%9] = %33 : int[] -> int[] // isCopyEliminated = false items[i] = _33; //const %34 = 1 : int _34 = 1; //add %35 = %8, %34 : int _35=r+_34; //assign %8 = %35 : int // isCopyEliminated = true r = _35; //.blklab4 blklab4:; //const %36 = 1 : int _36 = 1; //add %37 = %9, %36 : int _37=i+_36; //assign %9 = %37 : int // isCopyEliminated = true i = _37; //.blklab2 blklab2:; } //.blklab1 blklab1:; //loop (%0, %7, %9, %38, %39, %40, %41, %42, %43) while(true){ //sub %38 = %4, %1 : int _38=pivot-start; //ifge %7, %38 goto blklab5 : int if(l>=_38){goto blklab5;} //indexof %39 = %5, %7 : int[] _39=lhs[l]; //update %0[%9] = %39 : int[] -> int[] // isCopyEliminated = false items[i] = _39; //const %40 = 1 : int _40 = 1; //add %41 = %9, %40 : int _41=i+_40; //assign %9 = %41 : int // isCopyEliminated = true i = _41; //const %42 = 1 : int _42 = 1; //add %43 = %7, %42 : int _43=l+_42; //assign %7 = %43 : int // isCopyEliminated = true l = _43; //.blklab6 blklab6:; } //.blklab5 blklab5:; //loop (%0, %8, %9, %44, %45, %46, %47, %48, %49) while(true){ //sub %44 = %2, %4 : int _44=end-pivot; //ifge %8, %44 goto blklab7 : int if(r>=_44){goto blklab7;} //indexof %45 = %6, %8 : int[] _45=rhs[r]; //update %0[%9] = %45 : int[] -> int[] // isCopyEliminated = false items[i] = _45; //const %46 = 1 : int _46 = 1; //add %47 = %9, %46 : int _47=i+_46; //assign %9 = %47 : int // isCopyEliminated = true i = _47; //const %48 = 1 : int _48 = 1; //add %49 = %8, %48 : int _49=r+_48; //assign %8 = %49 : int // isCopyEliminated = true r = _49; //.blklab8 blklab8:; } //.blklab7 blklab7:; //.blklab0 blklab0:; //return %0 _DEALLOC(_3); _DEALLOC(lhs); _DEALLOC(rhs); _DEALLOC(_15); _DEALLOC(_16); _DEALLOC(_18); _DEALLOC(_19); _UPDATE_1DARRAYSZIE_PARAM_CALLBYREFERENCE(items); return items; //return }
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 = 0; int64_t index = 0; _DECL_1DARRAY(arr); _DECL_DEALLOC(arr); int64_t* _5; _DECL_DEALLOC(_5); _DECL_2DARRAY(_6); _DECL_DEALLOC(_6); int64_t _7 = 0; _DECL_1DARRAY(_8); _DECL_DEALLOC(_8); int64_t _9 = 0; int64_t _10 = 0; _DECL_1DARRAY(_11); _DECL_DEALLOC(_11); int64_t _12 = 0; int64_t _13 = 0; int64_t _14 = 0; _DECL_1DARRAY(_15); _DECL_DEALLOC(_15); int64_t _16 = 0; void* _17; int64_t _19 = 0; int64_t _20 = 0; void* _21; int64_t _23 = 0; int64_t _24 = 0; int64_t _25 = 0; void* _26; _DECL_1DARRAY(_28); _DECL_DEALLOC(_28); //fieldload %6 = %0 args : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} _DEALLOC_2DARRAY_int64_t(_6); _CONV_ARGS(_6); _ADD_DEALLOC(_6); //const %7 = 0 : int _7 = 0; //indexof %8 = %6, %7 : int[][] _8=_6[_7]; _8_size = _6_size_size; _REMOVE_DEALLOC(_8); //invoke (%5) = (%8) whiley/lang/Int:parse : function(whiley/lang/ASCII:string)->(null|int) { _STR_TO_INT(_5, _8); _ADD_DEALLOC(_5); _REMOVE_DEALLOC(_8); } //assign %1 = %5 : null|int _DEALLOC(n); // isCopyEliminated = true n = _5; _TRANSFER_DEALLOC(n, _5); //ifis %1, null goto blklab9 : null|int if(n == NULL) { goto blklab9;} //assign %2 = %1 : int // isCopyEliminated = true max = *n; //const %9 = 0 : int _9 = 0; //assign %3 = %9 : int // isCopyEliminated = true index = _9; //const %10 = 0 : int _10 = 0; //arraygen %11 = [10; 2] : int[] _DEALLOC(_11); _NEW_1DARRAY_int64_t(_11, max, _10); _ADD_DEALLOC(_11); //assign %4 = %11 : int[] _DEALLOC(arr); // isCopyEliminated = true _UPDATE_1DARRAY(arr, _11); _TRANSFER_DEALLOC(arr, _11); //loop (%3, %4, %12, %13, %14) while(true){ //ifge %3, %2 goto blklab10 : int if(index>=max){goto blklab10;} //sub %12 = %2, %3 : int _12=max-index; //update %4[%3] = %12 : int[] -> int[] // isCopyEliminated = false arr[index] = _12; //const %13 = 1 : int _13 = 1; //add %14 = %3, %13 : int _14=index+_13; //assign %3 = %14 : int // isCopyEliminated = true index = _14; //.blklab11 blklab11:; } //.blklab10 blklab10:; //const %16 = 0 : int _16 = 0; //invoke (%15) = (%4, %16, %2) MergeSort_original:sortV1 : function(int[],int,int)->(int[]) { _DEALLOC(_15); // isCopyEliminated of '_4' = true _15 = _sortV1_(_1DARRAY_PARAM(arr), false, _16, max, _1DARRAYSIZE_PARAM_CALLBYREFERENCE(_15)); _RESET_DEALLOC(arr, "true-true-false" , "sortV1"); _ADD_DEALLOC(_15); } //assign %4 = %15 : int[] _DEALLOC(arr); // isCopyEliminated = true _UPDATE_1DARRAY(arr, _15); _TRANSFER_DEALLOC(arr, _15); //fieldload %17 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %18 = %17 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %19 = 0 : int _19 = 0; //indexof %20 = %4, %19 : int[] _20=arr[_19]; //indirectinvoke () = %18 (%20) : method(any)->() { printf("%"PRId64"\n", _20); } //fieldload %21 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %22 = %21 println : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %23 = 1 : int _23 = 1; //sub %24 = %2, %23 : int _24=max-_23; //indexof %25 = %4, %24 : int[] _25=arr[_24]; //indirectinvoke () = %22 (%25) : method(any)->() { printf("%"PRId64"\n", _25); } //fieldload %26 = %0 out : {int[][] args,{method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} out} //fieldload %27 = %26 println_s : {method(any)->() print,method(int[])->() print_s,method(any)->() println,method(int[])->() println_s} //const %28 = [80,97,115,115,32,77,101,114,103,101,115,111,114,116,32,116,101,115,116,32,99,97,115,101] : int[] _DEALLOC(_28); _NEW_1DARRAY_int64_t(_28, 24, 0); _28[0] = 80; _28[1] = 97; _28[2] = 115; _28[3] = 115; _28[4] = 32; _28[5] = 77; _28[6] = 101; _28[7] = 114; _28[8] = 103; _28[9] = 101; _28[10] = 115; _28[11] = 111; _28[12] = 114; _28[13] = 116; _28[14] = 32; _28[15] = 116; _28[16] = 101; _28[17] = 115; _28[18] = 116; _28[19] = 32; _28[20] = 99; _28[21] = 97; _28[22] = 115; _28[23] = 101; _ADD_DEALLOC(_28); //indirectinvoke () = %27 (%28) : method(int[])->() { println_s(_28, _28_size); } //.blklab9 blklab9:; //return _DEALLOC(n); _DEALLOC(arr); _DEALLOC(_5); _DEALLOC_2DARRAY_int64_t(_6); _DEALLOC(_8); _DEALLOC(_11); _DEALLOC(_15); _DEALLOC(_28); exit(0); }