#include <stdio.h>
int Counter;
RecordInst(){Counter++;}
Init(){Counter = 0;}
Report(){printf("No. of instructions are %d\n", Counter);}
/* FileAst "sort.adap" Begin */
int array_1[16];
int array_2[16];
int array_3[16];
int array_4[16];
void populate_arrays() ;

void populate_arrays() {
      RecordInst();
      array_1[0]  = 0;
      RecordInst();
      array_2[0]  = 15;
      RecordInst();
      array_3[0]  = 5;
      RecordInst();
      array_4[0]  = 13;
      RecordInst();
      array_1[1]  = 1;
      RecordInst();
      array_2[1]  = 14;
      RecordInst();
      array_3[1]  = 5;
      RecordInst();
      array_4[1]  = 9;
      RecordInst();
      array_1[2]  = 2;
      RecordInst();
      array_2[2]  = 13;
      RecordInst();
      array_3[2]  = 5;
      RecordInst();
      array_4[2]  = 12;
      RecordInst();
      array_1[3]  = 3;
      RecordInst();
      array_2[3]  = 12;
      RecordInst();
      array_3[3]  = 5;
      RecordInst();
      array_4[3]  = 1;
      RecordInst();
      array_1[4]  = 4;
      RecordInst();
      array_2[4]  = 11;
      RecordInst();
      array_3[4]  = 5;
      RecordInst();
      array_4[4]  = 0;
      RecordInst();
      array_1[5]  = 5;
      RecordInst();
      array_2[5]  = 10;
      RecordInst();
      array_3[5]  = 5;
      RecordInst();
      array_4[5]  = 14;
      RecordInst();
      array_1[6]  = 6;
      RecordInst();
      array_2[6]  = 9;
      RecordInst();
      array_3[6]  = 5;
      RecordInst();
      array_4[6]  = 3;
      RecordInst();
      array_1[7]  = 7;
      RecordInst();
      array_2[7]  = 8;
      RecordInst();
      array_3[7]  = 5;
      RecordInst();
      array_4[7]  = 2;
      RecordInst();
      array_1[8]  = 8;
      RecordInst();
      array_2[8]  = 7;
      RecordInst();
      array_3[8]  = 5;
      RecordInst();
      array_4[8]  = 11;
      RecordInst();
      array_1[9]  = 9;
      RecordInst();
      array_2[9]  = 6;
      RecordInst();
      array_3[9]  = 5;
      RecordInst();
      array_4[9]  = 8;
      RecordInst();
      array_1[10]  = 10;
      RecordInst();
      array_2[10]  = 5;
      RecordInst();
      array_3[10]  = 5;
      RecordInst();
      array_4[10]  = 6;
      RecordInst();
      array_1[11]  = 11;
      RecordInst();
      array_2[11]  = 4;
      RecordInst();
      array_3[11]  = 5;
      RecordInst();
      array_4[11]  = 4;
      RecordInst();
      array_1[12]  = 12;
      RecordInst();
      array_2[12]  = 3;
      RecordInst();
      array_3[12]  = 5;
      RecordInst();
      array_4[12]  = 5;
      RecordInst();
      array_1[13]  = 13;
      RecordInst();
      array_2[13]  = 2;
      RecordInst();
      array_3[13]  = 5;
      RecordInst();
      array_4[13]  = 10;
      RecordInst();
      array_1[14]  = 14;
      RecordInst();
      array_2[14]  = 1;
      RecordInst();
      array_3[14]  = 5;
      RecordInst();
      array_4[14]  = 7;
      RecordInst();
      array_1[15]  = 15;
      RecordInst();
      array_2[15]  = 0;
      RecordInst();
      array_3[15]  = 5;
      RecordInst();
      array_4[15]  = 15;
   L1:;
}
void print_arrays() ;

