1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
92
  
93
  
94
  
95
  
96
  
97
  
98
  
99
  
100
  
101
  
102
  
103
  
104
  
105
  
106
  
107
  
108
  
109
  
110
  
111
  
112
  
113
  
114
  
115
  
116
  
117
  
118
  
119
  
120
  
121
  
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
  
198
  
199
  
200
  
201
  
202
  
203
  
204
  
205
  
206
  
207
  
208
  
209
  
210
  
211
  
212
  
213
  
214
  
215
  
216
  
217
  
218
  
219
  
220
  
221
  
222
  
223
  
224
  
225
  
226
  
227
  
228
  
229
  
230
  
231
  
232
  
233
  
234
  
235
  
236
  
237
  
238
  
239
  
240
  
241
  
242
  
243
  
244
  
245
  
246
  
247
  
248
  
249
  
250
  
251
  
252
  
253
  
254
  
255
  
256
  
257
  
258
  
259
  
260
  
261
  
262
  
263
  
264
  
265
  
266
  
267
  
268
  
269
  
270
  
271
  
272
  
273
  
274
  
275
  
276
  
277
  
278
  
279
  
280
  
281
  
282
  
283
  
284
  
285
  
286
  
287
  
288
  
289
  
290
  
291
  
292
  
293
  
294
  
295
  
296
  
297
  
298
  
299
  
300
  
301
  
302
  
303
  
304
  
305
  
306
  
307
  
308
  
// 
// $Id: peep.in,v 1.33 2000/04/30 16:46:36 nilsson Exp $ 
// 
 
NOP : 
POP_N_ELEMS (0) :  
POP_N_ELEMS POP_VALUE : POP_N_ELEMS ($1a + 1) 
POP_VALUE POP_VALUE : POP_N_ELEMS (2) 
POP_VALUE POP_N_ELEMS : POP_N_ELEMS ($2a + 1) 
POP_N_ELEMS POP_N_ELEMS : POP_N_ELEMS ($1a + $2a) 
POP_N_ELEMS(1) : POP_VALUE 
 
MARK MARK: MARK2 
 
ASSIGN_GLOBAL POP_VALUE : ASSIGN_GLOBAL_AND_POP($1a) 
ASSIGN_LOCAL  POP_VALUE : ASSIGN_LOCAL_AND_POP($1a) 
CALL_LFUN POP_VALUE : CALL_LFUN_AND_POP($1a) 
APPLY POP_VALUE : APPLY_AND_POP($1a) 
MARK APPLY : MARK_APPLY($2a) 
MARK_APPLY POP_VALUE : MARK_APPLY_POP($1a) 
NUMBER(0) : CONST0 
NUMBER(1) : CONST1 
NUMBER(-1) : CONST_1 
NUMBER (0x7fffffff) : BIGNUM 
CONST0 NEGATE : CONST0 
CONST1 NEGATE : CONST_1 
CONST_1 NEGATE : CONST1 
NUMBER NEGATE : NEG_NUMBER($1a) 
NUMBER [$1a < 0 && (-$1a)>0] : NEG_NUMBER (-$1a) 
NEG_NUMBER NEGATE : NUMBER ($1a) 
NEGATE NEGATE : 
COMPL COMPL : 
NEGATE CONST_1 ADD : COMPL 
NEGATE CONST1 SUBTRACT : COMPL 
CONST0 ASSIGN_LOCAL_AND_POP : CLEAR_LOCAL($2a) 
 
// Remove clearing of locals from the beginning of functions 
CLEAR_LOCAL [(fifo_len == (long)instrbuf.s.len / (long)sizeof(p_instr)) && $1a>=remove_clear_locals] :  
CLEAR_2_LOCAL [(fifo_len == (long)instrbuf.s.len / (long)sizeof(p_instr)) && $1a>=remove_clear_locals] :  
CLEAR_4_LOCAL [(fifo_len == (long)instrbuf.s.len / (long)sizeof(p_instr)) && $1a>=remove_clear_locals] :  
 
