1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
4 %struct.gs_matrix = type { float, int, float, int, float, int, float, int, float, int, float, int }
5 %struct.gx_bitmap = type { ubyte*, int, int, int }
6 %struct.gx_device = type { int, %struct.gx_device_procs*, sbyte*, int, int, float, float, int, ushort, int, int }
7 %struct.gx_device_memory = type { int, %struct.gx_device_procs*, sbyte*, int, int, float, float, int, ushort, int, int, %struct.gs_matrix, int, ubyte*, ubyte**, int (%struct.gx_device_memory*, int, int, int, int, int)*, int, int, ubyte* }
8 %struct.gx_device_procs = type { int (%struct.gx_device*)*, void (%struct.gx_device*, %struct.gs_matrix*)*, int (%struct.gx_device*)*, int (%struct.gx_device*)*, int (%struct.gx_device*)*, uint (%struct.gx_device*, ushort, ushort, ushort)*, int (%struct.gx_device*, uint, ushort*)*, int (%struct.gx_device*, int, int, int, int, uint)*, int (%struct.gx_device*, %struct.gx_bitmap*, int, int, int, int, uint, uint)*, int (%struct.gx_device*, ubyte*, int, int, int, int, int, int, uint, uint)*, int (%struct.gx_device*, ubyte*, int, int, int, int, int, int)*, int (%struct.gx_device*, int, int, int, int, uint)*, int (%struct.gx_device*, int, int, int, int, int, int, uint)*, int (%struct.gx_device*, %struct.gx_bitmap*, int, int, int, int, int, int, uint, uint)* }
10 implementation ; Functions:
12 int %mem_mono_copy_mono(%struct.gx_device* %dev, ubyte* %base, int %sourcex, int %raster, int %x, int %y, int %w, int %h, uint %zero, uint %one) {
14 %raster = cast int %raster to uint ; <uint> [#uses=3]
15 %tmp = seteq uint %one, %zero ; <bool> [#uses=1]
16 br bool %tmp, label %cond_true, label %cond_next
18 cond_true: ; preds = %entry
19 %tmp6 = tail call int %mem_mono_fill_rectangle( %struct.gx_device* %dev, int %x, int %y, int %w, int %h, uint %zero ) ; <int> [#uses=1]
22 cond_next: ; preds = %entry
23 %tmp8 = cast %struct.gx_device* %dev to %struct.gx_device_memory* ; <%struct.gx_device_memory*> [#uses=6]
24 %tmp = getelementptr %struct.gx_device_memory* %tmp8, int 0, uint 15 ; <int (%struct.gx_device_memory*, int, int, int, int, int)**> [#uses=1]
25 %tmp = load int (%struct.gx_device_memory*, int, int, int, int, int)** %tmp ; <int (%struct.gx_device_memory*, int, int, int, int, int)*> [#uses=2]
26 %tmp9 = seteq int (%struct.gx_device_memory*, int, int, int, int, int)* %tmp, %mem_no_fault_proc ; <bool> [#uses=1]
27 br bool %tmp9, label %cond_next46, label %cond_true10
29 cond_true10: ; preds = %cond_next
30 %tmp16 = add int %x, 7 ; <int> [#uses=1]
31 %tmp17 = add int %tmp16, %w ; <int> [#uses=1]
32 %tmp18 = shr int %tmp17, ubyte 3 ; <int> [#uses=1]
33 %tmp20 = shr int %x, ubyte 3 ; <int> [#uses=2]
34 %tmp21 = sub int %tmp18, %tmp20 ; <int> [#uses=1]
35 %tmp27 = tail call int %tmp( %struct.gx_device_memory* %tmp8, int %tmp20, int %y, int %tmp21, int %h, int 1 ) ; <int> [#uses=2]
36 %tmp29 = setlt int %tmp27, 0 ; <bool> [#uses=1]
37 br bool %tmp29, label %cond_true30, label %cond_next46
39 cond_true30: ; preds = %cond_true10
40 %tmp41 = tail call int %mem_copy_mono_recover( %struct.gx_device* %dev, ubyte* %base, int %sourcex, int %raster, int %x, int %y, int %w, int %h, uint %zero, uint %one, int %tmp27 ) ; <int> [#uses=1]
43 cond_next46: ; preds = %cond_true10, %cond_next
44 %tmp48 = setgt int %w, 0 ; <bool> [#uses=1]
45 %tmp53 = setgt int %h, 0 ; <bool> [#uses=1]
46 %bothcond = and bool %tmp53, %tmp48 ; <bool> [#uses=1]
47 br bool %bothcond, label %bb58, label %return
49 bb58: ; preds = %cond_next46
50 %tmp60 = setlt int %x, 0 ; <bool> [#uses=1]
51 br bool %tmp60, label %return, label %cond_next63
53 cond_next63: ; preds = %bb58
54 %tmp65 = getelementptr %struct.gx_device_memory* %tmp8, int 0, uint 3 ; <int*> [#uses=1]
55 %tmp66 = load int* %tmp65 ; <int> [#uses=1]
56 %tmp68 = sub int %tmp66, %w ; <int> [#uses=1]
57 %tmp70 = setlt int %tmp68, %x ; <bool> [#uses=1]
58 %tmp75 = setlt int %y, 0 ; <bool> [#uses=1]
59 %bothcond1 = or bool %tmp70, %tmp75 ; <bool> [#uses=1]
60 br bool %bothcond1, label %return, label %cond_next78
62 cond_next78: ; preds = %cond_next63
63 %tmp80 = getelementptr %struct.gx_device_memory* %tmp8, int 0, uint 4 ; <int*> [#uses=1]
64 %tmp81 = load int* %tmp80 ; <int> [#uses=1]
65 %tmp83 = sub int %tmp81, %h ; <int> [#uses=1]
66 %tmp85 = setlt int %tmp83, %y ; <bool> [#uses=1]
67 br bool %tmp85, label %return, label %bb91
69 bb91: ; preds = %cond_next78
70 %tmp93 = shr int %x, ubyte 3 ; <int> [#uses=4]
71 %tmp = getelementptr %struct.gx_device_memory* %tmp8, int 0, uint 14 ; <ubyte***> [#uses=1]
72 %tmp = load ubyte*** %tmp ; <ubyte**> [#uses=1]
73 %tmp96 = getelementptr ubyte** %tmp, int %y ; <ubyte**> [#uses=4]
74 %tmp98 = load ubyte** %tmp96 ; <ubyte*> [#uses=1]
75 %tmp100 = getelementptr ubyte* %tmp98, int %tmp93 ; <ubyte*> [#uses=3]
76 %tmp102 = shr int %sourcex, ubyte 3 ; <int> [#uses=3]
77 %tmp106 = and int %sourcex, 7 ; <int> [#uses=1]
78 %tmp107 = sub int 8, %tmp106 ; <int> [#uses=4]
79 %tmp109 = and int %x, 7 ; <int> [#uses=3]
80 %tmp110 = sub int 8, %tmp109 ; <int> [#uses=8]
81 %tmp112 = sub int 8, %tmp110 ; <int> [#uses=1]
82 %tmp112 = cast int %tmp112 to ubyte ; <ubyte> [#uses=1]
83 %tmp113464 = shr uint 255, ubyte %tmp112 ; <uint> [#uses=4]
84 %tmp116 = setgt int %tmp110, %w ; <bool> [#uses=1]
85 %tmp132 = getelementptr %struct.gx_device_memory* %tmp8, int 0, uint 16 ; <int*> [#uses=2]
86 br bool %tmp116, label %cond_true117, label %cond_false123
88 cond_true117: ; preds = %bb91
89 %tmp119 = cast int %w to ubyte ; <ubyte> [#uses=1]
90 %tmp120 = shr uint %tmp113464, ubyte %tmp119 ; <uint> [#uses=1]
91 %tmp122 = sub uint %tmp113464, %tmp120 ; <uint> [#uses=2]
92 %tmp13315 = load int* %tmp132 ; <int> [#uses=1]
93 %tmp13416 = seteq int %tmp13315, 0 ; <bool> [#uses=1]
94 br bool %tmp13416, label %cond_next151, label %cond_true135
96 cond_false123: ; preds = %bb91
97 %tmp126 = sub int %w, %tmp110 ; <int> [#uses=1]
98 %tmp126 = cast int %tmp126 to ubyte ; <ubyte> [#uses=1]
99 %tmp127 = and ubyte %tmp126, 7 ; <ubyte> [#uses=1]
100 %tmp128 = shr uint 255, ubyte %tmp127 ; <uint> [#uses=1]
101 %tmp1295 = sub uint 255, %tmp128 ; <uint> [#uses=2]
102 %tmp133 = load int* %tmp132 ; <int> [#uses=1]
103 %tmp134 = seteq int %tmp133, 0 ; <bool> [#uses=1]
104 br bool %tmp134, label %cond_next151, label %cond_true135
106 cond_true135: ; preds = %cond_false123, %cond_true117
107 %rmask.0.0 = phi uint [ undef, %cond_true117 ], [ %tmp1295, %cond_false123 ] ; <uint> [#uses=2]
108 %mask.1.0 = phi uint [ %tmp122, %cond_true117 ], [ %tmp113464, %cond_false123 ] ; <uint> [#uses=2]
109 %not.tmp137 = setne uint %zero, 4294967295 ; <bool> [#uses=1]
110 %tmp140 = cast bool %not.tmp137 to uint ; <uint> [#uses=1]
111 %zero_addr.0 = xor uint %tmp140, %zero ; <uint> [#uses=2]
112 %tmp144 = seteq uint %one, 4294967295 ; <bool> [#uses=1]
113 br bool %tmp144, label %cond_next151, label %cond_true145
115 cond_true145: ; preds = %cond_true135
116 %tmp147 = xor uint %one, 1 ; <uint> [#uses=1]
117 br label %cond_next151
119 cond_next151: ; preds = %cond_true145, %cond_true135, %cond_false123, %cond_true117
120 %rmask.0.1 = phi uint [ %rmask.0.0, %cond_true145 ], [ undef, %cond_true117 ], [ %tmp1295, %cond_false123 ], [ %rmask.0.0, %cond_true135 ] ; <uint> [#uses=4]
121 %mask.1.1 = phi uint [ %mask.1.0, %cond_true145 ], [ %tmp122, %cond_true117 ], [ %tmp113464, %cond_false123 ], [ %mask.1.0, %cond_true135 ] ; <uint> [#uses=4]
122 %one_addr.0 = phi uint [ %tmp147, %cond_true145 ], [ %one, %cond_true117 ], [ %one, %cond_false123 ], [ %one, %cond_true135 ] ; <uint> [#uses=2]
123 %zero_addr.1 = phi uint [ %zero_addr.0, %cond_true145 ], [ %zero, %cond_true117 ], [ %zero, %cond_false123 ], [ %zero_addr.0, %cond_true135 ] ; <uint> [#uses=2]
124 %tmp153 = seteq uint %zero_addr.1, 1 ; <bool> [#uses=2]
125 %tmp158 = seteq uint %one_addr.0, 0 ; <bool> [#uses=2]
126 %bothcond2 = or bool %tmp153, %tmp158 ; <bool> [#uses=1]
127 %iftmp.35.0 = select bool %bothcond2, uint 4294967295, uint 0 ; <uint> [#uses=8]
128 %tmp167 = seteq uint %zero_addr.1, 0 ; <bool> [#uses=1]
129 %bothcond3 = or bool %tmp167, %tmp158 ; <bool> [#uses=1]
130 %iftmp.36.0 = select bool %bothcond3, uint 0, uint 4294967295 ; <uint> [#uses=4]
131 %tmp186 = seteq uint %one_addr.0, 1 ; <bool> [#uses=1]
132 %bothcond4 = or bool %tmp153, %tmp186 ; <bool> [#uses=1]
133 %iftmp.37.0 = select bool %bothcond4, uint 4294967295, uint 0 ; <uint> [#uses=6]
134 %tmp196 = seteq int %tmp107, %tmp110 ; <bool> [#uses=1]
135 br bool %tmp196, label %cond_true197, label %cond_false299
137 cond_true197: ; preds = %cond_next151
138 %tmp29222 = add int %h, -1 ; <int> [#uses=3]
139 %tmp29424 = setlt int %tmp29222, 0 ; <bool> [#uses=1]
140 br bool %tmp29424, label %return, label %cond_true295.preheader
142 cond_true249.preheader: ; preds = %cond_true295
143 br label %cond_true249
145 cond_true249: ; preds = %cond_true249, %cond_true249.preheader
146 %indvar = phi uint [ 0, %cond_true249.preheader ], [ %indvar.next, %cond_true249 ] ; <uint> [#uses=2]
147 %optr.3.2 = phi ubyte* [ %tmp232, %cond_true249 ], [ %dest.1.0, %cond_true249.preheader ] ; <ubyte*> [#uses=1]
148 %bptr.3.2 = phi ubyte* [ %tmp226, %cond_true249 ], [ %line.1.0, %cond_true249.preheader ] ; <ubyte*> [#uses=1]
149 %tmp. = add int %tmp109, %w ; <int> [#uses=1]
150 %indvar = cast uint %indvar to int ; <int> [#uses=1]
151 %tmp.58 = mul int %indvar, -8 ; <int> [#uses=1]
152 %tmp.57 = add int %tmp., -16 ; <int> [#uses=1]
153 %tmp246.2 = add int %tmp.58, %tmp.57 ; <int> [#uses=1]
154 %tmp225 = cast ubyte* %bptr.3.2 to uint ; <uint> [#uses=1]
155 %tmp226 = add uint %tmp225, 1 ; <uint> [#uses=1]
156 %tmp226 = cast uint %tmp226 to ubyte* ; <ubyte*> [#uses=3]
157 %tmp228 = load ubyte* %tmp226 ; <ubyte> [#uses=1]
158 %tmp228 = cast ubyte %tmp228 to uint ; <uint> [#uses=1]
159 %tmp230 = xor uint %tmp228, %iftmp.35.0 ; <uint> [#uses=2]
160 %tmp231 = cast ubyte* %optr.3.2 to uint ; <uint> [#uses=1]
161 %tmp232 = add uint %tmp231, 1 ; <uint> [#uses=1]
162 %tmp232 = cast uint %tmp232 to ubyte* ; <ubyte*> [#uses=4]
163 %tmp235 = or uint %tmp230, %iftmp.36.0 ; <uint> [#uses=1]
164 %tmp235 = cast uint %tmp235 to ubyte ; <ubyte> [#uses=1]
165 %tmp237 = load ubyte* %tmp232 ; <ubyte> [#uses=1]
166 %tmp238 = and ubyte %tmp235, %tmp237 ; <ubyte> [#uses=1]
167 %tmp241 = and uint %tmp230, %iftmp.37.0 ; <uint> [#uses=1]
168 %tmp241 = cast uint %tmp241 to ubyte ; <ubyte> [#uses=1]
169 %tmp242 = or ubyte %tmp238, %tmp241 ; <ubyte> [#uses=1]
170 store ubyte %tmp242, ubyte* %tmp232
171 %tmp24629 = add int %tmp246.2, -8 ; <int> [#uses=2]
172 %tmp24831 = setlt int %tmp24629, 0 ; <bool> [#uses=1]
173 %indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
174 br bool %tmp24831, label %bb252.loopexit, label %cond_true249
176 bb252.loopexit: ; preds = %cond_true249
179 bb252: ; preds = %cond_true295, %bb252.loopexit
180 %optr.3.3 = phi ubyte* [ %dest.1.0, %cond_true295 ], [ %tmp232, %bb252.loopexit ] ; <ubyte*> [#uses=1]
181 %bptr.3.3 = phi ubyte* [ %line.1.0, %cond_true295 ], [ %tmp226, %bb252.loopexit ] ; <ubyte*> [#uses=1]
182 %tmp246.3 = phi int [ %tmp246, %cond_true295 ], [ %tmp24629, %bb252.loopexit ] ; <int> [#uses=1]
183 %tmp254 = setgt int %tmp246.3, -8 ; <bool> [#uses=1]
184 br bool %tmp254, label %cond_true255, label %cond_next280
186 cond_true255: ; preds = %bb252
187 %tmp256 = cast ubyte* %bptr.3.3 to uint ; <uint> [#uses=1]
188 %tmp257 = add uint %tmp256, 1 ; <uint> [#uses=1]
189 %tmp257 = cast uint %tmp257 to ubyte* ; <ubyte*> [#uses=1]
190 %tmp259 = load ubyte* %tmp257 ; <ubyte> [#uses=1]
191 %tmp259 = cast ubyte %tmp259 to uint ; <uint> [#uses=1]
192 %tmp261 = xor uint %tmp259, %iftmp.35.0 ; <uint> [#uses=2]
193 %tmp262 = cast ubyte* %optr.3.3 to uint ; <uint> [#uses=1]
194 %tmp263 = add uint %tmp262, 1 ; <uint> [#uses=1]
195 %tmp263 = cast uint %tmp263 to ubyte* ; <ubyte*> [#uses=2]
196 %tmp265 = cast uint %tmp261 to ubyte ; <ubyte> [#uses=1]
197 %tmp268 = or ubyte %tmp266, %tmp265 ; <ubyte> [#uses=1]
198 %tmp270 = load ubyte* %tmp263 ; <ubyte> [#uses=1]
199 %tmp271 = and ubyte %tmp268, %tmp270 ; <ubyte> [#uses=1]
200 %tmp276 = and uint %tmp274, %tmp261 ; <uint> [#uses=1]
201 %tmp276 = cast uint %tmp276 to ubyte ; <ubyte> [#uses=1]
202 %tmp277 = or ubyte %tmp271, %tmp276 ; <ubyte> [#uses=1]
203 store ubyte %tmp277, ubyte* %tmp263
204 br label %cond_next280
206 cond_next280: ; preds = %cond_true255, %bb252
207 %tmp281 = cast ubyte** %dest_line.1.0 to uint ; <uint> [#uses=1]
208 %tmp282 = add uint %tmp281, 4 ; <uint> [#uses=1]
209 %tmp282 = cast uint %tmp282 to ubyte** ; <ubyte**> [#uses=2]
210 %tmp284 = load ubyte** %tmp282 ; <ubyte*> [#uses=1]
211 %tmp286 = getelementptr ubyte* %tmp284, int %tmp93 ; <ubyte*> [#uses=1]
212 %tmp292 = add int %tmp292.0, -1 ; <int> [#uses=1]
213 %tmp294 = setlt int %tmp292, 0 ; <bool> [#uses=1]
214 %indvar.next61 = add uint %indvar60, 1 ; <uint> [#uses=1]
215 br bool %tmp294, label %return.loopexit, label %cond_true295
217 cond_true295.preheader: ; preds = %cond_true197
218 %tmp200 = sub int %w, %tmp110 ; <int> [#uses=1]
219 %tmp209 = cast uint %mask.1.1 to ubyte ; <ubyte> [#uses=1]
220 %tmp209not = xor ubyte %tmp209, 255 ; <ubyte> [#uses=1]
221 %tmp212 = cast uint %iftmp.36.0 to ubyte ; <ubyte> [#uses=2]
222 %tmp211 = or ubyte %tmp212, %tmp209not ; <ubyte> [#uses=2]
223 %tmp219 = and uint %iftmp.37.0, %mask.1.1 ; <uint> [#uses=2]
224 %tmp246 = add int %tmp200, -8 ; <int> [#uses=3]
225 %tmp248 = setlt int %tmp246, 0 ; <bool> [#uses=1]
226 %tmp264 = cast uint %rmask.0.1 to ubyte ; <ubyte> [#uses=1]
227 %tmp264not = xor ubyte %tmp264, 255 ; <ubyte> [#uses=1]
228 %tmp266 = or ubyte %tmp212, %tmp264not ; <ubyte> [#uses=2]
229 %tmp274 = and uint %iftmp.37.0, %rmask.0.1 ; <uint> [#uses=2]
230 br bool %tmp248, label %cond_true295.preheader.split.us, label %cond_true295.preheader.split
232 cond_true295.preheader.split.us: ; preds = %cond_true295.preheader
233 br label %cond_true295.us
235 cond_true295.us: ; preds = %cond_next280.us, %cond_true295.preheader.split.us
236 %indvar86 = phi uint [ 0, %cond_true295.preheader.split.us ], [ %indvar.next87, %cond_next280.us ] ; <uint> [#uses=3]
237 %dest.1.0.us = phi ubyte* [ %tmp286.us, %cond_next280.us ], [ %tmp100, %cond_true295.preheader.split.us ] ; <ubyte*> [#uses=3]
238 %dest_line.1.0.us = phi ubyte** [ %tmp282.us, %cond_next280.us ], [ %tmp96, %cond_true295.preheader.split.us ] ; <ubyte**> [#uses=1]
239 %tmp.89 = sub uint 0, %indvar86 ; <uint> [#uses=1]
240 %tmp.89 = cast uint %tmp.89 to int ; <int> [#uses=1]
241 %tmp292.0.us = add int %tmp.89, %tmp29222 ; <int> [#uses=1]
242 %tmp.91 = mul uint %indvar86, %raster ; <uint> [#uses=1]
243 %tmp.91 = cast uint %tmp.91 to int ; <int> [#uses=1]
244 %tmp104.sum101 = add int %tmp102, %tmp.91 ; <int> [#uses=1]
245 %line.1.0.us = getelementptr ubyte* %base, int %tmp104.sum101 ; <ubyte*> [#uses=2]
246 %tmp.us = load ubyte* %line.1.0.us ; <ubyte> [#uses=1]
247 %tmp206.us = cast ubyte %tmp.us to uint ; <uint> [#uses=1]
248 %tmp208.us = xor uint %tmp206.us, %iftmp.35.0 ; <uint> [#uses=2]
249 %tmp210.us = cast uint %tmp208.us to ubyte ; <ubyte> [#uses=1]
250 %tmp213.us = or ubyte %tmp211, %tmp210.us ; <ubyte> [#uses=1]
251 %tmp215.us = load ubyte* %dest.1.0.us ; <ubyte> [#uses=1]
252 %tmp216.us = and ubyte %tmp213.us, %tmp215.us ; <ubyte> [#uses=1]
253 %tmp221.us = and uint %tmp219, %tmp208.us ; <uint> [#uses=1]
254 %tmp221.us = cast uint %tmp221.us to ubyte ; <ubyte> [#uses=1]
255 %tmp222.us = or ubyte %tmp216.us, %tmp221.us ; <ubyte> [#uses=1]
256 store ubyte %tmp222.us, ubyte* %dest.1.0.us
257 br bool true, label %bb252.us, label %cond_true249.preheader.us
259 cond_next280.us: ; preds = %bb252.us, %cond_true255.us
260 %tmp281.us = cast ubyte** %dest_line.1.0.us to uint ; <uint> [#uses=1]
261 %tmp282.us = add uint %tmp281.us, 4 ; <uint> [#uses=1]
262 %tmp282.us = cast uint %tmp282.us to ubyte** ; <ubyte**> [#uses=2]
263 %tmp284.us = load ubyte** %tmp282.us ; <ubyte*> [#uses=1]
264 %tmp286.us = getelementptr ubyte* %tmp284.us, int %tmp93 ; <ubyte*> [#uses=1]
265 %tmp292.us = add int %tmp292.0.us, -1 ; <int> [#uses=1]
266 %tmp294.us = setlt int %tmp292.us, 0 ; <bool> [#uses=1]
267 %indvar.next87 = add uint %indvar86, 1 ; <uint> [#uses=1]
268 br bool %tmp294.us, label %return.loopexit.us, label %cond_true295.us
270 cond_true255.us: ; preds = %bb252.us
271 %tmp256.us = cast ubyte* %bptr.3.3.us to uint ; <uint> [#uses=1]
272 %tmp257.us = add uint %tmp256.us, 1 ; <uint> [#uses=1]
273 %tmp257.us = cast uint %tmp257.us to ubyte* ; <ubyte*> [#uses=1]
274 %tmp259.us = load ubyte* %tmp257.us ; <ubyte> [#uses=1]
275 %tmp259.us = cast ubyte %tmp259.us to uint ; <uint> [#uses=1]
276 %tmp261.us = xor uint %tmp259.us, %iftmp.35.0 ; <uint> [#uses=2]
277 %tmp262.us = cast ubyte* %optr.3.3.us to uint ; <uint> [#uses=1]
278 %tmp263.us = add uint %tmp262.us, 1 ; <uint> [#uses=1]
279 %tmp263.us = cast uint %tmp263.us to ubyte* ; <ubyte*> [#uses=2]
280 %tmp265.us = cast uint %tmp261.us to ubyte ; <ubyte> [#uses=1]
281 %tmp268.us = or ubyte %tmp266, %tmp265.us ; <ubyte> [#uses=1]
282 %tmp270.us = load ubyte* %tmp263.us ; <ubyte> [#uses=1]
283 %tmp271.us = and ubyte %tmp268.us, %tmp270.us ; <ubyte> [#uses=1]
284 %tmp276.us = and uint %tmp274, %tmp261.us ; <uint> [#uses=1]
285 %tmp276.us = cast uint %tmp276.us to ubyte ; <ubyte> [#uses=1]
286 %tmp277.us = or ubyte %tmp271.us, %tmp276.us ; <ubyte> [#uses=1]
287 store ubyte %tmp277.us, ubyte* %tmp263.us
288 br label %cond_next280.us
290 bb252.us: ; preds = %bb252.loopexit.us, %cond_true295.us
291 %optr.3.3.us = phi ubyte* [ %dest.1.0.us, %cond_true295.us ], [ undef, %bb252.loopexit.us ] ; <ubyte*> [#uses=1]
292 %bptr.3.3.us = phi ubyte* [ %line.1.0.us, %cond_true295.us ], [ undef, %bb252.loopexit.us ] ; <ubyte*> [#uses=1]
293 %tmp246.3.us = phi int [ %tmp246, %cond_true295.us ], [ undef, %bb252.loopexit.us ] ; <int> [#uses=1]
294 %tmp254.us = setgt int %tmp246.3.us, -8 ; <bool> [#uses=1]
295 br bool %tmp254.us, label %cond_true255.us, label %cond_next280.us
297 cond_true249.us: ; preds = %cond_true249.preheader.us, %cond_true249.us
298 br bool undef, label %bb252.loopexit.us, label %cond_true249.us
300 cond_true249.preheader.us: ; preds = %cond_true295.us
301 br label %cond_true249.us
303 bb252.loopexit.us: ; preds = %cond_true249.us
306 return.loopexit.us: ; preds = %cond_next280.us
307 br label %return.loopexit.split
309 cond_true295.preheader.split: ; preds = %cond_true295.preheader
310 br label %cond_true295
312 cond_true295: ; preds = %cond_true295.preheader.split, %cond_next280
313 %indvar60 = phi uint [ 0, %cond_true295.preheader.split ], [ %indvar.next61, %cond_next280 ] ; <uint> [#uses=3]
314 %dest.1.0 = phi ubyte* [ %tmp286, %cond_next280 ], [ %tmp100, %cond_true295.preheader.split ] ; <ubyte*> [#uses=4]
315 %dest_line.1.0 = phi ubyte** [ %tmp282, %cond_next280 ], [ %tmp96, %cond_true295.preheader.split ] ; <ubyte**> [#uses=1]
316 %tmp.63 = sub uint 0, %indvar60 ; <uint> [#uses=1]
317 %tmp.63 = cast uint %tmp.63 to int ; <int> [#uses=1]
318 %tmp292.0 = add int %tmp.63, %tmp29222 ; <int> [#uses=1]
319 %tmp.65 = mul uint %indvar60, %raster ; <uint> [#uses=1]
320 %tmp.65 = cast uint %tmp.65 to int ; <int> [#uses=1]
321 %tmp104.sum97 = add int %tmp102, %tmp.65 ; <int> [#uses=1]
322 %line.1.0 = getelementptr ubyte* %base, int %tmp104.sum97 ; <ubyte*> [#uses=3]
323 %tmp = load ubyte* %line.1.0 ; <ubyte> [#uses=1]
324 %tmp206 = cast ubyte %tmp to uint ; <uint> [#uses=1]
325 %tmp208 = xor uint %tmp206, %iftmp.35.0 ; <uint> [#uses=2]
326 %tmp210 = cast uint %tmp208 to ubyte ; <ubyte> [#uses=1]
327 %tmp213 = or ubyte %tmp211, %tmp210 ; <ubyte> [#uses=1]
328 %tmp215 = load ubyte* %dest.1.0 ; <ubyte> [#uses=1]
329 %tmp216 = and ubyte %tmp213, %tmp215 ; <ubyte> [#uses=1]
330 %tmp221 = and uint %tmp219, %tmp208 ; <uint> [#uses=1]
331 %tmp221 = cast uint %tmp221 to ubyte ; <ubyte> [#uses=1]
332 %tmp222 = or ubyte %tmp216, %tmp221 ; <ubyte> [#uses=1]
333 store ubyte %tmp222, ubyte* %dest.1.0
334 br bool false, label %bb252, label %cond_true249.preheader
336 cond_false299: ; preds = %cond_next151
337 %tmp302 = sub int %tmp107, %tmp110 ; <int> [#uses=1]
338 %tmp303 = and int %tmp302, 7 ; <int> [#uses=3]
339 %tmp305 = sub int 8, %tmp303 ; <int> [#uses=1]
340 %tmp45438 = add int %h, -1 ; <int> [#uses=2]
341 %tmp45640 = setlt int %tmp45438, 0 ; <bool> [#uses=1]
342 br bool %tmp45640, label %return, label %cond_true457.preheader
344 cond_true316: ; preds = %cond_true457
345 %tmp318 = cast ubyte %tmp318 to uint ; <uint> [#uses=1]
346 %tmp320 = shr uint %tmp318, ubyte %tmp319 ; <uint> [#uses=1]
347 br label %cond_next340
349 cond_false321: ; preds = %cond_true457
350 %tmp3188 = cast ubyte %tmp318 to uint ; <uint> [#uses=1]
351 %tmp325 = shl uint %tmp3188, ubyte %tmp324 ; <uint> [#uses=2]
352 %tmp326 = cast ubyte* %line.3.0 to uint ; <uint> [#uses=1]
353 %tmp327 = add uint %tmp326, 1 ; <uint> [#uses=1]
354 %tmp327 = cast uint %tmp327 to ubyte* ; <ubyte*> [#uses=3]
355 br bool %tmp330, label %cond_true331, label %cond_next340
357 cond_true331: ; preds = %cond_false321
358 %tmp333 = load ubyte* %tmp327 ; <ubyte> [#uses=1]
359 %tmp333 = cast ubyte %tmp333 to uint ; <uint> [#uses=1]
360 %tmp335 = shr uint %tmp333, ubyte %tmp319 ; <uint> [#uses=1]
361 %tmp337 = add uint %tmp335, %tmp325 ; <uint> [#uses=1]
362 br label %cond_next340
364 cond_next340: ; preds = %cond_true331, %cond_false321, %cond_true316
365 %bits.0 = phi uint [ %tmp320, %cond_true316 ], [ %tmp337, %cond_true331 ], [ %tmp325, %cond_false321 ] ; <uint> [#uses=1]
366 %bptr307.3 = phi ubyte* [ %line.3.0, %cond_true316 ], [ %tmp327, %cond_true331 ], [ %tmp327, %cond_false321 ] ; <ubyte*> [#uses=2]
367 %tmp343 = xor uint %bits.0, %iftmp.35.0 ; <uint> [#uses=2]
368 %tmp345 = cast uint %tmp343 to ubyte ; <ubyte> [#uses=1]
369 %tmp348 = or ubyte %tmp346, %tmp345 ; <ubyte> [#uses=1]
370 %tmp350 = load ubyte* %dest.3.0 ; <ubyte> [#uses=1]
371 %tmp351 = and ubyte %tmp348, %tmp350 ; <ubyte> [#uses=1]
372 %tmp356 = and uint %tmp354, %tmp343 ; <uint> [#uses=1]
373 %tmp356 = cast uint %tmp356 to ubyte ; <ubyte> [#uses=1]
374 %tmp357 = or ubyte %tmp351, %tmp356 ; <ubyte> [#uses=1]
375 store ubyte %tmp357, ubyte* %dest.3.0
376 %tmp362 = cast ubyte* %dest.3.0 to uint ; <uint> [#uses=1]
377 %optr309.3.in51 = add uint %tmp362, 1 ; <uint> [#uses=2]
378 %optr309.353 = cast uint %optr309.3.in51 to ubyte* ; <ubyte*> [#uses=2]
379 br bool %tmp39755, label %cond_true398.preheader, label %bb401
381 cond_true398.preheader: ; preds = %cond_next340
382 br label %cond_true398
384 cond_true398: ; preds = %cond_true398, %cond_true398.preheader
385 %indvar66 = phi uint [ 0, %cond_true398.preheader ], [ %indvar.next67, %cond_true398 ] ; <uint> [#uses=3]
386 %bptr307.4.0 = phi ubyte* [ %tmp370, %cond_true398 ], [ %bptr307.3, %cond_true398.preheader ] ; <ubyte*> [#uses=2]
387 %optr309.3.0 = phi ubyte* [ %optr309.3, %cond_true398 ], [ %optr309.353, %cond_true398.preheader ] ; <ubyte*> [#uses=2]
388 %optr309.3.in.0 = add uint %indvar66, %optr309.3.in51 ; <uint> [#uses=1]
389 %tmp.70 = add int %tmp109, %w ; <int> [#uses=1]
390 %indvar66 = cast uint %indvar66 to int ; <int> [#uses=1]
391 %tmp.72 = mul int %indvar66, -8 ; <int> [#uses=1]
392 %tmp.71 = add int %tmp.70, -8 ; <int> [#uses=1]
393 %count308.3.0 = add int %tmp.72, %tmp.71 ; <int> [#uses=1]
394 %tmp366 = load ubyte* %bptr307.4.0 ; <ubyte> [#uses=1]
395 %tmp366 = cast ubyte %tmp366 to uint ; <uint> [#uses=1]
396 %tmp369 = cast ubyte* %bptr307.4.0 to uint ; <uint> [#uses=1]
397 %tmp370 = add uint %tmp369, 1 ; <uint> [#uses=1]
398 %tmp370 = cast uint %tmp370 to ubyte* ; <ubyte*> [#uses=3]
399 %tmp372 = load ubyte* %tmp370 ; <ubyte> [#uses=1]
400 %tmp372 = cast ubyte %tmp372 to uint ; <uint> [#uses=1]
401 %tmp374463 = shr uint %tmp372, ubyte %tmp319 ; <uint> [#uses=1]
402 %tmp368 = shl uint %tmp366, ubyte %tmp324 ; <uint> [#uses=1]
403 %tmp377 = add uint %tmp374463, %tmp368 ; <uint> [#uses=1]
404 %tmp379 = xor uint %tmp377, %iftmp.35.0 ; <uint> [#uses=2]
405 %tmp382 = or uint %tmp379, %iftmp.36.0 ; <uint> [#uses=1]
406 %tmp382 = cast uint %tmp382 to ubyte ; <ubyte> [#uses=1]
407 %tmp384 = load ubyte* %optr309.3.0 ; <ubyte> [#uses=1]
408 %tmp385 = and ubyte %tmp382, %tmp384 ; <ubyte> [#uses=1]
409 %tmp388 = and uint %tmp379, %iftmp.37.0 ; <uint> [#uses=1]
410 %tmp388 = cast uint %tmp388 to ubyte ; <ubyte> [#uses=1]
411 %tmp389 = or ubyte %tmp385, %tmp388 ; <ubyte> [#uses=1]
412 store ubyte %tmp389, ubyte* %optr309.3.0
413 %tmp392 = add int %count308.3.0, -8 ; <int> [#uses=2]
414 %optr309.3.in = add uint %optr309.3.in.0, 1 ; <uint> [#uses=1]
415 %optr309.3 = cast uint %optr309.3.in to ubyte* ; <ubyte*> [#uses=2]
416 %tmp397 = setgt int %tmp392, 7 ; <bool> [#uses=1]
417 %indvar.next67 = add uint %indvar66, 1 ; <uint> [#uses=1]
418 br bool %tmp397, label %cond_true398, label %bb401.loopexit
420 bb401.loopexit: ; preds = %cond_true398
423 bb401: ; preds = %bb401.loopexit, %cond_next340
424 %count308.3.1 = phi int [ %tmp361, %cond_next340 ], [ %tmp392, %bb401.loopexit ] ; <int> [#uses=2]
425 %bptr307.4.1 = phi ubyte* [ %bptr307.3, %cond_next340 ], [ %tmp370, %bb401.loopexit ] ; <ubyte*> [#uses=2]
426 %optr309.3.1 = phi ubyte* [ %optr309.353, %cond_next340 ], [ %optr309.3, %bb401.loopexit ] ; <ubyte*> [#uses=2]
427 %tmp403 = setgt int %count308.3.1, 0 ; <bool> [#uses=1]
428 br bool %tmp403, label %cond_true404, label %cond_next442
430 cond_true404: ; preds = %bb401
431 %tmp406 = load ubyte* %bptr307.4.1 ; <ubyte> [#uses=1]
432 %tmp406 = cast ubyte %tmp406 to int ; <int> [#uses=1]
433 %tmp408 = shl int %tmp406, ubyte %tmp324 ; <int> [#uses=2]
434 %tmp413 = setgt int %count308.3.1, %tmp303 ; <bool> [#uses=1]
435 br bool %tmp413, label %cond_true414, label %cond_next422
437 cond_true414: ; preds = %cond_true404
438 %tmp409 = cast ubyte* %bptr307.4.1 to uint ; <uint> [#uses=1]
439 %tmp410 = add uint %tmp409, 1 ; <uint> [#uses=1]
440 %tmp410 = cast uint %tmp410 to ubyte* ; <ubyte*> [#uses=1]
441 %tmp416 = load ubyte* %tmp410 ; <ubyte> [#uses=1]
442 %tmp416 = cast ubyte %tmp416 to uint ; <uint> [#uses=1]
443 %tmp418 = shr uint %tmp416, ubyte %tmp319 ; <uint> [#uses=1]
444 %tmp418 = cast uint %tmp418 to int ; <int> [#uses=1]
445 %tmp420 = add int %tmp418, %tmp408 ; <int> [#uses=1]
446 br label %cond_next422
448 cond_next422: ; preds = %cond_true414, %cond_true404
449 %bits.6 = phi int [ %tmp420, %cond_true414 ], [ %tmp408, %cond_true404 ] ; <int> [#uses=1]
450 %tmp425 = xor int %bits.6, %iftmp.35.0 ; <int> [#uses=1]
451 %tmp427 = cast int %tmp425 to ubyte ; <ubyte> [#uses=2]
452 %tmp430 = or ubyte %tmp428, %tmp427 ; <ubyte> [#uses=1]
453 %tmp432 = load ubyte* %optr309.3.1 ; <ubyte> [#uses=1]
454 %tmp433 = and ubyte %tmp430, %tmp432 ; <ubyte> [#uses=1]
455 %tmp438 = and ubyte %tmp436, %tmp427 ; <ubyte> [#uses=1]
456 %tmp439 = or ubyte %tmp433, %tmp438 ; <ubyte> [#uses=1]
457 store ubyte %tmp439, ubyte* %optr309.3.1
458 br label %cond_next442
460 cond_next442: ; preds = %cond_next422, %bb401
461 %tmp443 = cast ubyte** %dest_line.3.0 to uint ; <uint> [#uses=1]
462 %tmp444 = add uint %tmp443, 4 ; <uint> [#uses=1]
463 %tmp444 = cast uint %tmp444 to ubyte** ; <ubyte**> [#uses=2]
464 %tmp446 = load ubyte** %tmp444 ; <ubyte*> [#uses=1]
465 %tmp448 = getelementptr ubyte* %tmp446, int %tmp93 ; <ubyte*> [#uses=1]
466 %tmp454 = add int %tmp454.0, -1 ; <int> [#uses=1]
467 %tmp456 = setlt int %tmp454, 0 ; <bool> [#uses=1]
468 %indvar.next75 = add uint %indvar74, 1 ; <uint> [#uses=1]
469 br bool %tmp456, label %return.loopexit56, label %cond_true457
471 cond_true457.preheader: ; preds = %cond_false299
472 %tmp315 = setlt int %tmp107, %tmp110 ; <bool> [#uses=1]
473 %tmp319 = cast int %tmp303 to ubyte ; <ubyte> [#uses=4]
474 %tmp324 = cast int %tmp305 to ubyte ; <ubyte> [#uses=3]
475 %tmp330 = setlt int %tmp107, %w ; <bool> [#uses=1]
476 %tmp344 = cast uint %mask.1.1 to ubyte ; <ubyte> [#uses=1]
477 %tmp344not = xor ubyte %tmp344, 255 ; <ubyte> [#uses=1]
478 %tmp347 = cast uint %iftmp.36.0 to ubyte ; <ubyte> [#uses=2]
479 %tmp346 = or ubyte %tmp347, %tmp344not ; <ubyte> [#uses=1]
480 %tmp354 = and uint %iftmp.37.0, %mask.1.1 ; <uint> [#uses=1]
481 %tmp361 = sub int %w, %tmp110 ; <int> [#uses=2]
482 %tmp39755 = setgt int %tmp361, 7 ; <bool> [#uses=1]
483 %iftmp.35.0 = cast uint %iftmp.35.0 to int ; <int> [#uses=1]
484 %tmp426 = cast uint %rmask.0.1 to ubyte ; <ubyte> [#uses=1]
485 %tmp426not = xor ubyte %tmp426, 255 ; <ubyte> [#uses=1]
486 %tmp428 = or ubyte %tmp347, %tmp426not ; <ubyte> [#uses=1]
487 %tmp436 = and uint %iftmp.37.0, %rmask.0.1 ; <uint> [#uses=1]
488 %tmp436 = cast uint %tmp436 to ubyte ; <ubyte> [#uses=1]
489 br label %cond_true457
491 cond_true457: ; preds = %cond_true457.preheader, %cond_next442
492 %indvar74 = phi uint [ 0, %cond_true457.preheader ], [ %indvar.next75, %cond_next442 ] ; <uint> [#uses=3]
493 %dest.3.0 = phi ubyte* [ %tmp448, %cond_next442 ], [ %tmp100, %cond_true457.preheader ] ; <ubyte*> [#uses=3]
494 %dest_line.3.0 = phi ubyte** [ %tmp444, %cond_next442 ], [ %tmp96, %cond_true457.preheader ] ; <ubyte**> [#uses=1]
495 %tmp.77 = sub uint 0, %indvar74 ; <uint> [#uses=1]
496 %tmp.77 = cast uint %tmp.77 to int ; <int> [#uses=1]
497 %tmp454.0 = add int %tmp.77, %tmp45438 ; <int> [#uses=1]
498 %tmp.79 = mul uint %indvar74, %raster ; <uint> [#uses=1]
499 %tmp.79 = cast uint %tmp.79 to int ; <int> [#uses=1]
500 %tmp104.sum = add int %tmp102, %tmp.79 ; <int> [#uses=1]
501 %line.3.0 = getelementptr ubyte* %base, int %tmp104.sum ; <ubyte*> [#uses=3]
502 %tmp318 = load ubyte* %line.3.0 ; <ubyte> [#uses=2]
503 br bool %tmp315, label %cond_false321, label %cond_true316
505 return.loopexit: ; preds = %cond_next280
506 br label %return.loopexit.split
508 return.loopexit.split: ; preds = %return.loopexit, %return.loopexit.us
511 return.loopexit56: ; preds = %cond_next442
514 return: ; preds = %return.loopexit56, %return.loopexit.split, %cond_false299, %cond_true197, %cond_next78, %cond_next63, %bb58, %cond_next46
515 %retval.0 = phi int [ 0, %cond_next46 ], [ -1, %bb58 ], [ -1, %cond_next63 ], [ -1, %cond_next78 ], [ 0, %cond_true197 ], [ 0, %cond_false299 ], [ 0, %return.loopexit.split ], [ 0, %return.loopexit56 ] ; <int> [#uses=1]
519 declare int %mem_no_fault_proc(%struct.gx_device_memory*, int, int, int, int, int)
521 declare int %mem_mono_fill_rectangle(%struct.gx_device*, int, int, int, int, uint)
523 declare int %mem_copy_mono_recover(%struct.gx_device*, ubyte*, int, int, int, int, int, int, uint, uint, int)