Exemplo n.º 1
0
int main(void) 
{ 
  int l1 ;
  int A[6] ;
  int __retres3 ;

  {
  __globinit_array_symbolic();
  __CrestCall(1, 1);
#line 9
  __CrestInt(& l1);
  __CrestLoad(2, (unsigned long )0, (long long )0);
  __CrestStore(3, (unsigned long )(& A[0]));
#line 19
  A[0] = 0;
  __CrestLoad(4, (unsigned long )0, (long long )1);
  __CrestStore(5, (unsigned long )(& A[1]));
#line 19
  A[1] = 1;
  __CrestLoad(6, (unsigned long )0, (long long )2);
  __CrestStore(7, (unsigned long )(& A[2]));
#line 19
  A[2] = 2;
  __CrestLoad(8, (unsigned long )0, (long long )3);
  __CrestStore(9, (unsigned long )(& A[3]));
#line 19
  A[3] = 3;
  __CrestLoad(10, (unsigned long )0, (long long )4);
  __CrestStore(11, (unsigned long )(& A[4]));
#line 19
  A[4] = 4;
  __CrestLoad(12, (unsigned long )0, (long long )5);
  __CrestStore(13, (unsigned long )(& A[5]));
#line 19
  A[5] = 5;
  __CrestLoad(16, (unsigned long )(& l1), (long long )l1);
  __CrestLoad(15, (unsigned long )0, (long long )5);
  __CrestApply2(14, 16, (long long )(l1 < 5));
  __CrestSolve(17, 3, 6);
#line 20
  if (l1 < 5) {
    __CrestBranch(18, 3, 1);
    {
    __CrestLoad(22, (unsigned long )(& A[l1]), (long long )A[l1]);
    __CrestLoad(21, (unsigned long )0, (long long )3);
    __CrestApply2(20, 12, (long long )(A[l1] == 3));
    __CrestSolve(23, 4, 5);
#line 21
    if (A[l1] == 3) {
      __CrestBranch(24, 4, 1);
#line 22
      printf((char const   * __restrict  )"Bazinga\n");
      __CrestClearStack(26);
    } else {
      __CrestBranch(25, 5, 0);
#line 24
      printf((char const   * __restrict  )"Badumtss");
      __CrestClearStack(27);
    }
    }
Exemplo n.º 2
0
int main(void)
{
    int side1 ;
    int side2 ;
    int side3 ;
    int triang ;
    int __retres5 ;

    {
        __globinit_triangle();
        __CrestCall(5, 3);
#line 7
        __CrestInt(& side1);
#line 8
        __CrestInt(& side2);
#line 9
        __CrestInt(& side3);
        __CrestLoad(8, (unsigned long )(& side1), (long long )side1);
        __CrestLoad(7, (unsigned long )0, (long long )0);
        __CrestApply2(6, 16, (long long )(side1 < 0));
#line 12
        if (side1 < 0) {
            __CrestBranch(9, 5, 1);
#line 13
            printf((char const   * __restrict  )"Illegal arguments !! \n");
            __CrestClearStack(11);
        } else {
Exemplo n.º 3
0
int main(void) 
{ 
  int a ;
  int b ;
  int c ;
  int d ;
  int __retres5 ;

  {
  __globinit_uniform_test();
  __CrestCall(1, 1);
#line 17
  __CrestInt(& a);
#line 18
  __CrestInt(& b);
#line 19
  __CrestInt(& c);
#line 20
  __CrestInt(& d);
  __CrestLoad(4, (unsigned long )(& a), (long long )a);
  __CrestLoad(3, (unsigned long )0, (long long )5);
  __CrestApply2(2, 12, (long long )(a == 5));
#line 21
  if (a == 5) {
    __CrestBranch(5, 3, 1);
    {
    __CrestLoad(9, (unsigned long )(& b), (long long )b);
    __CrestLoad(8, (unsigned long )0, (long long )19);
    __CrestApply2(7, 12, (long long )(b == 19));
#line 22
    if (b == 19) {
      __CrestBranch(10, 4, 1);
      {
      __CrestLoad(14, (unsigned long )(& c), (long long )c);
      __CrestLoad(13, (unsigned long )0, (long long )7);
      __CrestApply2(12, 12, (long long )(c == 7));
#line 23
      if (c == 7) {
        __CrestBranch(15, 5, 1);
        {
        __CrestLoad(19, (unsigned long )(& d), (long long )d);
        __CrestLoad(18, (unsigned long )0, (long long )4);
        __CrestApply2(17, 12, (long long )(d == 4));
#line 24
        if (d == 4) {
          __CrestBranch(20, 6, 1);
#line 25
          fprintf((FILE * __restrict  )stderr, (char const   * __restrict  )"GOAL!\n");
          __CrestClearStack(22);
        } else {
          __CrestBranch(21, 7, 0);

        }
        }
      } else {
Exemplo n.º 4
0
short dbl(short x ) 
{ 
  short __retres2 ;

  {
  __CrestCall(2, 1);
  __CrestStore(1, (unsigned long )(& x));
  __CrestLoad(5, (unsigned long )0, (long long )2);
  __CrestLoad(4, (unsigned long )(& x), (long long )x);
  __CrestApply2(3, 2, (long long )(2 * (int )x));
  __CrestStore(6, (unsigned long )(& __retres2));
#line 16
  __retres2 = (short )(2 * (int )x);
  {
  __CrestLoad(7, (unsigned long )(& __retres2), (long long )__retres2);
  __CrestReturn(8);
#line 15
  return (__retres2);
  }
}
}
Exemplo n.º 5
0
int main(void) 
{ 
  short a ;
  short tmp ;
  int __retres3 ;

  {
  __globinit_function();
  __CrestCall(9, 2);
#line 21
  __CrestShort(& a);
  __CrestLoad(10, (unsigned long )(& a), (long long )a);
#line 22
  tmp = dbl(a);
  __CrestHandleReturn(12, (long long )tmp);
  __CrestStore(11, (unsigned long )(& tmp));
  __CrestLoad(17, (unsigned long )(& tmp), (long long )tmp);
  __CrestLoad(16, (unsigned long )0, (long long )3);
  __CrestApply2(15, 0, (long long )((int )tmp + 3));
  __CrestLoad(14, (unsigned long )0, (long long )9);
  __CrestApply2(13, 12, (long long )((int )tmp + 3 == 9));
#line 22
  if ((int )tmp + 3 == 9) {
    __CrestBranch(18, 5, 1);
    __CrestLoad(20, (unsigned long )0, (long long )0);
    __CrestStore(21, (unsigned long )(& __retres3));
#line 23
    __retres3 = 0;
#line 23
    goto return_label;
  } else {
    __CrestBranch(19, 7, 0);
    __CrestLoad(22, (unsigned long )0, (long long )1);
    __CrestStore(23, (unsigned long )(& __retres3));
#line 25
    __retres3 = 1;
#line 25
    goto return_label;
  }
  return_label: /* CIL Label */ 
  {
  __CrestLoad(24, (unsigned long )(& __retres3), (long long )__retres3);
  __CrestReturn(25);
#line 19
  return (__retres3);
  }
}
}
Exemplo n.º 6
0
int main(void) 
{ 
  int n ;
  int i ;
  int a[50] ;
  int __retres4 ;

  {
  __globinit_heapsort();
  __CrestCall(1, 1);
#line 31
  printf((char const   * __restrict  )"\nEnter the limit:");
  __CrestClearStack(2);
#line 33
  printf((char const   * __restrict  )"\nEnter the elements:");
  __CrestClearStack(3);
  __CrestLoad(4, (unsigned long )0, (long long )0);
  __CrestStore(5, (unsigned long )(& i));
#line 34
  i = 0;
  __CrestLoad(8, (unsigned long )(& i), (long long )i);
  __CrestLoad(7, (unsigned long )(& n), (long long )n);
  __CrestApply2(6, 16, (long long )(i < n));
  if (i < n) {
    __CrestBranch(9, 4, 1);
    __CrestLoad(11, (unsigned long )(& n), (long long )n);
    heapSort(a, n);
    __CrestClearStack(12);
    __CrestLoad(15, (unsigned long )(& i), (long long )i);
    __CrestLoad(14, (unsigned long )0, (long long )1);
    __CrestApply2(13, 0, (long long )(i + 1));
    __CrestStore(16, (unsigned long )(& i));
    i ++;
  } else {
    __CrestBranch(10, 5, 0);

  }
  __CrestLoad(19, (unsigned long )(& i), (long long )i);
  __CrestLoad(18, (unsigned long )(& n), (long long )n);
  __CrestApply2(17, 16, (long long )(i < n));
  if (i < n) {
    __CrestBranch(20, 7, 1);
    __CrestLoad(22, (unsigned long )(& n), (long long )n);
    heapSort(a, n);
    __CrestClearStack(23);
    __CrestLoad(26, (unsigned long )(& i), (long long )i);
    __CrestLoad(25, (unsigned long )0, (long long )1);
    __CrestApply2(24, 0, (long long )(i + 1));
    __CrestStore(27, (unsigned long )(& i));
    i ++;
  } else {
    __CrestBranch(21, 8, 0);

  }
#line 38
  printf((char const   * __restrict  )"\nThe Sorted Elements Are:\n");
  __CrestClearStack(28);
  __CrestLoad(29, (unsigned long )0, (long long )0);
  __CrestStore(30, (unsigned long )(& i));
#line 39
  i = 0;
  __CrestLoad(33, (unsigned long )(& i), (long long )i);
  __CrestLoad(32, (unsigned long )(& n), (long long )n);
  __CrestApply2(31, 16, (long long )(i < n));
  if (i < n) {
    __CrestBranch(34, 12, 1);
    __CrestLoad(36, (unsigned long )(& a[i]), (long long )a[i]);
    printf((char const   * __restrict  )"\t%d", a[i]);
    __CrestClearStack(37);
    __CrestLoad(40, (unsigned long )(& i), (long long )i);
    __CrestLoad(39, (unsigned long )0, (long long )1);
    __CrestApply2(38, 0, (long long )(i + 1));
    __CrestStore(41, (unsigned long )(& i));
    i ++;
  } else {
Exemplo n.º 7
0
int main(void) 
{ 
  int i ;
  int j ;
  int k ;
  int type_code ;

  {
  __globinit_tritype();
  __CrestCall(1, 1);
#line 18
  __CrestInt(& i);
#line 19
  __CrestInt(& j);
#line 20
  __CrestInt(& k);
  __CrestLoad(4, (unsigned long )(& i), (long long )i);
  __CrestLoad(3, (unsigned long )0, (long long )0);
  __CrestApply2(2, 12, (long long )(i == 0));
  __CrestSolve(5, 3, 4);
#line 24
  if (i == 0) {
    __CrestBranch(6, 3, 1);
    __CrestLoad(8, (unsigned long )0, (long long )4);
    __CrestStore(9, (unsigned long )(& type_code));
#line 24
    type_code = 4;
  } else {
    __CrestBranch(7, 4, 0);
    {
    __CrestLoad(12, (unsigned long )(& j), (long long )j);
    __CrestLoad(11, (unsigned long )0, (long long )0);
    __CrestApply2(10, 12, (long long )(j == 0));
    __CrestSolve(13, 5, 6);
#line 24
    if (j == 0) {
      __CrestBranch(14, 5, 1);
      __CrestLoad(16, (unsigned long )0, (long long )4);
      __CrestStore(17, (unsigned long )(& type_code));
#line 24
      type_code = 4;
    } else {
      __CrestBranch(15, 6, 0);
      {
      __CrestLoad(20, (unsigned long )(& k), (long long )k);
      __CrestLoad(19, (unsigned long )0, (long long )0);
      __CrestApply2(18, 12, (long long )(k == 0));
      __CrestSolve(21, 7, 8);
#line 24
      if (k == 0) {
        __CrestBranch(22, 7, 1);
        __CrestLoad(24, (unsigned long )0, (long long )4);
        __CrestStore(25, (unsigned long )(& type_code));
#line 24
        type_code = 4;
      } else {
        __CrestBranch(23, 8, 0);
        __CrestLoad(26, (unsigned long )0, (long long )0);
        __CrestStore(27, (unsigned long )(& type_code));
#line 26
        type_code = 0;
        {
        __CrestLoad(30, (unsigned long )(& i), (long long )i);
        __CrestLoad(29, (unsigned long )(& j), (long long )j);
        __CrestApply2(28, 12, (long long )(i == j));
        __CrestSolve(31, 10, 11);
#line 27
        if (i == j) {
          __CrestBranch(32, 10, 1);
          __CrestLoad(36, (unsigned long )(& type_code), (long long )type_code);
          __CrestLoad(35, (unsigned long )0, (long long )1);
          __CrestApply2(34, 0, (long long )(type_code + 1));
          __CrestStore(37, (unsigned long )(& type_code));
#line 27
          type_code ++;
        } else {
          __CrestBranch(33, 11, 0);

        }
        }
        {
        __CrestLoad(40, (unsigned long )(& i), (long long )i);
        __CrestLoad(39, (unsigned long )(& k), (long long )k);
        __CrestApply2(38, 12, (long long )(i == k));
        __CrestSolve(41, 13, 14);
#line 28
        if (i == k) {
          __CrestBranch(42, 13, 1);
          __CrestLoad(46, (unsigned long )(& type_code), (long long )type_code);
          __CrestLoad(45, (unsigned long )0, (long long )2);
          __CrestApply2(44, 0, (long long )(type_code + 2));
          __CrestStore(47, (unsigned long )(& type_code));
#line 28
          type_code += 2;
        } else {
          __CrestBranch(43, 14, 0);

        }
        }
        {
        __CrestLoad(50, (unsigned long )(& j), (long long )j);
        __CrestLoad(49, (unsigned long )(& k), (long long )k);
        __CrestApply2(48, 12, (long long )(j == k));
        __CrestSolve(51, 16, 17);
#line 29
        if (j == k) {
          __CrestBranch(52, 16, 1);
          __CrestLoad(56, (unsigned long )(& type_code), (long long )type_code);
          __CrestLoad(55, (unsigned long )0, (long long )3);
          __CrestApply2(54, 0, (long long )(type_code + 3));
          __CrestStore(57, (unsigned long )(& type_code));
#line 29
          type_code += 3;
        } else {
          __CrestBranch(53, 17, 0);

        }
        }
        {
        __CrestLoad(60, (unsigned long )(& type_code), (long long )type_code);
        __CrestLoad(59, (unsigned long )0, (long long )0);
        __CrestApply2(58, 12, (long long )(type_code == 0));
        __CrestSolve(61, 19, 26);
#line 30
        if (type_code == 0) {
          __CrestBranch(62, 19, 1);
          {
          __CrestLoad(68, (unsigned long )(& i), (long long )i);
          __CrestLoad(67, (unsigned long )(& j), (long long )j);
          __CrestApply2(66, 0, (long long )(i + j));
          __CrestLoad(65, (unsigned long )(& k), (long long )k);
          __CrestApply2(64, 15, (long long )(i + j <= k));
          __CrestSolve(69, 20, 21);
#line 31
          if (i + j <= k) {
            __CrestBranch(70, 20, 1);
            __CrestLoad(72, (unsigned long )0, (long long )4);
            __CrestStore(73, (unsigned long )(& type_code));
#line 32
            type_code = 4;
          } else {
            __CrestBranch(71, 21, 0);
            {
            __CrestLoad(78, (unsigned long )(& j), (long long )j);
            __CrestLoad(77, (unsigned long )(& k), (long long )k);
            __CrestApply2(76, 0, (long long )(j + k));
            __CrestLoad(75, (unsigned long )(& i), (long long )i);
            __CrestApply2(74, 15, (long long )(j + k <= i));
            __CrestSolve(79, 22, 23);
#line 31
            if (j + k <= i) {
              __CrestBranch(80, 22, 1);
              __CrestLoad(82, (unsigned long )0, (long long )4);
              __CrestStore(83, (unsigned long )(& type_code));
#line 32
              type_code = 4;
            } else {
              __CrestBranch(81, 23, 0);
              {
              __CrestLoad(88, (unsigned long )(& i), (long long )i);
              __CrestLoad(87, (unsigned long )(& k), (long long )k);
              __CrestApply2(86, 0, (long long )(i + k));
              __CrestLoad(85, (unsigned long )(& j), (long long )j);
              __CrestApply2(84, 15, (long long )(i + k <= j));
              __CrestSolve(89, 24, 25);
#line 31
              if (i + k <= j) {
                __CrestBranch(90, 24, 1);
                __CrestLoad(92, (unsigned long )0, (long long )4);
                __CrestStore(93, (unsigned long )(& type_code));
#line 32
                type_code = 4;
              } else {
                __CrestBranch(91, 25, 0);
                __CrestLoad(94, (unsigned long )0, (long long )1);
                __CrestStore(95, (unsigned long )(& type_code));
#line 34
                type_code = 1;
              }
              }
            }
            }
          }
          }
        } else {
          __CrestBranch(63, 26, 0);
          {
          __CrestLoad(98, (unsigned long )(& type_code), (long long )type_code);
          __CrestLoad(97, (unsigned long )0, (long long )3);
          __CrestApply2(96, 14, (long long )(type_code > 3));
          __CrestSolve(99, 27, 28);
#line 36
          if (type_code > 3) {
            __CrestBranch(100, 27, 1);
            __CrestLoad(102, (unsigned long )0, (long long )3);
            __CrestStore(103, (unsigned long )(& type_code));
#line 36
            type_code = 3;
          } else {
            __CrestBranch(101, 28, 0);
            {
            __CrestLoad(106, (unsigned long )(& type_code), (long long )type_code);
            __CrestLoad(105, (unsigned long )0, (long long )1);
            __CrestApply2(104, 12, (long long )(type_code == 1));
            __CrestSolve(107, 29, 32);
#line 37
            if (type_code == 1) {
              __CrestBranch(108, 29, 1);
              {
              __CrestLoad(114, (unsigned long )(& i), (long long )i);
              __CrestLoad(113, (unsigned long )(& j), (long long )j);
              __CrestApply2(112, 0, (long long )(i + j));
              __CrestLoad(111, (unsigned long )(& k), (long long )k);
              __CrestApply2(110, 14, (long long )(i + j > k));
              __CrestSolve(115, 30, 31);
#line 37
              if (i + j > k) {
                __CrestBranch(116, 30, 1);
                __CrestLoad(118, (unsigned long )0, (long long )2);
                __CrestStore(119, (unsigned long )(& type_code));
#line 37
                type_code = 2;
              } else {
                __CrestBranch(117, 31, 0);
#line 37
                goto _L___0;
              }
              }
            } else {
              __CrestBranch(109, 32, 0);
              _L___0: /* CIL Label */ 
              {
              __CrestLoad(122, (unsigned long )(& type_code), (long long )type_code);
              __CrestLoad(121, (unsigned long )0, (long long )2);
              __CrestApply2(120, 12, (long long )(type_code == 2));
              __CrestSolve(123, 33, 36);
#line 38
              if (type_code == 2) {
                __CrestBranch(124, 33, 1);
                {
                __CrestLoad(130, (unsigned long )(& i), (long long )i);
                __CrestLoad(129, (unsigned long )(& k), (long long )k);
                __CrestApply2(128, 0, (long long )(i + k));
                __CrestLoad(127, (unsigned long )(& j), (long long )j);
                __CrestApply2(126, 14, (long long )(i + k > j));
                __CrestSolve(131, 34, 35);
#line 38
                if (i + k > j) {
                  __CrestBranch(132, 34, 1);
                  __CrestLoad(134, (unsigned long )0, (long long )2);
                  __CrestStore(135, (unsigned long )(& type_code));
#line 38
                  type_code = 2;
                } else {
                  __CrestBranch(133, 35, 0);
#line 38
                  goto _L;
                }
                }
              } else {
                __CrestBranch(125, 36, 0);
                _L: /* CIL Label */ 
                {
                __CrestLoad(138, (unsigned long )(& type_code), (long long )type_code);
                __CrestLoad(137, (unsigned long )0, (long long )3);
                __CrestApply2(136, 12, (long long )(type_code == 3));
                __CrestSolve(139, 37, 40);
#line 39
                if (type_code == 3) {
                  __CrestBranch(140, 37, 1);
                  {
                  __CrestLoad(146, (unsigned long )(& j), (long long )j);
                  __CrestLoad(145, (unsigned long )(& k), (long long )k);
                  __CrestApply2(144, 0, (long long )(j + k));
                  __CrestLoad(143, (unsigned long )(& i), (long long )i);
                  __CrestApply2(142, 14, (long long )(j + k > i));
                  __CrestSolve(147, 38, 39);
#line 39
                  if (j + k > i) {
                    __CrestBranch(148, 38, 1);
                    __CrestLoad(150, (unsigned long )0, (long long )2);
                    __CrestStore(151, (unsigned long )(& type_code));
#line 39
                    type_code = 2;
                  } else {
                    __CrestBranch(149, 39, 0);
                    __CrestLoad(152, (unsigned long )0, (long long )4);
                    __CrestStore(153, (unsigned long )(& type_code));
#line 40
                    type_code = 4;
                  }
                  }
                } else {
                  __CrestBranch(141, 40, 0);
                  __CrestLoad(154, (unsigned long )0, (long long )4);
                  __CrestStore(155, (unsigned long )(& type_code));
#line 40
                  type_code = 4;
                }
                }
              }
              }
            }
            }
          }
          }
        }
        }
      }
      }
    }
    }
  }
  __CrestLoad(156, (unsigned long )(& type_code), (long long )type_code);
  __CrestReturn(157);
#line 42
  return (type_code);
}
}