/* Generated by Frama-C */
#include "stddef.h"
#include "stdio.h"
extern int __e_acsl_sound_verdict;

struct mystruct {
   int k ;
   int l ;
};
typedef struct mystruct mystruct;
/*@ predicate p1(int x, int y) = x + y > 0;
 */
int __gen_e_acsl_p1(int x, int y);

/*@ predicate p2(ℤ x, ℤ y) = x + y > 0;

*/
int __gen_e_acsl_p2(int x, int y);

int __gen_e_acsl_p2_5(int x, long y);

int __gen_e_acsl_p2_3(int x, __e_acsl_mpz_struct * y);

/*@ logic ℤ f1(ℤ x, ℤ y) = x + y;

*/
long __gen_e_acsl_f1(int x, int y);

void __gen_e_acsl_f1_5(__e_acsl_mpz_t *__retres_arg, int x,
                       __e_acsl_mpz_struct * y);

void __gen_e_acsl_f1_7(__e_acsl_mpz_t *__retres_arg, __e_acsl_mpz_struct * x,
                       __e_acsl_mpz_struct * y);

/*@ logic char h_char(char c) = c;
 */
int __gen_e_acsl_h_char(int c);

/*@ logic short h_short(short s) = s;
 */
int __gen_e_acsl_h_short(int s);

/*@ logic int g_hidden(int x) = x;
 */
int __gen_e_acsl_g_hidden(int x);

/*@ logic int g(int x) = g_hidden(x);
 */
int __gen_e_acsl_g(int x);

/*@ logic mystruct t1(mystruct m) = m;
 */
mystruct __gen_e_acsl_t1(mystruct m);

/*@ logic ℤ t2(mystruct m) = m.k + m.l;
 */
long __gen_e_acsl_t2(mystruct m);

/*@ predicate k_pred(ℤ x) = x > 0;

*/
int __gen_e_acsl_k_pred(int x);

/*@ requires k_pred(x); */
void __gen_e_acsl_k(int x);

void k(int x)
{
  return;
}

int glob = 5;
/*@ predicate never_called(int x) = x ≡ x;
 */
/*@ logic double f2(double x) = (double)(1 / x);
 */
double __gen_e_acsl_f2(double x);

/*@ predicate p_notyet{L}(ℤ x) = x > 0;
 */