CLEAR_LOCAL NUMBER(0) ASSIGN_LOCAL_AND_POP ($1a) : CLEAR_LOCAL($1a) 
CLEAR_LOCAL NUMBER(0) ASSIGN_LOCAL_AND_POP ($1a+1) : CLEAR_2_LOCAL($1a) 
CLEAR_2_LOCAL CLEAR_2_LOCAL($1a+2) : CLEAR_4_LOCAL($1a) 
 
// CONST_1 MULTIPLY : NEGATE 
// CONST0 MULTIPLY : POP_VALUE CONST0 
// CONST1 MULTIPLY :  
// NUMBER MULTIPLY [count_bits($1a)==1]: NUMBER(my_log2($1a)) LSH 
 
// CONST_1 DIVIDE : NEGATE 
// CONST1 DIVIDE :  
// NUMBER DIVIDE [count_bits($1a)==1]: NUMBER(my_log2($1a)) RSH 
 
CONST0 SUBTRACT: 
CONST0 XOR: 
CONST_1 XOR: COMPL 
CONST0 RETURN: RETURN_0 
CONST1 RETURN: RETURN_1 
INC POP_VALUE: INC_AND_POP 
POST_INC POP_VALUE: INC_AND_POP 
DEC POP_VALUE: DEC_AND_POP 
POST_DEC POP_VALUE: DEC_AND_POP 
NOT BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_ZERO($2a) 
NOT BRANCH_WHEN_ZERO: BRANCH_WHEN_NON_ZERO($2a) 
 
POP_VALUE RETURN_0: RETURN_0 
POP_N_ELEMS RETURN_0: RETURN_0 
POP_VALUE RETURN_1: RETURN_1 
POP_N_ELEMS RETURN_1: RETURN_1 
 
BRANCH !LABEL : BRANCH($1a) 
RETURN !LABEL : RETURN 
RETURN_0 !LABEL : RETURN_0 
RETURN_1 !LABEL : RETURN_1 
RETURN_LOCAL !LABEL : RETURN_LOCAL($1a) 
APPLY_AND_RETURN !LABEL : APPLY_AND_RETURN($1a) 
CALL_FUNCTION_AND_RETURN !LABEL : CALL_FUNCTION_AND_RETURN($1a) 
CALL_LFUN_AND_RETURN !LABEL : CALL_LFUN_AND_RETURN($1a) 
BRANCH LABEL ($1a) : LABEL ($1a) 
 
LOCAL_LVALUE INC : INC_LOCAL ($1a) 
LOCAL_LVALUE POST_INC : POST_INC_LOCAL ($1a) 
LOCAL_LVALUE INC_AND_POP : INC_LOCAL_AND_POP ($1a) 
INC_LOCAL POP_VALUE : INC_LOCAL_AND_POP ($1a) 
POST_INC_LOCAL POP_VALUE : INC_LOCAL_AND_POP ($1a) 
 
LOCAL_LVALUE DEC : DEC_LOCAL ($1a) 
LOCAL_LVALUE POST_DEC : POST_DEC_LOCAL ($1a) 
LOCAL_LVALUE DEC_AND_POP : DEC_LOCAL_AND_POP ($1a) 
DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a) 
POST_DEC_LOCAL POP_VALUE : DEC_LOCAL_AND_POP ($1a) 
 
ASSIGN_LOCAL_AND_POP LOCAL ($1a) RETURN: ASSIGN_LOCAL($1a) RETURN 
ASSIGN_LOCAL_AND_POP LOCAL ($1a) RETURN [compiler_frame->lexical_scope< 2]: RETURN 
 
ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) RETURN LABEL($2a): ASSIGN_LOCAL($1a) RETURN_IF_TRUE LABEL($2a) 
 
ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) RETURN LABEL($2a) [compiler_frame->lexical_scope<2] : RETURN_IF_TRUE ASSIGN_LOCAL($1a) LABEL($2a) 
 
