1 ; RUN: llc < %s -mtriple=i686-apple-darwin | grep "48(%esp)" | count 5
3 %struct..0anon = type { i32 }
4 %struct.rtvec_def = type { i32, [1 x %struct..0anon] }
5 %struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
6 @rtx_format = external global [116 x i8*] ; <[116 x i8*]*> [#uses=1]
7 @rtx_length = external global [117 x i32] ; <[117 x i32]*> [#uses=1]
9 declare %struct.rtx_def* @fixup_memory_subreg(%struct.rtx_def*, %struct.rtx_def*, i32)
11 define %struct.rtx_def* @walk_fixup_memory_subreg(%struct.rtx_def* %x, %struct.rtx_def* %insn) {
13 %tmp2 = icmp eq %struct.rtx_def* %x, null ; <i1> [#uses=1]
14 br i1 %tmp2, label %UnifiedReturnBlock, label %cond_next
16 cond_next: ; preds = %entry
17 %tmp6 = getelementptr %struct.rtx_def* %x, i32 0, i32 0 ; <i16*> [#uses=1]
18 %tmp7 = load i16* %tmp6 ; <i16> [#uses=2]
19 %tmp78 = zext i16 %tmp7 to i32 ; <i32> [#uses=2]
20 %tmp10 = icmp eq i16 %tmp7, 54 ; <i1> [#uses=1]
21 br i1 %tmp10, label %cond_true13, label %cond_next32
23 cond_true13: ; preds = %cond_next
24 %tmp15 = getelementptr %struct.rtx_def* %x, i32 0, i32 3 ; <[1 x %struct..0anon]*> [#uses=1]
25 %tmp1718 = bitcast [1 x %struct..0anon]* %tmp15 to %struct.rtx_def** ; <%struct.rtx_def**> [#uses=1]
26 %tmp19 = load %struct.rtx_def** %tmp1718 ; <%struct.rtx_def*> [#uses=1]
27 %tmp20 = getelementptr %struct.rtx_def* %tmp19, i32 0, i32 0 ; <i16*> [#uses=1]
28 %tmp21 = load i16* %tmp20 ; <i16> [#uses=1]
29 %tmp22 = icmp eq i16 %tmp21, 57 ; <i1> [#uses=1]
30 br i1 %tmp22, label %cond_true25, label %cond_next32
32 cond_true25: ; preds = %cond_true13
33 %tmp29 = tail call %struct.rtx_def* @fixup_memory_subreg( %struct.rtx_def* %x, %struct.rtx_def* %insn, i32 1 ) ; <%struct.rtx_def*> [#uses=1]
34 ret %struct.rtx_def* %tmp29
36 cond_next32: ; preds = %cond_true13, %cond_next
37 %tmp34 = getelementptr [116 x i8*]* @rtx_format, i32 0, i32 %tmp78 ; <i8**> [#uses=1]
38 %tmp35 = load i8** %tmp34, align 4 ; <i8*> [#uses=1]
39 %tmp37 = getelementptr [117 x i32]* @rtx_length, i32 0, i32 %tmp78 ; <i32*> [#uses=1]
40 %tmp38 = load i32* %tmp37, align 4 ; <i32> [#uses=1]
41 %i.011 = add i32 %tmp38, -1 ; <i32> [#uses=2]
42 %tmp12513 = icmp sgt i32 %i.011, -1 ; <i1> [#uses=1]
43 br i1 %tmp12513, label %bb, label %UnifiedReturnBlock
45 bb: ; preds = %bb123, %cond_next32
46 %indvar = phi i32 [ %indvar.next26, %bb123 ], [ 0, %cond_next32 ] ; <i32> [#uses=2]
47 %i.01.0 = sub i32 %i.011, %indvar ; <i32> [#uses=5]
48 %tmp42 = getelementptr i8* %tmp35, i32 %i.01.0 ; <i8*> [#uses=2]
49 %tmp43 = load i8* %tmp42 ; <i8> [#uses=1]
50 switch i8 %tmp43, label %bb123 [
51 i8 101, label %cond_true47
52 i8 69, label %bb105.preheader
55 cond_true47: ; preds = %bb
56 %tmp52 = getelementptr %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0 ; <%struct..0anon*> [#uses=1]
57 %tmp5354 = bitcast %struct..0anon* %tmp52 to %struct.rtx_def** ; <%struct.rtx_def**> [#uses=1]
58 %tmp55 = load %struct.rtx_def** %tmp5354 ; <%struct.rtx_def*> [#uses=1]
59 %tmp58 = tail call %struct.rtx_def* @walk_fixup_memory_subreg( %struct.rtx_def* %tmp55, %struct.rtx_def* %insn ) ; <%struct.rtx_def*> [#uses=1]
60 %tmp62 = getelementptr %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0, i32 0 ; <i32*> [#uses=1]
61 %tmp58.c = ptrtoint %struct.rtx_def* %tmp58 to i32 ; <i32> [#uses=1]
62 store i32 %tmp58.c, i32* %tmp62
63 %tmp6816 = load i8* %tmp42 ; <i8> [#uses=1]
64 %tmp6917 = icmp eq i8 %tmp6816, 69 ; <i1> [#uses=1]
65 br i1 %tmp6917, label %bb105.preheader, label %bb123
67 bb105.preheader: ; preds = %cond_true47, %bb
68 %tmp11020 = getelementptr %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0 ; <%struct..0anon*> [#uses=1]
69 %tmp11111221 = bitcast %struct..0anon* %tmp11020 to %struct.rtvec_def** ; <%struct.rtvec_def**> [#uses=3]
70 %tmp11322 = load %struct.rtvec_def** %tmp11111221 ; <%struct.rtvec_def*> [#uses=1]
71 %tmp11423 = getelementptr %struct.rtvec_def* %tmp11322, i32 0, i32 0 ; <i32*> [#uses=1]
72 %tmp11524 = load i32* %tmp11423 ; <i32> [#uses=1]
73 %tmp11625 = icmp eq i32 %tmp11524, 0 ; <i1> [#uses=1]
74 br i1 %tmp11625, label %bb123, label %bb73
76 bb73: ; preds = %bb73, %bb105.preheader
77 %j.019 = phi i32 [ %tmp104, %bb73 ], [ 0, %bb105.preheader ] ; <i32> [#uses=3]
78 %tmp81 = load %struct.rtvec_def** %tmp11111221 ; <%struct.rtvec_def*> [#uses=2]
79 %tmp92 = getelementptr %struct.rtvec_def* %tmp81, i32 0, i32 1, i32 %j.019 ; <%struct..0anon*> [#uses=1]
80 %tmp9394 = bitcast %struct..0anon* %tmp92 to %struct.rtx_def** ; <%struct.rtx_def**> [#uses=1]
81 %tmp95 = load %struct.rtx_def** %tmp9394 ; <%struct.rtx_def*> [#uses=1]
82 %tmp98 = tail call %struct.rtx_def* @walk_fixup_memory_subreg( %struct.rtx_def* %tmp95, %struct.rtx_def* %insn ) ; <%struct.rtx_def*> [#uses=1]
83 %tmp101 = getelementptr %struct.rtvec_def* %tmp81, i32 0, i32 1, i32 %j.019, i32 0 ; <i32*> [#uses=1]
84 %tmp98.c = ptrtoint %struct.rtx_def* %tmp98 to i32 ; <i32> [#uses=1]
85 store i32 %tmp98.c, i32* %tmp101
86 %tmp104 = add i32 %j.019, 1 ; <i32> [#uses=2]
87 %tmp113 = load %struct.rtvec_def** %tmp11111221 ; <%struct.rtvec_def*> [#uses=1]
88 %tmp114 = getelementptr %struct.rtvec_def* %tmp113, i32 0, i32 0 ; <i32*> [#uses=1]
89 %tmp115 = load i32* %tmp114 ; <i32> [#uses=1]
90 %tmp116 = icmp ult i32 %tmp104, %tmp115 ; <i1> [#uses=1]
91 br i1 %tmp116, label %bb73, label %bb123
93 bb123: ; preds = %bb73, %bb105.preheader, %cond_true47, %bb
94 %i.0 = add i32 %i.01.0, -1 ; <i32> [#uses=1]
95 %tmp125 = icmp sgt i32 %i.0, -1 ; <i1> [#uses=1]
96 %indvar.next26 = add i32 %indvar, 1 ; <i32> [#uses=1]
97 br i1 %tmp125, label %bb, label %UnifiedReturnBlock
99 UnifiedReturnBlock: ; preds = %bb123, %cond_next32, %entry
100 %UnifiedRetVal = phi %struct.rtx_def* [ null, %entry ], [ %x, %cond_next32 ], [ %x, %bb123 ] ; <%struct.rtx_def*> [#uses=1]
101 ret %struct.rtx_def* %UnifiedRetVal