2 #if defined(HAS_CODE) && defined(VERBOSE)
3 cpu_printf("Pr: %d Tr: %d\n", II, t->forw);
6 default: Uerror("bad forward move");
7 case 0: /* if without executable clauses */
9 case 1: /* generic 'goto' or 'skip' */
12 case 2: /* generic 'else' */
14 if (trpt->o_pm&1) continue;
18 case 3: /* STATE 1 - line 225 "buffer.spin" - [i = 0] (0:0:1 - 1) */
21 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
24 logval(":init::i", ((int)((P4 *)this)->i));
27 _m = 3; goto P999; /* 0 */
28 case 4: /* STATE 2 - line 227 "buffer.spin" - [((i<2))] (8:0:3 - 1) */
31 if (!((((int)((P4 *)this)->i)<2)))
33 /* merge: commit_count[i] = 0(8, 3, 8) */
35 (trpt+1)->bup.ovals = grab_ints(3);
36 (trpt+1)->bup.ovals[0] = ((int)now.commit_count[ Index(((int)((P4 *)this)->i), 2) ]);
37 now.commit_count[ Index(((P4 *)this)->i, 2) ] = 0;
39 logval("commit_count[:init::i]", ((int)now.commit_count[ Index(((int)((P4 *)this)->i), 2) ]));
42 /* merge: retrieve_count[i] = 0(8, 4, 8) */
44 (trpt+1)->bup.ovals[1] = ((int)now.retrieve_count[ Index(((int)((P4 *)this)->i), 2) ]);
45 now.retrieve_count[ Index(((P4 *)this)->i, 2) ] = 0;
47 logval("retrieve_count[:init::i]", ((int)now.retrieve_count[ Index(((int)((P4 *)this)->i), 2) ]));
50 /* merge: i = (i+1)(8, 5, 8) */
52 (trpt+1)->bup.ovals[2] = ((int)((P4 *)this)->i);
53 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
55 logval(":init::i", ((int)((P4 *)this)->i));
58 /* merge: .(goto)(0, 9, 8) */
61 _m = 3; goto P999; /* 4 */
62 case 5: /* STATE 6 - line 231 "buffer.spin" - [((i>=2))] (17:0:2 - 1) */
65 if (!((((int)((P4 *)this)->i)>=2)))
67 /* dead 1: i */ (trpt+1)->bup.ovals = grab_ints(2);
68 (trpt+1)->bup.ovals[0] = ((P4 *)this)->i;
73 /* merge: goto :b6(17, 7, 17) */
76 /* merge: i = 0(17, 11, 17) */
78 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->i);
81 logval(":init::i", ((int)((P4 *)this)->i));
84 /* merge: .(goto)(0, 18, 17) */
87 _m = 3; goto P999; /* 3 */
88 case 6: /* STATE 11 - line 233 "buffer.spin" - [i = 0] (0:17:1 - 3) */
91 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
94 logval(":init::i", ((int)((P4 *)this)->i));
97 /* merge: .(goto)(0, 18, 17) */
100 _m = 3; goto P999; /* 1 */
101 case 7: /* STATE 12 - line 235 "buffer.spin" - [((i<4))] (17:0:2 - 1) */
104 if (!((((int)((P4 *)this)->i)<4)))
106 /* merge: buffer_use[i] = 0(17, 13, 17) */
108 (trpt+1)->bup.ovals = grab_ints(2);
109 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((int)((P4 *)this)->i), 4) ]);
110 now.buffer_use[ Index(((P4 *)this)->i, 4) ] = 0;
112 logval("buffer_use[:init::i]", ((int)now.buffer_use[ Index(((int)((P4 *)this)->i), 4) ]));
115 /* merge: i = (i+1)(17, 14, 17) */
117 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->i);
118 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
120 logval(":init::i", ((int)((P4 *)this)->i));
123 /* merge: .(goto)(0, 18, 17) */
126 _m = 3; goto P999; /* 3 */
127 case 8: /* STATE 15 - line 238 "buffer.spin" - [((i>=4))] (0:0:1 - 1) */
130 if (!((((int)((P4 *)this)->i)>=4)))
132 /* dead 1: i */ (trpt+1)->bup.oval = ((P4 *)this)->i;
137 _m = 3; goto P999; /* 0 */
138 case 9: /* STATE 20 - line 240 "buffer.spin" - [(run reader())] (0:0:0 - 3) */
143 _m = 3; goto P999; /* 0 */
144 case 10: /* STATE 21 - line 241 "buffer.spin" - [(run cleaner())] (29:0:1 - 1) */
149 /* merge: i = 0(0, 22, 29) */
151 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
154 logval(":init::i", ((int)((P4 *)this)->i));
157 /* merge: .(goto)(0, 30, 29) */
160 _m = 3; goto P999; /* 2 */
161 case 11: /* STATE 23 - line 244 "buffer.spin" - [((i<4))] (25:0:1 - 1) */
164 if (!((((int)((P4 *)this)->i)<4)))
166 /* merge: refcount = (refcount+1)(0, 24, 25) */
168 (trpt+1)->bup.oval = ((int)now.refcount);
169 now.refcount = (((int)now.refcount)+1);
171 logval("refcount", ((int)now.refcount));
174 _m = 3; goto P999; /* 1 */
175 case 12: /* STATE 25 - line 246 "buffer.spin" - [(run tracer())] (29:0:1 - 1) */
180 /* merge: i = (i+1)(0, 26, 29) */
182 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
183 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
185 logval(":init::i", ((int)((P4 *)this)->i));
188 /* merge: .(goto)(0, 30, 29) */
191 _m = 3; goto P999; /* 2 */
192 case 13: /* STATE 27 - line 248 "buffer.spin" - [((i>=4))] (39:0:2 - 1) */
195 if (!((((int)((P4 *)this)->i)>=4)))
197 /* dead 1: i */ (trpt+1)->bup.ovals = grab_ints(2);
198 (trpt+1)->bup.ovals[0] = ((P4 *)this)->i;
203 /* merge: goto :b8(39, 28, 39) */
206 /* merge: i = 0(39, 32, 39) */
208 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->i);
211 logval(":init::i", ((int)((P4 *)this)->i));
214 /* merge: .(goto)(0, 40, 39) */
217 _m = 3; goto P999; /* 3 */
218 case 14: /* STATE 32 - line 250 "buffer.spin" - [i = 0] (0:39:1 - 3) */
221 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
224 logval(":init::i", ((int)((P4 *)this)->i));
227 /* merge: .(goto)(0, 40, 39) */
230 _m = 3; goto P999; /* 1 */
231 case 15: /* STATE 33 - line 252 "buffer.spin" - [((i<1))] (35:0:1 - 1) */
234 if (!((((int)((P4 *)this)->i)<1)))
236 /* merge: refcount = (refcount+1)(0, 34, 35) */
238 (trpt+1)->bup.oval = ((int)now.refcount);
239 now.refcount = (((int)now.refcount)+1);
241 logval("refcount", ((int)now.refcount));
244 _m = 3; goto P999; /* 1 */
245 case 16: /* STATE 35 - line 254 "buffer.spin" - [(run switcher())] (39:0:1 - 1) */
250 /* merge: i = (i+1)(0, 36, 39) */
252 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
253 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
255 logval(":init::i", ((int)((P4 *)this)->i));
258 /* merge: .(goto)(0, 40, 39) */
261 _m = 3; goto P999; /* 2 */
262 case 17: /* STATE 37 - line 256 "buffer.spin" - [((i>=1))] (41:0:1 - 1) */
265 if (!((((int)((P4 *)this)->i)>=1)))
267 /* dead 1: i */ (trpt+1)->bup.oval = ((P4 *)this)->i;
272 /* merge: goto :b9(0, 38, 41) */
275 _m = 3; goto P999; /* 1 */
276 case 18: /* STATE 43 - line 262 "buffer.spin" - [assert((((write_off-read_off)>=0)&&((write_off-read_off)<(255/2))))] (0:52:2 - 1) */
279 assert((((((int)now.write_off)-((int)now.read_off))>=0)&&((((int)now.write_off)-((int)now.read_off))<(255/2))), "(((write_off-read_off)>=0)&&((write_off-read_off)<(255/2)))", II, tt, t);
280 /* merge: j = 0(52, 44, 52) */
282 (trpt+1)->bup.ovals = grab_ints(2);
283 (trpt+1)->bup.ovals[0] = ((int)((P4 *)this)->j);
286 logval(":init::j", ((int)((P4 *)this)->j));
289 /* merge: commit_sum = 0(52, 45, 52) */
291 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->commit_sum);
292 ((P4 *)this)->commit_sum = 0;
294 logval(":init::commit_sum", ((int)((P4 *)this)->commit_sum));
297 /* merge: .(goto)(0, 53, 52) */
300 _m = 3; goto P999; /* 3 */
301 case 19: /* STATE 46 - line 266 "buffer.spin" - [((j<2))] (52:0:2 - 1) */
304 if (!((((int)((P4 *)this)->j)<2)))
306 /* merge: commit_sum = (commit_sum+commit_count[j])(52, 47, 52) */
308 (trpt+1)->bup.ovals = grab_ints(2);
309 (trpt+1)->bup.ovals[0] = ((int)((P4 *)this)->commit_sum);
310 ((P4 *)this)->commit_sum = (((int)((P4 *)this)->commit_sum)+((int)now.commit_count[ Index(((int)((P4 *)this)->j), 2) ]));
312 logval(":init::commit_sum", ((int)((P4 *)this)->commit_sum));
315 /* merge: assert((((commit_count[j]-retrieve_count[j])>=0)&&((commit_count[j]-retrieve_count[j])<(255/2))))(52, 48, 52) */
317 assert((((((int)now.commit_count[ Index(((int)((P4 *)this)->j), 2) ])-((int)now.retrieve_count[ Index(((int)((P4 *)this)->j), 2) ]))>=0)&&((((int)now.commit_count[ Index(((int)((P4 *)this)->j), 2) ])-((int)now.retrieve_count[ Index(((int)((P4 *)this)->j), 2) ]))<(255/2))), "(((commit_count[j]-retrieve_count[j])>=0)&&((commit_count[j]-retrieve_count[j])<(255/2)))", II, tt, t);
318 /* merge: j = (j+1)(52, 49, 52) */
320 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->j);
321 ((P4 *)this)->j = (((int)((P4 *)this)->j)+1);
323 logval(":init::j", ((int)((P4 *)this)->j));
326 /* merge: .(goto)(0, 53, 52) */
329 _m = 3; goto P999; /* 4 */
330 case 20: /* STATE 50 - line 273 "buffer.spin" - [((j>=2))] (58:0:1 - 1) */
333 if (!((((int)((P4 *)this)->j)>=2)))
335 /* dead 1: j */ (trpt+1)->bup.oval = ((P4 *)this)->j;
340 /* merge: goto :b10(58, 51, 58) */
343 /* merge: assert((((write_off-commit_sum)>=0)&&((write_off-commit_sum)<(255/2))))(58, 55, 58) */
345 assert((((((int)now.write_off)-((int)((P4 *)this)->commit_sum))>=0)&&((((int)now.write_off)-((int)((P4 *)this)->commit_sum))<(255/2))), "(((write_off-commit_sum)>=0)&&((write_off-commit_sum)<(255/2)))", II, tt, t);
346 /* merge: assert((((4+1)>4)||(events_lost==0)))(58, 56, 58) */
348 assert((((4+1)>4)||(((int)now.events_lost)==0)), "(((4+1)>4)||(events_lost==0))", II, tt, t);
349 _m = 3; goto P999; /* 3 */
350 case 21: /* STATE 55 - line 278 "buffer.spin" - [assert((((write_off-commit_sum)>=0)&&((write_off-commit_sum)<(255/2))))] (0:58:0 - 3) */
353 assert((((((int)now.write_off)-((int)((P4 *)this)->commit_sum))>=0)&&((((int)now.write_off)-((int)((P4 *)this)->commit_sum))<(255/2))), "(((write_off-commit_sum)>=0)&&((write_off-commit_sum)<(255/2)))", II, tt, t);
354 /* merge: assert((((4+1)>4)||(events_lost==0)))(58, 56, 58) */
356 assert((((4+1)>4)||(((int)now.events_lost)==0)), "(((4+1)>4)||(events_lost==0))", II, tt, t);
357 _m = 3; goto P999; /* 1 */
358 case 22: /* STATE 58 - line 284 "buffer.spin" - [-end-] (0:0:0 - 1) */
361 if (!delproc(1, II)) continue;
362 _m = 3; goto P999; /* 0 */
365 case 23: /* STATE 1 - line 210 "buffer.spin" - [((refcount==0))] (3:0:1 - 1) */
368 if (!((((int)now.refcount)==0)))
370 /* merge: refcount = (refcount+1)(0, 2, 3) */
372 (trpt+1)->bup.oval = ((int)now.refcount);
373 now.refcount = (((int)now.refcount)+1);
375 logval("refcount", ((int)now.refcount));
378 _m = 3; goto P999; /* 1 */
379 case 24: /* STATE 3 - line 212 "buffer.spin" - [(run switcher())] (7:0:0 - 1) */
384 /* merge: goto :b5(0, 4, 7) */
387 _m = 3; goto P999; /* 1 */
388 case 25: /* STATE 9 - line 216 "buffer.spin" - [-end-] (0:0:0 - 1) */
391 if (!delproc(1, II)) continue;
392 _m = 3; goto P999; /* 0 */
395 case 26: /* STATE 1 - line 169 "buffer.spin" - [((((((write_off/(4/2))-(read_off/(4/2)))>0)&&(((write_off/(4/2))-(read_off/(4/2)))<(255/2)))&&((commit_count[((read_off%4)/(4/2))]-retrieve_count[((read_off%4)/(4/2))])==(4/2))))] (0:0:0 - 1) */
398 if (!((((((((int)now.write_off)/(4/2))-(((int)now.read_off)/(4/2)))>0)&&(((((int)now.write_off)/(4/2))-(((int)now.read_off)/(4/2)))<(255/2)))&&((((int)now.commit_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ])-((int)now.retrieve_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ]))==(4/2)))))
400 _m = 3; goto P999; /* 0 */
401 case 27: /* STATE 2 - line 171 "buffer.spin" - [i = 0] (0:0:1 - 1) */
404 (trpt+1)->bup.oval = ((int)((P2 *)this)->i);
407 logval("reader:i", ((int)((P2 *)this)->i));
410 _m = 3; goto P999; /* 0 */
411 case 28: /* STATE 3 - line 173 "buffer.spin" - [((i<(4/2)))] (9:0:2 - 1) */
414 if (!((((int)((P2 *)this)->i)<(4/2))))
416 /* merge: assert((buffer_use[((read_off+i)%4)]==0))(9, 4, 9) */
418 assert((((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ])==0), "(buffer_use[((read_off+i)%4)]==0)", II, tt, t);
419 /* merge: buffer_use[((read_off+i)%4)] = 1(9, 5, 9) */
421 (trpt+1)->bup.ovals = grab_ints(2);
422 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]);
423 now.buffer_use[ Index(((now.read_off+((P2 *)this)->i)%4), 4) ] = 1;
425 logval("buffer_use[((read_off+reader:i)%4)]", ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]));
428 /* merge: i = (i+1)(9, 6, 9) */
430 (trpt+1)->bup.ovals[1] = ((int)((P2 *)this)->i);
431 ((P2 *)this)->i = (((int)((P2 *)this)->i)+1);
433 logval("reader:i", ((int)((P2 *)this)->i));
436 /* merge: .(goto)(0, 10, 9) */
439 _m = 3; goto P999; /* 4 */
440 case 29: /* STATE 7 - line 177 "buffer.spin" - [((i>=(4/2)))] (11:0:1 - 1) */
443 if (!((((int)((P2 *)this)->i)>=(4/2))))
445 /* dead 1: i */ (trpt+1)->bup.oval = ((P2 *)this)->i;
450 /* merge: goto :b3(0, 8, 11) */
453 _m = 3; goto P999; /* 1 */
454 /* STATE 13 - line 187 "buffer.spin" - [i = 0] (0:0 - 1) same as 27 (0:0 - 1) */
455 case 30: /* STATE 14 - line 189 "buffer.spin" - [((i<(4/2)))] (19:0:2 - 1) */
458 if (!((((int)((P2 *)this)->i)<(4/2))))
460 /* merge: buffer_use[((read_off+i)%4)] = 0(19, 15, 19) */
462 (trpt+1)->bup.ovals = grab_ints(2);
463 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]);
464 now.buffer_use[ Index(((now.read_off+((P2 *)this)->i)%4), 4) ] = 0;
466 logval("buffer_use[((read_off+reader:i)%4)]", ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]));
469 /* merge: i = (i+1)(19, 16, 19) */
471 (trpt+1)->bup.ovals[1] = ((int)((P2 *)this)->i);
472 ((P2 *)this)->i = (((int)((P2 *)this)->i)+1);
474 logval("reader:i", ((int)((P2 *)this)->i));
477 /* merge: .(goto)(0, 20, 19) */
480 _m = 3; goto P999; /* 3 */
481 case 31: /* STATE 17 - line 192 "buffer.spin" - [((i>=(4/2)))] (28:0:4 - 1) */
484 if (!((((int)((P2 *)this)->i)>=(4/2))))
486 /* dead 1: i */ (trpt+1)->bup.ovals = grab_ints(4);
487 (trpt+1)->bup.ovals[0] = ((P2 *)this)->i;
492 /* merge: goto :b4(28, 18, 28) */
495 /* merge: tmp_retrieve = (retrieve_count[((read_off%4)/(4/2))]+(4/2))(28, 22, 28) */
497 (trpt+1)->bup.ovals[1] = ((int)((P2 *)this)->tmp_retrieve);
498 ((P2 *)this)->tmp_retrieve = (((int)now.retrieve_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ])+(4/2));
500 logval("reader:tmp_retrieve", ((int)((P2 *)this)->tmp_retrieve));
503 /* merge: retrieve_count[((read_off%4)/(4/2))] = tmp_retrieve(28, 23, 28) */
505 (trpt+1)->bup.ovals[2] = ((int)now.retrieve_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ]);
506 now.retrieve_count[ Index(((now.read_off%4)/(4/2)), 2) ] = ((int)((P2 *)this)->tmp_retrieve);
508 logval("retrieve_count[((read_off%4)/(4/2))]", ((int)now.retrieve_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ]));
511 /* merge: read_off = (read_off+(4/2))(28, 24, 28) */
513 (trpt+1)->bup.ovals[3] = ((int)now.read_off);
514 now.read_off = (((int)now.read_off)+(4/2));
516 logval("read_off", ((int)now.read_off));
519 /* merge: .(goto)(0, 29, 28) */
522 _m = 3; goto P999; /* 5 */
523 case 32: /* STATE 22 - line 194 "buffer.spin" - [tmp_retrieve = (retrieve_count[((read_off%4)/(4/2))]+(4/2))] (0:28:3 - 3) */
526 (trpt+1)->bup.ovals = grab_ints(3);
527 (trpt+1)->bup.ovals[0] = ((int)((P2 *)this)->tmp_retrieve);
528 ((P2 *)this)->tmp_retrieve = (((int)now.retrieve_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ])+(4/2));
530 logval("reader:tmp_retrieve", ((int)((P2 *)this)->tmp_retrieve));
533 /* merge: retrieve_count[((read_off%4)/(4/2))] = tmp_retrieve(28, 23, 28) */
535 (trpt+1)->bup.ovals[1] = ((int)now.retrieve_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ]);
536 now.retrieve_count[ Index(((now.read_off%4)/(4/2)), 2) ] = ((int)((P2 *)this)->tmp_retrieve);
538 logval("retrieve_count[((read_off%4)/(4/2))]", ((int)now.retrieve_count[ Index(((((int)now.read_off)%4)/(4/2)), 2) ]));
541 /* merge: read_off = (read_off+(4/2))(28, 24, 28) */
543 (trpt+1)->bup.ovals[2] = ((int)now.read_off);
544 now.read_off = (((int)now.read_off)+(4/2));
546 logval("read_off", ((int)now.read_off));
549 /* merge: .(goto)(0, 29, 28) */
552 _m = 3; goto P999; /* 3 */
553 case 33: /* STATE 26 - line 199 "buffer.spin" - [((read_off>=(4-events_lost)))] (0:0:0 - 1) */
556 if (!((((int)now.read_off)>=(4-((int)now.events_lost)))))
558 _m = 3; goto P999; /* 0 */
559 case 34: /* STATE 31 - line 201 "buffer.spin" - [-end-] (0:0:0 - 3) */
562 if (!delproc(1, II)) continue;
563 _m = 3; goto P999; /* 0 */
566 case 35: /* STATE 1 - line 99 "buffer.spin" - [prev_off = write_off] (0:10:2 - 1) */
569 (trpt+1)->bup.ovals = grab_ints(2);
570 (trpt+1)->bup.ovals[0] = ((int)((P1 *)this)->prev_off);
571 ((P1 *)this)->prev_off = ((int)now.write_off);
573 logval("tracer:prev_off", ((int)((P1 *)this)->prev_off));
576 /* merge: new_off = (prev_off+size)(10, 2, 10) */
578 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->new_off);
579 ((P1 *)this)->new_off = (((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->size));
581 logval("tracer:new_off", ((int)((P1 *)this)->new_off));
584 _m = 3; goto P999; /* 1 */
585 case 36: /* STATE 4 - line 104 "buffer.spin" - [((((new_off-read_off)>4)&&((new_off-read_off)<(255/2))))] (0:0:1 - 1) */
588 if (!((((((int)((P1 *)this)->new_off)-((int)now.read_off))>4)&&((((int)((P1 *)this)->new_off)-((int)now.read_off))<(255/2)))))
590 /* dead 1: new_off */ (trpt+1)->bup.oval = ((P1 *)this)->new_off;
594 ((P1 *)this)->new_off = 0;
595 _m = 3; goto P999; /* 0 */
596 case 37: /* STATE 7 - line 106 "buffer.spin" - [(1)] (27:0:0 - 1) */
601 /* merge: .(goto)(0, 9, 27) */
604 _m = 3; goto P999; /* 1 */
605 case 38: /* STATE 11 - line 111 "buffer.spin" - [((prev_off!=write_off))] (3:0:1 - 1) */
608 if (!((((int)((P1 *)this)->prev_off)!=((int)now.write_off))))
610 /* dead 1: prev_off */ (trpt+1)->bup.oval = ((P1 *)this)->prev_off;
614 ((P1 *)this)->prev_off = 0;
615 /* merge: goto cmpxchg_loop(0, 12, 3) */
618 _m = 3; goto P999; /* 1 */
619 case 39: /* STATE 14 - line 112 "buffer.spin" - [write_off = new_off] (0:24:2 - 1) */
622 (trpt+1)->bup.ovals = grab_ints(2);
623 (trpt+1)->bup.ovals[0] = ((int)now.write_off);
624 now.write_off = ((int)((P1 *)this)->new_off);
626 logval("write_off", ((int)now.write_off));
629 /* merge: .(goto)(24, 16, 24) */
632 /* merge: i = 0(24, 17, 24) */
634 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->i);
637 logval("tracer:i", ((int)((P1 *)this)->i));
640 /* merge: .(goto)(0, 25, 24) */
643 _m = 3; goto P999; /* 3 */
644 case 40: /* STATE 17 - line 114 "buffer.spin" - [i = 0] (0:24:1 - 2) */
647 (trpt+1)->bup.oval = ((int)((P1 *)this)->i);
650 logval("tracer:i", ((int)((P1 *)this)->i));
653 /* merge: .(goto)(0, 25, 24) */
656 _m = 3; goto P999; /* 1 */
657 case 41: /* STATE 18 - line 116 "buffer.spin" - [((i<size))] (24:0:2 - 1) */
660 if (!((((int)((P1 *)this)->i)<((int)((P1 *)this)->size))))
662 /* merge: assert((buffer_use[((prev_off+i)%4)]==0))(24, 19, 24) */
664 assert((((int)now.buffer_use[ Index(((((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->i))%4), 4) ])==0), "(buffer_use[((prev_off+i)%4)]==0)", II, tt, t);
665 /* merge: buffer_use[((prev_off+i)%4)] = 1(24, 20, 24) */
667 (trpt+1)->bup.ovals = grab_ints(2);
668 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->i))%4), 4) ]);
669 now.buffer_use[ Index(((((P1 *)this)->prev_off+((P1 *)this)->i)%4), 4) ] = 1;
671 logval("buffer_use[((tracer:prev_off+tracer:i)%4)]", ((int)now.buffer_use[ Index(((((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->i))%4), 4) ]));
674 /* merge: i = (i+1)(24, 21, 24) */
676 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->i);
677 ((P1 *)this)->i = (((int)((P1 *)this)->i)+1);
679 logval("tracer:i", ((int)((P1 *)this)->i));
682 /* merge: .(goto)(0, 25, 24) */
685 _m = 3; goto P999; /* 4 */
686 case 42: /* STATE 22 - line 120 "buffer.spin" - [((i>=size))] (26:0:1 - 1) */
689 if (!((((int)((P1 *)this)->i)>=((int)((P1 *)this)->size))))
691 /* dead 1: i */ (trpt+1)->bup.oval = ((P1 *)this)->i;
696 /* merge: goto :b0(0, 23, 26) */
699 _m = 3; goto P999; /* 1 */
700 case 43: /* STATE 28 - line 127 "buffer.spin" - [i = 0] (0:0:1 - 1) */
703 (trpt+1)->bup.oval = ((int)((P1 *)this)->i);
706 logval("tracer:i", ((int)((P1 *)this)->i));
709 _m = 3; goto P999; /* 0 */
710 case 44: /* STATE 29 - line 129 "buffer.spin" - [((i<size))] (34:0:2 - 1) */
713 if (!((((int)((P1 *)this)->i)<((int)((P1 *)this)->size))))
715 /* merge: buffer_use[((prev_off+i)%4)] = 0(34, 30, 34) */
717 (trpt+1)->bup.ovals = grab_ints(2);
718 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->i))%4), 4) ]);
719 now.buffer_use[ Index(((((P1 *)this)->prev_off+((P1 *)this)->i)%4), 4) ] = 0;
721 logval("buffer_use[((tracer:prev_off+tracer:i)%4)]", ((int)now.buffer_use[ Index(((((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->i))%4), 4) ]));
724 /* merge: i = (i+1)(34, 31, 34) */
726 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->i);
727 ((P1 *)this)->i = (((int)((P1 *)this)->i)+1);
729 logval("tracer:i", ((int)((P1 *)this)->i));
732 /* merge: .(goto)(0, 35, 34) */
735 _m = 3; goto P999; /* 3 */
736 case 45: /* STATE 32 - line 132 "buffer.spin" - [((i>=size))] (43:0:3 - 1) */
739 if (!((((int)((P1 *)this)->i)>=((int)((P1 *)this)->size))))
741 /* dead 1: i */ (trpt+1)->bup.ovals = grab_ints(3);
742 (trpt+1)->bup.ovals[0] = ((P1 *)this)->i;
747 /* merge: goto :b1(43, 33, 43) */
750 /* merge: tmp_commit = (commit_count[((prev_off%4)/(4/2))]+size)(43, 37, 43) */
752 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->tmp_commit);
753 ((P1 *)this)->tmp_commit = (((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ])+((int)((P1 *)this)->size));
755 logval("tracer:tmp_commit", ((int)((P1 *)this)->tmp_commit));
758 /* merge: commit_count[((prev_off%4)/(4/2))] = tmp_commit(43, 38, 43) */
760 (trpt+1)->bup.ovals[2] = ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]);
761 now.commit_count[ Index(((((P1 *)this)->prev_off%4)/(4/2)), 2) ] = ((int)((P1 *)this)->tmp_commit);
763 logval("commit_count[((tracer:prev_off%4)/(4/2))]", ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]));
766 _m = 3; goto P999; /* 3 */
767 case 46: /* STATE 37 - line 134 "buffer.spin" - [tmp_commit = (commit_count[((prev_off%4)/(4/2))]+size)] (0:43:2 - 3) */
770 (trpt+1)->bup.ovals = grab_ints(2);
771 (trpt+1)->bup.ovals[0] = ((int)((P1 *)this)->tmp_commit);
772 ((P1 *)this)->tmp_commit = (((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ])+((int)((P1 *)this)->size));
774 logval("tracer:tmp_commit", ((int)((P1 *)this)->tmp_commit));
777 /* merge: commit_count[((prev_off%4)/(4/2))] = tmp_commit(43, 38, 43) */
779 (trpt+1)->bup.ovals[1] = ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]);
780 now.commit_count[ Index(((((P1 *)this)->prev_off%4)/(4/2)), 2) ] = ((int)((P1 *)this)->tmp_commit);
782 logval("commit_count[((tracer:prev_off%4)/(4/2))]", ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]));
785 _m = 3; goto P999; /* 1 */
786 case 47: /* STATE 39 - line 137 "buffer.spin" - [(((tmp_commit%(4/2))==0))] (49:0:2 - 1) */
789 if (!(((((int)((P1 *)this)->tmp_commit)%(4/2))==0)))
791 /* dead 1: tmp_commit */ (trpt+1)->bup.ovals = grab_ints(2);
792 (trpt+1)->bup.ovals[0] = ((P1 *)this)->tmp_commit;
796 ((P1 *)this)->tmp_commit = 0;
797 /* merge: deliver = 1(49, 40, 49) */
799 (trpt+1)->bup.ovals[1] = ((int)deliver);
802 logval("deliver", ((int)deliver));
805 /* merge: .(goto)(49, 44, 49) */
808 _m = 3; goto P999; /* 2 */
809 case 48: /* STATE 44 - line 140 "buffer.spin" - [.(goto)] (0:49:0 - 2) */
813 _m = 3; goto P999; /* 0 */
814 case 49: /* STATE 42 - line 138 "buffer.spin" - [(1)] (49:0:0 - 1) */
819 /* merge: .(goto)(49, 44, 49) */
822 _m = 3; goto P999; /* 1 */
823 case 50: /* STATE 47 - line 144 "buffer.spin" - [events_lost = (events_lost+1)] (0:0:1 - 2) */
826 (trpt+1)->bup.oval = ((int)now.events_lost);
827 now.events_lost = (((int)now.events_lost)+1);
829 logval("events_lost", ((int)now.events_lost));
832 _m = 3; goto P999; /* 0 */
833 case 51: /* STATE 48 - line 146 "buffer.spin" - [refcount = (refcount-1)] (0:0:1 - 2) */
836 (trpt+1)->bup.oval = ((int)now.refcount);
837 now.refcount = (((int)now.refcount)-1);
839 logval("refcount", ((int)now.refcount));
842 _m = 3; goto P999; /* 0 */
843 case 52: /* STATE 50 - line 148 "buffer.spin" - [-end-] (0:0:0 - 1) */
846 if (!delproc(1, II)) continue;
847 _m = 3; goto P999; /* 0 */
850 case 53: /* STATE 1 - line 56 "buffer.spin" - [prev_off = write_off] (0:9:3 - 1) */
853 (trpt+1)->bup.ovals = grab_ints(3);
854 (trpt+1)->bup.ovals[0] = ((int)((P0 *)this)->prev_off);
855 ((P0 *)this)->prev_off = ((int)now.write_off);
857 logval("switcher:prev_off", ((int)((P0 *)this)->prev_off));
860 /* merge: size = ((4/2)-(prev_off%(4/2)))(9, 2, 9) */
862 (trpt+1)->bup.ovals[1] = ((int)((P0 *)this)->size);
863 ((P0 *)this)->size = ((4/2)-(((int)((P0 *)this)->prev_off)%(4/2)));
865 logval("switcher:size", ((int)((P0 *)this)->size));
868 /* merge: new_off = (prev_off+size)(9, 3, 9) */
870 (trpt+1)->bup.ovals[2] = ((int)((P0 *)this)->new_off);
871 ((P0 *)this)->new_off = (((int)((P0 *)this)->prev_off)+((int)((P0 *)this)->size));
873 logval("switcher:new_off", ((int)((P0 *)this)->new_off));
876 _m = 3; goto P999; /* 2 */
877 case 54: /* STATE 4 - line 61 "buffer.spin" - [(((((new_off-read_off)>4)&&((new_off-read_off)<(255/2)))||(size==(4/2))))] (29:0:3 - 1) */
880 if (!(((((((int)((P0 *)this)->new_off)-((int)now.read_off))>4)&&((((int)((P0 *)this)->new_off)-((int)now.read_off))<(255/2)))||(((int)((P0 *)this)->size)==(4/2)))))
882 /* dead 1: new_off */ (trpt+1)->bup.ovals = grab_ints(3);
883 (trpt+1)->bup.ovals[0] = ((P0 *)this)->new_off;
887 ((P0 *)this)->new_off = 0;
888 /* dead 1: size */ (trpt+1)->bup.ovals[1] = ((P0 *)this)->size;
892 ((P0 *)this)->size = 0;
893 /* merge: refcount = (refcount-1)(29, 5, 29) */
895 (trpt+1)->bup.ovals[2] = ((int)now.refcount);
896 now.refcount = (((int)now.refcount)-1);
898 logval("refcount", ((int)now.refcount));
901 /* merge: goto not_needed(29, 6, 29) */
904 _m = 3; goto P999; /* 2 */
905 case 55: /* STATE 8 - line 64 "buffer.spin" - [(1)] (18:0:0 - 1) */
910 /* merge: .(goto)(0, 10, 18) */
913 _m = 3; goto P999; /* 1 */
914 case 56: /* STATE 12 - line 69 "buffer.spin" - [((prev_off!=write_off))] (11:0:1 - 1) */
917 if (!((((int)((P0 *)this)->prev_off)!=((int)now.write_off))))
919 /* dead 1: prev_off */ (trpt+1)->bup.oval = ((P0 *)this)->prev_off;
923 ((P0 *)this)->prev_off = 0;
924 /* merge: goto cmpxchg_loop(0, 13, 11) */
927 _m = 3; goto P999; /* 1 */
928 case 57: /* STATE 17 - line 72 "buffer.spin" - [.(goto)] (0:28:0 - 1) */
932 _m = 3; goto P999; /* 0 */
933 case 58: /* STATE 15 - line 70 "buffer.spin" - [write_off = new_off] (0:28:1 - 1) */
936 (trpt+1)->bup.oval = ((int)now.write_off);
937 now.write_off = ((int)((P0 *)this)->new_off);
939 logval("write_off", ((int)now.write_off));
942 /* merge: .(goto)(28, 17, 28) */
945 _m = 3; goto P999; /* 1 */
946 case 59: /* STATE 19 - line 75 "buffer.spin" - [tmp_commit = (commit_count[((prev_off%4)/(4/2))]+size)] (0:25:2 - 1) */
949 (trpt+1)->bup.ovals = grab_ints(2);
950 (trpt+1)->bup.ovals[0] = ((int)((P0 *)this)->tmp_commit);
951 ((P0 *)this)->tmp_commit = (((int)now.commit_count[ Index(((((int)((P0 *)this)->prev_off)%4)/(4/2)), 2) ])+((int)((P0 *)this)->size));
953 logval("switcher:tmp_commit", ((int)((P0 *)this)->tmp_commit));
956 /* merge: commit_count[((prev_off%4)/(4/2))] = tmp_commit(25, 20, 25) */
958 (trpt+1)->bup.ovals[1] = ((int)now.commit_count[ Index(((((int)((P0 *)this)->prev_off)%4)/(4/2)), 2) ]);
959 now.commit_count[ Index(((((P0 *)this)->prev_off%4)/(4/2)), 2) ] = ((int)((P0 *)this)->tmp_commit);
961 logval("commit_count[((switcher:prev_off%4)/(4/2))]", ((int)now.commit_count[ Index(((((int)((P0 *)this)->prev_off)%4)/(4/2)), 2) ]));
964 _m = 3; goto P999; /* 1 */
965 case 60: /* STATE 21 - line 78 "buffer.spin" - [(((tmp_commit%(4/2))==0))] (29:0:3 - 1) */
968 if (!(((((int)((P0 *)this)->tmp_commit)%(4/2))==0)))
970 /* dead 1: tmp_commit */ (trpt+1)->bup.ovals = grab_ints(3);
971 (trpt+1)->bup.ovals[0] = ((P0 *)this)->tmp_commit;
975 ((P0 *)this)->tmp_commit = 0;
976 /* merge: deliver = 1(29, 22, 29) */
978 (trpt+1)->bup.ovals[1] = ((int)deliver);
981 logval("deliver", ((int)deliver));
984 /* merge: .(goto)(29, 26, 29) */
987 /* merge: refcount = (refcount-1)(29, 27, 29) */
989 (trpt+1)->bup.ovals[2] = ((int)now.refcount);
990 now.refcount = (((int)now.refcount)-1);
992 logval("refcount", ((int)now.refcount));
995 _m = 3; goto P999; /* 3 */
996 case 61: /* STATE 26 - line 81 "buffer.spin" - [.(goto)] (0:29:1 - 2) */
1000 /* merge: refcount = (refcount-1)(29, 27, 29) */
1002 (trpt+1)->bup.oval = ((int)now.refcount);
1003 now.refcount = (((int)now.refcount)-1);
1005 logval("refcount", ((int)now.refcount));
1008 _m = 3; goto P999; /* 1 */
1009 case 62: /* STATE 24 - line 79 "buffer.spin" - [(1)] (29:0:1 - 1) */
1014 /* merge: .(goto)(29, 26, 29) */
1017 /* merge: refcount = (refcount-1)(29, 27, 29) */
1019 (trpt+1)->bup.oval = ((int)now.refcount);
1020 now.refcount = (((int)now.refcount)-1);
1022 logval("refcount", ((int)now.refcount));
1025 _m = 3; goto P999; /* 2 */
1026 case 63: /* STATE 30 - line 85 "buffer.spin" - [-end-] (0:0:0 - 1) */
1029 if (!delproc(1, II)) continue;
1030 _m = 3; goto P999; /* 0 */
1032 if (!((!(trpt->o_pm&4) && !(trpt->tau&128))))
1034 /* else fall through */
1035 case _T2: /* true */