ASSIGN_GLOBAL BRANCH_WHEN_ZERO GLOBAL($1a) RETURN LABEL($2a): ASSIGN_GLOBAL($1a) RETURN_IF_TRUE LABEL($2a) 
 
 
GLOBAL_LVALUE INC_AND_POP GLOBAL($1a): GLOBAL_LVALUE($1a) INC 
GLOBAL_LVALUE DEC_AND_POP GLOBAL($1a): GLOBAL_LVALUE($1a) DEC 
 
CONST1 BRANCH_WHEN_ZERO: 
CONST0 BRANCH_WHEN_ZERO: BRANCH($2a) 
CONST1 BRANCH_WHEN_NON_ZERO: BRANCH($2a) 
CONST0 BRANCH_WHEN_NON_ZERO:  
 
// These optimizations are now handled in optimize_eq 
// CONST0 BRANCH_WHEN_EQ: BRANCH_WHEN_ZERO($2a) 
// CONST0 BRANCH_WHEN_NE: BRANCH_WHEN_NON_ZERO($2a) 
// CONST0 EQ: NOT 
 
EQ BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_EQ ($2a) 
NE BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_NE ($2a) 
LT BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_LT ($2a) 
GT BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_GT ($2a) 
LE BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_LE ($2a) 
GE BRANCH_WHEN_NON_ZERO: BRANCH_WHEN_GE ($2a) 
 
EQ BRANCH_WHEN_ZERO: BRANCH_WHEN_NE ($2a) 
NE BRANCH_WHEN_ZERO: BRANCH_WHEN_EQ ($2a) 
LT BRANCH_WHEN_ZERO: BRANCH_WHEN_GE ($2a) 
GT BRANCH_WHEN_ZERO: BRANCH_WHEN_LE ($2a) 
LE BRANCH_WHEN_ZERO: BRANCH_WHEN_GT ($2a) 
GE BRANCH_WHEN_ZERO: BRANCH_WHEN_LT ($2a) 
 
EQ LOR: EQ_OR ($2a) 
EQ LAND: EQ_AND ($2a) 
 
EQ NOT: NE 
NE NOT: EQ 
LT NOT: GE 
GT NOT: LE 
LE NOT: GT 
GE NOT: LT 
 
LOCAL LOCAL [$3o != F_SIZEOF && $3o != F_INDEX ]: 2_LOCALS ($1a,$2a) 
MARK LOCAL [ $3o != F_SIZEOF && $3o != F_INDEX ]: MARK_AND_LOCAL ($2a) 
MARK STRING : MARK_AND_STRING($2a) 
LOCAL SIZEOF: SIZEOF_LOCAL ($1a) 
STRING INDEX: STRING_INDEX ($1a) 
 
STRING CLEAR_STRING_SUBTYPE: STRING ($1a) 
CONST0 CLEAR_STRING_SUBTYPE: CONST0 
CONST1 CLEAR_STRING_SUBTYPE: CONST1 
CONST_1 CLEAR_STRING_SUBTYPE: CONST_1 
NUMBER CLEAR_STRING_SUBTYPE: NUMBER($1a) 
NEG_NUMBER CLEAR_STRING_SUBTYPE: NEG_NUMBER($1a) 
 
LOCAL INDEX: LOCAL_INDEX ($1a) 
LOCAL CLEAR_STRING_SUBTYPE INDEX: LOCAL_INDEX ($1a) 
 
LOCAL LOCAL INDEX: LOCAL_LOCAL_INDEX($2a,$1a) 
LOCAL LOCAL CLEAR_STRING_SUBTYPE INDEX: LOCAL_LOCAL_INDEX($2a,$1a) 
 
CONST0 INDEX: POS_INT_INDEX (0) 
CONST_1 INDEX: NEG_INT_INDEX (1) 
CONST1 INDEX: POS_INT_INDEX (1) 
 
NUMBER [$1a < 0] INDEX: NEG_INT_INDEX (-$1a) 
NUMBER [$1a >= 0] INDEX: POS_INT_INDEX ($1a) 
NEG_NUMBER [$1a >= 0] INDEX: NEG_INT_INDEX ($1a) 
NEG_NUMBER [$1a < 0] INDEX: POS_INT_INDEX (-$1a) 
 
