Get rid of the warning about ignoring the return value of fgets
[cloog.git] / test / reservoir / liu-zhuge1.good.c
blob2b07aded62fb62f2ecb729ffc29218b80f82542d
1 /* Generated from ../../../git/cloog/test/./reservoir/liu-zhuge1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.05s. */
2 extern void hash(int);
4 /* Useful macros. */
5 #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d))
6 #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d))
7 #define max(x,y) ((x) > (y) ? (x) : (y))
8 #define min(x,y) ((x) < (y) ? (x) : (y))
10 #define S1(i,j) { hash(1); hash(i); hash(j); }
11 #define S2(i,j) { hash(2); hash(i); hash(j); }
12 #define S3(i,j) { hash(3); hash(i); hash(j); }
14 void test(int M, int N)
16 /* Scattering iterators. */
17 int c2, c4;
18 /* Original iterators. */
19 int i, j;
20 if ((M >= 0) && (N >= 0)) {
21 for (c2=-4;c2<=min(-1,3*M+N-4);c2++) {
22 for (c4=max(0,c2-3*M+4);c4<=min(c2+4,N);c4++) {
23 if ((c2+2*c4+1)%3 == 0) {
24 i = (c2-c4+4)/3 ;
25 S1((c2-c4+4)/3,c4) ;
30 if ((M <= 1) && (M >= 0)) {
31 for (c2=0;c2<=3*M+N-4;c2++) {
32 for (c4=max(c2-3*M,0);c4<=c2;c4++) {
33 if ((c2+2*c4)%3 == 0) {
34 i = (c2-c4)/3 ;
35 S2((c2-c4)/3,c4) ;
38 for (c4=c2-3*M+4;c4<=min(c2+4,N);c4++) {
39 if ((c2+2*c4+1)%3 == 0) {
40 i = (c2-c4+4)/3 ;
41 S1((c2-c4+4)/3,c4) ;
44 for (c4=max(0,c2-3*M);c4<=c2;c4++) {
45 if ((c2+2*c4)%3 == 0) {
46 i = (c2-c4)/3 ;
47 S3((c2-c4)/3,c4) ;
52 for (c2=0;c2<=min(3*M-4,N-1);c2++) {
53 for (c4=0;c4<=c2;c4++) {
54 if ((c2+2*c4)%3 == 0) {
55 i = (c2-c4)/3 ;
56 S2((c2-c4)/3,c4) ;
58 if ((c2+2*c4+1)%3 == 0) {
59 i = (c2-c4+4)/3 ;
60 S1((c2-c4+4)/3,c4) ;
63 for (c4=c2+1;c4<=min(c2+4,N);c4++) {
64 if ((c2+2*c4+1)%3 == 0) {
65 i = (c2-c4+4)/3 ;
66 S1((c2-c4+4)/3,c4) ;
69 for (c4=0;c4<=c2;c4++) {
70 if ((c2+2*c4)%3 == 0) {
71 i = (c2-c4)/3 ;
72 S3((c2-c4)/3,c4) ;
76 if (M >= 2) {
77 for (c2=3*M-3;c2<=N-1;c2++) {
78 for (c4=max(c2-3*M,0);c4<=c2-3*M+3;c4++) {
79 if ((c2+2*c4)%3 == 0) {
80 i = (c2-c4)/3 ;
81 S2((c2-c4)/3,c4) ;
84 for (c4=c2-3*M+4;c4<=c2;c4++) {
85 if ((c2+2*c4)%3 == 0) {
86 i = (c2-c4)/3 ;
87 S2((c2-c4)/3,c4) ;
89 if ((c2+2*c4+1)%3 == 0) {
90 i = (c2-c4+4)/3 ;
91 S1((c2-c4+4)/3,c4) ;
94 for (c4=c2+1;c4<=min(c2+4,N);c4++) {
95 if ((c2+2*c4+1)%3 == 0) {
96 i = (c2-c4+4)/3 ;
97 S1((c2-c4+4)/3,c4) ;
100 for (c4=max(0,c2-3*M);c4<=c2;c4++) {
101 if ((c2+2*c4)%3 == 0) {
102 i = (c2-c4)/3 ;
103 S3((c2-c4)/3,c4) ;
108 if (N >= 0) {
109 for (c2=N;c2<=3*M-4;c2++) {
110 for (c4=0;c4<=N;c4++) {
111 if ((c2+2*c4)%3 == 0) {
112 i = (c2-c4)/3 ;
113 S2((c2-c4)/3,c4) ;
115 if ((c2+2*c4+1)%3 == 0) {
116 i = (c2-c4+4)/3 ;
117 S1((c2-c4+4)/3,c4) ;
120 for (c4=0;c4<=N;c4++) {
121 if ((c2+2*c4)%3 == 0) {
122 i = (c2-c4)/3 ;
123 S3((c2-c4)/3,c4) ;
128 for (c2=max(3*M-3,N);c2<=3*M+N-4;c2++) {
129 for (c4=max(c2-3*M,0);c4<=c2-3*M+3;c4++) {
130 if ((c2+2*c4)%3 == 0) {
131 i = (c2-c4)/3 ;
132 S2((c2-c4)/3,c4) ;
135 for (c4=c2-3*M+4;c4<=N;c4++) {
136 if ((c2+2*c4)%3 == 0) {
137 i = (c2-c4)/3 ;
138 S2((c2-c4)/3,c4) ;
140 if ((c2+2*c4+1)%3 == 0) {
141 i = (c2-c4+4)/3 ;
142 S1((c2-c4+4)/3,c4) ;
145 for (c4=max(0,c2-3*M);c4<=N;c4++) {
146 if ((c2+2*c4)%3 == 0) {
147 i = (c2-c4)/3 ;
148 S3((c2-c4)/3,c4) ;
152 if ((M >= 0) && (N >= 0)) {
153 for (c2=max(3*M+N-3,0);c2<=3*M+N;c2++) {
154 for (c4=max(0,c2-3*M);c4<=min(c2,N);c4++) {
155 if ((c2+2*c4)%3 == 0) {
156 i = (c2-c4)/3 ;
157 S2((c2-c4)/3,c4) ;
160 for (c4=max(0,c2-3*M);c4<=min(c2,N);c4++) {
161 if ((c2+2*c4)%3 == 0) {
162 i = (c2-c4)/3 ;
163 S3((c2-c4)/3,c4) ;