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

typedef int ArrayInt[5];
/*@ ensures
      *\old(AverageAccel) ≡
      (((((*\old(Accel))[4] + (*\old(Accel))[3]) + (*\old(Accel))[2]) +
        (*\old(Accel))[1])
       + (*\old(Accel))[0])
      / 5;
 */
void __gen_e_acsl_atp_NORMAL_computeAverageAccel(ArrayInt *Accel,
                                                 int *AverageAccel);

void atp_NORMAL_computeAverageAccel(ArrayInt *Accel, int *AverageAccel)
{
  __e_acsl_store_block((void *)(& AverageAccel),(size_t)8);
  __e_acsl_store_block((void *)(& Accel),(size_t)8);
  __e_acsl_initialize((void *)AverageAccel,sizeof(int));
  *AverageAccel = (((((*Accel)[4] + (*Accel)[3]) + (*Accel)[2]) + (*Accel)[1]) + (*Accel)[0]) / 5;
  __e_acsl_delete_block((void *)(& AverageAccel));
  __e_acsl_delete_block((void *)(& Accel));
  return;
}

int main(void)
{
  int __retres;
  int av;
  __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8);
  __e_acsl_store_block((void *)(& av),(size_t)4);
  ArrayInt Accel = {1, 2, 3, 4, 5};
  __e_acsl_store_block((void *)(Accel),(size_t)20);
  __e_acsl_full_init((void *)(& Accel));
  __gen_e_acsl_atp_NORMAL_computeAverageAccel(& Accel,& av);
  __retres = 0;
  __e_acsl_delete_block((void *)(& av));
  __e_acsl_delete_block((void *)(Accel));
  __e_acsl_memory_clean();
  return __retres;
}

/*@ ensures
      *\old(AverageAccel) ≡
      (((((*\old(Accel))[4] + (*\old(Accel))[3]) + (*\old(Accel))[2]) +
        (*\old(Accel))[1])
       + (*\old(Accel))[0])
      / 5;
 */
void __gen_e_acsl_atp_NORMAL_computeAverageAccel(ArrayInt *Accel,
                                                 int *AverageAccel)
{
  ArrayInt *__gen_e_acsl_at_6;
  ArrayInt *__gen_e_acsl_at_5;
  ArrayInt *__gen_e_acsl_at_4;
  ArrayInt *__gen_e_acsl_at_3;
  ArrayInt *__gen_e_acsl_at_2;
  int *__gen_e_acsl_at;
  __e_acsl_store_block((void *)(& AverageAccel),(size_t)8);
  __e_acsl_store_block((void *)(& Accel),(size_t)8);
  __gen_e_acsl_at_6 = Accel;
  __gen_e_acsl_at_5 = Accel;
  __gen_e_acsl_at_4 = Accel;
  __gen_e_acsl_at_3 = Accel;
  __gen_e_acsl_at_2 = Accel;
  __gen_e_acsl_at = AverageAccel;
  atp_NORMAL_computeAverageAccel(Accel,AverageAccel);
  {
    int __gen_e_acsl_valid_read;
    int __gen_e_acsl_valid_read_2;
    int __gen_e_acsl_valid_read_3;
    int __gen_e_acsl_valid_read_4;
    int __gen_e_acsl_valid_read_5;
    int __gen_e_acsl_valid_read_6;
    __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(*__gen_e_acsl_at_6),
                                                  sizeof(int),
                                                  (void *)(*__gen_e_acsl_at_6),
                                                  (void *)(*__gen_e_acsl_at_6));
    __e_acsl_assert(__gen_e_acsl_valid_read,"RTE",
                    "atp_NORMAL_computeAverageAccel",
                    "mem_access: \\valid_read((int *)*__gen_e_acsl_at_6)",
                    "tests/bts/bts1326.i",8);
    __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_5)[1]),
                                                    sizeof(int),
                                                    (void *)(& (*__gen_e_acsl_at_5)[1]),
                                                    (void *)0);
    __e_acsl_assert(__gen_e_acsl_valid_read_2,"RTE",
                    "atp_NORMAL_computeAverageAccel",
                    "mem_access: \\valid_read(&(*__gen_e_acsl_at_5)[1])",
                    "tests/bts/bts1326.i",8);
    __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_4)[2]),
                                                    sizeof(int),
                                                    (void *)(& (*__gen_e_acsl_at_4)[2]),
                                                    (void *)0);
    __e_acsl_assert(__gen_e_acsl_valid_read_3,"RTE",
                    "atp_NORMAL_computeAverageAccel",
                    "mem_access: \\valid_read(&(*__gen_e_acsl_at_4)[2])",
                    "tests/bts/bts1326.i",8);
    __gen_e_acsl_valid_read_4 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_3)[3]),
                                                    sizeof(int),
                                                    (void *)(& (*__gen_e_acsl_at_3)[3]),
                                                    (void *)0);
    __e_acsl_assert(__gen_e_acsl_valid_read_4,"RTE",
                    "atp_NORMAL_computeAverageAccel",
                    "mem_access: \\valid_read(&(*__gen_e_acsl_at_3)[3])",
                    "tests/bts/bts1326.i",8);
    __gen_e_acsl_valid_read_5 = __e_acsl_valid_read((void *)(& (*__gen_e_acsl_at_2)[4]),
                                                    sizeof(int),
                                                    (void *)(& (*__gen_e_acsl_at_2)[4]),
                                                    (void *)0);
    __e_acsl_assert(__gen_e_acsl_valid_read_5,"RTE",
                    "atp_NORMAL_computeAverageAccel",
                    "mem_access: \\valid_read(&(*__gen_e_acsl_at_2)[4])",
                    "tests/bts/bts1326.i",8);
    __gen_e_acsl_valid_read_6 = __e_acsl_valid_read((void *)__gen_e_acsl_at,
                                                    sizeof(int),
                                                    (void *)__gen_e_acsl_at,
                                                    (void *)(& __gen_e_acsl_at));
    __e_acsl_assert(__gen_e_acsl_valid_read_6,"RTE",
                    "atp_NORMAL_computeAverageAccel",
                    "mem_access: \\valid_read(__gen_e_acsl_at)",
                    "tests/bts/bts1326.i",8);
    __e_acsl_assert(*__gen_e_acsl_at == (int)((((((*__gen_e_acsl_at_2)[4] + (long)(*__gen_e_acsl_at_3)[3]) + (*__gen_e_acsl_at_4)[2]) + (*__gen_e_acsl_at_5)[1]) + (*__gen_e_acsl_at_6)[0]) / 5L),
                    "Postcondition","atp_NORMAL_computeAverageAccel",
                    "*\\old(AverageAccel) ==\n(((((*\\old(Accel))[4] + (*\\old(Accel))[3]) + (*\\old(Accel))[2]) +\n  (*\\old(Accel))[1])\n + (*\\old(Accel))[0])\n/ 5",
                    "tests/bts/bts1326.i",8);
    __e_acsl_delete_block((void *)(& AverageAccel));
    __e_acsl_delete_block((void *)(& Accel));
    return;
  }
}