BRANCH_WHEN_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_NON_ZERO($2a) LABEL($1a) 
BRANCH_WHEN_NON_ZERO BRANCH LABEL ($1a): BRANCH_WHEN_ZERO($2a) LABEL($1a) 
 
BRANCH_WHEN_EQ BRANCH LABEL ($1a) : BRANCH_WHEN_NE($2a) LABEL($1a) 
BRANCH_WHEN_NE BRANCH LABEL ($1a) : BRANCH_WHEN_EQ($2a) LABEL($1a) 
 
BRANCH_WHEN_LT BRANCH LABEL ($1a) : BRANCH_WHEN_GE($2a) LABEL($1a) 
BRANCH_WHEN_GE BRANCH LABEL ($1a) : BRANCH_WHEN_LT($2a) LABEL($1a) 
 
BRANCH_WHEN_LE BRANCH LABEL ($1a) : BRANCH_WHEN_GT($2a) LABEL($1a) 
BRANCH_WHEN_GT BRANCH LABEL ($1a) : BRANCH_WHEN_LE($2a) LABEL($1a) 
 
 
CONST0 ADD: ADD_INT (0) 
CONST1 ADD: ADD_INT (1) 
CONST_1 ADD: ADD_NEG_INT (1) 
NUMBER [$1a >= 0] ADD : ADD_INT ($1a) 
NUMBER [$1a < 0] ADD : ADD_NEG_INT (-$1a) 
 
CONST0 SUBTRACT: ADD_INT (0) 
CONST1 SUBTRACT: ADD_NEG_INT (-1) 
CONST_1 SUBTRACT: ADD_INT (1) 
NUMBER [$1a >= 0] SUBTRACT : ADD_NEG_INT ($1a) 
NUMBER [$1a < 0] SUBTRACT : ADD_INT (-$1a) 
 
LTOSVAL2 ADD ASSIGN_AND_POP : ADD_TO_AND_POP 
LTOSVAL ADD ASSIGN_AND_POP : ADD_TO_AND_POP 
 
APPLY [ !(debug_options & NO_TAILRECURSION) ] RETURN : APPLY_AND_RETURN($1a) 
CALL_FUNCTION [ !(debug_options & NO_TAILRECURSION) ] RETURN : CALL_FUNCTION_AND_RETURN 
CALL_LFUN [ !(debug_options & NO_TAILRECURSION) ] RETURN : CALL_LFUN_AND_RETURN($1a) 
 
LOCAL RETURN : RETURN_LOCAL($1a) 
APPLY ASSIGN_LOCAL_AND_POP : APPLY_ASSIGN_LOCAL_AND_POP($1a,$2a) 
ASSIGN_LOCAL_AND_POP INC_LOCAL_AND_POP($1a) : ADD_INT(1) ASSIGN_LOCAL_AND_POP($1a) 
ASSIGN_LOCAL_AND_POP DEC_LOCAL_AND_POP($1a) : ADD_NEG_INT(1) ASSIGN_LOCAL_AND_POP($1a) 
NUMBER ADD_INT [ !INT_TYPE_ADD_OVERFLOW($1a, $2a) ] : NUMBER($1a+$2a) 
NUMBER ADD_NEG_INT [ !INT_TYPE_SUB_OVERFLOW($1a, $2a) ]: NUMBER($1a-$2a) 
NEG_NUMBER ADD_INT [ !INT_TYPE_ADD_OVERFLOW(-$1a, $2a) ]: NUMBER(-$1a+$2a) 
NEG_NUMBER ADD_NEG_INT [ !INT_TYPE_SUB_OVERFLOW(-$1a, $2a) ]: NUMBER(-$1a-$2a) 
 
LOCAL BRANCH_WHEN_NON_ZERO : BRANCH_IF_LOCAL($1a) POINTER($2a) 
LOCAL BRANCH_WHEN_ZERO : BRANCH_IF_NOT_LOCAL($1a) POINTER($2a) 
 