void print_arrays() {
      int temp_6;
      int temp_7;
      int temp_4;
      int temp_5;
      int temp_2;
      int temp_3;
      int temp_0;
      int temp_1;
      int bound;
      int idx;
      RecordInst();
      bound = 16;
      RecordInst();
      printf("Array_1:\n");
      RecordInst();
      idx = 0;
      RecordInst();
      goto L5;
   L4:;
      RecordInst();
      temp_1 = (1 * idx);
      RecordInst();
      temp_0 = array_1[temp_1] ;
      RecordInst();
      printf("%d\n", temp_0);
      RecordInst();
      idx = (idx + 1);
   L5:;
      RecordInst();
      if ((idx < bound)) goto L4;
      RecordInst();
      printf("\nArray_2:\n");
      RecordInst();
      idx = 0;
      RecordInst();
      goto L10;
   L9:;
      RecordInst();
      temp_3 = (1 * idx);
      RecordInst();
      temp_2 = array_2[temp_3] ;
      RecordInst();
      printf("%d\n", temp_2);
      RecordInst();
      idx = (idx + 1);
   L10:;
      RecordInst();
      if ((idx < bound)) goto L9;
      RecordInst();
      printf("\nArray_3:\n");
      RecordInst();
      idx = 0;
      RecordInst();
      goto L14;
   L13:;
      RecordInst();
      temp_5 = (1 * idx);
      RecordInst();
      temp_4 = array_3[temp_5] ;
      RecordInst();
      printf("%d\n", temp_4);
      RecordInst();
      idx = (idx + 1);
   L14:;
      RecordInst();
      if ((idx < bound)) goto L13;
      RecordInst();
      printf("\nArray_4:\n");
      RecordInst();
      idx = 0;
      RecordInst();
      goto L18;
   L17:;
      RecordInst();
      temp_7 = (1 * idx);
      RecordInst();
      temp_6 = array_4[temp_7] ;
      RecordInst();
      printf("%d\n", temp_6);
      RecordInst();
      idx = (idx + 1);
   L18:;
      RecordInst();
      if ((idx < bound)) goto L17;
      RecordInst();
      printf("\n");
   L2:;
}
int main() ;