/*@ logic ℤ f_notyet{L}(ℤ x) = x;

*/
int main(void)
{
  int __retres;
  mystruct m;
  int x = 1;
  int y = 2;
  {
    int __gen_e_acsl_p1_2;
    __gen_e_acsl_p1_2 = __gen_e_acsl_p1(x,y);
    __e_acsl_assert(__gen_e_acsl_p1_2,"Assertion","main","p1(x, y)",
                    "tests/arith/functions.c",42);
  }
  /*@ assert p1(x, y); */ ;
  {
    int __gen_e_acsl_p2_2;
    __gen_e_acsl_p2_2 = __gen_e_acsl_p2(3,4);
    __e_acsl_assert(__gen_e_acsl_p2_2,"Assertion","main","p2(3, 4)",
                    "tests/arith/functions.c",43);
  }
  /*@ assert p2(3, 4); */ ;
  {
    __e_acsl_mpz_t __gen_e_acsl_;
    int __gen_e_acsl_p2_4;
    __gmpz_init_set_str(__gen_e_acsl_,"99999999999999999999999999999",10);
    __gen_e_acsl_p2_4 = __gen_e_acsl_p2_3(5,
                                          (__e_acsl_mpz_struct *)__gen_e_acsl_);
    __e_acsl_assert(__gen_e_acsl_p2_4,"Assertion","main",
                    "p2(5, 99999999999999999999999999999)",
                    "tests/arith/functions.c",44);
    __gmpz_clear(__gen_e_acsl_);
  }
  /*@ assert p2(5, 99999999999999999999999999999); */ ;
  {
    long __gen_e_acsl_f1_2;
    __gen_e_acsl_f1_2 = __gen_e_acsl_f1(x,y);
    __e_acsl_assert(__gen_e_acsl_f1_2 == 3L,"Assertion","main",
                    "f1(x, y) == 3","tests/arith/functions.c",46);
  }
  /*@ assert f1(x, y) ≡ 3; */ ;
  {
    long __gen_e_acsl_f1_4;
    int __gen_e_acsl_p2_6;
    __gen_e_acsl_f1_4 = __gen_e_acsl_f1(3,4);
    __gen_e_acsl_p2_6 = __gen_e_acsl_p2_5(x,__gen_e_acsl_f1_4);
    __e_acsl_assert(__gen_e_acsl_p2_6,"Assertion","main","p2(x, f1(3, 4))",
                    "tests/arith/functions.c",47);
  }
  /*@ assert p2(x, f1(3, 4)); */ ;
  {
    __e_acsl_mpz_t __gen_e_acsl__4;
    __e_acsl_mpz_t __gen_e_acsl_f1_6;
    __e_acsl_mpz_t __gen_e_acsl__5;
    int __gen_e_acsl_gt_3;
    __gmpz_init_set_str(__gen_e_acsl__4,"99999999999999999999999999999",10);
    __gen_e_acsl_f1_5(& __gen_e_acsl_f1_6,9,
                      (__e_acsl_mpz_struct *)__gen_e_acsl__4);
    __gmpz_init_set_si(__gen_e_acsl__5,0L);
    __gen_e_acsl_gt_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_6),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__5));
    __e_acsl_assert(__gen_e_acsl_gt_3 > 0,"Assertion","main",
                    "f1(9, 99999999999999999999999999999) > 0",
                    "tests/arith/functions.c",48);
    __gmpz_clear(__gen_e_acsl__4);
    __gmpz_clear(__gen_e_acsl_f1_6);
    __gmpz_clear(__gen_e_acsl__5);
  }
  /*@ assert f1(9, 99999999999999999999999999999) > 0; */ ;
  {
    __e_acsl_mpz_t __gen_e_acsl__6;
    __e_acsl_mpz_t __gen_e_acsl_f1_8;
    __e_acsl_mpz_t __gen_e_acsl__7;
    int __gen_e_acsl_eq;
    __gmpz_init_set_str(__gen_e_acsl__6,"99999999999999999999999999999",10);
    __gen_e_acsl_f1_7(& __gen_e_acsl_f1_8,
                      (__e_acsl_mpz_struct *)__gen_e_acsl__6,
                      (__e_acsl_mpz_struct *)__gen_e_acsl__6);
    __gmpz_init_set_str(__gen_e_acsl__7,"199999999999999999999999999998",10);
    __gen_e_acsl_eq = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_f1_8),
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl__7));
    __e_acsl_assert(__gen_e_acsl_eq == 0,"Assertion","main",
                    "f1(99999999999999999999999999999, 99999999999999999999999999999) ==\n199999999999999999999999999998",
                    "tests/arith/functions.c",49);
    __gmpz_clear(__gen_e_acsl__6);
    __gmpz_clear(__gen_e_acsl_f1_8);
    __gmpz_clear(__gen_e_acsl__7);
  }
  /*@
  assert
  f1(99999999999999999999999999999, 99999999999999999999999999999) ≡
  199999999999999999999999999998; */
  ;
  {
    int __gen_e_acsl_g_2;
    __gen_e_acsl_g_2 = __gen_e_acsl_g(x);
    __e_acsl_assert(__gen_e_acsl_g_2 == x,"Assertion","main","g(x) == x",
                    "tests/arith/functions.c",53);
  }
  /*@ assert g(x) ≡ x; */ ;
  char c = (char)'c';
  {
    int __gen_e_acsl_h_char_2;
    __gen_e_acsl_h_char_2 = __gen_e_acsl_h_char((int)c);
    __e_acsl_assert(__gen_e_acsl_h_char_2 == (int)c,"Assertion","main",
                    "h_char(c) == c","tests/arith/functions.c",56);
  }
  /*@ assert h_char(c) ≡ c; */ ;
  short s = (short)1;
  {
    int __gen_e_acsl_h_short_2;
    __gen_e_acsl_h_short_2 = __gen_e_acsl_h_short((int)s);
    __e_acsl_assert(__gen_e_acsl_h_short_2 == (int)s,"Assertion","main",
                    "h_short(s) == s","tests/arith/functions.c",58);
  }
  /*@ assert h_short(s) ≡ s; */ ;
  m.k = 8;
  m.l = 9;
  {
    mystruct __gen_e_acsl_t1_2;
    long __gen_e_acsl_t2_2;
    __gen_e_acsl_t1_2 = __gen_e_acsl_t1(m);
    __gen_e_acsl_t2_2 = __gen_e_acsl_t2(__gen_e_acsl_t1_2);
    __e_acsl_assert(__gen_e_acsl_t2_2 == 17L,"Assertion","main",
                    "t2(t1(m)) == 17","tests/arith/functions.c",63);
  }
  /*@ assert t2(t1(m)) ≡ 17; */ ;
  __gen_e_acsl_k(9);
  double d = 2.0;
  {
    double __gen_e_acsl_f2_2;
    __gen_e_acsl_f2_2 = __gen_e_acsl_f2(d);
    __e_acsl_assert(__gen_e_acsl_f2_2 > 0.,"Assertion","main","f2(d) > 0",
                    "tests/arith/functions.c",68);
  }
  /*@ assert f2(d) > 0; */ ;
  __retres = 0;
  return __retres;
}

