1 ; RUN: llc < %s -mtriple=arm-apple-darwin
3 %struct.CONTENTBOX = type { i32, i32, i32, i32, i32 }
4 %struct.FILE = type { ptr, i32, i32, i16, i16, %struct.__sbuf, i32, ptr, ptr, ptr, ptr, ptr, %struct.__sbuf, ptr, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
5 %struct.LOCBOX = type { i32, i32, i32, i32 }
6 %struct.SIDEBOX = type { i32, i32 }
7 %struct.UNCOMBOX = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
8 %struct.__sFILEX = type opaque
9 %struct.__sbuf = type { ptr, i32 }
10 %struct.cellbox = type { ptr, i32, i32, i32, [9 x i32], i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, i32, i32, ptr, ptr, [8 x ptr], ptr }
11 %struct.termbox = type { ptr, i32, i32, i32, i32, i32 }
12 %struct.tilebox = type { ptr, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr }
13 @.str127 = external constant [2 x i8] ; <ptr> [#uses=1]
14 @.str584 = external constant [5 x i8] ; <ptr> [#uses=1]
15 @.str8115 = external constant [9 x i8] ; <ptr> [#uses=1]
17 declare ptr @fopen(ptr, ptr)
19 declare i32 @strcmp(ptr, ptr)
21 declare i32 @fscanf(ptr, ptr, ...)
23 define void @main(i32 %argc, ptr %argv) noreturn {
25 br i1 false, label %cond_next48, label %cond_false674
26 cond_next48: ; preds = %entry
27 %tmp61 = call ptr @fopen( ptr null, ptr @.str127 ) ; <ptr> [#uses=2]
28 br i1 false, label %bb220.i.i.i, label %bb62.preheader.i.i.i
29 bb62.preheader.i.i.i: ; preds = %cond_next48
31 bb220.i.i.i: ; preds = %cond_next48
32 br i1 false, label %bb248.i.i.i, label %cond_next232.i.i.i
33 cond_next232.i.i.i: ; preds = %bb220.i.i.i
35 bb248.i.i.i: ; preds = %bb220.i.i.i
36 br i1 false, label %bb300.i.i.i, label %cond_false256.i.i.i
37 cond_false256.i.i.i: ; preds = %bb248.i.i.i
39 bb300.i.i.i: ; preds = %bb248.i.i.i
41 bb.i.i347.i: ; preds = %bb.i.i347.i, %bb300.i.i.i
42 br i1 false, label %bb894.loopexit.i.i, label %bb.i.i347.i
43 bb.i350.i: ; preds = %bb894.i.i
44 br i1 false, label %bb24.i.i, label %cond_false373.i.i
45 bb24.i.i: ; preds = %bb24.i.i, %bb.i350.i
46 br i1 false, label %bb40.i.i, label %bb24.i.i
47 bb40.i.i: ; preds = %bb24.i.i
48 br i1 false, label %bb177.i393.i, label %bb82.i.i
49 bb82.i.i: ; preds = %bb40.i.i
51 bb177.i393.i: ; preds = %bb40.i.i
52 br i1 false, label %bb894.i.i, label %bb192.i.i
53 bb192.i.i: ; preds = %bb177.i393.i
55 cond_false373.i.i: ; preds = %bb.i350.i
56 %tmp376.i.i = call i32 @strcmp( ptr null, ptr @.str8115 ) ; <i32> [#uses=0]
57 br i1 false, label %cond_true380.i.i, label %cond_next602.i.i
58 cond_true380.i.i: ; preds = %cond_false373.i.i
59 %tmp394.i418.i = add i32 %cell.0.i.i, 1 ; <i32> [#uses=1]
60 %tmp397.i420.i = load ptr, ptr null, align 4 ; <ptr> [#uses=1]
62 bb398.i.i: ; preds = %bb398.i.i, %cond_true380.i.i
63 br i1 false, label %bb414.i.i, label %bb398.i.i
64 bb414.i.i: ; preds = %bb398.i.i
65 br i1 false, label %bb581.i.i, label %bb455.i442.i
66 bb455.i442.i: ; preds = %bb414.i.i
68 bb581.i.i: ; preds = %bb581.i.i, %bb414.i.i
69 br i1 false, label %bb894.i.i, label %bb581.i.i
70 cond_next602.i.i: ; preds = %cond_false373.i.i
71 br i1 false, label %bb609.i.i, label %bb661.i.i
72 bb609.i.i: ; preds = %cond_next602.i.i
74 bb620.i.i: ; preds = %bb620.i.i, %bb609.i.i
75 %indvar166.i465.i = phi i32 [ %indvar.next167.i.i, %bb620.i.i ], [ 0, %bb609.i.i ] ; <i32> [#uses=1]
76 %tmp640.i.i = call i32 (ptr, ptr, ...) @fscanf( ptr %tmp61, ptr @.str584, ptr null ) ; <i32> [#uses=0]
77 %tmp648.i.i = load i32, ptr null, align 4 ; <i32> [#uses=1]
78 %tmp650.i468.i = icmp sgt i32 0, %tmp648.i.i ; <i1> [#uses=1]
79 %tmp624.i469.i = call i32 (ptr, ptr, ...) @fscanf( ptr %tmp61, ptr @.str584, ptr null ) ; <i32> [#uses=0]
80 %indvar.next167.i.i = add i32 %indvar166.i465.i, 1 ; <i32> [#uses=1]
81 br i1 %tmp650.i468.i, label %bb653.i.i.loopexit, label %bb620.i.i
82 bb653.i.i.loopexit: ; preds = %bb620.i.i
83 %tmp642.i466.i = add i32 0, 1 ; <i32> [#uses=1]
85 bb661.i.i: ; preds = %cond_next602.i.i
87 bb894.loopexit.i.i: ; preds = %bb.i.i347.i
89 bb894.i.i: ; preds = %bb894.loopexit.i.i, %bb653.i.i.loopexit, %bb581.i.i, %bb177.i393.i
90 %pinctr.0.i.i = phi i32 [ 0, %bb894.loopexit.i.i ], [ %tmp642.i466.i, %bb653.i.i.loopexit ], [ %pinctr.0.i.i, %bb177.i393.i ], [ %pinctr.0.i.i, %bb581.i.i ] ; <i32> [#uses=2]
91 %soft.0.i.i = phi i32 [ undef, %bb894.loopexit.i.i ], [ %soft.0.i.i, %bb653.i.i.loopexit ], [ 0, %bb177.i393.i ], [ 1, %bb581.i.i ] ; <i32> [#uses=1]
92 %cell.0.i.i = phi i32 [ 0, %bb894.loopexit.i.i ], [ %cell.0.i.i, %bb653.i.i.loopexit ], [ 0, %bb177.i393.i ], [ %tmp394.i418.i, %bb581.i.i ] ; <i32> [#uses=2]
93 %ptr.0.i.i = phi ptr [ undef, %bb894.loopexit.i.i ], [ %ptr.0.i.i, %bb653.i.i.loopexit ], [ null, %bb177.i393.i ], [ %tmp397.i420.i, %bb581.i.i ] ; <ptr> [#uses=1]
94 br i1 false, label %bb.i350.i, label %bb902.i502.i
95 bb902.i502.i: ; preds = %bb894.i.i
97 cond_false674: ; preds = %entry
101 %struct.III_psy_xmin = type { [22 x double], [13 x [3 x double]] }
102 %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
103 %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, [4 x i32] }
104 %struct.lame_global_flags = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
105 @scalefac_band.1 = external global [14 x i32] ; <ptr> [#uses=2]
107 declare fastcc i32 @init_outer_loop(ptr, ptr, ptr)
109 define fastcc void @outer_loop(ptr %gfp, ptr %xr, i32 %targ_bits, ptr %best_noise, ptr %l3_xmin, ptr %l3_enc, ptr %scalefac, ptr %cod_info, i32 %ch) {
111 %cod_info.182 = getelementptr %struct.gr_info, ptr %cod_info, i32 0, i32 1 ; <ptr> [#uses=1]
113 bb: ; preds = %bb226, %entry
114 %save_cod_info.1.1 = phi i32 [ undef, %entry ], [ %save_cod_info.1.1, %bb226 ] ; <i32> [#uses=2]
115 br i1 false, label %cond_next, label %cond_true
116 cond_true: ; preds = %bb
118 cond_next: ; preds = %bb
119 br i1 false, label %cond_next144, label %cond_false
120 cond_false: ; preds = %cond_next
122 cond_next144: ; preds = %cond_next
123 br i1 false, label %cond_next205, label %cond_true163
124 cond_true163: ; preds = %cond_next144
125 br i1 false, label %bb34.i, label %bb.i53
126 bb.i53: ; preds = %cond_true163
128 bb34.i: ; preds = %cond_true163
129 %tmp37.i55 = load i32, ptr null, align 4 ; <i32> [#uses=1]
130 br i1 false, label %bb65.preheader.i, label %bb78.i
131 bb65.preheader.i: ; preds = %bb34.i
132 br label %bb65.outer.us.i
133 bb65.outer.us.i: ; preds = %bb65.outer.us.i, %bb65.preheader.i
134 br i1 false, label %bb78.i, label %bb65.outer.us.i
135 bb78.i: ; preds = %bb65.outer.us.i, %bb34.i
136 br i1 false, label %bb151.i.preheader, label %bb90.i
137 bb90.i: ; preds = %bb78.i
139 bb151.i.preheader: ; preds = %bb78.i
141 bb151.i: ; preds = %bb226.backedge.i, %bb151.i.preheader
142 %i.154.i = phi i32 [ %tmp15747.i, %bb226.backedge.i ], [ 0, %bb151.i.preheader ] ; <i32> [#uses=2]
143 %tmp15747.i = add i32 %i.154.i, 1 ; <i32> [#uses=3]
144 br i1 false, label %bb155.i, label %bb226.backedge.i
145 bb226.backedge.i: ; preds = %cond_next215.i, %bb151.i
146 %tmp228.i71 = icmp slt i32 %tmp15747.i, 3 ; <i1> [#uses=1]
147 br i1 %tmp228.i71, label %bb151.i, label %amp_scalefac_bands.exit
148 bb155.i: ; preds = %cond_next215.i, %bb151.i
149 %indvar90.i = phi i32 [ %indvar.next91.i, %cond_next215.i ], [ 0, %bb151.i ] ; <i32> [#uses=2]
150 %sfb.3.reg2mem.0.i = add i32 %indvar90.i, %tmp37.i55 ; <i32> [#uses=4]
151 %tmp161.i = getelementptr [4 x [21 x double]], ptr null, i32 0, i32 %tmp15747.i, i32 %sfb.3.reg2mem.0.i ; <ptr> [#uses=1]
152 %tmp162.i74 = load double, ptr %tmp161.i, align 4 ; <double> [#uses=0]
153 br i1 false, label %cond_true167.i, label %cond_next215.i
154 cond_true167.i: ; preds = %bb155.i
155 %tmp173.i = getelementptr %struct.III_scalefac_t, ptr null, i32 0, i32 1, i32 %sfb.3.reg2mem.0.i, i32 %i.154.i ; <ptr> [#uses=1]
156 store i32 0, ptr %tmp173.i, align 4
157 %tmp182.1.i = getelementptr [14 x i32], ptr @scalefac_band.1, i32 0, i32 %sfb.3.reg2mem.0.i ; <ptr> [#uses=0]
158 %tmp185.i78 = add i32 %sfb.3.reg2mem.0.i, 1 ; <i32> [#uses=1]
159 %tmp187.1.i = getelementptr [14 x i32], ptr @scalefac_band.1, i32 0, i32 %tmp185.i78 ; <ptr> [#uses=1]
160 %tmp188.i = load i32, ptr %tmp187.1.i, align 4 ; <i32> [#uses=1]
161 %tmp21153.i = icmp slt i32 0, %tmp188.i ; <i1> [#uses=1]
162 br i1 %tmp21153.i, label %bb190.preheader.i, label %cond_next215.i
163 bb190.preheader.i: ; preds = %cond_true167.i
165 cond_next215.i: ; preds = %cond_true167.i, %bb155.i
166 %indvar.next91.i = add i32 %indvar90.i, 1 ; <i32> [#uses=2]
167 %exitcond99.i87 = icmp eq i32 %indvar.next91.i, 0 ; <i1> [#uses=1]
168 br i1 %exitcond99.i87, label %bb226.backedge.i, label %bb155.i
169 amp_scalefac_bands.exit: ; preds = %bb226.backedge.i
170 br i1 false, label %bb19.i, label %bb.i16
171 bb.i16: ; preds = %amp_scalefac_bands.exit
173 bb19.i: ; preds = %amp_scalefac_bands.exit
174 br i1 false, label %bb40.outer.i, label %cond_next205
175 bb40.outer.i: ; preds = %bb19.i
177 cond_next205: ; preds = %bb19.i, %cond_next144
178 br i1 false, label %bb226, label %cond_true210
179 cond_true210: ; preds = %cond_next205
180 br i1 false, label %bb226, label %cond_true217
181 cond_true217: ; preds = %cond_true210
182 %tmp221 = call fastcc i32 @init_outer_loop( ptr %gfp, ptr %xr, ptr %cod_info ) ; <i32> [#uses=0]
184 bb226: ; preds = %cond_true210, %cond_next205
185 br i1 false, label %bb231, label %bb
186 bb231: ; preds = %bb226
187 store i32 %save_cod_info.1.1, ptr %cod_info.182
191 define fastcc void @outer_loop2(ptr %gfp, ptr %xr, i32 %targ_bits, ptr %best_noise, ptr %l3_xmin, ptr %l3_enc, ptr %scalefac, ptr %cod_info, i32 %ch) {
193 %cod_info.20128.1 = getelementptr %struct.gr_info, ptr %cod_info, i32 0, i32 20, i32 1 ; <ptr> [#uses=1]
194 %cod_info.20128.2 = getelementptr %struct.gr_info, ptr %cod_info, i32 0, i32 20, i32 2 ; <ptr> [#uses=1]
195 %cod_info.20128.3 = getelementptr %struct.gr_info, ptr %cod_info, i32 0, i32 20, i32 3 ; <ptr> [#uses=1]
197 bb: ; preds = %bb226, %entry
198 %save_cod_info.19.1 = phi ptr [ undef, %entry ], [ %save_cod_info.19.0, %bb226 ] ; <ptr> [#uses=1]
199 %save_cod_info.0.1 = phi i32 [ undef, %entry ], [ %save_cod_info.0.0, %bb226 ] ; <i32> [#uses=1]
200 br i1 false, label %cond_next144, label %cond_false
201 cond_false: ; preds = %bb
202 br i1 false, label %cond_true56, label %cond_false78
203 cond_true56: ; preds = %cond_false
204 br i1 false, label %inner_loop.exit, label %cond_next85
205 inner_loop.exit: ; preds = %cond_true56
206 br i1 false, label %cond_next104, label %cond_false96
207 cond_false78: ; preds = %cond_false
209 cond_next85: ; preds = %cond_true56
211 cond_false96: ; preds = %inner_loop.exit
213 cond_next104: ; preds = %inner_loop.exit
214 br i1 false, label %cond_next144, label %cond_false110
215 cond_false110: ; preds = %cond_next104
217 cond_next144: ; preds = %cond_next104, %bb
218 %save_cod_info.19.0 = phi ptr [ %save_cod_info.19.1, %bb ], [ null, %cond_next104 ] ; <ptr> [#uses=1]
219 %save_cod_info.4.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
220 %save_cod_info.3.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
221 %save_cod_info.2.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
222 %save_cod_info.1.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
223 %save_cod_info.0.0 = phi i32 [ %save_cod_info.0.1, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
224 %over.1 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
225 %best_over.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
226 %notdone.0 = phi i32 [ 0, %bb ], [ 0, %cond_next104 ] ; <i32> [#uses=1]
227 %tmp147 = load i32, ptr null, align 4 ; <i32> [#uses=1]
228 %tmp148 = icmp eq i32 %tmp147, 0 ; <i1> [#uses=1]
229 %tmp153 = icmp eq i32 %over.1, 0 ; <i1> [#uses=1]
230 %bothcond = and i1 %tmp148, %tmp153 ; <i1> [#uses=1]
231 %notdone.2 = select i1 %bothcond, i32 0, i32 %notdone.0 ; <i32> [#uses=1]
232 br i1 false, label %cond_next205, label %cond_true163
233 cond_true163: ; preds = %cond_next144
235 cond_next205: ; preds = %cond_next144
236 br i1 false, label %bb226, label %cond_true210
237 cond_true210: ; preds = %cond_next205
239 bb226: ; preds = %cond_next205
240 %tmp228 = icmp eq i32 %notdone.2, 0 ; <i1> [#uses=1]
241 br i1 %tmp228, label %bb231, label %bb
242 bb231: ; preds = %bb226
243 store i32 %save_cod_info.1.0, ptr null
244 store i32 %save_cod_info.2.0, ptr null
245 store i32 %save_cod_info.3.0, ptr null
246 store i32 %save_cod_info.4.0, ptr null
247 store i32 0, ptr %cod_info.20128.1
248 store i32 0, ptr %cod_info.20128.2
249 store i32 0, ptr %cod_info.20128.3
250 %tmp244245 = sitofp i32 %best_over.0 to double ; <double> [#uses=1]
251 store double %tmp244245, ptr %best_noise, align 4