int main() {
      int temp_55;
      int temp_53;
      int temp_54;
      int temp_51;
      int temp_52;
      int temp_50;
      int temp_49;
      int temp_46;
      int temp_47;
      int temp_48;
      int temp_44;
      int temp_45;
      int temp_43;
      int temp_41;
      int temp_42;
      int temp_39;
      int temp_40;
      int temp_38;
      int temp_37;
      int temp_34;
      int temp_35;
      int temp_36;
      int temp_32;
      int temp_33;
      int temp_31;
      int temp_29;
      int temp_30;
      int temp_27;
      int temp_28;
      int temp_26;
      int temp_25;
      int temp_22;
      int temp_23;
      int temp_24;
      int temp_20;
      int temp_21;
      int temp_19;
      int temp_17;
      int temp_18;
      int temp_15;
      int temp_16;
      int temp_14;
      int temp_13;
      int temp_10;
      int temp_11;
      int temp_12;
      int temp_8;
      int temp_9;
      int temp;
      int bound;
      int idx;
      Init();
      RecordInst();
      bound = 16;
      RecordInst();
      populate_arrays();
      RecordInst();
      print_arrays();
      RecordInst();
      bound = 16;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L23;
   L22:;
      RecordInst();
      temp_9 = (1 * idx);
      RecordInst();
      temp_8 = array_1[temp_9] ;
      RecordInst();
      temp_12 = (1 * idx);
      RecordInst();
      temp_11 = (temp_12 + 1);
      RecordInst();
      temp_10 = array_1[temp_11] ;
      RecordInst();
      if ((temp_8 <= temp_10)) goto L25;
      RecordInst();
      temp_13 = (1 * idx);
      RecordInst();
      temp = array_1[temp_13] ;
      RecordInst();
      temp_14 = (1 * idx);
      RecordInst();
      temp_16 = (1 * idx);
      RecordInst();
      temp_15 = (temp_16 + 1);
      RecordInst();
      array_1[temp_14]  = array_1[temp_15] ;
      RecordInst();
      temp_18 = (1 * idx);
      RecordInst();
      temp_17 = (temp_18 + 1);
      RecordInst();
      array_1[temp_17]  = temp;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L23;
   L25:;
      RecordInst();
      idx = (idx + 1);
   L23:;
      RecordInst();
      temp_19 = (bound - 1);
      RecordInst();
      if ((idx < temp_19)) goto L22;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L28;
   L27:;
      RecordInst();
      temp_21 = (1 * idx);
      RecordInst();
      temp_20 = array_2[temp_21] ;
      RecordInst();
      temp_24 = (1 * idx);
      RecordInst();
      temp_23 = (temp_24 + 1);
      RecordInst();
      temp_22 = array_2[temp_23] ;
      RecordInst();
      if ((temp_20 <= temp_22)) goto L30;
      RecordInst();
      temp_25 = (1 * idx);
      RecordInst();
      temp = array_2[temp_25] ;
      RecordInst();
      temp_26 = (1 * idx);
      RecordInst();
      temp_28 = (1 * idx);
      RecordInst();
      temp_27 = (temp_28 + 1);
      RecordInst();
      array_2[temp_26]  = array_2[temp_27] ;
      RecordInst();
      temp_30 = (1 * idx);
      RecordInst();
      temp_29 = (temp_30 + 1);
      RecordInst();
      array_2[temp_29]  = temp;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L28;
   L30:;
      RecordInst();
      idx = (idx + 1);
   L28:;
      RecordInst();
      temp_31 = (bound - 1);
      RecordInst();
      if ((idx < temp_31)) goto L27;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L33;
   L32:;
      RecordInst();
      temp_33 = (1 * idx);
      RecordInst();
      temp_32 = array_3[temp_33] ;
      RecordInst();
      temp_36 = (1 * idx);
      RecordInst();
      temp_35 = (temp_36 + 1);
      RecordInst();
      temp_34 = array_3[temp_35] ;
      RecordInst();
      if ((temp_32 <= temp_34)) goto L35;
      RecordInst();
      temp_37 = (1 * idx);
      RecordInst();
      temp = array_1[temp_37] ;
      RecordInst();
      temp_38 = (1 * idx);
      RecordInst();
      temp_40 = (1 * idx);
      RecordInst();
      temp_39 = (temp_40 + 1);
      RecordInst();
      array_3[temp_38]  = array_3[temp_39] ;
      RecordInst();
      temp_42 = (1 * idx);
      RecordInst();
      temp_41 = (temp_42 + 1);
      RecordInst();
      array_3[temp_41]  = temp;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L33;
   L35:;
      RecordInst();
      idx = (idx + 1);
   L33:;
      RecordInst();
      temp_43 = (bound - 1);
      RecordInst();
      if ((idx < temp_43)) goto L32;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L38;
   L37:;
      RecordInst();
      temp_45 = (1 * idx);
      RecordInst();
      temp_44 = array_4[temp_45] ;
      RecordInst();
      temp_48 = (1 * idx);
      RecordInst();
      temp_47 = (temp_48 + 1);
      RecordInst();
      temp_46 = array_4[temp_47] ;
      RecordInst();
      if ((temp_44 <= temp_46)) goto L40;
      RecordInst();
      temp_49 = (1 * idx);
      RecordInst();
      temp = array_4[temp_49] ;
      RecordInst();
      temp_50 = (1 * idx);
      RecordInst();
      temp_52 = (1 * idx);
      RecordInst();
      temp_51 = (temp_52 + 1);
      RecordInst();
      array_4[temp_50]  = array_4[temp_51] ;
      RecordInst();
      temp_54 = (1 * idx);
      RecordInst();
      temp_53 = (temp_54 + 1);
      RecordInst();
      array_4[temp_53]  = temp;
      RecordInst();
      idx = 0;
      RecordInst();
      goto L38;
   L40:;
      RecordInst();
      idx = (idx + 1);
   L38:;
      RecordInst();
      temp_55 = (bound - 1);
      RecordInst();
      if ((idx < temp_55)) goto L37;
      RecordInst();
      print_arrays();
      Report();
      return 0;
   L21:;
      Report();
}
/* FileAst "sort.adap" End */
