115{
116
118
119
121 integer i__, q, osptr1, hrange, lrange;
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197 --osbuf;
198 vwin -= 3;
199
200
201
202 i__1 = vwin[((*af - 1) << 1) + 2] + 1, i__2 = (*af - 2) * *
lframe + 1;
203 lrange =
max(i__1,i__2);
205
206 for (osptr1 = *osptr - 1; osptr1 >= 1; --osptr1) {
207 if (osbuf[osptr1] <= hrange) {
208 goto L90;
209 }
210 }
211L90:
212 ++osptr1;
213
214 if (osptr1 <= 1 || osbuf[osptr1 - 1] < lrange) {
215
216 i__1 = vwin[((*af - 1) << 1) + 2] + 1;
217 vwin[(*af << 1) + 1] =
max(i__1,*dvwinl);
218 vwin[(*af << 1) + 2] = vwin[(*af << 1) + 1] + *maxwin - 1;
219 *obound = 0;
220 } else {
221
222
223 for (q = osptr1 - 1; q >= 1; --q) {
224 if (osbuf[q] < lrange) {
225 goto L100;
226 }
227 }
228L100:
229 ++q;
230
231
232 i__1 = osptr1 - 1;
233 for (i__ = q + 1; i__ <= i__1; ++i__) {
234 if (osbuf[i__] - osbuf[q] >= *minwin) {
236 goto L105;
237 }
238 }
240L105:
241
242 i__1 = (*af - 1) * *
lframe, i__2 = lrange + *minwin - 1;
243 if (! crit && osbuf[q] >
max(i__1,i__2)) {
244 vwin[(*af << 1) + 2] = osbuf[q] - 1;
245
246 i__1 = lrange, i__2 = vwin[(*af << 1) + 2] - *maxwin + 1;
247 vwin[(*af << 1) + 1] =
max(i__1,i__2);
248 *obound = 2;
249
250 } else {
251 vwin[(*af << 1) + 1] = osbuf[q];
252L110:
253 ++q;
254 if (q >= osptr1) {
255 goto L120;
256 }
257 if (osbuf[q] > vwin[(*af << 1) + 1] + *maxwin) {
258 goto L120;
259 }
260 if (osbuf[q] < vwin[(*af << 1) + 1] + *minwin) {
261 goto L110;
262 }
263 vwin[(*af << 1) + 2] = osbuf[q] - 1;
264 *obound = 3;
265 return 0;
266L120:
267
268 i__1 = vwin[(*af << 1) + 1] + *maxwin - 1;
269 vwin[(*af << 1) + 2] =
min(i__1,hrange);
270 *obound = 1;
271 }
272 }
273 return 0;
274}