1; RUN: llc < %s -mtriple=x86_64-unknown-freebsd7.2
2; PR4478
3
4	%struct.sockaddr = type <{ i8, i8, [14 x i8] }>
5
6define i32 @main(i32 %argc, i8** %argv) nounwind {
7entry:
8	br label %while.cond
9
10while.cond:		; preds = %sw.bb6, %entry
11	switch i32 undef, label %sw.default [
12		i32 -1, label %while.end
13		i32 119, label %sw.bb6
14	]
15
16sw.bb6:		; preds = %while.cond
17	br i1 undef, label %if.then, label %while.cond
18
19if.then:		; preds = %sw.bb6
20	ret i32 1
21
22sw.default:		; preds = %while.cond
23	ret i32 1
24
25while.end:		; preds = %while.cond
26	br i1 undef, label %if.then15, label %if.end16
27
28if.then15:		; preds = %while.end
29	ret i32 1
30
31if.end16:		; preds = %while.end
32	br i1 undef, label %lor.lhs.false, label %if.then21
33
34lor.lhs.false:		; preds = %if.end16
35	br i1 undef, label %if.end22, label %if.then21
36
37if.then21:		; preds = %lor.lhs.false, %if.end16
38	ret i32 1
39
40if.end22:		; preds = %lor.lhs.false
41	br i1 undef, label %lor.lhs.false27, label %if.then51
42
43lor.lhs.false27:		; preds = %if.end22
44	br i1 undef, label %lor.lhs.false39, label %if.then51
45
46lor.lhs.false39:		; preds = %lor.lhs.false27
47	br i1 undef, label %if.end52, label %if.then51
48
49if.then51:		; preds = %lor.lhs.false39, %lor.lhs.false27, %if.end22
50	ret i32 1
51
52if.end52:		; preds = %lor.lhs.false39
53	br i1 undef, label %if.then57, label %if.end58
54
55if.then57:		; preds = %if.end52
56	ret i32 1
57
58if.end58:		; preds = %if.end52
59	br i1 undef, label %if.then64, label %if.end65
60
61if.then64:		; preds = %if.end58
62	ret i32 1
63
64if.end65:		; preds = %if.end58
65	br i1 undef, label %if.then71, label %if.end72
66
67if.then71:		; preds = %if.end65
68	ret i32 1
69
70if.end72:		; preds = %if.end65
71	br i1 undef, label %if.then83, label %if.end84
72
73if.then83:		; preds = %if.end72
74	ret i32 1
75
76if.end84:		; preds = %if.end72
77	br i1 undef, label %if.then101, label %if.end102
78
79if.then101:		; preds = %if.end84
80	ret i32 1
81
82if.end102:		; preds = %if.end84
83	br i1 undef, label %if.then113, label %if.end114
84
85if.then113:		; preds = %if.end102
86	ret i32 1
87
88if.end114:		; preds = %if.end102
89	br i1 undef, label %if.then209, label %if.end210
90
91if.then209:		; preds = %if.end114
92	ret i32 1
93
94if.end210:		; preds = %if.end114
95	br i1 undef, label %if.then219, label %if.end220
96
97if.then219:		; preds = %if.end210
98	ret i32 1
99
100if.end220:		; preds = %if.end210
101	br i1 undef, label %if.end243, label %lor.lhs.false230
102
103lor.lhs.false230:		; preds = %if.end220
104	unreachable
105
106if.end243:		; preds = %if.end220
107	br i1 undef, label %if.then249, label %if.end250
108
109if.then249:		; preds = %if.end243
110	ret i32 1
111
112if.end250:		; preds = %if.end243
113	br i1 undef, label %if.end261, label %if.then260
114
115if.then260:		; preds = %if.end250
116	ret i32 1
117
118if.end261:		; preds = %if.end250
119	br i1 undef, label %if.then270, label %if.end271
120
121if.then270:		; preds = %if.end261
122	ret i32 1
123
124if.end271:		; preds = %if.end261
125	%call.i = call i32 @arc4random() nounwind		; <i32> [#uses=1]
126	%rem.i = urem i32 %call.i, 16383		; <i32> [#uses=1]
127	%rem1.i = trunc i32 %rem.i to i16		; <i16> [#uses=1]
128	%conv2.i = or i16 %rem1.i, -16384		; <i16> [#uses=1]
129	%0 = call i16 asm "xchgb ${0:h}, ${0:b}", "=Q,0,~{dirflag},~{fpsr},~{flags}"(i16 %conv2.i) nounwind		; <i16> [#uses=1]
130	store i16 %0, i16* undef
131	%call281 = call i32 @bind(i32 undef, %struct.sockaddr* undef, i32 16) nounwind		; <i32> [#uses=0]
132	unreachable
133}
134
135declare i32 @bind(i32, %struct.sockaddr*, i32)
136
137declare i32 @arc4random()
138