1 ; RUN: llvm-as < %s | opt -simplify-libcalls
4 %struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, i8*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64, %struct.pthread_mutex*, %struct.pthread*, i32, i32, %union.anon }
5 %struct.__sbuf = type { i8*, i32, [4 x i8] }
6 %struct.pthread = type opaque
7 %struct.pthread_mutex = type opaque
8 %union.anon = type { i64, [120 x i8] }
9 @.str13 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1]
10 @.str14 = external constant [2 x i8] ; <[2 x i8]*> [#uses=1]
12 define i32 @main(i32 %argc, i8** %argv) nounwind {
14 br i1 undef, label %if.then.i, label %xmalloc.exit
16 if.then.i: ; preds = %entry
19 xmalloc.exit: ; preds = %entry
20 br i1 undef, label %if.then.i11, label %xmalloc.exit13
22 if.then.i11: ; preds = %xmalloc.exit
25 xmalloc.exit13: ; preds = %xmalloc.exit
28 while.cond: ; preds = %sw.bb124, %if.end59, %if.end, %while.cond, %xmalloc.exit13
29 switch i32 undef, label %sw.default [
30 i32 -1, label %for.cond
31 i32 0, label %while.cond
32 i32 4097, label %sw.bb36
33 i32 102, label %sw.bb55
34 i32 111, label %sw.bb55
35 i32 108, label %sw.bb62
36 i32 99, label %sw.bb84
37 i32 86, label %sw.bb114
38 i32 66, label %sw.bb124
41 sw.bb36: ; preds = %while.cond
42 br i1 undef, label %if.end, label %if.then
44 if.then: ; preds = %sw.bb36
47 if.end: ; preds = %sw.bb36
50 sw.bb55: ; preds = %while.cond, %while.cond
51 br i1 undef, label %if.end59, label %if.then58
53 if.then58: ; preds = %sw.bb55
56 if.end59: ; preds = %if.then58, %sw.bb55
59 sw.bb62: ; preds = %while.cond
62 sw.bb84: ; preds = %while.cond
65 sw.bb114: ; preds = %while.cond
68 sw.bb124: ; preds = %while.cond
71 sw.default: ; preds = %while.cond
74 for.cond: ; preds = %while.cond
75 br i1 undef, label %if.end167, label %if.then8.i
77 if.then8.i: ; preds = %for.cond
80 if.end167: ; preds = %for.cond
81 br i1 undef, label %if.then174, label %if.end175
83 if.then174: ; preds = %if.end167
86 if.end175: ; preds = %if.end167
87 br i1 undef, label %if.then179, label %if.end181
89 if.then179: ; preds = %if.end175
92 if.end181: ; preds = %if.end175
93 br i1 undef, label %if.then.i.i189, label %while.cond.i194
95 if.then.i.i189: ; preds = %if.end181
98 while.cond.i194: ; preds = %if.end181
99 br i1 undef, label %while.body.i198, label %for.cond.i.i202
101 while.body.i198: ; preds = %while.cond.i194
104 for.cond.i.i202: ; preds = %while.cond.i194
105 br i1 undef, label %if.end197, label %if.then191
107 if.then191: ; preds = %for.cond.i.i202
110 if.end197: ; preds = %for.cond.i.i202
111 br label %for.cond.i144
113 for.cond.i144: ; preds = %for.body.i145, %if.end197
114 br i1 undef, label %for.body.i145, label %for.cond24.i
116 for.body.i145: ; preds = %for.cond.i144
117 br label %for.cond.i144
119 for.cond24.i: ; preds = %for.cond.i144
120 br label %for.cond78.i
122 for.cond78.i: ; preds = %for.body84.i, %for.cond24.i
123 br i1 undef, label %for.end94.i, label %for.body84.i
125 for.body84.i: ; preds = %for.cond78.i
126 br label %for.cond78.i
128 for.end94.i: ; preds = %for.cond78.i
129 br i1 undef, label %if.then.i.i139, label %linebuffer_init.exit142
131 if.then.i.i139: ; preds = %for.end94.i
132 br label %linebuffer_init.exit142
134 linebuffer_init.exit142: ; preds = %if.then.i.i139, %for.end94.i
135 br i1 undef, label %if.then.i.i124, label %linebuffer_init.exit129
137 if.then.i.i124: ; preds = %linebuffer_init.exit142
140 linebuffer_init.exit129: ; preds = %linebuffer_init.exit142
141 br i1 undef, label %if.then.i.i110, label %linebuffer_init.exit113
143 if.then.i.i110: ; preds = %linebuffer_init.exit129
146 linebuffer_init.exit113: ; preds = %linebuffer_init.exit129
147 br i1 undef, label %if.then.i.i98, label %linebuffer_init.exit
149 if.then.i.i98: ; preds = %linebuffer_init.exit113
150 br label %linebuffer_init.exit
152 linebuffer_init.exit: ; preds = %if.then.i.i98, %linebuffer_init.exit113
153 br i1 undef, label %if.then227, label %while.cond.i50
155 if.then227: ; preds = %linebuffer_init.exit
158 while.cond.i50: ; preds = %linebuffer_init.exit
159 br i1 undef, label %while.end339, label %while.body334
161 while.body334: ; preds = %while.cond.i50
164 while.end339: ; preds = %while.cond.i50
165 br i1 undef, label %if.then344, label %if.end346
167 if.then344: ; preds = %while.end339
170 if.end346: ; preds = %while.end339
171 call void @exit(i32 0) nounwind
172 %cond392 = select i1 undef, i8* getelementptr ([2 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str14, i32 0, i32 0) ; <i8*> [#uses=1]
173 %call393 = call %struct.__sFILE* @fopen(i8* undef, i8* %cond392) nounwind ; <%struct.__sFILE*> [#uses=0]
177 declare %struct.__sFILE* @fopen(i8*, i8*)
179 declare void @exit(i32)