/*@ requires k_pred(x); */
void __gen_e_acsl_k(int x)
{
  {
    int __gen_e_acsl_k_pred_2;
    __gen_e_acsl_k_pred_2 = __gen_e_acsl_k_pred(x);
    __e_acsl_assert(__gen_e_acsl_k_pred_2,"Precondition","k","k_pred(x)",
                    "tests/arith/functions.c",25);
  }
  k(x);
  return;
}

int __gen_e_acsl_p1(int x, int y)
{
  int __retres = x + (long)y > 0L;
  return __retres;
}

int __gen_e_acsl_p2(int x, int y)
{
  int __retres = x + (long)y > 0L;
  return __retres;
}

int __gen_e_acsl_p2_5(int x, long y)
{
  __e_acsl_mpz_t __gen_e_acsl_x_2;
  __e_acsl_mpz_t __gen_e_acsl_y;
  __e_acsl_mpz_t __gen_e_acsl_add_2;
  __e_acsl_mpz_t __gen_e_acsl__3;
  int __gen_e_acsl_gt_2;
  __gmpz_init_set_si(__gen_e_acsl_x_2,(long)x);
  __gmpz_init_set_si(__gen_e_acsl_y,y);
  __gmpz_init(__gen_e_acsl_add_2);
  __gmpz_add(__gen_e_acsl_add_2,
             (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_2),
             (__e_acsl_mpz_struct const *)(__gen_e_acsl_y));
  __gmpz_init_set_si(__gen_e_acsl__3,0L);
  __gen_e_acsl_gt_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2),
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl__3));
  int __retres = __gen_e_acsl_gt_2 > 0;
  __gmpz_clear(__gen_e_acsl_x_2);
  __gmpz_clear(__gen_e_acsl_y);
  __gmpz_clear(__gen_e_acsl_add_2);
  __gmpz_clear(__gen_e_acsl__3);
  return __retres;
}

int __gen_e_acsl_p2_3(int x, __e_acsl_mpz_struct * y)
{
  __e_acsl_mpz_t __gen_e_acsl_x;
  __e_acsl_mpz_t __gen_e_acsl_add;
  __e_acsl_mpz_t __gen_e_acsl__2;
  int __gen_e_acsl_gt;
  __gmpz_init_set_si(__gen_e_acsl_x,(long)x);
  __gmpz_init(__gen_e_acsl_add);
  __gmpz_add(__gen_e_acsl_add,(__e_acsl_mpz_struct const *)(__gen_e_acsl_x),
             (__e_acsl_mpz_struct const *)(y));
  __gmpz_init_set_si(__gen_e_acsl__2,0L);
  __gen_e_acsl_gt = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_add),
                               (__e_acsl_mpz_struct const *)(__gen_e_acsl__2));
  int __retres = __gen_e_acsl_gt > 0;
  __gmpz_clear(__gen_e_acsl_x);
  __gmpz_clear(__gen_e_acsl_add);
  __gmpz_clear(__gen_e_acsl__2);
  return __retres;
}