DEC_LOCAL_AND_POP LOCAL ($1a) : DEC_LOCAL ($1a) 
INC_LOCAL_AND_POP LOCAL ($1a) : INC_LOCAL ($1a) 
ASSIGN_LOCAL_AND_POP LOCAL($1a) : ASSIGN_LOCAL($1a) 
ASSIGN_GLOBAL_AND_POP GLOBAL($1a) : ASSIGN_GLOBAL($1a) 
APPLY_ASSIGN_LOCAL_AND_POP LOCAL ($1b) : APPLY_ASSIGN_LOCAL($1a,$1b) 
 
DEC_LOCAL_AND_POP MARK_AND_LOCAL ($1a) : MARK DEC_LOCAL ($1a) 
INC_LOCAL_AND_POP MARK_AND_LOCAL ($1a) : MARK INC_LOCAL ($1a) 
ASSIGN_GLOBAL_AND_POP MARK GLOBAL($1a) : MARK_X(1) ASSIGN_GLOBAL($1a) 
ASSIGN_LOCAL_AND_POP MARK_AND_LOCAL($1a) : MARK_X(1) ASSIGN_LOCAL($1a) 
APPLY_ASSIGN_LOCAL_AND_POP MARK_AND_LOCAL ($1b) : APPLY_ASSIGN_LOCAL($1a,$1b) MARK_X(1)  
 
ASSIGN_LOCAL ASSIGN_LOCAL($1a) : ASSIGN_LOCAL($1a) 
 
// MARK_X rules 
MARK_X(0) : MARK 
LOCAL MARK_X [$2a>0] : MARK_X($2a-1) LOCAL($1a) 
STRING MARK_X [$2a>0] : MARK_X($2a-1) STRING($1a) 
NUMBER MARK_X [$2a>0] : MARK_X($2a-1) NUMBER($1a) 
CONST0 MARK_X [$2a>0] : MARK_X($2a-1) CONST0 
CONST1 MARK_X [$2a>0] : MARK_X($2a-1) CONST1 
CONST_1 MARK_X [$2a>0] : MARK_X($2a-1) CONST_1 
NEG_NUMBER MARK_X [$2a>0] : MARK_X($2a-1) NEG_NUMBER($1a) 
GLOBAL MARK_X [$2a>0] : MARK_X($2a-1) GLOBAL($1a) 
MARK_APPLY MARK_X [$2a>0] : MARK_X($2a-1) MARK_APPLY($1a) 
CONSTANT MARK_X [$2a>0] : MARK_X($2a-1) CONSTANT($1a) 
FLOAT MARK_X [$2a>0] : MARK_X($2a-1) FLOAT($1a) 
LFUN MARK_X [$2a>0] : MARK_X($2a-1) LFUN($1a) 
LTOSVAL MARK_X [$2a>0] : MARK_X($2a-1) LTOSVAL 
LOCAL_LVALUE MARK_X [$2a>1] : MARK_X($2a-2) LOCAL_LVALUE($1a) 
2_LOCALS MARK_X [$2a>0] : LOCAL($1a) MARK_X($2a-1) LOCAL($1b) 
 
#define BasicBranch2(Branch,Oper,Pre,Post,Variable) \ 
 Variable Branch Pre Variable ($1a) : Variable ($1a) Oper ($2a) Post ; \ 
 ASSIGN_##Variable Branch Pre Variable ($1a) : ASSIGN_##Variable($1a) Oper ($2a) Post ; 
 
#define BasicBranch1(Branch,Oper,Pre,Post) \ 
  BasicBranch2(Branch,Oper,Pre,Post,LOCAL) \ 
  BasicBranch2(Branch,Oper,Pre,Post,GLOBAL) 
 
#define BasicBranch0(Branch,Oper) \ 
  BasicBranch1(Branch,Oper,MARK,MARK_X(1)) \ 
  BasicBranch1(Branch,Oper, , ) 
 
BasicBranch0(BRANCH_WHEN_NON_ZERO, BRANCH_AND_POP_WHEN_NON_ZERO) 
BasicBranch0(BRANCH_WHEN_ZERO, BRANCH_AND_POP_WHEN_ZERO) 
 
