1 ; This testcase, obviously distilled from a large program (bzip2 from
2 ; Specint2000) caused instcombine to fail because it got the same instruction
3 ; on it's worklist more than once (which is ok), but then deleted the
4 ; instruction. Since the inst stayed on the worklist, as soon as it came back
5 ; up to be processed, bad things happened, and opt asserted.
7 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine
11 %.LC0 = internal global [21 x sbyte] c"hbMakeCodeLengths(1)\00" ; <[21 x sbyte]*> [#uses=1]
12 %.LC1 = internal global [21 x sbyte] c"hbMakeCodeLengths(2)\00" ; <[21 x sbyte]*> [#uses=1]
14 implementation ; Functions:
16 void %hbMakeCodeLengths(ubyte* %len, int* %freq, int %alphaSize, int %maxLen) {
18 %len = alloca ubyte* ; <ubyte**> [#uses=2]
19 store ubyte* %len, ubyte** %len
20 %freq = alloca int* ; <int**> [#uses=2]
21 store int* %freq, int** %freq
22 %alphaSize = alloca int ; <int*> [#uses=2]
23 store int %alphaSize, int* %alphaSize
24 %maxLen = alloca int ; <int*> [#uses=2]
25 store int %maxLen, int* %maxLen
26 %heap = alloca int, uint 260 ; <int*> [#uses=27]
27 %weight = alloca int, uint 516 ; <int*> [#uses=18]
28 %parent = alloca int, uint 516 ; <int*> [#uses=7]
32 %reg107 = load ubyte** %len ; <ubyte*> [#uses=1]
33 %reg108 = load int** %freq ; <int*> [#uses=1]
34 %reg109 = load int* %alphaSize ; <int> [#uses=10]
35 %reg110 = load int* %maxLen ; <int> [#uses=1]
36 %cond747 = setge int 0, %reg109 ; <bool> [#uses=1]
37 br bool %cond747, label %bb6, label %bb2
40 %reg591 = phi int [ %reg594, %bb5 ], [ 0, %bb1 ] ; <int> [#uses=3]
41 %reg591-idxcast1 = cast int %reg591 to uint ; <uint> [#uses=1]
42 %reg591-idxcast1-offset = add uint %reg591-idxcast1, 1 ; <uint> [#uses=1]
43 %reg591-idxcast1-offset = cast uint %reg591-idxcast1-offset to long ; <long> [#uses=1]
44 %reg126 = getelementptr int* %weight, long %reg591-idxcast1-offset ; <int*> [#uses=1]
45 %reg591-idxcast = cast int %reg591 to long ; <long> [#uses=1]
46 %reg132 = getelementptr int* %reg108, long %reg591-idxcast ; <int*> [#uses=1]
47 %reg133 = load int* %reg132 ; <int> [#uses=2]
48 %cond748 = seteq int %reg133, 0 ; <bool> [#uses=1]
49 br bool %cond748, label %bb4, label %bb3
52 %reg127 = shl int %reg133, ubyte 8 ; <int> [#uses=1]
59 %reg593 = phi int [ 256, %bb4 ], [ %reg127, %bb3 ] ; <int> [#uses=1]
60 store int %reg593, int* %reg126
61 %reg594 = add int %reg591, 1 ; <int> [#uses=2]
62 %cond749 = setlt int %reg594, %reg109 ; <bool> [#uses=1]
63 br bool %cond749, label %bb2, label %bb6
66 store int 0, int* %heap
67 store int 0, int* %weight
68 store int -2, int* %parent
69 %cond750 = setgt int 1, %reg109 ; <bool> [#uses=1]
70 br bool %cond750, label %bb11, label %bb7
73 %reg597 = phi uint [ %reg598, %bb10 ], [ 0, %bb6 ] ; <uint> [#uses=5]
74 %reg597-casted = cast uint %reg597 to int ; <int> [#uses=1]
75 %reg596 = add int %reg597-casted, 1 ; <int> [#uses=3]
76 %reg597-offset = add uint %reg597, 1 ; <uint> [#uses=1]
77 %reg597-offset = cast uint %reg597-offset to long ; <long> [#uses=1]
78 %reg149 = getelementptr int* %parent, long %reg597-offset ; <int*> [#uses=1]
79 store int -1, int* %reg149
80 %reg598 = add uint %reg597, 1 ; <uint> [#uses=3]
81 %reg597-offset1 = add uint %reg597, 1 ; <uint> [#uses=1]
82 %reg597-offset1 = cast uint %reg597-offset1 to long ; <long> [#uses=1]
83 %reg157 = getelementptr int* %heap, long %reg597-offset1 ; <int*> [#uses=1]
84 store int %reg596, int* %reg157
88 %reg599 = cast uint %reg599 to long ; <long> [#uses=1]
89 %reg198 = getelementptr int* %heap, long %reg599 ; <int*> [#uses=1]
90 store int %reg182, int* %reg198
91 %cast938 = cast int %reg174 to uint ; <uint> [#uses=1]
95 %reg599 = phi uint [ %cast938, %bb8 ], [ %reg598, %bb7 ] ; <uint> [#uses=3]
96 %cast807 = cast uint %reg599 to int ; <int> [#uses=1]
97 %reg597-offset2 = add uint %reg597, 1 ; <uint> [#uses=1]
98 %reg597-offset2 = cast uint %reg597-offset2 to long ; <long> [#uses=1]
99 %reg173 = getelementptr int* %weight, long %reg597-offset2 ; <int*> [#uses=1]
100 %reg174 = shr int %cast807, ubyte 1 ; <int> [#uses=2]
101 %reg174-idxcast = cast int %reg174 to uint ; <uint> [#uses=1]
102 cast uint %reg174-idxcast to long ; <long>:0 [#uses=1]
103 %reg181 = getelementptr int* %heap, long %0 ; <int*> [#uses=1]
104 %reg182 = load int* %reg181 ; <int> [#uses=2]
105 %reg182-idxcast = cast int %reg182 to uint ; <uint> [#uses=1]
106 cast uint %reg182-idxcast to long ; <long>:1 [#uses=1]
107 %reg189 = getelementptr int* %weight, long %1 ; <int*> [#uses=1]
108 %reg190 = load int* %reg173 ; <int> [#uses=1]
109 %reg191 = load int* %reg189 ; <int> [#uses=1]
110 %cond751 = setlt int %reg190, %reg191 ; <bool> [#uses=1]
111 br bool %cond751, label %bb8, label %bb10
114 cast uint %reg599 to long ; <long>:2 [#uses=1]
115 %reg214 = getelementptr int* %heap, long %2 ; <int*> [#uses=1]
116 store int %reg596, int* %reg214
117 %reg601 = add int %reg596, 1 ; <int> [#uses=1]
118 %cond752 = setle int %reg601, %reg109 ; <bool> [#uses=1]
119 br bool %cond752, label %bb7, label %bb11
122 %reg602 = phi uint [ %reg598, %bb10 ], [ 0, %bb6 ] ; <uint> [#uses=3]
123 %cast819 = cast uint %reg602 to int ; <int> [#uses=1]
124 %cast818 = cast uint %reg602 to int ; <int> [#uses=1]
125 %cond753 = setle int %cast818, 259 ; <bool> [#uses=1]
126 br bool %cond753, label %bb13, label %bb12
129 cast uint 0 to long ; <long>:3 [#uses=1]
130 cast uint 0 to long ; <long>:4 [#uses=1]
131 %cast784 = getelementptr [21 x sbyte]* %.LC0, long %3, long %4 ; <sbyte*> [#uses=1]
132 call void %panic( sbyte* %cast784 )
136 %cond754 = setle int %cast819, 1 ; <bool> [#uses=1]
137 %cast918 = cast int %reg109 to uint ; <uint> [#uses=1]
138 %cast940 = cast uint %reg602 to int ; <int> [#uses=1]
139 %cast942 = cast int %reg109 to uint ; <uint> [#uses=1]
140 br bool %cond754, label %bb32, label %bb14
143 %cann-indvar1 = phi uint [ 0, %bb13 ], [ %add1-indvar1, %bb31 ] ; <uint> [#uses=3]
144 %cann-indvar1-casted = cast uint %cann-indvar1 to int ; <int> [#uses=1]
145 %reg603-scale = mul int %cann-indvar1-casted, -1 ; <int> [#uses=1]
146 %reg603 = add int %reg603-scale, %cast940 ; <int> [#uses=4]
147 %reg604 = add uint %cann-indvar1, %cast942 ; <uint> [#uses=4]
148 %add1-indvar1 = add uint %cann-indvar1, 1 ; <uint> [#uses=1]
149 cast uint 1 to long ; <long>:5 [#uses=1]
150 %reg7551 = getelementptr int* %heap, long %5 ; <int*> [#uses=1]
151 %reg113 = load int* %reg7551 ; <int> [#uses=2]
152 %reg603-idxcast = cast int %reg603 to uint ; <uint> [#uses=1]
153 cast uint %reg603-idxcast to long ; <long>:6 [#uses=1]
154 %reg222 = getelementptr int* %heap, long %6 ; <int*> [#uses=1]
155 %reg223 = load int* %reg222 ; <int> [#uses=1]
156 cast uint 1 to long ; <long>:7 [#uses=1]
157 %reg7561 = getelementptr int* %heap, long %7 ; <int*> [#uses=1]
158 store int %reg223, int* %reg7561
159 %reg605 = add int %reg603, -1 ; <int> [#uses=4]
160 cast uint 1 to long ; <long>:8 [#uses=1]
161 %reg757 = getelementptr int* %heap, long %8 ; <int*> [#uses=1]
162 %reg226 = load int* %reg757 ; <int> [#uses=2]
163 %cond758 = setgt int 2, %reg605 ; <bool> [#uses=1]
164 br bool %cond758, label %bb20, label %bb15
167 %reg606 = phi int [ %reg611, %bb19 ], [ 2, %bb14 ] ; <int> [#uses=6]
168 %reg607 = phi int [ %reg609, %bb19 ], [ 1, %bb14 ] ; <int> [#uses=2]
169 %cond759 = setge int %reg606, %reg605 ; <bool> [#uses=1]
170 br bool %cond759, label %bb18, label %bb16
173 %reg606-idxcast = cast int %reg606 to uint ; <uint> [#uses=1]
174 %reg606-idxcast-offset = add uint %reg606-idxcast, 1 ; <uint> [#uses=1]
175 cast uint %reg606-idxcast-offset to long ; <long>:9 [#uses=1]
176 %reg241 = getelementptr int* %heap, long %9 ; <int*> [#uses=1]
177 %reg242 = load int* %reg241 ; <int> [#uses=1]
178 %reg242-idxcast = cast int %reg242 to uint ; <uint> [#uses=1]
179 cast uint %reg242-idxcast to long ; <long>:10 [#uses=1]
180 %reg249 = getelementptr int* %weight, long %10 ; <int*> [#uses=1]
181 %reg606-idxcast1 = cast int %reg606 to uint ; <uint> [#uses=1]
182 cast uint %reg606-idxcast1 to long ; <long>:11 [#uses=1]
183 %reg256 = getelementptr int* %heap, long %11 ; <int*> [#uses=1]
184 %reg257 = load int* %reg256 ; <int> [#uses=1]
185 %reg257-idxcast = cast int %reg257 to uint ; <uint> [#uses=1]
186 cast uint %reg257-idxcast to long ; <long>:12 [#uses=1]
187 %reg264 = getelementptr int* %weight, long %12 ; <int*> [#uses=1]
188 %reg265 = load int* %reg249 ; <int> [#uses=1]
189 %reg266 = load int* %reg264 ; <int> [#uses=1]
190 %cond760 = setge int %reg265, %reg266 ; <bool> [#uses=1]
191 br bool %cond760, label %bb18, label %bb17
194 %reg608 = add int %reg606, 1 ; <int> [#uses=1]
198 %reg609 = phi int [ %reg608, %bb17 ], [ %reg606, %bb16 ], [ %reg606, %bb15 ] ; <int> [#uses=4]
199 %reg226-idxcast = cast int %reg226 to uint ; <uint> [#uses=1]
200 cast uint %reg226-idxcast to long ; <long>:13 [#uses=1]
201 %reg273 = getelementptr int* %weight, long %13 ; <int*> [#uses=1]
202 %reg609-idxcast = cast int %reg609 to uint ; <uint> [#uses=1]
203 cast uint %reg609-idxcast to long ; <long>:14 [#uses=1]
204 %reg280 = getelementptr int* %heap, long %14 ; <int*> [#uses=1]
205 %reg281 = load int* %reg280 ; <int> [#uses=2]
206 %reg281-idxcast = cast int %reg281 to uint ; <uint> [#uses=1]
207 cast uint %reg281-idxcast to long ; <long>:15 [#uses=1]
208 %reg288 = getelementptr int* %weight, long %15 ; <int*> [#uses=1]
209 %reg289 = load int* %reg273 ; <int> [#uses=1]
210 %reg290 = load int* %reg288 ; <int> [#uses=1]
211 %cond761 = setlt int %reg289, %reg290 ; <bool> [#uses=1]
212 br bool %cond761, label %bb20, label %bb19
215 %reg607-idxcast = cast int %reg607 to uint ; <uint> [#uses=1]
216 cast uint %reg607-idxcast to long ; <long>:16 [#uses=1]
217 %reg297 = getelementptr int* %heap, long %16 ; <int*> [#uses=1]
218 store int %reg281, int* %reg297
219 %reg611 = shl int %reg609, ubyte 1 ; <int> [#uses=2]
220 %cond762 = setle int %reg611, %reg605 ; <bool> [#uses=1]
221 br bool %cond762, label %bb15, label %bb20
224 %reg612 = phi int [ %reg609, %bb19 ], [ %reg607, %bb18 ], [ 1, %bb14 ] ; <int> [#uses=1]
225 %reg612-idxcast = cast int %reg612 to uint ; <uint> [#uses=1]
226 cast uint %reg612-idxcast to long ; <long>:17 [#uses=1]
227 %reg312 = getelementptr int* %heap, long %17 ; <int*> [#uses=1]
228 store int %reg226, int* %reg312
229 cast uint 1 to long ; <long>:18 [#uses=1]
230 %reg7631 = getelementptr int* %heap, long %18 ; <int*> [#uses=1]
231 %reg114 = load int* %reg7631 ; <int> [#uses=2]
232 %reg603-idxcast1 = cast int %reg603 to uint ; <uint> [#uses=1]
233 %reg603-idxcast1-offset = add uint %reg603-idxcast1, 1073741823 ; <uint> [#uses=1]
234 cast uint %reg603-idxcast1-offset to long ; <long>:19 [#uses=1]
235 %reg319 = getelementptr int* %heap, long %19 ; <int*> [#uses=1]
236 %reg320 = load int* %reg319 ; <int> [#uses=1]
237 cast uint 1 to long ; <long>:20 [#uses=1]
238 %reg7641 = getelementptr int* %heap, long %20 ; <int*> [#uses=1]
239 store int %reg320, int* %reg7641
240 %reg613 = add int %reg605, -1 ; <int> [#uses=4]
241 cast uint 1 to long ; <long>:21 [#uses=1]
242 %reg765 = getelementptr int* %heap, long %21 ; <int*> [#uses=1]
243 %reg323 = load int* %reg765 ; <int> [#uses=2]
244 %cond766 = setgt int 2, %reg613 ; <bool> [#uses=1]
245 br bool %cond766, label %bb26, label %bb21
248 %reg614 = phi int [ %reg619, %bb25 ], [ 2, %bb20 ] ; <int> [#uses=6]
249 %reg615 = phi int [ %reg617, %bb25 ], [ 1, %bb20 ] ; <int> [#uses=2]
250 %cond767 = setge int %reg614, %reg613 ; <bool> [#uses=1]
251 br bool %cond767, label %bb24, label %bb22
254 %reg614-idxcast = cast int %reg614 to uint ; <uint> [#uses=1]
255 %reg614-idxcast-offset = add uint %reg614-idxcast, 1 ; <uint> [#uses=1]
256 cast uint %reg614-idxcast-offset to long ; <long>:22 [#uses=1]
257 %reg338 = getelementptr int* %heap, long %22 ; <int*> [#uses=1]
258 %reg339 = load int* %reg338 ; <int> [#uses=1]
259 %reg339-idxcast = cast int %reg339 to uint ; <uint> [#uses=1]
260 cast uint %reg339-idxcast to long ; <long>:23 [#uses=1]
261 %reg346 = getelementptr int* %weight, long %23 ; <int*> [#uses=1]
262 %reg614-idxcast1 = cast int %reg614 to uint ; <uint> [#uses=1]
263 cast uint %reg614-idxcast1 to long ; <long>:24 [#uses=1]
264 %reg353 = getelementptr int* %heap, long %24 ; <int*> [#uses=1]
265 %reg354 = load int* %reg353 ; <int> [#uses=1]
266 %reg354-idxcast = cast int %reg354 to uint ; <uint> [#uses=1]
267 cast uint %reg354-idxcast to long ; <long>:25 [#uses=1]
268 %reg361 = getelementptr int* %weight, long %25 ; <int*> [#uses=1]
269 %reg362 = load int* %reg346 ; <int> [#uses=1]
270 %reg363 = load int* %reg361 ; <int> [#uses=1]
271 %cond768 = setge int %reg362, %reg363 ; <bool> [#uses=1]
272 br bool %cond768, label %bb24, label %bb23
275 %reg616 = add int %reg614, 1 ; <int> [#uses=1]
279 %reg617 = phi int [ %reg616, %bb23 ], [ %reg614, %bb22 ], [ %reg614, %bb21 ] ; <int> [#uses=4]
280 %reg323-idxcast = cast int %reg323 to uint ; <uint> [#uses=1]
281 cast uint %reg323-idxcast to long ; <long>:26 [#uses=1]
282 %reg370 = getelementptr int* %weight, long %26 ; <int*> [#uses=1]
283 %reg617-idxcast = cast int %reg617 to uint ; <uint> [#uses=1]
284 cast uint %reg617-idxcast to long ; <long>:27 [#uses=1]
285 %reg377 = getelementptr int* %heap, long %27 ; <int*> [#uses=1]
286 %reg378 = load int* %reg377 ; <int> [#uses=2]
287 %reg378-idxcast = cast int %reg378 to uint ; <uint> [#uses=1]
288 cast uint %reg378-idxcast to long ; <long>:28 [#uses=1]
289 %reg385 = getelementptr int* %weight, long %28 ; <int*> [#uses=1]
290 %reg386 = load int* %reg370 ; <int> [#uses=1]
291 %reg387 = load int* %reg385 ; <int> [#uses=1]
292 %cond769 = setlt int %reg386, %reg387 ; <bool> [#uses=1]
293 br bool %cond769, label %bb26, label %bb25
296 %reg615-idxcast = cast int %reg615 to uint ; <uint> [#uses=1]
297 cast uint %reg615-idxcast to long ; <long>:29 [#uses=1]
298 %reg394 = getelementptr int* %heap, long %29 ; <int*> [#uses=1]
299 store int %reg378, int* %reg394
300 %reg619 = shl int %reg617, ubyte 1 ; <int> [#uses=2]
301 %cond770 = setle int %reg619, %reg613 ; <bool> [#uses=1]
302 br bool %cond770, label %bb21, label %bb26
305 %reg620 = phi int [ %reg617, %bb25 ], [ %reg615, %bb24 ], [ 1, %bb20 ] ; <int> [#uses=1]
306 %reg620-idxcast = cast int %reg620 to uint ; <uint> [#uses=1]
307 cast uint %reg620-idxcast to long ; <long>:30 [#uses=1]
308 %reg409 = getelementptr int* %heap, long %30 ; <int*> [#uses=1]
309 store int %reg323, int* %reg409
310 %reg621 = add uint %reg604, 1 ; <uint> [#uses=5]
311 %reg113-idxcast = cast int %reg113 to uint ; <uint> [#uses=1]
312 cast uint %reg113-idxcast to long ; <long>:31 [#uses=1]
313 %reg416 = getelementptr int* %parent, long %31 ; <int*> [#uses=1]
314 %reg114-idxcast = cast int %reg114 to uint ; <uint> [#uses=1]
315 cast uint %reg114-idxcast to long ; <long>:32 [#uses=1]
316 %reg423 = getelementptr int* %parent, long %32 ; <int*> [#uses=1]
317 %cast889 = cast uint %reg621 to int ; <int> [#uses=1]
318 store int %cast889, int* %reg423
319 %cast890 = cast uint %reg621 to int ; <int> [#uses=1]
320 store int %cast890, int* %reg416
321 %reg604-offset = add uint %reg604, 1 ; <uint> [#uses=1]
322 cast uint %reg604-offset to long ; <long>:33 [#uses=1]
323 %reg431 = getelementptr int* %weight, long %33 ; <int*> [#uses=1]
324 %reg113-idxcast2 = cast int %reg113 to uint ; <uint> [#uses=1]
325 cast uint %reg113-idxcast2 to long ; <long>:34 [#uses=1]
326 %reg4381 = getelementptr int* %weight, long %34 ; <int*> [#uses=1]
327 %reg439 = load int* %reg4381 ; <int> [#uses=2]
328 %reg440 = and int %reg439, -256 ; <int> [#uses=1]
329 %reg114-idxcast2 = cast int %reg114 to uint ; <uint> [#uses=1]
330 cast uint %reg114-idxcast2 to long ; <long>:35 [#uses=1]
331 %reg4471 = getelementptr int* %weight, long %35 ; <int*> [#uses=1]
332 %reg448 = load int* %reg4471 ; <int> [#uses=2]
333 %reg449 = and int %reg448, -256 ; <int> [#uses=1]
334 %reg450 = add int %reg440, %reg449 ; <int> [#uses=1]
335 %reg460 = and int %reg439, 255 ; <int> [#uses=2]
336 %reg451 = and int %reg448, 255 ; <int> [#uses=2]
337 %cond771 = setge int %reg451, %reg460 ; <bool> [#uses=1]
338 br bool %cond771, label %bb28, label %bb27
344 %reg623 = phi int [ %reg460, %bb27 ], [ %reg451, %bb26 ] ; <int> [#uses=1]
345 %reg469 = add int %reg623, 1 ; <int> [#uses=1]
346 %reg470 = or int %reg450, %reg469 ; <int> [#uses=1]
347 store int %reg470, int* %reg431
348 %reg604-offset1 = add uint %reg604, 1 ; <uint> [#uses=1]
349 cast uint %reg604-offset1 to long ; <long>:36 [#uses=1]
350 %reg4771 = getelementptr int* %parent, long %36 ; <int*> [#uses=1]
351 store int -1, int* %reg4771
352 %reg624 = add int %reg613, 1 ; <int> [#uses=2]
353 %reg603-idxcast2 = cast int %reg603 to uint ; <uint> [#uses=1]
354 %reg603-idxcast2-offset = add uint %reg603-idxcast2, 1073741823 ; <uint> [#uses=1]
355 cast uint %reg603-idxcast2-offset to long ; <long>:37 [#uses=1]
356 %reg485 = getelementptr int* %heap, long %37 ; <int*> [#uses=1]
357 %cast902 = cast uint %reg621 to int ; <int> [#uses=1]
358 store int %cast902, int* %reg485
362 %reg625-idxcast = cast int %reg625 to uint ; <uint> [#uses=1]
363 cast uint %reg625-idxcast to long ; <long>:38 [#uses=1]
364 %reg526 = getelementptr int* %heap, long %38 ; <int*> [#uses=1]
365 store int %reg510, int* %reg526
369 %reg625 = phi int [ %reg502, %bb29 ], [ %reg624, %bb28 ] ; <int> [#uses=3]
370 %reg604-offset2 = add uint %reg604, 1 ; <uint> [#uses=1]
371 cast uint %reg604-offset2 to long ; <long>:39 [#uses=1]
372 %reg501 = getelementptr int* %weight, long %39 ; <int*> [#uses=1]
373 %reg502 = shr int %reg625, ubyte 1 ; <int> [#uses=2]
374 %reg502-idxcast = cast int %reg502 to uint ; <uint> [#uses=1]
375 cast uint %reg502-idxcast to long ; <long>:40 [#uses=1]
376 %reg509 = getelementptr int* %heap, long %40 ; <int*> [#uses=1]
377 %reg510 = load int* %reg509 ; <int> [#uses=2]
378 %reg510-idxcast = cast int %reg510 to uint ; <uint> [#uses=1]
379 cast uint %reg510-idxcast to long ; <long>:41 [#uses=1]
380 %reg517 = getelementptr int* %weight, long %41 ; <int*> [#uses=1]
381 %reg518 = load int* %reg501 ; <int> [#uses=1]
382 %reg519 = load int* %reg517 ; <int> [#uses=1]
383 %cond772 = setlt int %reg518, %reg519 ; <bool> [#uses=1]
384 br bool %cond772, label %bb29, label %bb31
387 %reg625-idxcast1 = cast int %reg625 to uint ; <uint> [#uses=1]
388 cast uint %reg625-idxcast1 to long ; <long>:42 [#uses=1]
389 %reg542 = getelementptr int* %heap, long %42 ; <int*> [#uses=1]
390 %cast916 = cast uint %reg621 to int ; <int> [#uses=1]
391 store int %cast916, int* %reg542
392 %cond773 = setgt int %reg624, 1 ; <bool> [#uses=1]
393 br bool %cond773, label %bb14, label %bb32
396 %reg627 = phi uint [ %reg621, %bb31 ], [ %cast918, %bb13 ] ; <uint> [#uses=1]
397 %cast919 = cast uint %reg627 to int ; <int> [#uses=1]
398 %cond774 = setle int %cast919, 515 ; <bool> [#uses=1]
399 br bool %cond774, label %bb34, label %bb33
402 cast uint 0 to long ; <long>:43 [#uses=1]
403 cast uint 0 to long ; <long>:44 [#uses=1]
404 %cast785 = getelementptr [21 x sbyte]* %.LC1, long %43, long %44 ; <sbyte*> [#uses=1]
405 call void %panic( sbyte* %cast785 )
409 %cond775 = setgt int 1, %reg109 ; <bool> [#uses=1]
410 br bool %cond775, label %bb40, label %bb35
413 %reg629 = phi ubyte [ %reg639, %bb39 ], [ 0, %bb34 ] ; <ubyte> [#uses=1]
414 %cann-indvar = phi uint [ 0, %bb34 ], [ %add1-indvar, %bb39 ] ; <uint> [#uses=4]
415 %cann-indvar-casted = cast uint %cann-indvar to int ; <int> [#uses=1]
416 %reg630 = add int %cann-indvar-casted, 1 ; <int> [#uses=2]
417 %add1-indvar = add uint %cann-indvar, 1 ; <uint> [#uses=1]
418 %cann-indvar-offset1 = add uint %cann-indvar, 1 ; <uint> [#uses=1]
419 cast uint %cann-indvar-offset1 to long ; <long>:45 [#uses=1]
420 %reg589 = getelementptr int* %parent, long %45 ; <int*> [#uses=1]
421 %reg590 = load int* %reg589 ; <int> [#uses=1]
422 %cond776 = setlt int %reg590, 0 ; <bool> [#uses=1]
423 %parent-idxcast = cast int* %parent to uint ; <uint> [#uses=1]
424 %cast948 = cast int %reg630 to uint ; <uint> [#uses=1]
425 br bool %cond776, label %bb37, label %bb36
428 %reg632 = phi uint [ %reg634, %bb36 ], [ %cast948, %bb35 ] ; <uint> [#uses=1]
429 %reg633 = phi uint [ %reg635, %bb36 ], [ 0, %bb35 ] ; <uint> [#uses=3]
430 %reg633-casted = cast uint %reg633 to sbyte* ; <sbyte*> [#uses=0]
431 %reg631-scale = mul uint %reg633, 0 ; <uint> [#uses=1]
432 %reg631-scale = cast uint %reg631-scale to sbyte* ; <sbyte*> [#uses=1]
433 cast uint %parent-idxcast to long ; <long>:46 [#uses=1]
434 %reg6311 = getelementptr sbyte* %reg631-scale, long %46 ; <sbyte*> [#uses=2]
435 %reg632-scale = mul uint %reg632, 4 ; <uint> [#uses=1]
436 cast uint %reg632-scale to long ; <long>:47 [#uses=1]
437 %reg5581 = getelementptr sbyte* %reg6311, long %47 ; <sbyte*> [#uses=1]
438 %cast924 = cast sbyte* %reg5581 to uint* ; <uint*> [#uses=1]
439 %reg634 = load uint* %cast924 ; <uint> [#uses=2]
440 %reg635 = add uint %reg633, 1 ; <uint> [#uses=2]
441 %reg634-scale = mul uint %reg634, 4 ; <uint> [#uses=1]
442 cast uint %reg634-scale to long ; <long>:48 [#uses=1]
443 %reg5501 = getelementptr sbyte* %reg6311, long %48 ; <sbyte*> [#uses=1]
444 %cast925 = cast sbyte* %reg5501 to int* ; <int*> [#uses=1]
445 %reg551 = load int* %cast925 ; <int> [#uses=1]
446 %cond777 = setge int %reg551, 0 ; <bool> [#uses=1]
447 br bool %cond777, label %bb36, label %bb37
450 %reg637 = phi uint [ %reg635, %bb36 ], [ 0, %bb35 ] ; <uint> [#uses=2]
451 %cast928 = cast uint %reg637 to int ; <int> [#uses=1]
452 %cann-indvar-offset = add uint %cann-indvar, 1 ; <uint> [#uses=1]
453 cast uint %cann-indvar-offset to long ; <long>:49 [#uses=1]
454 %reg561 = getelementptr ubyte* %reg107, long %49 ; <ubyte*> [#uses=1]
455 cast uint 4294967295 to long ; <long>:50 [#uses=1]
456 %reg778 = getelementptr ubyte* %reg561, long %50 ; <ubyte*> [#uses=1]
457 %cast788 = cast uint %reg637 to ubyte ; <ubyte> [#uses=1]
458 store ubyte %cast788, ubyte* %reg778
459 %cond779 = setle int %cast928, %reg110 ; <bool> [#uses=1]
460 br bool %cond779, label %bb39, label %bb38
466 %reg639 = phi ubyte [ 1, %bb38 ], [ %reg629, %bb37 ] ; <ubyte> [#uses=2]
467 %reg640 = add int %reg630, 1 ; <int> [#uses=1]
468 %cond780 = setle int %reg640, %reg109 ; <bool> [#uses=1]
469 br bool %cond780, label %bb35, label %bb40
472 %reg641 = phi ubyte [ %reg639, %bb39 ], [ 0, %bb34 ] ; <ubyte> [#uses=1]
473 %cond781 = seteq ubyte %reg641, 0 ; <bool> [#uses=1]
474 br bool %cond781, label %bb44, label %bb41
477 %cond782 = setge int 1, %reg109 ; <bool> [#uses=1]
478 br bool %cond782, label %bb6, label %bb42
481 %cann-indvar2 = phi int [ 0, %bb41 ], [ %add1-indvar2, %bb42 ] ; <int> [#uses=3]
482 %reg643 = add int %cann-indvar2, 1 ; <int> [#uses=1]
483 %add1-indvar2 = add int %cann-indvar2, 1 ; <int> [#uses=1]
484 %cann-indvar2-idxcast = cast int %cann-indvar2 to uint ; <uint> [#uses=1]
485 %cann-indvar2-idxcast-offset = add uint %cann-indvar2-idxcast, 1 ; <uint> [#uses=1]
486 cast uint %cann-indvar2-idxcast-offset to long ; <long>:51 [#uses=1]
487 %reg569 = getelementptr int* %weight, long %51 ; <int*> [#uses=2]
488 %reg570 = load int* %reg569 ; <int> [#uses=2]
489 %reg644 = shr int %reg570, ubyte 8 ; <int> [#uses=1]
490 %reg572 = shr int %reg570, ubyte 31 ; <int> [#uses=1]
491 %cast933 = cast int %reg572 to uint ; <uint> [#uses=1]
492 %reg573 = shr uint %cast933, ubyte 31 ; <uint> [#uses=1]
493 %cast934 = cast uint %reg573 to int ; <int> [#uses=1]
494 %reg574 = add int %reg644, %cast934 ; <int> [#uses=1]
495 %reg571 = shr int %reg574, ubyte 1 ; <int> [#uses=1]
496 %reg645 = add int %reg571, 1 ; <int> [#uses=1]
497 %reg582 = shl int %reg645, ubyte 8 ; <int> [#uses=1]
498 store int %reg582, int* %reg569
499 %reg646 = add int %reg643, 1 ; <int> [#uses=1]
500 %cond783 = setlt int %reg646, %reg109 ; <bool> [#uses=1]
501 br bool %cond783, label %bb42, label %bb43
510 declare void %panic(sbyte*)