Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
[oota-llvm.git] / test / Transforms / InstCombine / 2006-04-01-InfLoop.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output
2 ; END.
3
4         %struct.DecRefPicMarking_s = type { int, int, int, int, int, %struct.DecRefPicMarking_s* }
5         %struct.datapartition = type { %typedef.Bitstream*, %typedef.DecodingEnvironment, int (%struct.syntaxelement*, %struct.img_par*, %struct.inp_par*, %struct.datapartition*)* }
6         %struct.img_par = type { int, uint, uint, int, int*, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, [16 x [16 x ushort]], [6 x [32 x int]], [16 x [16 x int]], [4 x [12 x [4 x [4 x int]]]], [16 x int], int**, int*, int***, int**, int, int, int, int, %typedef.Slice*, %struct.macroblock*, int, int, int, int, int, int, int**, %struct.DecRefPicMarking_s*, int, int, int, int, int, int, int, uint, int, int, int, uint, uint, uint, uint, int, [3 x int], int, uint, int, uint, int, int, int, uint, uint, int, int, int, int, uint, uint, int***, int***, int****, int, int, uint, int, int, int, int, uint, uint, uint, uint, uint, uint, uint, int, int, int, int, int, int, int, int, int, int, int, uint, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, %struct.timeb, %struct.timeb, int, int, int, int, int, uint, int, int }
7         %struct.inp_par = type { [100 x sbyte], [100 x sbyte], [100 x sbyte], int, int, int, int, int, int, int }
8         %struct.macroblock = type { int, int, int, %struct.macroblock*, %struct.macroblock*, int, [2 x [4 x [4 x [2 x int]]]], int, long, long, int, int, [4 x int], [4 x int], int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int }
9         %struct.pix_pos = type { int, int, int, int, int, int }
10         %struct.storable_picture = type { uint, int, int, int, int, [50 x [6 x [33 x long]]], [50 x [6 x [33 x long]]], [50 x [6 x [33 x long]]], [50 x [6 x [33 x long]]], uint, int, int, int, int, int, int, int, short, int, int, int, int, int, int, int, uint, uint, ushort**, ushort***, ubyte*, short**, sbyte***, long***, long***, short****, ubyte**, ubyte**, %struct.storable_picture*, %struct.storable_picture*, %struct.storable_picture*, int, int, int, int, int, int, int, int, int, int, int, int, int, [2 x int], int, %struct.DecRefPicMarking_s*, int }
11         %struct.syntaxelement = type { int, int, int, int, int, uint, int, int, void (int, int, int*, int*)*, void (%struct.syntaxelement*, %struct.inp_par*, %struct.img_par*, %typedef.DecodingEnvironment*)* }
12         %struct.timeb = type { int, ushort, short, short }
13         %typedef.BiContextType = type { ushort, ubyte }
14         %typedef.Bitstream = type { int, int, int, int, ubyte*, int }
15         %typedef.DecodingEnvironment = type { uint, uint, uint, uint, int, ubyte*, int* }
16         %typedef.MotionInfoContexts = type { [4 x [11 x %typedef.BiContextType]], [2 x [9 x %typedef.BiContextType]], [2 x [10 x %typedef.BiContextType]], [2 x [6 x %typedef.BiContextType]], [4 x %typedef.BiContextType], [4 x %typedef.BiContextType], [3 x %typedef.BiContextType] }
17         %typedef.Slice = type { int, int, int, int, uint, int, int, int, int, %struct.datapartition*, %typedef.MotionInfoContexts*, %typedef.TextureInfoContexts*, int, int*, int*, int*, int, int*, int*, int*, int (%struct.img_par*, %struct.inp_par*)*, int, int, int, int }
18         %typedef.TextureInfoContexts = type { [2 x %typedef.BiContextType], [4 x %typedef.BiContextType], [3 x [4 x %typedef.BiContextType]], [10 x [4 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]], [10 x [5 x %typedef.BiContextType]], [10 x [5 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]], [10 x [15 x %typedef.BiContextType]] }
19 %dec_picture = external global %struct.storable_picture*                ; <%struct.storable_picture**> [#uses=1]
20 %last_dquant = external global int              ; <int*> [#uses=1]
21
22 implementation   ; Functions:
23
24 void %readCBP_CABAC(%struct.syntaxelement* %se, %struct.inp_par* %inp, %struct.img_par* %img.1, %typedef.DecodingEnvironment* %dep_dp) {
25 entry:
26         %block_a = alloca %struct.pix_pos               ; <%struct.pix_pos*> [#uses=5]
27         %tmp.1 = getelementptr %struct.img_par* %img.1, int 0, uint 37          ; <%typedef.Slice**> [#uses=1]
28         %tmp.2 = load %typedef.Slice** %tmp.1           ; <%typedef.Slice*> [#uses=1]
29         %tmp.3 = getelementptr %typedef.Slice* %tmp.2, int 0, uint 11           ; <%typedef.TextureInfoContexts**> [#uses=1]
30         %tmp.4 = load %typedef.TextureInfoContexts** %tmp.3             ; <%typedef.TextureInfoContexts*> [#uses=3]
31         %tmp.6 = getelementptr %struct.img_par* %img.1, int 0, uint 38          ; <%struct.macroblock**> [#uses=1]
32         %tmp.7 = load %struct.macroblock** %tmp.6               ; <%struct.macroblock*> [#uses=1]
33         %tmp.9 = getelementptr %struct.img_par* %img.1, int 0, uint 1           ; <uint*> [#uses=1]
34         %tmp.10 = load uint* %tmp.9             ; <uint> [#uses=1]
35         %tmp.11 = cast uint %tmp.10 to int              ; <int> [#uses=1]
36         %tmp.12 = getelementptr %struct.macroblock* %tmp.7, int %tmp.11         ; <%struct.macroblock*> [#uses=18]
37         br label %loopentry.0
38
39 loopentry.0:            ; preds = %loopexit.1, %entry
40         %mask.1 = phi int [ undef, %entry ], [ %mask.0, %loopexit.1 ]           ; <int> [#uses=1]
41         %cbp_bit.1 = phi int [ undef, %entry ], [ %cbp_bit.0, %loopexit.1 ]             ; <int> [#uses=1]
42         %cbp.2 = phi int [ 0, %entry ], [ %cbp.1, %loopexit.1 ]         ; <int> [#uses=5]
43         %curr_cbp_ctx.1 = phi int [ undef, %entry ], [ %curr_cbp_ctx.0, %loopexit.1 ]           ; <int> [#uses=1]
44         %b.2 = phi int [ undef, %entry ], [ %b.1, %loopexit.1 ]         ; <int> [#uses=1]
45         %a.2 = phi int [ undef, %entry ], [ %a.1, %loopexit.1 ]         ; <int> [#uses=1]
46         %mb_y.0 = phi int [ 0, %entry ], [ %tmp.152, %loopexit.1 ]              ; <int> [#uses=7]
47         %mb_x.0 = phi int [ undef, %entry ], [ %mb_x.1, %loopexit.1 ]           ; <int> [#uses=0]
48         %tmp.14 = setle int %mb_y.0, 3          ; <bool> [#uses=2]
49         %tmp.15 = cast bool %tmp.14 to int              ; <int> [#uses=0]
50         br bool %tmp.14, label %no_exit.0, label %loopexit.0
51
52 no_exit.0:              ; preds = %loopentry.0
53         br label %loopentry.1
54
55 loopentry.1:            ; preds = %endif.7, %no_exit.0
56         %mask.0 = phi int [ %mask.1, %no_exit.0 ], [ %tmp.131, %endif.7 ]               ; <int> [#uses=1]
57         %cbp_bit.0 = phi int [ %cbp_bit.1, %no_exit.0 ], [ %tmp.142, %endif.7 ]         ; <int> [#uses=1]
58         %cbp.1 = phi int [ %cbp.2, %no_exit.0 ], [ %cbp.0, %endif.7 ]           ; <int> [#uses=5]
59         %curr_cbp_ctx.0 = phi int [ %curr_cbp_ctx.1, %no_exit.0 ], [ %tmp.125, %endif.7 ]               ; <int> [#uses=1]
60         %b.1 = phi int [ %b.2, %no_exit.0 ], [ %b.0, %endif.7 ]         ; <int> [#uses=1]
61         %a.1 = phi int [ %a.2, %no_exit.0 ], [ %a.0, %endif.7 ]         ; <int> [#uses=1]
62         %mb_x.1 = phi int [ 0, %no_exit.0 ], [ %tmp.150, %endif.7 ]             ; <int> [#uses=9]
63         %tmp.17 = setle int %mb_x.1, 3          ; <bool> [#uses=2]
64         %tmp.18 = cast bool %tmp.17 to int              ; <int> [#uses=0]
65         br bool %tmp.17, label %no_exit.1, label %loopexit.1
66
67 no_exit.1:              ; preds = %loopentry.1
68         %tmp.20 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 12             ; <[4 x int]*> [#uses=1]
69         %tmp.22 = div int %mb_x.1, 2            ; <int> [#uses=1]
70         %tmp.24 = add int %tmp.22, %mb_y.0              ; <int> [#uses=1]
71         %tmp.25 = getelementptr [4 x int]* %tmp.20, int 0, int %tmp.24          ; <int*> [#uses=1]
72         %tmp.26 = load int* %tmp.25             ; <int> [#uses=1]
73         %tmp.27 = seteq int %tmp.26, 11         ; <bool> [#uses=2]
74         %tmp.28 = cast bool %tmp.27 to int              ; <int> [#uses=0]
75         br bool %tmp.27, label %then.0, label %else.0
76
77 then.0:         ; preds = %no_exit.1
78         br label %endif.0
79
80 else.0:         ; preds = %no_exit.1
81         br label %endif.0
82
83 endif.0:                ; preds = %else.0, %then.0
84         %tmp.30 = seteq int %mb_y.0, 0          ; <bool> [#uses=2]
85         %tmp.31 = cast bool %tmp.30 to int              ; <int> [#uses=0]
86         br bool %tmp.30, label %then.1, label %else.1
87
88 then.1:         ; preds = %endif.0
89         %tmp.33 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3              ; <%struct.macroblock**> [#uses=1]
90         %tmp.34 = load %struct.macroblock** %tmp.33             ; <%struct.macroblock*> [#uses=1]
91         %tmp.35 = cast %struct.macroblock* %tmp.34 to sbyte*            ; <sbyte*> [#uses=1]
92         %tmp.36 = seteq sbyte* %tmp.35, null            ; <bool> [#uses=2]
93         %tmp.37 = cast bool %tmp.36 to int              ; <int> [#uses=0]
94         br bool %tmp.36, label %then.2, label %else.2
95
96 then.2:         ; preds = %then.1
97         br label %endif.1
98
99 else.2:         ; preds = %then.1
100         %tmp.39 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3              ; <%struct.macroblock**> [#uses=1]
101         %tmp.40 = load %struct.macroblock** %tmp.39             ; <%struct.macroblock*> [#uses=1]
102         %tmp.41 = getelementptr %struct.macroblock* %tmp.40, int 0, uint 5              ; <int*> [#uses=1]
103         %tmp.42 = load int* %tmp.41             ; <int> [#uses=1]
104         %tmp.43 = seteq int %tmp.42, 14         ; <bool> [#uses=2]
105         %tmp.44 = cast bool %tmp.43 to int              ; <int> [#uses=0]
106         br bool %tmp.43, label %then.3, label %else.3
107
108 then.3:         ; preds = %else.2
109         br label %endif.1
110
111 else.3:         ; preds = %else.2
112         %tmp.46 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3              ; <%struct.macroblock**> [#uses=1]
113         %tmp.47 = load %struct.macroblock** %tmp.46             ; <%struct.macroblock*> [#uses=1]
114         %tmp.48 = getelementptr %struct.macroblock* %tmp.47, int 0, uint 7              ; <int*> [#uses=1]
115         %tmp.49 = load int* %tmp.48             ; <int> [#uses=1]
116         %tmp.51 = div int %mb_x.1, 2            ; <int> [#uses=1]
117         %tmp.52 = add int %tmp.51, 2            ; <int> [#uses=1]
118         %tmp.53 = cast int %tmp.52 to ubyte             ; <ubyte> [#uses=1]
119         %tmp.54 = shr int %tmp.49, ubyte %tmp.53                ; <int> [#uses=1]
120         %tmp.55 = cast int %tmp.54 to uint              ; <uint> [#uses=1]
121         %tmp.57 = xor uint %tmp.55, 1           ; <uint> [#uses=1]
122         %tmp.58 = cast uint %tmp.57 to int              ; <int> [#uses=1]
123         %tmp.59 = and int %tmp.58, 1            ; <int> [#uses=1]
124         br label %endif.1
125
126 else.1:         ; preds = %endif.0
127         %tmp.62 = div int %mb_x.1, 2            ; <int> [#uses=1]
128         %tmp.63 = cast int %tmp.62 to ubyte             ; <ubyte> [#uses=1]
129         %tmp.64 = shr int %cbp.1, ubyte %tmp.63         ; <int> [#uses=1]
130         %tmp.65 = cast int %tmp.64 to uint              ; <uint> [#uses=1]
131         %tmp.67 = xor uint %tmp.65, 1           ; <uint> [#uses=1]
132         %tmp.68 = cast uint %tmp.67 to int              ; <int> [#uses=1]
133         %tmp.69 = and int %tmp.68, 1            ; <int> [#uses=1]
134         br label %endif.1
135
136 endif.1:                ; preds = %else.1, %else.3, %then.3, %then.2
137         %b.0 = phi int [ 0, %then.2 ], [ 0, %then.3 ], [ %tmp.59, %else.3 ], [ %tmp.69, %else.1 ]               ; <int> [#uses=2]
138         %tmp.71 = seteq int %mb_x.1, 0          ; <bool> [#uses=2]
139         %tmp.72 = cast bool %tmp.71 to int              ; <int> [#uses=0]
140         br bool %tmp.71, label %then.4, label %else.4
141
142 then.4:         ; preds = %endif.1
143         %tmp.74 = getelementptr %struct.img_par* %img.1, int 0, uint 1          ; <uint*> [#uses=1]
144         %tmp.75 = load uint* %tmp.74            ; <uint> [#uses=1]
145         %tmp.76 = cast uint %tmp.75 to int              ; <int> [#uses=1]
146         call void %getLuma4x4Neighbour( int %tmp.76, int %mb_x.1, int %mb_y.0, int -1, int 0, %struct.pix_pos* %block_a )
147         %tmp.79 = getelementptr %struct.pix_pos* %block_a, int 0, uint 0                ; <int*> [#uses=1]
148         %tmp.80 = load int* %tmp.79             ; <int> [#uses=1]
149         %tmp.81 = setne int %tmp.80, 0          ; <bool> [#uses=2]
150         %tmp.82 = cast bool %tmp.81 to int              ; <int> [#uses=0]
151         br bool %tmp.81, label %then.5, label %else.5
152
153 then.5:         ; preds = %then.4
154         %tmp.84 = getelementptr %struct.img_par* %img.1, int 0, uint 38         ; <%struct.macroblock**> [#uses=1]
155         %tmp.85 = load %struct.macroblock** %tmp.84             ; <%struct.macroblock*> [#uses=1]
156         %tmp.86 = getelementptr %struct.pix_pos* %block_a, int 0, uint 1                ; <int*> [#uses=1]
157         %tmp.87 = load int* %tmp.86             ; <int> [#uses=1]
158         %tmp.88 = getelementptr %struct.macroblock* %tmp.85, int %tmp.87                ; <%struct.macroblock*> [#uses=1]
159         %tmp.89 = getelementptr %struct.macroblock* %tmp.88, int 0, uint 5              ; <int*> [#uses=1]
160         %tmp.90 = load int* %tmp.89             ; <int> [#uses=1]
161         %tmp.91 = seteq int %tmp.90, 14         ; <bool> [#uses=2]
162         %tmp.92 = cast bool %tmp.91 to int              ; <int> [#uses=0]
163         br bool %tmp.91, label %then.6, label %else.6
164
165 then.6:         ; preds = %then.5
166         br label %endif.4
167
168 else.6:         ; preds = %then.5
169         %tmp.94 = getelementptr %struct.img_par* %img.1, int 0, uint 38         ; <%struct.macroblock**> [#uses=1]
170         %tmp.95 = load %struct.macroblock** %tmp.94             ; <%struct.macroblock*> [#uses=1]
171         %tmp.96 = getelementptr %struct.pix_pos* %block_a, int 0, uint 1                ; <int*> [#uses=1]
172         %tmp.97 = load int* %tmp.96             ; <int> [#uses=1]
173         %tmp.98 = getelementptr %struct.macroblock* %tmp.95, int %tmp.97                ; <%struct.macroblock*> [#uses=1]
174         %tmp.99 = getelementptr %struct.macroblock* %tmp.98, int 0, uint 7              ; <int*> [#uses=1]
175         %tmp.100 = load int* %tmp.99            ; <int> [#uses=1]
176         %tmp.101 = getelementptr %struct.pix_pos* %block_a, int 0, uint 3               ; <int*> [#uses=1]
177         %tmp.102 = load int* %tmp.101           ; <int> [#uses=1]
178         %tmp.103 = div int %tmp.102, 2          ; <int> [#uses=1]
179         %tmp.104 = mul int %tmp.103, 2          ; <int> [#uses=1]
180         %tmp.105 = add int %tmp.104, 1          ; <int> [#uses=1]
181         %tmp.106 = cast int %tmp.105 to ubyte           ; <ubyte> [#uses=1]
182         %tmp.107 = shr int %tmp.100, ubyte %tmp.106             ; <int> [#uses=1]
183         %tmp.108 = cast int %tmp.107 to uint            ; <uint> [#uses=1]
184         %tmp.110 = xor uint %tmp.108, 1         ; <uint> [#uses=1]
185         %tmp.111 = cast uint %tmp.110 to int            ; <int> [#uses=1]
186         %tmp.112 = and int %tmp.111, 1          ; <int> [#uses=1]
187         br label %endif.4
188
189 else.5:         ; preds = %then.4
190         br label %endif.4
191
192 else.4:         ; preds = %endif.1
193         %tmp.115 = cast int %mb_y.0 to ubyte            ; <ubyte> [#uses=1]
194         %tmp.116 = shr int %cbp.1, ubyte %tmp.115               ; <int> [#uses=1]
195         %tmp.117 = cast int %tmp.116 to uint            ; <uint> [#uses=1]
196         %tmp.119 = xor uint %tmp.117, 1         ; <uint> [#uses=1]
197         %tmp.120 = cast uint %tmp.119 to int            ; <int> [#uses=1]
198         %tmp.121 = and int %tmp.120, 1          ; <int> [#uses=1]
199         br label %endif.4
200
201 endif.4:                ; preds = %else.4, %else.5, %else.6, %then.6
202         %a.0 = phi int [ 0, %then.6 ], [ %tmp.112, %else.6 ], [ 0, %else.5 ], [ %tmp.121, %else.4 ]             ; <int> [#uses=2]
203         %tmp.123 = mul int %b.0, 2              ; <int> [#uses=1]
204         %tmp.125 = add int %tmp.123, %a.0               ; <int> [#uses=2]
205         %tmp.127 = div int %mb_x.1, 2           ; <int> [#uses=1]
206         %tmp.129 = add int %tmp.127, %mb_y.0            ; <int> [#uses=1]
207         %tmp.130 = cast int %tmp.129 to ubyte           ; <ubyte> [#uses=1]
208         %tmp.131 = shl int 1, ubyte %tmp.130            ; <int> [#uses=2]
209         %tmp.135 = getelementptr %typedef.TextureInfoContexts* %tmp.4, int 0, uint 2            ; <[3 x [4 x %typedef.BiContextType]]*> [#uses=1]
210         %tmp.136 = getelementptr [3 x [4 x %typedef.BiContextType]]* %tmp.135, int 0, int 0             ; <[4 x %typedef.BiContextType]*> [#uses=1]
211         %tmp.137 = getelementptr [4 x %typedef.BiContextType]* %tmp.136, int 0, int 0           ; <%typedef.BiContextType*> [#uses=1]
212         %tmp.139 = cast int %tmp.125 to uint            ; <uint> [#uses=1]
213         %tmp.140 = cast uint %tmp.139 to int            ; <int> [#uses=1]
214         %tmp.141 = getelementptr %typedef.BiContextType* %tmp.137, int %tmp.140         ; <%typedef.BiContextType*> [#uses=1]
215         %tmp.132 = call uint %biari_decode_symbol( %typedef.DecodingEnvironment* %dep_dp, %typedef.BiContextType* %tmp.141 )            ; <uint> [#uses=1]
216         %tmp.142 = cast uint %tmp.132 to int            ; <int> [#uses=2]
217         %tmp.144 = setne int %tmp.142, 0                ; <bool> [#uses=2]
218         %tmp.145 = cast bool %tmp.144 to int            ; <int> [#uses=0]
219         br bool %tmp.144, label %then.7, label %endif.7
220
221 then.7:         ; preds = %endif.4
222         %tmp.148 = add int %cbp.1, %tmp.131             ; <int> [#uses=1]
223         br label %endif.7
224
225 endif.7:                ; preds = %then.7, %endif.4
226         %cbp.0 = phi int [ %tmp.148, %then.7 ], [ %cbp.1, %endif.4 ]            ; <int> [#uses=1]
227         %tmp.150 = add int %mb_x.1, 2           ; <int> [#uses=1]
228         br label %loopentry.1
229
230 loopexit.1:             ; preds = %loopentry.1
231         %tmp.152 = add int %mb_y.0, 2           ; <int> [#uses=1]
232         br label %loopentry.0
233
234 loopexit.0:             ; preds = %loopentry.0
235         %tmp.153 = load %struct.storable_picture** %dec_picture         ; <%struct.storable_picture*> [#uses=1]
236         %tmp.154 = getelementptr %struct.storable_picture* %tmp.153, int 0, uint 45             ; <int*> [#uses=1]
237         %tmp.155 = load int* %tmp.154           ; <int> [#uses=1]
238         %tmp.156 = setne int %tmp.155, 0                ; <bool> [#uses=2]
239         %tmp.157 = cast bool %tmp.156 to int            ; <int> [#uses=0]
240         br bool %tmp.156, label %then.8, label %endif.8
241
242 then.8:         ; preds = %loopexit.0
243         %tmp.159 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3             ; <%struct.macroblock**> [#uses=1]
244         %tmp.160 = load %struct.macroblock** %tmp.159           ; <%struct.macroblock*> [#uses=1]
245         %tmp.161 = cast %struct.macroblock* %tmp.160 to sbyte*          ; <sbyte*> [#uses=1]
246         %tmp.162 = setne sbyte* %tmp.161, null          ; <bool> [#uses=2]
247         %tmp.163 = cast bool %tmp.162 to int            ; <int> [#uses=0]
248         br bool %tmp.162, label %then.9, label %endif.9
249
250 then.9:         ; preds = %then.8
251         %tmp.165 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3             ; <%struct.macroblock**> [#uses=1]
252         %tmp.166 = load %struct.macroblock** %tmp.165           ; <%struct.macroblock*> [#uses=1]
253         %tmp.167 = getelementptr %struct.macroblock* %tmp.166, int 0, uint 5            ; <int*> [#uses=1]
254         %tmp.168 = load int* %tmp.167           ; <int> [#uses=1]
255         %tmp.169 = seteq int %tmp.168, 14               ; <bool> [#uses=2]
256         %tmp.170 = cast bool %tmp.169 to int            ; <int> [#uses=0]
257         br bool %tmp.169, label %then.10, label %else.7
258
259 then.10:                ; preds = %then.9
260         br label %endif.9
261
262 else.7:         ; preds = %then.9
263         %tmp.172 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3             ; <%struct.macroblock**> [#uses=1]
264         %tmp.173 = load %struct.macroblock** %tmp.172           ; <%struct.macroblock*> [#uses=1]
265         %tmp.174 = getelementptr %struct.macroblock* %tmp.173, int 0, uint 7            ; <int*> [#uses=1]
266         %tmp.175 = load int* %tmp.174           ; <int> [#uses=1]
267         %tmp.176 = setgt int %tmp.175, 15               ; <bool> [#uses=1]
268         %tmp.177 = cast bool %tmp.176 to int            ; <int> [#uses=1]
269         br label %endif.9
270
271 endif.9:                ; preds = %else.7, %then.10, %then.8
272         %b.4 = phi int [ 1, %then.10 ], [ %tmp.177, %else.7 ], [ 0, %then.8 ]           ; <int> [#uses=1]
273         %tmp.179 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 4             ; <%struct.macroblock**> [#uses=1]
274         %tmp.180 = load %struct.macroblock** %tmp.179           ; <%struct.macroblock*> [#uses=1]
275         %tmp.181 = cast %struct.macroblock* %tmp.180 to sbyte*          ; <sbyte*> [#uses=1]
276         %tmp.182 = setne sbyte* %tmp.181, null          ; <bool> [#uses=2]
277         %tmp.183 = cast bool %tmp.182 to int            ; <int> [#uses=0]
278         br bool %tmp.182, label %then.11, label %endif.11
279
280 then.11:                ; preds = %endif.9
281         %tmp.185 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 4             ; <%struct.macroblock**> [#uses=1]
282         %tmp.186 = load %struct.macroblock** %tmp.185           ; <%struct.macroblock*> [#uses=1]
283         %tmp.187 = getelementptr %struct.macroblock* %tmp.186, int 0, uint 5            ; <int*> [#uses=1]
284         %tmp.188 = load int* %tmp.187           ; <int> [#uses=1]
285         %tmp.189 = seteq int %tmp.188, 14               ; <bool> [#uses=2]
286         %tmp.190 = cast bool %tmp.189 to int            ; <int> [#uses=0]
287         br bool %tmp.189, label %then.12, label %else.8
288
289 then.12:                ; preds = %then.11
290         br label %endif.11
291
292 else.8:         ; preds = %then.11
293         %tmp.192 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 4             ; <%struct.macroblock**> [#uses=1]
294         %tmp.193 = load %struct.macroblock** %tmp.192           ; <%struct.macroblock*> [#uses=1]
295         %tmp.194 = getelementptr %struct.macroblock* %tmp.193, int 0, uint 7            ; <int*> [#uses=1]
296         %tmp.195 = load int* %tmp.194           ; <int> [#uses=1]
297         %tmp.196 = setgt int %tmp.195, 15               ; <bool> [#uses=1]
298         %tmp.197 = cast bool %tmp.196 to int            ; <int> [#uses=1]
299         br label %endif.11
300
301 endif.11:               ; preds = %else.8, %then.12, %endif.9
302         %a.4 = phi int [ 1, %then.12 ], [ %tmp.197, %else.8 ], [ 0, %endif.9 ]          ; <int> [#uses=1]
303         %tmp.199 = mul int %b.4, 2              ; <int> [#uses=1]
304         %tmp.201 = add int %tmp.199, %a.4               ; <int> [#uses=1]
305         %tmp.205 = getelementptr %typedef.TextureInfoContexts* %tmp.4, int 0, uint 2            ; <[3 x [4 x %typedef.BiContextType]]*> [#uses=1]
306         %tmp.206 = getelementptr [3 x [4 x %typedef.BiContextType]]* %tmp.205, int 0, int 1             ; <[4 x %typedef.BiContextType]*> [#uses=1]
307         %tmp.207 = getelementptr [4 x %typedef.BiContextType]* %tmp.206, int 0, int 0           ; <%typedef.BiContextType*> [#uses=1]
308         %tmp.209 = cast int %tmp.201 to uint            ; <uint> [#uses=1]
309         %tmp.210 = cast uint %tmp.209 to int            ; <int> [#uses=1]
310         %tmp.211 = getelementptr %typedef.BiContextType* %tmp.207, int %tmp.210         ; <%typedef.BiContextType*> [#uses=1]
311         %tmp.202 = call uint %biari_decode_symbol( %typedef.DecodingEnvironment* %dep_dp, %typedef.BiContextType* %tmp.211 )            ; <uint> [#uses=1]
312         %tmp.212 = cast uint %tmp.202 to int            ; <int> [#uses=1]
313         %tmp.214 = setne int %tmp.212, 0                ; <bool> [#uses=2]
314         %tmp.215 = cast bool %tmp.214 to int            ; <int> [#uses=0]
315         br bool %tmp.214, label %then.13, label %endif.8
316
317 then.13:                ; preds = %endif.11
318         %tmp.217 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3             ; <%struct.macroblock**> [#uses=1]
319         %tmp.218 = load %struct.macroblock** %tmp.217           ; <%struct.macroblock*> [#uses=1]
320         %tmp.219 = cast %struct.macroblock* %tmp.218 to sbyte*          ; <sbyte*> [#uses=1]
321         %tmp.220 = setne sbyte* %tmp.219, null          ; <bool> [#uses=2]
322         %tmp.221 = cast bool %tmp.220 to int            ; <int> [#uses=0]
323         br bool %tmp.220, label %then.14, label %endif.14
324
325 then.14:                ; preds = %then.13
326         %tmp.223 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3             ; <%struct.macroblock**> [#uses=1]
327         %tmp.224 = load %struct.macroblock** %tmp.223           ; <%struct.macroblock*> [#uses=1]
328         %tmp.225 = getelementptr %struct.macroblock* %tmp.224, int 0, uint 5            ; <int*> [#uses=1]
329         %tmp.226 = load int* %tmp.225           ; <int> [#uses=1]
330         %tmp.227 = seteq int %tmp.226, 14               ; <bool> [#uses=2]
331         %tmp.228 = cast bool %tmp.227 to int            ; <int> [#uses=0]
332         br bool %tmp.227, label %then.15, label %else.9
333
334 then.15:                ; preds = %then.14
335         br label %endif.14
336
337 else.9:         ; preds = %then.14
338         %tmp.230 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3             ; <%struct.macroblock**> [#uses=1]
339         %tmp.231 = load %struct.macroblock** %tmp.230           ; <%struct.macroblock*> [#uses=1]
340         %tmp.232 = getelementptr %struct.macroblock* %tmp.231, int 0, uint 7            ; <int*> [#uses=1]
341         %tmp.233 = load int* %tmp.232           ; <int> [#uses=1]
342         %tmp.234 = setgt int %tmp.233, 15               ; <bool> [#uses=2]
343         %tmp.235 = cast bool %tmp.234 to int            ; <int> [#uses=0]
344         br bool %tmp.234, label %then.16, label %endif.14
345
346 then.16:                ; preds = %else.9
347         %tmp.237 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 3             ; <%struct.macroblock**> [#uses=1]
348         %tmp.238 = load %struct.macroblock** %tmp.237           ; <%struct.macroblock*> [#uses=1]
349         %tmp.239 = getelementptr %struct.macroblock* %tmp.238, int 0, uint 7            ; <int*> [#uses=1]
350         %tmp.240 = load int* %tmp.239           ; <int> [#uses=1]
351         %tmp.242 = shr int %tmp.240, ubyte 4            ; <int> [#uses=1]
352         %tmp.243 = seteq int %tmp.242, 2                ; <bool> [#uses=1]
353         %tmp.244 = cast bool %tmp.243 to int            ; <int> [#uses=1]
354         br label %endif.14
355
356 endif.14:               ; preds = %then.16, %else.9, %then.15, %then.13
357         %b.5 = phi int [ 1, %then.15 ], [ %tmp.244, %then.16 ], [ 0, %else.9 ], [ 0, %then.13 ]         ; <int> [#uses=1]
358         %tmp.246 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 4             ; <%struct.macroblock**> [#uses=1]
359         %tmp.247 = load %struct.macroblock** %tmp.246           ; <%struct.macroblock*> [#uses=1]
360         %tmp.248 = cast %struct.macroblock* %tmp.247 to sbyte*          ; <sbyte*> [#uses=1]
361         %tmp.249 = setne sbyte* %tmp.248, null          ; <bool> [#uses=2]
362         %tmp.250 = cast bool %tmp.249 to int            ; <int> [#uses=0]
363         br bool %tmp.249, label %then.17, label %endif.17
364
365 then.17:                ; preds = %endif.14
366         %tmp.252 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 4             ; <%struct.macroblock**> [#uses=1]
367         %tmp.253 = load %struct.macroblock** %tmp.252           ; <%struct.macroblock*> [#uses=1]
368         %tmp.254 = getelementptr %struct.macroblock* %tmp.253, int 0, uint 5            ; <int*> [#uses=1]
369         %tmp.255 = load int* %tmp.254           ; <int> [#uses=1]
370         %tmp.256 = seteq int %tmp.255, 14               ; <bool> [#uses=2]
371         %tmp.257 = cast bool %tmp.256 to int            ; <int> [#uses=0]
372         br bool %tmp.256, label %then.18, label %else.10
373
374 then.18:                ; preds = %then.17
375         br label %endif.17
376
377 else.10:                ; preds = %then.17
378         %tmp.259 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 4             ; <%struct.macroblock**> [#uses=1]
379         %tmp.260 = load %struct.macroblock** %tmp.259           ; <%struct.macroblock*> [#uses=1]
380         %tmp.261 = getelementptr %struct.macroblock* %tmp.260, int 0, uint 7            ; <int*> [#uses=1]
381         %tmp.262 = load int* %tmp.261           ; <int> [#uses=1]
382         %tmp.263 = setgt int %tmp.262, 15               ; <bool> [#uses=2]
383         %tmp.264 = cast bool %tmp.263 to int            ; <int> [#uses=0]
384         br bool %tmp.263, label %then.19, label %endif.17
385
386 then.19:                ; preds = %else.10
387         %tmp.266 = getelementptr %struct.macroblock* %tmp.12, int 0, uint 4             ; <%struct.macroblock**> [#uses=1]
388         %tmp.267 = load %struct.macroblock** %tmp.266           ; <%struct.macroblock*> [#uses=1]
389         %tmp.268 = getelementptr %struct.macroblock* %tmp.267, int 0, uint 7            ; <int*> [#uses=1]
390         %tmp.269 = load int* %tmp.268           ; <int> [#uses=1]
391         %tmp.271 = shr int %tmp.269, ubyte 4            ; <int> [#uses=1]
392         %tmp.272 = seteq int %tmp.271, 2                ; <bool> [#uses=1]
393         %tmp.273 = cast bool %tmp.272 to int            ; <int> [#uses=1]
394         br label %endif.17
395
396 endif.17:               ; preds = %then.19, %else.10, %then.18, %endif.14
397         %a.5 = phi int [ 1, %then.18 ], [ %tmp.273, %then.19 ], [ 0, %else.10 ], [ 0, %endif.14 ]               ; <int> [#uses=1]
398         %tmp.275 = mul int %b.5, 2              ; <int> [#uses=1]
399         %tmp.277 = add int %tmp.275, %a.5               ; <int> [#uses=1]
400         %tmp.281 = getelementptr %typedef.TextureInfoContexts* %tmp.4, int 0, uint 2            ; <[3 x [4 x %typedef.BiContextType]]*> [#uses=1]
401         %tmp.282 = getelementptr [3 x [4 x %typedef.BiContextType]]* %tmp.281, int 0, int 2             ; <[4 x %typedef.BiContextType]*> [#uses=1]
402         %tmp.283 = getelementptr [4 x %typedef.BiContextType]* %tmp.282, int 0, int 0           ; <%typedef.BiContextType*> [#uses=1]
403         %tmp.285 = cast int %tmp.277 to uint            ; <uint> [#uses=1]
404         %tmp.286 = cast uint %tmp.285 to int            ; <int> [#uses=1]
405         %tmp.287 = getelementptr %typedef.BiContextType* %tmp.283, int %tmp.286         ; <%typedef.BiContextType*> [#uses=1]
406         %tmp.278 = call uint %biari_decode_symbol( %typedef.DecodingEnvironment* %dep_dp, %typedef.BiContextType* %tmp.287 )            ; <uint> [#uses=1]
407         %tmp.288 = cast uint %tmp.278 to int            ; <int> [#uses=1]
408         %tmp.290 = seteq int %tmp.288, 1                ; <bool> [#uses=2]
409         %tmp.291 = cast bool %tmp.290 to int            ; <int> [#uses=0]
410         br bool %tmp.290, label %cond_true, label %cond_false
411
412 cond_true:              ; preds = %endif.17
413         %tmp.293 = add int %cbp.2, 32           ; <int> [#uses=1]
414         br label %cond_continue
415
416 cond_false:             ; preds = %endif.17
417         %tmp.295 = add int %cbp.2, 16           ; <int> [#uses=1]
418         br label %cond_continue
419
420 cond_continue:          ; preds = %cond_false, %cond_true
421         %mem_tmp.0 = phi int [ %tmp.293, %cond_true ], [ %tmp.295, %cond_false ]                ; <int> [#uses=1]
422         br label %endif.8
423
424 endif.8:                ; preds = %cond_continue, %endif.11, %loopexit.0
425         %cbp.3 = phi int [ %mem_tmp.0, %cond_continue ], [ %cbp.2, %endif.11 ], [ %cbp.2, %loopexit.0 ]         ; <int> [#uses=2]
426         %tmp.298 = getelementptr %struct.syntaxelement* %se, int 0, uint 1              ; <int*> [#uses=1]
427         store int %cbp.3, int* %tmp.298
428         %tmp.301 = seteq int %cbp.3, 0          ; <bool> [#uses=2]
429         %tmp.302 = cast bool %tmp.301 to int            ; <int> [#uses=0]
430         br bool %tmp.301, label %then.20, label %return
431
432 then.20:                ; preds = %endif.8
433         store int 0, int* %last_dquant
434         ret void
435
436 return:         ; preds = %endif.8
437         ret void
438 }
439
440 declare uint %biari_decode_symbol(%typedef.DecodingEnvironment*, %typedef.BiContextType*)
441
442 declare void %getLuma4x4Neighbour(int, int, int, int, int, %struct.pix_pos*)