1; RUN: llc < %s -mtriple=powerpc-apple-darwin
2
3	%struct.CGLDI = type { %struct.cgli*, i32, i32, i32, i32, i32, i8*, i32, void (%struct.CGLSI*, i32, %struct.CGLDI*)*, i8*, %struct.vv_t }
4	%struct.cgli = type { i32, %struct.cgli*, void (%struct.cgli*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32)*, i32, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i8*, i32*, %struct._cgro*, %struct._cgro*, float, float, float, float, i32, i8*, float, i8*, [16 x i32] }
5	%struct.CGLSI = type { %struct.cgli*, i32, i8*, i8*, i32, i32, i8*, void (%struct.cgli*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32)*, %struct.vv_t, %struct.vv_t, %struct.xx_t* }
6	%struct._cgro = type opaque
7	%struct.xx_t = type { [3 x %struct.vv_t], [2 x %struct.vv_t], [2 x [3 x i8*]] }
8	%struct.vv_t = type { <16 x i8> }
9@llvm.used = appending global [1 x i8*] [ i8* bitcast (void (%struct.CGLSI*, i32, %struct.CGLDI*)* @lb to i8*) ], section "llvm.metadata"		; <[1 x i8*]*> [#uses=0]
10
11define void @lb(%struct.CGLSI* %src, i32 %n, %struct.CGLDI* %dst) nounwind {
12entry:
13	%0 = load i32, i32* null, align 4		; <i32> [#uses=1]
14	%1 = icmp sgt i32 %0, 0		; <i1> [#uses=1]
15	br i1 %1, label %bb.nph4945, label %return
16
17bb.nph4945:		; preds = %entry
18	%2 = bitcast [2 x %struct.vv_t]* null to i64*		; <i64*> [#uses=6]
19	%3 = getelementptr [2 x i64], [2 x i64]* null, i32 0, i32 1		; <i64*> [#uses=6]
20	%4 = bitcast %struct.vv_t* null to i64*		; <i64*> [#uses=5]
21	%5 = getelementptr [2 x i64], [2 x i64]* null, i32 0, i32 1		; <i64*> [#uses=3]
22	br label %bb2326
23
24bb2217:		; preds = %bb2326
25	%6 = or i64 0, 0		; <i64> [#uses=2]
26	%7 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
27	%8 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
28	%9 = getelementptr float, float* null, i32 2		; <float*> [#uses=1]
29	%10 = load float, float* %9, align 4		; <float> [#uses=1]
30	%11 = getelementptr float, float* null, i32 3		; <float*> [#uses=1]
31	%12 = load float, float* %11, align 4		; <float> [#uses=1]
32	%13 = fmul float %10, 6.553500e+04		; <float> [#uses=1]
33	%14 = fadd float %13, 5.000000e-01		; <float> [#uses=1]
34	%15 = fmul float %12, 6.553500e+04		; <float> [#uses=1]
35	%16 = fadd float %15, 5.000000e-01		; <float> [#uses=3]
36	%17 = fcmp olt float %14, 0.000000e+00		; <i1> [#uses=0]
37	%18 = fcmp olt float %16, 0.000000e+00		; <i1> [#uses=1]
38	br i1 %18, label %bb2265, label %bb2262
39
40bb2262:		; preds = %bb2217
41	%19 = fcmp ogt float %16, 6.553500e+04		; <i1> [#uses=1]
42	br i1 %19, label %bb2264, label %bb2265
43
44bb2264:		; preds = %bb2262
45	br label %bb2265
46
47bb2265:		; preds = %bb2264, %bb2262, %bb2217
48	%f3596.0 = phi float [ 6.553500e+04, %bb2264 ], [ 0.000000e+00, %bb2217 ], [ %16, %bb2262 ]		; <float> [#uses=1]
49	%20 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
50	%21 = fptosi float %f3596.0 to i32		; <i32> [#uses=1]
51	%22 = zext i32 %7 to i64		; <i64> [#uses=1]
52	%23 = shl i64 %22, 48		; <i64> [#uses=1]
53	%24 = zext i32 %8 to i64		; <i64> [#uses=1]
54	%25 = shl i64 %24, 32		; <i64> [#uses=1]
55	%26 = sext i32 %20 to i64		; <i64> [#uses=1]
56	%27 = shl i64 %26, 16		; <i64> [#uses=1]
57	%28 = sext i32 %21 to i64		; <i64> [#uses=1]
58	%29 = or i64 %25, %23		; <i64> [#uses=1]
59	%30 = or i64 %29, %27		; <i64> [#uses=1]
60	%31 = or i64 %30, %28		; <i64> [#uses=2]
61	%32 = shl i64 %6, 48		; <i64> [#uses=1]
62	%33 = shl i64 %31, 32		; <i64> [#uses=1]
63	%34 = and i64 %33, 281470681743360		; <i64> [#uses=1]
64	store i64 %6, i64* %2, align 16
65	store i64 %31, i64* %3, align 8
66	%35 = getelementptr i8, i8* null, i32 0		; <i8*> [#uses=1]
67	%36 = bitcast i8* %35 to float*		; <float*> [#uses=4]
68	%37 = load float, float* %36, align 4		; <float> [#uses=1]
69	%38 = getelementptr float, float* %36, i32 1		; <float*> [#uses=1]
70	%39 = load float, float* %38, align 4		; <float> [#uses=1]
71	%40 = fmul float %37, 6.553500e+04		; <float> [#uses=1]
72	%41 = fadd float %40, 5.000000e-01		; <float> [#uses=1]
73	%42 = fmul float %39, 6.553500e+04		; <float> [#uses=1]
74	%43 = fadd float %42, 5.000000e-01		; <float> [#uses=3]
75	%44 = fcmp olt float %41, 0.000000e+00		; <i1> [#uses=0]
76	%45 = fcmp olt float %43, 0.000000e+00		; <i1> [#uses=1]
77	br i1 %45, label %bb2277, label %bb2274
78
79bb2274:		; preds = %bb2265
80	%46 = fcmp ogt float %43, 6.553500e+04		; <i1> [#uses=0]
81	br label %bb2277
82
83bb2277:		; preds = %bb2274, %bb2265
84	%f1582.0 = phi float [ 0.000000e+00, %bb2265 ], [ %43, %bb2274 ]		; <float> [#uses=1]
85	%47 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
86	%48 = fptosi float %f1582.0 to i32		; <i32> [#uses=1]
87	%49 = getelementptr float, float* %36, i32 2		; <float*> [#uses=1]
88	%50 = load float, float* %49, align 4		; <float> [#uses=1]
89	%51 = getelementptr float, float* %36, i32 3		; <float*> [#uses=1]
90	%52 = load float, float* %51, align 4		; <float> [#uses=1]
91	%53 = fmul float %50, 6.553500e+04		; <float> [#uses=1]
92	%54 = fadd float %53, 5.000000e-01		; <float> [#uses=1]
93	%55 = fmul float %52, 6.553500e+04		; <float> [#uses=1]
94	%56 = fadd float %55, 5.000000e-01		; <float> [#uses=1]
95	%57 = fcmp olt float %54, 0.000000e+00		; <i1> [#uses=0]
96	%58 = fcmp olt float %56, 0.000000e+00		; <i1> [#uses=0]
97	%59 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
98	%60 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
99	%61 = zext i32 %47 to i64		; <i64> [#uses=1]
100	%62 = shl i64 %61, 48		; <i64> [#uses=1]
101	%63 = zext i32 %48 to i64		; <i64> [#uses=1]
102	%64 = shl i64 %63, 32		; <i64> [#uses=1]
103	%65 = sext i32 %59 to i64		; <i64> [#uses=1]
104	%66 = shl i64 %65, 16		; <i64> [#uses=1]
105	%67 = sext i32 %60 to i64		; <i64> [#uses=1]
106	%68 = or i64 %64, %62		; <i64> [#uses=1]
107	%69 = or i64 %68, %66		; <i64> [#uses=1]
108	%70 = or i64 %69, %67		; <i64> [#uses=2]
109	%71 = getelementptr i8, i8* null, i32 0		; <i8*> [#uses=1]
110	%72 = bitcast i8* %71 to float*		; <float*> [#uses=4]
111	%73 = load float, float* %72, align 4		; <float> [#uses=1]
112	%74 = getelementptr float, float* %72, i32 1		; <float*> [#uses=1]
113	%75 = load float, float* %74, align 4		; <float> [#uses=1]
114	%76 = fmul float %73, 6.553500e+04		; <float> [#uses=1]
115	%77 = fadd float %76, 5.000000e-01		; <float> [#uses=3]
116	%78 = fmul float %75, 6.553500e+04		; <float> [#uses=1]
117	%79 = fadd float %78, 5.000000e-01		; <float> [#uses=1]
118	%80 = fcmp olt float %77, 0.000000e+00		; <i1> [#uses=1]
119	br i1 %80, label %bb2295, label %bb2292
120
121bb2292:		; preds = %bb2277
122	%81 = fcmp ogt float %77, 6.553500e+04		; <i1> [#uses=1]
123	br i1 %81, label %bb2294, label %bb2295
124
125bb2294:		; preds = %bb2292
126	br label %bb2295
127
128bb2295:		; preds = %bb2294, %bb2292, %bb2277
129	%f0569.0 = phi float [ 6.553500e+04, %bb2294 ], [ 0.000000e+00, %bb2277 ], [ %77, %bb2292 ]		; <float> [#uses=1]
130	%82 = fcmp olt float %79, 0.000000e+00		; <i1> [#uses=0]
131	%83 = fptosi float %f0569.0 to i32		; <i32> [#uses=1]
132	%84 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
133	%85 = getelementptr float, float* %72, i32 2		; <float*> [#uses=1]
134	%86 = load float, float* %85, align 4		; <float> [#uses=1]
135	%87 = getelementptr float, float* %72, i32 3		; <float*> [#uses=1]
136	%88 = load float, float* %87, align 4		; <float> [#uses=1]
137	%89 = fmul float %86, 6.553500e+04		; <float> [#uses=1]
138	%90 = fadd float %89, 5.000000e-01		; <float> [#uses=1]
139	%91 = fmul float %88, 6.553500e+04		; <float> [#uses=1]
140	%92 = fadd float %91, 5.000000e-01		; <float> [#uses=1]
141	%93 = fcmp olt float %90, 0.000000e+00		; <i1> [#uses=0]
142	%94 = fcmp olt float %92, 0.000000e+00		; <i1> [#uses=0]
143	%95 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
144	%96 = fptosi float 0.000000e+00 to i32		; <i32> [#uses=1]
145	%97 = zext i32 %83 to i64		; <i64> [#uses=1]
146	%98 = shl i64 %97, 48		; <i64> [#uses=1]
147	%99 = zext i32 %84 to i64		; <i64> [#uses=1]
148	%100 = shl i64 %99, 32		; <i64> [#uses=1]
149	%101 = sext i32 %95 to i64		; <i64> [#uses=1]
150	%102 = shl i64 %101, 16		; <i64> [#uses=1]
151	%103 = sext i32 %96 to i64		; <i64> [#uses=1]
152	%104 = or i64 %100, %98		; <i64> [#uses=1]
153	%105 = or i64 %104, %102		; <i64> [#uses=1]
154	%106 = or i64 %105, %103		; <i64> [#uses=2]
155	%107 = shl i64 %70, 16		; <i64> [#uses=1]
156	%108 = and i64 %107, 4294901760		; <i64> [#uses=1]
157	%109 = and i64 %106, 65535		; <i64> [#uses=1]
158	%110 = or i64 %34, %32		; <i64> [#uses=1]
159	%111 = or i64 %110, %108		; <i64> [#uses=1]
160	%112 = or i64 %111, %109		; <i64> [#uses=1]
161	store i64 %70, i64* %4, align 16
162	store i64 %106, i64* %5, align 8
163	%113 = icmp eq i64 %112, 0		; <i1> [#uses=1]
164	br i1 %113, label %bb2325, label %bb2315
165
166bb2315:		; preds = %bb2295
167	%114 = icmp eq %struct.xx_t* %159, null		; <i1> [#uses=1]
168	br i1 %114, label %bb2318, label %bb2317
169
170bb2317:		; preds = %bb2315
171	%115 = load i64, i64* %2, align 16		; <i64> [#uses=1]
172	%116 = call i32 (...) @_u16a_cm( i64 %115, %struct.xx_t* %159, double 0.000000e+00, double 1.047551e+06 ) nounwind		; <i32> [#uses=1]
173	%117 = sext i32 %116 to i64		; <i64> [#uses=1]
174	store i64 %117, i64* %2, align 16
175	%118 = load i64, i64* %3, align 8		; <i64> [#uses=1]
176	%119 = call i32 (...) @_u16a_cm( i64 %118, %struct.xx_t* %159, double 0.000000e+00, double 1.047551e+06 ) nounwind		; <i32> [#uses=1]
177	%120 = sext i32 %119 to i64		; <i64> [#uses=1]
178	store i64 %120, i64* %3, align 8
179	%121 = load i64, i64* %4, align 16		; <i64> [#uses=1]
180	%122 = call i32 (...) @_u16a_cm( i64 %121, %struct.xx_t* %159, double 0.000000e+00, double 1.047551e+06 ) nounwind		; <i32> [#uses=1]
181	%123 = sext i32 %122 to i64		; <i64> [#uses=1]
182	store i64 %123, i64* %4, align 16
183	%124 = load i64, i64* %5, align 8		; <i64> [#uses=1]
184	%125 = call i32 (...) @_u16a_cm( i64 %124, %struct.xx_t* %159, double 0.000000e+00, double 1.047551e+06 ) nounwind		; <i32> [#uses=0]
185	unreachable
186
187bb2318:		; preds = %bb2315
188	%126 = getelementptr %struct.CGLSI, %struct.CGLSI* %src, i32 %indvar5021, i32 8		; <%struct.vv_t*> [#uses=1]
189	%127 = bitcast %struct.vv_t* %126 to i64*		; <i64*> [#uses=1]
190	%128 = load i64, i64* %127, align 8		; <i64> [#uses=1]
191	%129 = trunc i64 %128 to i32		; <i32> [#uses=4]
192	%130 = load i64, i64* %2, align 16		; <i64> [#uses=1]
193	%131 = call i32 (...) @_u16_ff( i64 %130, i32 %129 ) nounwind		; <i32> [#uses=1]
194	%132 = sext i32 %131 to i64		; <i64> [#uses=1]
195	store i64 %132, i64* %2, align 16
196	%133 = load i64, i64* %3, align 8		; <i64> [#uses=1]
197	%134 = call i32 (...) @_u16_ff( i64 %133, i32 %129 ) nounwind		; <i32> [#uses=1]
198	%135 = sext i32 %134 to i64		; <i64> [#uses=1]
199	store i64 %135, i64* %3, align 8
200	%136 = load i64, i64* %4, align 16		; <i64> [#uses=1]
201	%137 = call i32 (...) @_u16_ff( i64 %136, i32 %129 ) nounwind		; <i32> [#uses=1]
202	%138 = sext i32 %137 to i64		; <i64> [#uses=1]
203	store i64 %138, i64* %4, align 16
204	%139 = load i64, i64* %5, align 8		; <i64> [#uses=1]
205	%140 = call i32 (...) @_u16_ff( i64 %139, i32 %129 ) nounwind		; <i32> [#uses=0]
206	unreachable
207
208bb2319:		; preds = %bb2326
209	%141 = getelementptr %struct.CGLSI, %struct.CGLSI* %src, i32 %indvar5021, i32 2		; <i8**> [#uses=1]
210	%142 = load i8*, i8** %141, align 4		; <i8*> [#uses=4]
211	%143 = getelementptr i8, i8* %142, i32 0		; <i8*> [#uses=1]
212	%144 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, i8* %143 ) nounwind		; <i32> [#uses=1]
213	%145 = sext i32 %144 to i64		; <i64> [#uses=2]
214	%146 = getelementptr i8, i8* %142, i32 0		; <i8*> [#uses=1]
215	%147 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, i8* %146 ) nounwind		; <i32> [#uses=1]
216	%148 = sext i32 %147 to i64		; <i64> [#uses=2]
217	%149 = shl i64 %145, 48		; <i64> [#uses=0]
218	%150 = shl i64 %148, 32		; <i64> [#uses=1]
219	%151 = and i64 %150, 281470681743360		; <i64> [#uses=0]
220	store i64 %145, i64* %2, align 16
221	store i64 %148, i64* %3, align 8
222	%152 = getelementptr i8, i8* %142, i32 0		; <i8*> [#uses=1]
223	%153 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, i8* %152 ) nounwind		; <i32> [#uses=1]
224	%154 = sext i32 %153 to i64		; <i64> [#uses=0]
225	%155 = getelementptr i8, i8* %142, i32 0		; <i8*> [#uses=1]
226	%156 = call i32 (...) @_u16_sf32( double 0.000000e+00, double 6.553500e+04, double 5.000000e-01, i8* %155 ) nounwind		; <i32> [#uses=0]
227	unreachable
228
229bb2325:		; preds = %bb2326, %bb2295
230	%indvar.next5145 = add i32 %indvar5021, 1		; <i32> [#uses=1]
231	br label %bb2326
232
233bb2326:		; preds = %bb2325, %bb.nph4945
234	%indvar5021 = phi i32 [ 0, %bb.nph4945 ], [ %indvar.next5145, %bb2325 ]		; <i32> [#uses=6]
235	%157 = icmp slt i32 %indvar5021, %n		; <i1> [#uses=0]
236	%158 = getelementptr %struct.CGLSI, %struct.CGLSI* %src, i32 %indvar5021, i32 10		; <%struct.xx_t**> [#uses=1]
237	%159 = load %struct.xx_t*, %struct.xx_t** %158, align 4		; <%struct.xx_t*> [#uses=5]
238	%160 = getelementptr %struct.CGLSI, %struct.CGLSI* %src, i32 %indvar5021, i32 1		; <i32*> [#uses=1]
239	%161 = load i32, i32* %160, align 4		; <i32> [#uses=1]
240	%162 = and i32 %161, 255		; <i32> [#uses=1]
241	switch i32 %162, label %bb2325 [
242		 i32 59, label %bb2217
243		 i32 60, label %bb2319
244	]
245
246return:		; preds = %entry
247	ret void
248}
249
250declare i32 @_u16_ff(...)
251
252declare i32 @_u16a_cm(...)
253
254declare i32 @_u16_sf32(...)
255