1 ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic -frame-pointer=all
3 %struct..0objc_selector = type opaque
4 %struct.NSString = type opaque
5 %struct.XCStringList = type { i32, ptr }
6 %struct._XCStringListNode = type { [3 x i8], [0 x i8], i8 }
7 %struct.__builtin_CFString = type { ptr, i32, ptr, i32 }
8 @0 = internal constant %struct.__builtin_CFString { ptr @__CFConstantStringClassReference, i32 1992, ptr @"\01LC", i32 2 } ; <ptr>:0 [#uses=1]
9 @__CFConstantStringClassReference = external global [0 x i32] ; <ptr> [#uses=1]
10 @"\01LC" = internal constant [3 x i8] c"NO\00" ; <ptr> [#uses=1]
11 @"\01LC1" = internal constant [1 x i8] zeroinitializer ; <ptr> [#uses=1]
12 @llvm.used1 = appending global [1 x ptr] [ ptr @"-[XCStringList stringRepresentation]" ], section "llvm.metadata" ; <ptr> [#uses=0]
14 define ptr @"-[XCStringList stringRepresentation]"(ptr %self, ptr %_cmd) nounwind {
16 %0 = load i32, ptr null, align 4 ; <i32> [#uses=1]
17 %1 = and i32 %0, 16777215 ; <i32> [#uses=1]
18 %2 = icmp eq i32 %1, 0 ; <i1> [#uses=1]
19 br i1 %2, label %bb44, label %bb4
22 %3 = load ptr, ptr null, align 4 ; <ptr> [#uses=2]
23 %4 = icmp eq ptr %3, null ; <i1> [#uses=1]
29 bb19: ; preds = %bb37, %bb6
30 %.rle = phi i32 [ 0, %bb6 ], [ %9, %bb37 ] ; <i32> [#uses=1]
31 %bufptr.0.lcssa = phi ptr [ null, %bb6 ], [ null, %bb37 ] ; <ptr> [#uses=2]
32 %5 = and i32 %.rle, 16777215 ; <i32> [#uses=1]
33 %6 = icmp eq i32 %5, 0 ; <i1> [#uses=1]
34 br i1 %6, label %bb25.split, label %bb37
36 bb25.split: ; preds = %bb19
37 call void @foo(ptr @"\01LC1") nounwind nounwind
40 bb34: ; preds = %bb35, %bb35, %bb35, %bb35
41 %7 = getelementptr i8, ptr %bufptr.0.lcssa, i32 %totalLength.0.ph ; <ptr> [#uses=1]
42 store i8 92, ptr %7, align 1
45 bb35.outer: ; preds = %bb34, %bb25.split
46 %totalLength.0.ph = add i32 0, %totalLength.1.ph ; <i32> [#uses=2]
49 bb35: ; preds = %bb35, %bb35.outer
50 %8 = load i8, ptr null, align 1 ; <i8> [#uses=1]
51 switch i8 %8, label %bb35 [
52 i8 0, label %bb37.outer
59 bb37.outer: ; preds = %bb35, %bb4
60 %totalLength.1.ph = phi i32 [ 0, %bb4 ], [ %totalLength.0.ph, %bb35 ] ; <i32> [#uses=1]
61 %bufptr.1.ph = phi ptr [ null, %bb4 ], [ %bufptr.0.lcssa, %bb35 ] ; <ptr> [#uses=2]
62 br i1 %4, label %bb39.split, label %bb37
64 bb37: ; preds = %bb37.outer, %bb19
65 %9 = load i32, ptr %3, align 4 ; <i32> [#uses=1]
66 br i1 false, label %bb6, label %bb19
68 bb39.split: ; preds = %bb37.outer
69 %10 = icmp eq ptr null, %bufptr.1.ph ; <i1> [#uses=1]
70 br i1 %10, label %bb44, label %bb42
72 bb42: ; preds = %bb39.split
73 call void @quux(ptr %bufptr.1.ph) nounwind nounwind
76 bb44: ; preds = %bb39.split, %entry
77 %.0 = phi ptr [ @0, %entry ], [ null, %bb39.split ] ; <ptr> [#uses=1]
81 declare void @foo(ptr)
83 declare void @quux(ptr)