1; RUN: llc < %s -mtriple=powerpc-apple-darwin10
2; rdar://6692215
3
4define fastcc void @_qsort(i8* %a, i32 %n, i32 %es, i32 (i8*, i8*)* %cmp, i32 %depth_limit) nounwind optsize ssp {
5entry:
6	br i1 false, label %bb21, label %bb20.loopexit
7
8bb20.loopexit:		; preds = %entry
9	ret void
10
11bb21:		; preds = %entry
12	%0 = getelementptr i8, i8* %a, i32 0		; <i8*> [#uses=2]
13	br label %bb35
14
15bb29:		; preds = %bb35
16	br i1 false, label %bb7.i252, label %bb34
17
18bb7.i252:		; preds = %bb7.i252, %bb29
19	%pj.0.rec.i247 = phi i32 [ %indvar.next488, %bb7.i252 ], [ 0, %bb29 ]		; <i32> [#uses=2]
20	%pi.0.i248 = getelementptr i8, i8* %pa.1, i32 %pj.0.rec.i247		; <i8*> [#uses=0]
21	%indvar.next488 = add i32 %pj.0.rec.i247, 1		; <i32> [#uses=1]
22	br i1 false, label %bb34, label %bb7.i252
23
24bb34:		; preds = %bb7.i252, %bb29
25	%indvar.next505 = add i32 %indvar504, 1		; <i32> [#uses=1]
26	br label %bb35
27
28bb35:		; preds = %bb34, %bb21
29	%indvar504 = phi i32 [ %indvar.next505, %bb34 ], [ 0, %bb21 ]		; <i32> [#uses=2]
30	%pa.1 = phi i8* [ null, %bb34 ], [ %0, %bb21 ]		; <i8*> [#uses=2]
31	%pb.0.rec = mul i32 %indvar504, %es		; <i32> [#uses=1]
32	br i1 false, label %bb43, label %bb29
33
34bb43:		; preds = %bb43, %bb35
35	br i1 false, label %bb50, label %bb43
36
37bb50:		; preds = %bb43
38	%1 = ptrtoint i8* %pa.1 to i32		; <i32> [#uses=1]
39	%2 = sub i32 %1, 0		; <i32> [#uses=2]
40	%3 = icmp sle i32 0, %2		; <i1> [#uses=1]
41	%min = select i1 %3, i32 0, i32 %2		; <i32> [#uses=1]
42	br label %bb7.i161
43
44bb7.i161:		; preds = %bb7.i161, %bb50
45	%pj.0.rec.i156 = phi i32 [ %indvar.next394, %bb7.i161 ], [ 0, %bb50 ]		; <i32> [#uses=2]
46	%.sum279 = sub i32 %pj.0.rec.i156, %min		; <i32> [#uses=1]
47	%pb.0.sum542 = add i32 %pb.0.rec, %.sum279		; <i32> [#uses=1]
48	%pj.0.i158 = getelementptr i8, i8* %0, i32 %pb.0.sum542		; <i8*> [#uses=0]
49	%indvar.next394 = add i32 %pj.0.rec.i156, 1		; <i32> [#uses=1]
50	br label %bb7.i161
51}
52