long __gen_e_acsl_f1(int x, int y)
{
  long __retres = x + (long)y;
  return __retres;
}

void __gen_e_acsl_f1_5(__e_acsl_mpz_t *__retres_arg, int x,
                       __e_acsl_mpz_struct * y)
{
  __e_acsl_mpz_t __gen_e_acsl_x_3;
  __e_acsl_mpz_t __gen_e_acsl_add_3;
  __gmpz_init_set_si(__gen_e_acsl_x_3,(long)x);
  __gmpz_init(__gen_e_acsl_add_3);
  __gmpz_add(__gen_e_acsl_add_3,
             (__e_acsl_mpz_struct const *)(__gen_e_acsl_x_3),
             (__e_acsl_mpz_struct const *)(y));
  __gmpz_init_set(*__retres_arg,
                  (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_3));
  __gmpz_clear(__gen_e_acsl_x_3);
  __gmpz_clear(__gen_e_acsl_add_3);
  return;
}

void __gen_e_acsl_f1_7(__e_acsl_mpz_t *__retres_arg, __e_acsl_mpz_struct * x,
                       __e_acsl_mpz_struct * y)
{
  __e_acsl_mpz_t __gen_e_acsl_add_4;
  __gmpz_init(__gen_e_acsl_add_4);
  __gmpz_add(__gen_e_acsl_add_4,(__e_acsl_mpz_struct const *)(x),
             (__e_acsl_mpz_struct const *)(y));
  __gmpz_init_set(*__retres_arg,
                  (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_4));
  __gmpz_clear(__gen_e_acsl_add_4);
  return;
}

int __gen_e_acsl_h_char(int c)
{
  return c;
}

int __gen_e_acsl_h_short(int s)
{
  return s;
}

int __gen_e_acsl_g_hidden(int x)
{
  return x;
}

int __gen_e_acsl_g(int x)
{
  int __gen_e_acsl_g_hidden_2;
  __gen_e_acsl_g_hidden_2 = __gen_e_acsl_g_hidden(x);
  return __gen_e_acsl_g_hidden_2;
}

mystruct __gen_e_acsl_t1(mystruct m)
{
  return m;
}

long __gen_e_acsl_t2(mystruct m)
{
  long __retres = m.k + (long)m.l;
  return __retres;
}

int __gen_e_acsl_k_pred(int x)
{
  int __retres = x > 0;
  return __retres;
}

double __gen_e_acsl_f2(double x)
{
  __e_acsl_mpq_t __gen_e_acsl__8;
  __e_acsl_mpq_t __gen_e_acsl__9;
  __e_acsl_mpq_t __gen_e_acsl_div;
  double __gen_e_acsl__10;
  __gmpq_init(__gen_e_acsl__8);
  __gmpq_set_str(__gen_e_acsl__8,"1",10);
  __gmpq_init(__gen_e_acsl__9);
  __gmpq_set_d(__gen_e_acsl__9,x);
  __gmpq_init(__gen_e_acsl_div);
  __gmpq_div(__gen_e_acsl_div,(__e_acsl_mpq_struct const *)(__gen_e_acsl__8),
             (__e_acsl_mpq_struct const *)(__gen_e_acsl__9));
  __gen_e_acsl__10 = __gmpq_get_d((__e_acsl_mpq_struct const *)(__gen_e_acsl_div));
  __gmpq_clear(__gen_e_acsl__8);
  __gmpq_clear(__gen_e_acsl__9);
  __gmpq_clear(__gen_e_acsl_div);
  /*@ assert Eva: is_nan_or_infinite: \is_finite(__gen_e_acsl__10); */
  return __gen_e_acsl__10;
}


