Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec / optim / oversampling / oversampling0.c @ 6a93d814

History | View | Annotate | Download (1.3 KB)

1
#include <assert.h>
2
#include "oversampling0.h"
3

    
4
/* C code generated by lustrec
5
   SVN version number 0.1-382M
6
   Code is C99 compliant */
7
   
8
/* Import dependencies */
9

    
10
/* Global constants (definitions) */
11

    
12
/* Struct definitions */
13
struct g_mem {struct g_reg {int __g_2; } _reg; struct _arrow_mem *ni_1; struct f_mem *ni_0; };
14
struct f_mem {struct f_reg {int __f_2; } _reg; struct _arrow_mem *ni_2; };
15

    
16

    
17
void g_reset (struct g_mem *self) {
18
  _arrow_reset(self->ni_1);
19
  f_reset(self->ni_0);
20
  return;
21
}
22

    
23
void g_step (_Bool c, int x, 
24
             int (*out),
25
             struct g_mem *self) {
26
  _Bool __g_1;
27
  int cpt;
28
  int last_y;
29
  int t;
30
  int y;
31
  
32
  _arrow_step (1, 0, &__g_1, self->ni_1);
33
  if (__g_1) {
34
    last_y = 0;
35
  } else {
36
    last_y = self->_reg.__g_2;
37
  }
38
  if (c) {
39
    t = x;
40
  } else {
41
    t = last_y;
42
  }
43
  f_step (t, &cpt, &y, self->ni_0);
44
  if (c) {
45
  } else {
46
    *out = y;
47
  }
48
  self->_reg.__g_2 = y;
49
  return;
50
}
51

    
52
void f_reset (struct f_mem *self) {
53
  _arrow_reset(self->ni_2);
54
  return;
55
}
56

    
57
void f_step (int x, 
58
             int (*cpt), int (*y),
59
             struct f_mem *self) {
60
  _Bool __f_1;
61
  int __f_3;
62
  
63
  *y = (x + 1);
64
  _arrow_step (1, 0, &__f_1, self->ni_2);
65
  if (__f_1) {
66
    __f_3 = 0;
67
  } else {
68
    __f_3 = self->_reg.__f_2;
69
  }
70
  *cpt = (__f_3 + 1);
71
  self->_reg.__f_2 = *cpt;
72
  return;
73
}
74