#define SimpleBranch(Sequence,X) \ 
 Sequence BRANCH_WHEN_ZERO Sequence : Sequence BRANCH_AND_POP_WHEN_ZERO ( X ) ; \ 
 Sequence BRANCH_WHEN_ZERO MARK Sequence : Sequence BRANCH_AND_POP_WHEN_ZERO ( X ) MARK_X(1) ; 
 
SimpleBranch( LOCAL_ARROW($1a, $1b), $2a ) 
SimpleBranch( LOCAL_ARROW($1a, $1b) ARROW($2a), $3a ) 
SimpleBranch( LOCAL_ARROW($1a, $1b) ARROW($2a) ARROW($3a), $4a ) 
SimpleBranch( LOCAL_ARROW($1a, $1b) ARROW($2a) ARROW($3a) ARROW($4a), $5a ) 
 
SimpleBranch( GLOBAL($1a) ARROW ($2a), $3a ) 
 
LOCAL ASSIGN_LOCAL_AND_POP : LOCAL_2_LOCAL($2a,$1a) 
GLOBAL ASSIGN_LOCAL_AND_POP : GLOBAL_2_LOCAL($1a,$2a) 
LOCAL ASSIGN_GLOBAL_AND_POP : LOCAL_2_GLOBAL($2a,$1a) 
 
LOCAL ARROW : LOCAL_ARROW($2a,$1a) 
LOCAL_ARROW BRANCH_WHEN_ZERO: BRANCH_IF_NOT_LOCAL_ARROW($1a,$1b) POINTER($2a) 
 
GLOBAL LOCAL_INDEX : GLOBAL_LOCAL_INDEX($1a,$2a) 
 
SIZEOF CONST1 BRANCH_WHEN_LT : SIZEOF BRANCH_WHEN_ZERO ($3a) 
SIZEOF_LOCAL CONST1 BRANCH_WHEN_LT : SIZEOF_LOCAL($1a) BRANCH_WHEN_ZERO ($3a) 
SIZEOF CONST0 BRANCH_WHEN_LE : SIZEOF BRANCH_WHEN_ZERO ($3a) 
SIZEOF_LOCAL CONST0 BRANCH_WHEN_LE : SIZEOF_LOCAL($1a) BRANCH_WHEN_ZERO ($3a) 
 
CLEAR_LOCAL DEC_LOCAL_AND_POP($1a) : CONST_1 ASSIGN_LOCAL_AND_POP($1a) 
CLEAR_LOCAL INC_LOCAL_AND_POP($1a) : CONST1 ASSIGN_LOCAL_AND_POP($1a) 
 
NUMBER POP_VALUE : 
STRING POP_VALUE : 
FLOAT POP_VALUE : 
CONSTANT POP_VALUE : 
LOCAL POP_VALUE : 
IDENTIFIER POP_VALUE : 
TRAMPOLINE POP_VALUE : 
 
 
RECUR RETURN: TAIL_RECUR ($1a) 
MARK TAIL_RECUR : BRANCH ($1a) 
 
ASSIGN_LOCAL BRANCH_WHEN_ZERO 2_LOCALS(,$1a) BRANCH_WHEN_EQ : ASSIGN_LOCAL($1a) BRANCH_AND_POP_WHEN_ZERO($2a) LOCAL($3a) BRANCH_WHEN_EQ($4a) 
ASSIGN_LOCAL BRANCH_WHEN_ZERO 2_LOCALS(,$1a) BRANCH_WHEN_NE : ASSIGN_LOCAL($1a) BRANCH_AND_POP_WHEN_ZERO($2a) LOCAL($3a) BRANCH_WHEN_NE($4a) 
 
/* This will facilitate other optimizations I hope */ 
CLEAR_LOCAL MARK LOCAL [ $1a != $3a ] : MARK LOCAL($3a) CLEAR_LOCAL($1a) 
 
/* The result of this optimization could be reordered... */ 
CLEAR_LOCAL MARK LOCAL($1a) : MARK CLEAR_LOCAL($1a) CONST0