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 226 "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 228 "buffer.spin" - [((i<2))] (7:0:2 - 1) */
31 if (!((((int)((P4 *)this)->i)<2)))
33 /* merge: commit_count[i] = 0(7, 3, 7) */
35 (trpt+1)->bup.ovals = grab_ints(2);
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: i = (i+1)(7, 4, 7) */
44 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->i);
45 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
47 logval(":init::i", ((int)((P4 *)this)->i));
50 /* merge: .(goto)(0, 8, 7) */
53 _m = 3; goto P999; /* 3 */
54 case 5: /* STATE 5 - line 231 "buffer.spin" - [((i>=2))] (16:0:2 - 1) */
57 if (!((((int)((P4 *)this)->i)>=2)))
59 /* dead 1: i */ (trpt+1)->bup.ovals = grab_ints(2);
60 (trpt+1)->bup.ovals[0] = ((P4 *)this)->i;
65 /* merge: goto :b6(16, 6, 16) */
68 /* merge: i = 0(16, 10, 16) */
70 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->i);
73 logval(":init::i", ((int)((P4 *)this)->i));
76 /* merge: .(goto)(0, 17, 16) */
79 _m = 3; goto P999; /* 3 */
80 case 6: /* STATE 10 - line 233 "buffer.spin" - [i = 0] (0:16:1 - 3) */
83 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
86 logval(":init::i", ((int)((P4 *)this)->i));
89 /* merge: .(goto)(0, 17, 16) */
92 _m = 3; goto P999; /* 1 */
93 case 7: /* STATE 11 - line 235 "buffer.spin" - [((i<4))] (16:0:2 - 1) */
96 if (!((((int)((P4 *)this)->i)<4)))
98 /* merge: buffer_use[i] = 0(16, 12, 16) */
100 (trpt+1)->bup.ovals = grab_ints(2);
101 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((int)((P4 *)this)->i), 4) ]);
102 now.buffer_use[ Index(((P4 *)this)->i, 4) ] = 0;
104 logval("buffer_use[:init::i]", ((int)now.buffer_use[ Index(((int)((P4 *)this)->i), 4) ]));
107 /* merge: i = (i+1)(16, 13, 16) */
109 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->i);
110 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
112 logval(":init::i", ((int)((P4 *)this)->i));
115 /* merge: .(goto)(0, 17, 16) */
118 _m = 3; goto P999; /* 3 */
119 case 8: /* STATE 14 - line 238 "buffer.spin" - [((i>=4))] (0:0:1 - 1) */
122 if (!((((int)((P4 *)this)->i)>=4)))
124 /* dead 1: i */ (trpt+1)->bup.oval = ((P4 *)this)->i;
129 _m = 3; goto P999; /* 0 */
130 case 9: /* STATE 19 - line 240 "buffer.spin" - [(run reader())] (0:0:0 - 3) */
135 _m = 3; goto P999; /* 0 */
136 case 10: /* STATE 20 - line 241 "buffer.spin" - [(run cleaner())] (28:0:1 - 1) */
141 /* merge: i = 0(0, 21, 28) */
143 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
146 logval(":init::i", ((int)((P4 *)this)->i));
149 /* merge: .(goto)(0, 29, 28) */
152 _m = 3; goto P999; /* 2 */
153 case 11: /* STATE 22 - line 244 "buffer.spin" - [((i<4))] (24:0:1 - 1) */
156 if (!((((int)((P4 *)this)->i)<4)))
158 /* merge: refcount = (refcount+1)(0, 23, 24) */
160 (trpt+1)->bup.oval = ((int)now.refcount);
161 now.refcount = (((int)now.refcount)+1);
163 logval("refcount", ((int)now.refcount));
166 _m = 3; goto P999; /* 1 */
167 case 12: /* STATE 24 - line 246 "buffer.spin" - [(run tracer())] (28:0:1 - 1) */
172 /* merge: i = (i+1)(0, 25, 28) */
174 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
175 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
177 logval(":init::i", ((int)((P4 *)this)->i));
180 /* merge: .(goto)(0, 29, 28) */
183 _m = 3; goto P999; /* 2 */
184 case 13: /* STATE 26 - line 248 "buffer.spin" - [((i>=4))] (38:0:2 - 1) */
187 if (!((((int)((P4 *)this)->i)>=4)))
189 /* dead 1: i */ (trpt+1)->bup.ovals = grab_ints(2);
190 (trpt+1)->bup.ovals[0] = ((P4 *)this)->i;
195 /* merge: goto :b8(38, 27, 38) */
198 /* merge: i = 0(38, 31, 38) */
200 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->i);
203 logval(":init::i", ((int)((P4 *)this)->i));
206 /* merge: .(goto)(0, 39, 38) */
209 _m = 3; goto P999; /* 3 */
210 case 14: /* STATE 31 - line 250 "buffer.spin" - [i = 0] (0:38:1 - 3) */
213 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
216 logval(":init::i", ((int)((P4 *)this)->i));
219 /* merge: .(goto)(0, 39, 38) */
222 _m = 3; goto P999; /* 1 */
223 case 15: /* STATE 32 - line 252 "buffer.spin" - [((i<1))] (34:0:1 - 1) */
226 if (!((((int)((P4 *)this)->i)<1)))
228 /* merge: refcount = (refcount+1)(0, 33, 34) */
230 (trpt+1)->bup.oval = ((int)now.refcount);
231 now.refcount = (((int)now.refcount)+1);
233 logval("refcount", ((int)now.refcount));
236 _m = 3; goto P999; /* 1 */
237 case 16: /* STATE 34 - line 254 "buffer.spin" - [(run switcher())] (38:0:1 - 1) */
242 /* merge: i = (i+1)(0, 35, 38) */
244 (trpt+1)->bup.oval = ((int)((P4 *)this)->i);
245 ((P4 *)this)->i = (((int)((P4 *)this)->i)+1);
247 logval(":init::i", ((int)((P4 *)this)->i));
250 /* merge: .(goto)(0, 39, 38) */
253 _m = 3; goto P999; /* 2 */
254 case 17: /* STATE 36 - line 256 "buffer.spin" - [((i>=1))] (40:0:1 - 1) */
257 if (!((((int)((P4 *)this)->i)>=1)))
259 /* dead 1: i */ (trpt+1)->bup.oval = ((P4 *)this)->i;
264 /* merge: goto :b9(0, 37, 40) */
267 _m = 3; goto P999; /* 1 */
268 case 18: /* STATE 42 - line 262 "buffer.spin" - [assert((((write_off-read_off)>=0)&&((write_off-read_off)<(255/2))))] (0:50:2 - 1) */
271 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);
272 /* merge: j = 0(50, 43, 50) */
274 (trpt+1)->bup.ovals = grab_ints(2);
275 (trpt+1)->bup.ovals[0] = ((int)((P4 *)this)->j);
278 logval(":init::j", ((int)((P4 *)this)->j));
281 /* merge: commit_sum = 0(50, 44, 50) */
283 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->commit_sum);
284 ((P4 *)this)->commit_sum = 0;
286 logval(":init::commit_sum", ((int)((P4 *)this)->commit_sum));
289 /* merge: .(goto)(0, 51, 50) */
292 _m = 3; goto P999; /* 3 */
293 case 19: /* STATE 45 - line 266 "buffer.spin" - [((j<2))] (50:0:2 - 1) */
296 if (!((((int)((P4 *)this)->j)<2)))
298 /* merge: commit_sum = (commit_sum+commit_count[j])(50, 46, 50) */
300 (trpt+1)->bup.ovals = grab_ints(2);
301 (trpt+1)->bup.ovals[0] = ((int)((P4 *)this)->commit_sum);
302 ((P4 *)this)->commit_sum = (((int)((P4 *)this)->commit_sum)+((int)now.commit_count[ Index(((int)((P4 *)this)->j), 2) ]));
304 logval(":init::commit_sum", ((int)((P4 *)this)->commit_sum));
307 /* merge: j = (j+1)(50, 47, 50) */
309 (trpt+1)->bup.ovals[1] = ((int)((P4 *)this)->j);
310 ((P4 *)this)->j = (((int)((P4 *)this)->j)+1);
312 logval(":init::j", ((int)((P4 *)this)->j));
315 /* merge: .(goto)(0, 51, 50) */
318 _m = 3; goto P999; /* 3 */
319 case 20: /* STATE 48 - line 273 "buffer.spin" - [((j>=2))] (56:0:1 - 1) */
322 if (!((((int)((P4 *)this)->j)>=2)))
324 /* dead 1: j */ (trpt+1)->bup.oval = ((P4 *)this)->j;
329 /* merge: goto :b10(56, 49, 56) */
332 /* merge: assert((((write_off-commit_sum)>=0)&&((write_off-commit_sum)<(255/2))))(56, 53, 56) */
334 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);
335 /* merge: assert((((4+1)>4)||(events_lost==0)))(56, 54, 56) */
337 assert((((4+1)>4)||(((int)now.events_lost)==0)), "(((4+1)>4)||(events_lost==0))", II, tt, t);
338 _m = 3; goto P999; /* 3 */
339 case 21: /* STATE 53 - line 278 "buffer.spin" - [assert((((write_off-commit_sum)>=0)&&((write_off-commit_sum)<(255/2))))] (0:56:0 - 3) */
342 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);
343 /* merge: assert((((4+1)>4)||(events_lost==0)))(56, 54, 56) */
345 assert((((4+1)>4)||(((int)now.events_lost)==0)), "(((4+1)>4)||(events_lost==0))", II, tt, t);
346 _m = 3; goto P999; /* 1 */
347 case 22: /* STATE 56 - line 284 "buffer.spin" - [-end-] (0:0:0 - 1) */
350 if (!delproc(1, II)) continue;
351 _m = 3; goto P999; /* 0 */
354 case 23: /* STATE 1 - line 211 "buffer.spin" - [((refcount==0))] (3:0:1 - 1) */
357 if (!((((int)now.refcount)==0)))
359 /* merge: refcount = (refcount+1)(0, 2, 3) */
361 (trpt+1)->bup.oval = ((int)now.refcount);
362 now.refcount = (((int)now.refcount)+1);
364 logval("refcount", ((int)now.refcount));
367 _m = 3; goto P999; /* 1 */
368 case 24: /* STATE 3 - line 213 "buffer.spin" - [(run switcher())] (7:0:0 - 1) */
373 /* merge: goto :b5(0, 4, 7) */
376 _m = 3; goto P999; /* 1 */
377 case 25: /* STATE 9 - line 217 "buffer.spin" - [-end-] (0:0:0 - 1) */
380 if (!delproc(1, II)) continue;
381 _m = 3; goto P999; /* 0 */
384 case 26: /* STATE 1 - line 177 "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))]-(4/2))-(((read_off/4)*4)/2))==0)))] (0:0:0 - 1) */
387 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) ])-(4/2))-(((((int)now.read_off)/4)*4)/2))==0))))
389 _m = 3; goto P999; /* 0 */
390 case 27: /* STATE 2 - line 179 "buffer.spin" - [i = 0] (0:0:1 - 1) */
393 (trpt+1)->bup.oval = ((int)((P2 *)this)->i);
396 logval("reader:i", ((int)((P2 *)this)->i));
399 _m = 3; goto P999; /* 0 */
400 case 28: /* STATE 3 - line 181 "buffer.spin" - [((i<(4/2)))] (9:0:2 - 1) */
403 if (!((((int)((P2 *)this)->i)<(4/2))))
405 /* merge: assert((buffer_use[((read_off+i)%4)]==0))(9, 4, 9) */
407 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);
408 /* merge: buffer_use[((read_off+i)%4)] = 1(9, 5, 9) */
410 (trpt+1)->bup.ovals = grab_ints(2);
411 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]);
412 now.buffer_use[ Index(((now.read_off+((P2 *)this)->i)%4), 4) ] = 1;
414 logval("buffer_use[((read_off+reader:i)%4)]", ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]));
417 /* merge: i = (i+1)(9, 6, 9) */
419 (trpt+1)->bup.ovals[1] = ((int)((P2 *)this)->i);
420 ((P2 *)this)->i = (((int)((P2 *)this)->i)+1);
422 logval("reader:i", ((int)((P2 *)this)->i));
425 /* merge: .(goto)(0, 10, 9) */
428 _m = 3; goto P999; /* 4 */
429 case 29: /* STATE 7 - line 185 "buffer.spin" - [((i>=(4/2)))] (11:0:1 - 1) */
432 if (!((((int)((P2 *)this)->i)>=(4/2))))
434 /* dead 1: i */ (trpt+1)->bup.oval = ((P2 *)this)->i;
439 /* merge: goto :b3(0, 8, 11) */
442 _m = 3; goto P999; /* 1 */
443 /* STATE 13 - line 191 "buffer.spin" - [i = 0] (0:0 - 1) same as 27 (0:0 - 1) */
444 case 30: /* STATE 14 - line 193 "buffer.spin" - [((i<(4/2)))] (19:0:2 - 1) */
447 if (!((((int)((P2 *)this)->i)<(4/2))))
449 /* merge: buffer_use[((read_off+i)%4)] = 0(19, 15, 19) */
451 (trpt+1)->bup.ovals = grab_ints(2);
452 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]);
453 now.buffer_use[ Index(((now.read_off+((P2 *)this)->i)%4), 4) ] = 0;
455 logval("buffer_use[((read_off+reader:i)%4)]", ((int)now.buffer_use[ Index(((((int)now.read_off)+((int)((P2 *)this)->i))%4), 4) ]));
458 /* merge: i = (i+1)(19, 16, 19) */
460 (trpt+1)->bup.ovals[1] = ((int)((P2 *)this)->i);
461 ((P2 *)this)->i = (((int)((P2 *)this)->i)+1);
463 logval("reader:i", ((int)((P2 *)this)->i));
466 /* merge: .(goto)(0, 20, 19) */
469 _m = 3; goto P999; /* 3 */
470 case 31: /* STATE 17 - line 196 "buffer.spin" - [((i>=(4/2)))] (0:0:1 - 1) */
473 if (!((((int)((P2 *)this)->i)>=(4/2))))
475 /* dead 1: i */ (trpt+1)->bup.oval = ((P2 *)this)->i;
480 _m = 3; goto P999; /* 0 */
481 case 32: /* STATE 22 - line 198 "buffer.spin" - [read_off = (read_off+(4/2))] (0:0:1 - 1) */
484 (trpt+1)->bup.oval = ((int)now.read_off);
485 now.read_off = (((int)now.read_off)+(4/2));
487 logval("read_off", ((int)now.read_off));
490 _m = 3; goto P999; /* 0 */
491 case 33: /* STATE 24 - line 200 "buffer.spin" - [((read_off>=(4-events_lost)))] (0:0:0 - 1) */
494 if (!((((int)now.read_off)>=(4-((int)now.events_lost)))))
496 _m = 3; goto P999; /* 0 */
497 case 34: /* STATE 29 - line 202 "buffer.spin" - [-end-] (0:0:0 - 3) */
500 if (!delproc(1, II)) continue;
501 _m = 3; goto P999; /* 0 */
504 case 35: /* STATE 1 - line 106 "buffer.spin" - [prev_off = write_off] (0:10:2 - 1) */
507 (trpt+1)->bup.ovals = grab_ints(2);
508 (trpt+1)->bup.ovals[0] = ((int)((P1 *)this)->prev_off);
509 ((P1 *)this)->prev_off = ((int)now.write_off);
511 logval("tracer:prev_off", ((int)((P1 *)this)->prev_off));
514 /* merge: new_off = (prev_off+size)(10, 2, 10) */
516 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->new_off);
517 ((P1 *)this)->new_off = (((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->size));
519 logval("tracer:new_off", ((int)((P1 *)this)->new_off));
522 _m = 3; goto P999; /* 1 */
523 case 36: /* STATE 4 - line 111 "buffer.spin" - [((((new_off-read_off)>4)&&((new_off-read_off)<(255/2))))] (0:0:1 - 1) */
526 if (!((((((int)((P1 *)this)->new_off)-((int)now.read_off))>4)&&((((int)((P1 *)this)->new_off)-((int)now.read_off))<(255/2)))))
528 /* dead 1: new_off */ (trpt+1)->bup.oval = ((P1 *)this)->new_off;
532 ((P1 *)this)->new_off = 0;
533 _m = 3; goto P999; /* 0 */
534 case 37: /* STATE 7 - line 113 "buffer.spin" - [(1)] (27:0:0 - 1) */
539 /* merge: .(goto)(0, 9, 27) */
542 _m = 3; goto P999; /* 1 */
543 case 38: /* STATE 11 - line 118 "buffer.spin" - [((prev_off!=write_off))] (3:0:1 - 1) */
546 if (!((((int)((P1 *)this)->prev_off)!=((int)now.write_off))))
548 /* dead 1: prev_off */ (trpt+1)->bup.oval = ((P1 *)this)->prev_off;
552 ((P1 *)this)->prev_off = 0;
553 /* merge: goto cmpxchg_loop(0, 12, 3) */
556 _m = 3; goto P999; /* 1 */
557 case 39: /* STATE 14 - line 119 "buffer.spin" - [write_off = new_off] (0:24:2 - 1) */
560 (trpt+1)->bup.ovals = grab_ints(2);
561 (trpt+1)->bup.ovals[0] = ((int)now.write_off);
562 now.write_off = ((int)((P1 *)this)->new_off);
564 logval("write_off", ((int)now.write_off));
567 /* merge: .(goto)(24, 16, 24) */
570 /* merge: i = 0(24, 17, 24) */
572 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->i);
575 logval("tracer:i", ((int)((P1 *)this)->i));
578 /* merge: .(goto)(0, 25, 24) */
581 _m = 3; goto P999; /* 3 */
582 case 40: /* STATE 17 - line 121 "buffer.spin" - [i = 0] (0:24:1 - 2) */
585 (trpt+1)->bup.oval = ((int)((P1 *)this)->i);
588 logval("tracer:i", ((int)((P1 *)this)->i));
591 /* merge: .(goto)(0, 25, 24) */
594 _m = 3; goto P999; /* 1 */
595 case 41: /* STATE 18 - line 123 "buffer.spin" - [((i<size))] (24:0:2 - 1) */
598 if (!((((int)((P1 *)this)->i)<((int)((P1 *)this)->size))))
600 /* merge: assert((buffer_use[((prev_off+i)%4)]==0))(24, 19, 24) */
602 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);
603 /* merge: buffer_use[((prev_off+i)%4)] = 1(24, 20, 24) */
605 (trpt+1)->bup.ovals = grab_ints(2);
606 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->i))%4), 4) ]);
607 now.buffer_use[ Index(((((P1 *)this)->prev_off+((P1 *)this)->i)%4), 4) ] = 1;
609 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) ]));
612 /* merge: i = (i+1)(24, 21, 24) */
614 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->i);
615 ((P1 *)this)->i = (((int)((P1 *)this)->i)+1);
617 logval("tracer:i", ((int)((P1 *)this)->i));
620 /* merge: .(goto)(0, 25, 24) */
623 _m = 3; goto P999; /* 4 */
624 case 42: /* STATE 22 - line 127 "buffer.spin" - [((i>=size))] (26:0:1 - 1) */
627 if (!((((int)((P1 *)this)->i)>=((int)((P1 *)this)->size))))
629 /* dead 1: i */ (trpt+1)->bup.oval = ((P1 *)this)->i;
634 /* merge: goto :b0(0, 23, 26) */
637 _m = 3; goto P999; /* 1 */
638 case 43: /* STATE 28 - line 134 "buffer.spin" - [i = 0] (0:0:1 - 1) */
641 (trpt+1)->bup.oval = ((int)((P1 *)this)->i);
644 logval("tracer:i", ((int)((P1 *)this)->i));
647 _m = 3; goto P999; /* 0 */
648 case 44: /* STATE 29 - line 136 "buffer.spin" - [((i<size))] (34:0:2 - 1) */
651 if (!((((int)((P1 *)this)->i)<((int)((P1 *)this)->size))))
653 /* merge: buffer_use[((prev_off+i)%4)] = 0(34, 30, 34) */
655 (trpt+1)->bup.ovals = grab_ints(2);
656 (trpt+1)->bup.ovals[0] = ((int)now.buffer_use[ Index(((((int)((P1 *)this)->prev_off)+((int)((P1 *)this)->i))%4), 4) ]);
657 now.buffer_use[ Index(((((P1 *)this)->prev_off+((P1 *)this)->i)%4), 4) ] = 0;
659 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) ]));
662 /* merge: i = (i+1)(34, 31, 34) */
664 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->i);
665 ((P1 *)this)->i = (((int)((P1 *)this)->i)+1);
667 logval("tracer:i", ((int)((P1 *)this)->i));
670 /* merge: .(goto)(0, 35, 34) */
673 _m = 3; goto P999; /* 3 */
674 case 45: /* STATE 32 - line 139 "buffer.spin" - [((i>=size))] (43:0:3 - 1) */
677 if (!((((int)((P1 *)this)->i)>=((int)((P1 *)this)->size))))
679 /* dead 1: i */ (trpt+1)->bup.ovals = grab_ints(3);
680 (trpt+1)->bup.ovals[0] = ((P1 *)this)->i;
685 /* merge: goto :b1(43, 33, 43) */
688 /* merge: tmp_commit = (commit_count[((prev_off%4)/(4/2))]+size)(43, 37, 43) */
690 (trpt+1)->bup.ovals[1] = ((int)((P1 *)this)->tmp_commit);
691 ((P1 *)this)->tmp_commit = (((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ])+((int)((P1 *)this)->size));
693 logval("tracer:tmp_commit", ((int)((P1 *)this)->tmp_commit));
696 /* merge: commit_count[((prev_off%4)/(4/2))] = tmp_commit(43, 38, 43) */
698 (trpt+1)->bup.ovals[2] = ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]);
699 now.commit_count[ Index(((((P1 *)this)->prev_off%4)/(4/2)), 2) ] = ((int)((P1 *)this)->tmp_commit);
701 logval("commit_count[((tracer:prev_off%4)/(4/2))]", ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]));
704 _m = 3; goto P999; /* 3 */
705 case 46: /* STATE 37 - line 141 "buffer.spin" - [tmp_commit = (commit_count[((prev_off%4)/(4/2))]+size)] (0:43:2 - 3) */
708 (trpt+1)->bup.ovals = grab_ints(2);
709 (trpt+1)->bup.ovals[0] = ((int)((P1 *)this)->tmp_commit);
710 ((P1 *)this)->tmp_commit = (((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ])+((int)((P1 *)this)->size));
712 logval("tracer:tmp_commit", ((int)((P1 *)this)->tmp_commit));
715 /* merge: commit_count[((prev_off%4)/(4/2))] = tmp_commit(43, 38, 43) */
717 (trpt+1)->bup.ovals[1] = ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]);
718 now.commit_count[ Index(((((P1 *)this)->prev_off%4)/(4/2)), 2) ] = ((int)((P1 *)this)->tmp_commit);
720 logval("commit_count[((tracer:prev_off%4)/(4/2))]", ((int)now.commit_count[ Index(((((int)((P1 *)this)->prev_off)%4)/(4/2)), 2) ]));
723 _m = 3; goto P999; /* 1 */
724 case 47: /* STATE 39 - line 145 "buffer.spin" - [((((((prev_off/4)*4)/2)+(4/2))-tmp_commit))] (49:0:3 - 1) */
727 if (!((((((((int)((P1 *)this)->prev_off)/4)*4)/2)+(4/2))-((int)((P1 *)this)->tmp_commit))))
729 /* dead 1: prev_off */ (trpt+1)->bup.ovals = grab_ints(3);
730 (trpt+1)->bup.ovals[0] = ((P1 *)this)->prev_off;
734 ((P1 *)this)->prev_off = 0;
735 /* dead 1: tmp_commit */ (trpt+1)->bup.ovals[1] = ((P1 *)this)->tmp_commit;
739 ((P1 *)this)->tmp_commit = 0;
740 /* merge: deliver = 1(49, 40, 49) */
742 (trpt+1)->bup.ovals[2] = ((int)deliver);
745 logval("deliver", ((int)deliver));
748 /* merge: .(goto)(49, 44, 49) */
751 _m = 3; goto P999; /* 2 */
752 case 48: /* STATE 44 - line 150 "buffer.spin" - [.(goto)] (0:49:0 - 2) */
756 _m = 3; goto P999; /* 0 */
757 case 49: /* STATE 42 - line 148 "buffer.spin" - [(1)] (49:0:0 - 1) */
762 /* merge: .(goto)(49, 44, 49) */
765 _m = 3; goto P999; /* 1 */
766 case 50: /* STATE 47 - line 154 "buffer.spin" - [events_lost = (events_lost+1)] (0:0:1 - 2) */
769 (trpt+1)->bup.oval = ((int)now.events_lost);
770 now.events_lost = (((int)now.events_lost)+1);
772 logval("events_lost", ((int)now.events_lost));
775 _m = 3; goto P999; /* 0 */
776 case 51: /* STATE 48 - line 156 "buffer.spin" - [refcount = (refcount-1)] (0:0:1 - 2) */
779 (trpt+1)->bup.oval = ((int)now.refcount);
780 now.refcount = (((int)now.refcount)-1);
782 logval("refcount", ((int)now.refcount));
785 _m = 3; goto P999; /* 0 */
786 case 52: /* STATE 50 - line 158 "buffer.spin" - [-end-] (0:0:0 - 1) */
789 if (!delproc(1, II)) continue;
790 _m = 3; goto P999; /* 0 */
793 case 53: /* STATE 1 - line 60 "buffer.spin" - [prev_off = write_off] (0:9:3 - 1) */
796 (trpt+1)->bup.ovals = grab_ints(3);
797 (trpt+1)->bup.ovals[0] = ((int)((P0 *)this)->prev_off);
798 ((P0 *)this)->prev_off = ((int)now.write_off);
800 logval("switcher:prev_off", ((int)((P0 *)this)->prev_off));
803 /* merge: size = ((4/2)-(prev_off%(4/2)))(9, 2, 9) */
805 (trpt+1)->bup.ovals[1] = ((int)((P0 *)this)->size);
806 ((P0 *)this)->size = ((4/2)-(((int)((P0 *)this)->prev_off)%(4/2)));
808 logval("switcher:size", ((int)((P0 *)this)->size));
811 /* merge: new_off = (prev_off+size)(9, 3, 9) */
813 (trpt+1)->bup.ovals[2] = ((int)((P0 *)this)->new_off);
814 ((P0 *)this)->new_off = (((int)((P0 *)this)->prev_off)+((int)((P0 *)this)->size));
816 logval("switcher:new_off", ((int)((P0 *)this)->new_off));
819 _m = 3; goto P999; /* 2 */
820 case 54: /* STATE 4 - line 65 "buffer.spin" - [(((((new_off-read_off)>4)&&((new_off-read_off)<(255/2)))||(size==(4/2))))] (29:0:3 - 1) */
823 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)))))
825 /* dead 1: new_off */ (trpt+1)->bup.ovals = grab_ints(3);
826 (trpt+1)->bup.ovals[0] = ((P0 *)this)->new_off;
830 ((P0 *)this)->new_off = 0;
831 /* dead 1: size */ (trpt+1)->bup.ovals[1] = ((P0 *)this)->size;
835 ((P0 *)this)->size = 0;
836 /* merge: refcount = (refcount-1)(29, 5, 29) */
838 (trpt+1)->bup.ovals[2] = ((int)now.refcount);
839 now.refcount = (((int)now.refcount)-1);
841 logval("refcount", ((int)now.refcount));
844 /* merge: goto not_needed(29, 6, 29) */
847 _m = 3; goto P999; /* 2 */
848 case 55: /* STATE 8 - line 68 "buffer.spin" - [(1)] (18:0:0 - 1) */
853 /* merge: .(goto)(0, 10, 18) */
856 _m = 3; goto P999; /* 1 */
857 case 56: /* STATE 12 - line 73 "buffer.spin" - [((prev_off!=write_off))] (11:0:1 - 1) */
860 if (!((((int)((P0 *)this)->prev_off)!=((int)now.write_off))))
862 /* dead 1: prev_off */ (trpt+1)->bup.oval = ((P0 *)this)->prev_off;
866 ((P0 *)this)->prev_off = 0;
867 /* merge: goto cmpxchg_loop(0, 13, 11) */
870 _m = 3; goto P999; /* 1 */
871 case 57: /* STATE 17 - line 76 "buffer.spin" - [.(goto)] (0:28:0 - 1) */
875 _m = 3; goto P999; /* 0 */
876 case 58: /* STATE 15 - line 74 "buffer.spin" - [write_off = new_off] (0:28:1 - 1) */
879 (trpt+1)->bup.oval = ((int)now.write_off);
880 now.write_off = ((int)((P0 *)this)->new_off);
882 logval("write_off", ((int)now.write_off));
885 /* merge: .(goto)(28, 17, 28) */
888 _m = 3; goto P999; /* 1 */
889 case 59: /* STATE 19 - line 79 "buffer.spin" - [tmp_commit = (commit_count[((prev_off%4)/(4/2))]+size)] (0:25:2 - 1) */
892 (trpt+1)->bup.ovals = grab_ints(2);
893 (trpt+1)->bup.ovals[0] = ((int)((P0 *)this)->tmp_commit);
894 ((P0 *)this)->tmp_commit = (((int)now.commit_count[ Index(((((int)((P0 *)this)->prev_off)%4)/(4/2)), 2) ])+((int)((P0 *)this)->size));
896 logval("switcher:tmp_commit", ((int)((P0 *)this)->tmp_commit));
899 /* merge: commit_count[((prev_off%4)/(4/2))] = tmp_commit(25, 20, 25) */
901 (trpt+1)->bup.ovals[1] = ((int)now.commit_count[ Index(((((int)((P0 *)this)->prev_off)%4)/(4/2)), 2) ]);
902 now.commit_count[ Index(((((P0 *)this)->prev_off%4)/(4/2)), 2) ] = ((int)((P0 *)this)->tmp_commit);
904 logval("commit_count[((switcher:prev_off%4)/(4/2))]", ((int)now.commit_count[ Index(((((int)((P0 *)this)->prev_off)%4)/(4/2)), 2) ]));
907 _m = 3; goto P999; /* 1 */
908 case 60: /* STATE 21 - line 83 "buffer.spin" - [((((((prev_off/4)*4)/2)+(4/2))-tmp_commit))] (29:0:4 - 1) */
911 if (!((((((((int)((P0 *)this)->prev_off)/4)*4)/2)+(4/2))-((int)((P0 *)this)->tmp_commit))))
913 /* dead 1: prev_off */ (trpt+1)->bup.ovals = grab_ints(4);
914 (trpt+1)->bup.ovals[0] = ((P0 *)this)->prev_off;
918 ((P0 *)this)->prev_off = 0;
919 /* dead 1: tmp_commit */ (trpt+1)->bup.ovals[1] = ((P0 *)this)->tmp_commit;
923 ((P0 *)this)->tmp_commit = 0;
924 /* merge: deliver = 1(29, 22, 29) */
926 (trpt+1)->bup.ovals[2] = ((int)deliver);
929 logval("deliver", ((int)deliver));
932 /* merge: .(goto)(29, 26, 29) */
935 /* merge: refcount = (refcount-1)(29, 27, 29) */
937 (trpt+1)->bup.ovals[3] = ((int)now.refcount);
938 now.refcount = (((int)now.refcount)-1);
940 logval("refcount", ((int)now.refcount));
943 _m = 3; goto P999; /* 3 */
944 case 61: /* STATE 26 - line 88 "buffer.spin" - [.(goto)] (0:29:1 - 2) */
948 /* merge: refcount = (refcount-1)(29, 27, 29) */
950 (trpt+1)->bup.oval = ((int)now.refcount);
951 now.refcount = (((int)now.refcount)-1);
953 logval("refcount", ((int)now.refcount));
956 _m = 3; goto P999; /* 1 */
957 case 62: /* STATE 24 - line 86 "buffer.spin" - [(1)] (29:0:1 - 1) */
962 /* merge: .(goto)(29, 26, 29) */
965 /* merge: refcount = (refcount-1)(29, 27, 29) */
967 (trpt+1)->bup.oval = ((int)now.refcount);
968 now.refcount = (((int)now.refcount)-1);
970 logval("refcount", ((int)now.refcount));
973 _m = 3; goto P999; /* 2 */
974 case 63: /* STATE 30 - line 92 "buffer.spin" - [-end-] (0:0:0 - 1) */
977 if (!delproc(1, II)) continue;
978 _m = 3; goto P999; /* 0 */
980 if (!((!(trpt->o_pm&4) && !(trpt->tau&128))))
982 /* else fall through */