/* Generated by Frama-C */
#include "pthread.h"
#include "sched.h"
#include "signal.h"
#include "stddef.h"
#include "stdint.h"
#include "stdio.h"
#include "time.h"
char *__gen_e_acsl_literal_string;
extern  __attribute__((__FC_BUILTIN__)) int __e_acsl_sound_verdict;

/*@ check requires a != 0;
    check ensures \result != 0; */
int __gen_e_acsl_f(int a);

int f(int a)
{
  return a;
}

void g(int a, int *b)
{
  {
    int __gen_e_acsl_valid_read;
    __e_acsl_store_block((void *)(& b),8UL);
    __e_acsl_assert_data_t __gen_e_acsl_assert_data = {.values = (void *)0};
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,"a",0,a);
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,"*(b + 1)",0,
                                 *(b + 1));
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_2 =
      {.values = (void *)0};
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_2,"*(b + 1)",0,
                                 *(b + 1));
    __gen_e_acsl_assert_data_2.blocking = 1;
    __gen_e_acsl_assert_data_2.kind = "RTE";
    __gen_e_acsl_assert_data_2.pred_txt = "(long)*(b + 1) != 0";
    __gen_e_acsl_assert_data_2.file = "acsl_check.c";
    __gen_e_acsl_assert_data_2.fct = "g";
    __gen_e_acsl_assert_data_2.line = 15;
    __gen_e_acsl_assert_data_2.name = "division_by_zero";
    __e_acsl_assert((long)*(b + 1) != 0L,& __gen_e_acsl_assert_data_2);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_2);
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_3 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_3,"b",(void *)b);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_3,
                                   "sizeof(int)",0,sizeof(int));
    __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(b + 1),
                                                  sizeof(int),(void *)b,
                                                  (void *)(& b));
    __gen_e_acsl_assert_data_3.blocking = 1;
    __gen_e_acsl_assert_data_3.kind = "RTE";
    __gen_e_acsl_assert_data_3.pred_txt = "\\valid_read(b + 1)";
    __gen_e_acsl_assert_data_3.file = "acsl_check.c";
    __gen_e_acsl_assert_data_3.fct = "g";
    __gen_e_acsl_assert_data_3.line = 15;
    __gen_e_acsl_assert_data_3.name = "mem_access";
    __e_acsl_assert(__gen_e_acsl_valid_read,& __gen_e_acsl_assert_data_3);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_3);
    __gen_e_acsl_assert_data.blocking = 0;
    __gen_e_acsl_assert_data.kind = "Assertion";
    __gen_e_acsl_assert_data.pred_txt = "a / *(b + 1) == 0";
    __gen_e_acsl_assert_data.file = "acsl_check.c";
    __gen_e_acsl_assert_data.fct = "g";
    __gen_e_acsl_assert_data.line = 15;
    __e_acsl_assert(a / (long)*(b + 1) == 0L,& __gen_e_acsl_assert_data);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data);
  }
  /*@ check a / *(b + 1) == 0; */ ;
  __e_acsl_delete_block((void *)(& b));
  return;
}

/*@ check requires a != 0;
    check ensures \result != 0; */
int __gen_e_acsl_f(int a)
{
  int __retres;
  {
    __e_acsl_assert_data_t __gen_e_acsl_assert_data = {.values = (void *)0};
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,"a",0,a);
    __gen_e_acsl_assert_data.blocking = 0;
    __gen_e_acsl_assert_data.kind = "Precondition";
    __gen_e_acsl_assert_data.pred_txt = "a != 0";
    __gen_e_acsl_assert_data.file = "acsl_check.c";
    __gen_e_acsl_assert_data.fct = "f";
    __gen_e_acsl_assert_data.line = 7;
    __e_acsl_assert(a != 0,& __gen_e_acsl_assert_data);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data);
  }
  __retres = f(a);
  {
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_2 =
      {.values = (void *)0};
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_2,"\\result",0,
                                 __retres);
    __gen_e_acsl_assert_data_2.blocking = 0;
    __gen_e_acsl_assert_data_2.kind = "Postcondition";
    __gen_e_acsl_assert_data_2.pred_txt = "\\result != 0";
    __gen_e_acsl_assert_data_2.file = "acsl_check.c";
    __gen_e_acsl_assert_data_2.fct = "f";
    __gen_e_acsl_assert_data_2.line = 8;
    __e_acsl_assert(__retres != 0,& __gen_e_acsl_assert_data_2);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_2);
    return __retres;
  }
}

void __e_acsl_globals_init(void)
{
  static char __e_acsl_already_run = 0;
  if (! __e_acsl_already_run) {
    __e_acsl_already_run = 1;
    __gen_e_acsl_literal_string = "SHOULD BE PRINTED IN EXECUTION LOG\n";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string,
                         sizeof("SHOULD BE PRINTED IN EXECUTION LOG\n"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string);
  }
  return;
}

int main(void)
{
  __e_acsl_memory_init((int *)0,(char ***)0,8UL);
  __e_acsl_globals_init();
  int a = 0;
  int b[3] = {1, 2, 3};
  __e_acsl_store_block((void *)(b),12UL);
  __e_acsl_full_init((void *)(& b));
  {
    __e_acsl_assert_data_t __gen_e_acsl_assert_data = {.values = (void *)0};
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,"a",0,a);
    __gen_e_acsl_assert_data.blocking = 0;
    __gen_e_acsl_assert_data.kind = "Assertion";
    __gen_e_acsl_assert_data.pred_txt = "a == 1";
    __gen_e_acsl_assert_data.file = "acsl_check.c";
    __gen_e_acsl_assert_data.fct = "main";
    __gen_e_acsl_assert_data.line = 21;
    __e_acsl_assert(a == 1,& __gen_e_acsl_assert_data);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data);
  }
  /*@ check a == 1; */ ;
  a = __gen_e_acsl_f(a);
  fprintf(stderr,__gen_e_acsl_literal_string); /* fprintf_va_1 */
  g(a,b);
  /*@ admit a == 1; */ ;
  /*@ admit a == 2; */ ;
  __e_acsl_delete_block((void *)(b));
  __e_acsl_memory_clean();
  return a;
}


