1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -inline -instcombine -jump-threading -licm -loop-unswitch -instcombine -indvars -loop-deletion -gvn -simplifycfg -verify -disable-output 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" 4*9880d681SAndroid Build Coastguard Workertarget triple = "i386-apple-darwin9" 5*9880d681SAndroid Build Coastguard Worker %struct.BF_BitstreamElement = type { i32, i16 } 6*9880d681SAndroid Build Coastguard Worker %struct.BF_BitstreamPart = type { i32, %struct.BF_BitstreamElement* } 7*9880d681SAndroid Build Coastguard Worker %struct.BF_PartHolder = type { i32, %struct.BF_BitstreamPart* } 8*9880d681SAndroid Build Coastguard Worker %struct.Bit_stream_struc = type { i8*, i32, %struct.FILE*, i8*, i32, i32, i32, i32 } 9*9880d681SAndroid Build Coastguard Worker %struct.FILE = 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, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } 10*9880d681SAndroid Build Coastguard Worker %struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] } 11*9880d681SAndroid Build Coastguard Worker %struct.III_side_info_t = type { i32, i32, i32, [2 x [4 x i32]], [2 x %struct.anon] } 12*9880d681SAndroid Build Coastguard Worker %struct.__sFILEX = type opaque 13*9880d681SAndroid Build Coastguard Worker %struct.__sbuf = type { i8*, i32 } 14*9880d681SAndroid Build Coastguard Worker %struct.anon = type { [2 x %struct.gr_info_ss] } 15*9880d681SAndroid Build Coastguard Worker %struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] } 16*9880d681SAndroid Build Coastguard Worker %struct.gr_info_ss = type { %struct.gr_info } 17*9880d681SAndroid Build Coastguard Worker %struct.lame_global_flags = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 } 18*9880d681SAndroid Build Coastguard Worker@scaleFactorsPH = external global [2 x [2 x %struct.BF_PartHolder*]] ; <[2 x [2 x %struct.BF_PartHolder*]]*> [#uses=1] 19*9880d681SAndroid Build Coastguard Worker@slen1_tab = external constant [16 x i32] ; <[16 x i32]*> [#uses=1] 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Workerdeclare %struct.BF_PartHolder* @BF_addElement(%struct.BF_PartHolder*, %struct.BF_BitstreamElement*) nounwind 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Workerdefine %struct.BF_PartHolder* @BF_addEntry(%struct.BF_PartHolder* %thePH, i32 %value, i32 %length) nounwind { 24*9880d681SAndroid Build Coastguard Workerentry: 25*9880d681SAndroid Build Coastguard Worker %myElement = alloca %struct.BF_BitstreamElement ; <%struct.BF_BitstreamElement*> [#uses=2] 26*9880d681SAndroid Build Coastguard Worker %tmp1 = getelementptr %struct.BF_BitstreamElement, %struct.BF_BitstreamElement* %myElement, i32 0, i32 0 ; <i32*> [#uses=1] 27*9880d681SAndroid Build Coastguard Worker store i32 %value, i32* %tmp1, align 8 28*9880d681SAndroid Build Coastguard Worker %tmp7 = icmp eq i32 %length, 0 ; <i1> [#uses=1] 29*9880d681SAndroid Build Coastguard Worker br i1 %tmp7, label %bb13, label %bb 30*9880d681SAndroid Build Coastguard Worker 31*9880d681SAndroid Build Coastguard Workerbb: ; preds = %entry 32*9880d681SAndroid Build Coastguard Worker %tmp10 = call %struct.BF_PartHolder* @BF_addElement( %struct.BF_PartHolder* %thePH, %struct.BF_BitstreamElement* %myElement ) nounwind ; <%struct.BF_PartHolder*> [#uses=1] 33*9880d681SAndroid Build Coastguard Worker ret %struct.BF_PartHolder* %tmp10 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Workerbb13: ; preds = %entry 36*9880d681SAndroid Build Coastguard Worker ret %struct.BF_PartHolder* %thePH 37*9880d681SAndroid Build Coastguard Worker} 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Workerdefine void @III_format_bitstream(%struct.lame_global_flags* %gfp, i32 %bitsPerFrame, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %l3_side, [2 x %struct.III_scalefac_t]* %scalefac, %struct.Bit_stream_struc* %in_bs) nounwind { 40*9880d681SAndroid Build Coastguard Workerentry: 41*9880d681SAndroid Build Coastguard Worker call fastcc void @encodeMainData( %struct.lame_global_flags* %gfp, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %l3_side, [2 x %struct.III_scalefac_t]* %scalefac ) nounwind 42*9880d681SAndroid Build Coastguard Worker unreachable 43*9880d681SAndroid Build Coastguard Worker} 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Workerdefine internal fastcc void @encodeMainData(%struct.lame_global_flags* %gfp, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %si, [2 x %struct.III_scalefac_t]* %scalefac) nounwind { 46*9880d681SAndroid Build Coastguard Workerentry: 47*9880d681SAndroid Build Coastguard Worker %tmp69 = getelementptr %struct.lame_global_flags, %struct.lame_global_flags* %gfp, i32 0, i32 43 ; <i32*> [#uses=1] 48*9880d681SAndroid Build Coastguard Worker %tmp70 = load i32, i32* %tmp69, align 4 ; <i32> [#uses=1] 49*9880d681SAndroid Build Coastguard Worker %tmp71 = icmp eq i32 %tmp70, 1 ; <i1> [#uses=1] 50*9880d681SAndroid Build Coastguard Worker br i1 %tmp71, label %bb352, label %bb498 51*9880d681SAndroid Build Coastguard Worker 52*9880d681SAndroid Build Coastguard Workerbb113: ; preds = %bb132 53*9880d681SAndroid Build Coastguard Worker %tmp123 = getelementptr [2 x %struct.III_scalefac_t], [2 x %struct.III_scalefac_t]* %scalefac, i32 0, i32 0, i32 1, i32 %sfb.0, i32 %window.0 ; <i32*> [#uses=1] 54*9880d681SAndroid Build Coastguard Worker %tmp124 = load i32, i32* %tmp123, align 4 ; <i32> [#uses=1] 55*9880d681SAndroid Build Coastguard Worker %tmp126 = load %struct.BF_PartHolder*, %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1] 56*9880d681SAndroid Build Coastguard Worker %tmp128 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp126, i32 %tmp124, i32 %tmp93 ) nounwind ; <%struct.BF_PartHolder*> [#uses=1] 57*9880d681SAndroid Build Coastguard Worker store %struct.BF_PartHolder* %tmp128, %struct.BF_PartHolder** %tmp80, align 4 58*9880d681SAndroid Build Coastguard Worker %tmp131 = add i32 %window.0, 1 ; <i32> [#uses=1] 59*9880d681SAndroid Build Coastguard Worker br label %bb132 60*9880d681SAndroid Build Coastguard Worker 61*9880d681SAndroid Build Coastguard Workerbb132: ; preds = %bb140, %bb113 62*9880d681SAndroid Build Coastguard Worker %window.0 = phi i32 [ %tmp131, %bb113 ], [ 0, %bb140 ] ; <i32> [#uses=3] 63*9880d681SAndroid Build Coastguard Worker %tmp134 = icmp slt i32 %window.0, 3 ; <i1> [#uses=1] 64*9880d681SAndroid Build Coastguard Worker br i1 %tmp134, label %bb113, label %bb137 65*9880d681SAndroid Build Coastguard Worker 66*9880d681SAndroid Build Coastguard Workerbb137: ; preds = %bb132 67*9880d681SAndroid Build Coastguard Worker %tmp139 = add i32 %sfb.0, 1 ; <i32> [#uses=1] 68*9880d681SAndroid Build Coastguard Worker br label %bb140 69*9880d681SAndroid Build Coastguard Worker 70*9880d681SAndroid Build Coastguard Workerbb140: ; preds = %bb341, %bb137 71*9880d681SAndroid Build Coastguard Worker %sfb.0 = phi i32 [ %tmp139, %bb137 ], [ 0, %bb341 ] ; <i32> [#uses=3] 72*9880d681SAndroid Build Coastguard Worker %tmp142 = icmp slt i32 %sfb.0, 6 ; <i1> [#uses=1] 73*9880d681SAndroid Build Coastguard Worker br i1 %tmp142, label %bb132, label %bb174 74*9880d681SAndroid Build Coastguard Worker 75*9880d681SAndroid Build Coastguard Workerbb166: ; preds = %bb174 76*9880d681SAndroid Build Coastguard Worker %tmp160 = load %struct.BF_PartHolder*, %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1] 77*9880d681SAndroid Build Coastguard Worker %tmp162 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp160, i32 0, i32 0 ) nounwind ; <%struct.BF_PartHolder*> [#uses=0] 78*9880d681SAndroid Build Coastguard Worker unreachable 79*9880d681SAndroid Build Coastguard Worker 80*9880d681SAndroid Build Coastguard Workerbb174: ; preds = %bb140 81*9880d681SAndroid Build Coastguard Worker %tmp176 = icmp slt i32 6, 12 ; <i1> [#uses=1] 82*9880d681SAndroid Build Coastguard Worker br i1 %tmp176, label %bb166, label %bb341 83*9880d681SAndroid Build Coastguard Worker 84*9880d681SAndroid Build Coastguard Workerbb341: ; preds = %bb352, %bb174 85*9880d681SAndroid Build Coastguard Worker %tmp80 = getelementptr [2 x [2 x %struct.BF_PartHolder*]], [2 x [2 x %struct.BF_PartHolder*]]* @scaleFactorsPH, i32 0, i32 0, i32 0 ; <%struct.BF_PartHolder**> [#uses=3] 86*9880d681SAndroid Build Coastguard Worker %tmp92 = getelementptr [16 x i32], [16 x i32]* @slen1_tab, i32 0, i32 0 ; <i32*> [#uses=1] 87*9880d681SAndroid Build Coastguard Worker %tmp93 = load i32, i32* %tmp92, align 4 ; <i32> [#uses=1] 88*9880d681SAndroid Build Coastguard Worker br label %bb140 89*9880d681SAndroid Build Coastguard Worker 90*9880d681SAndroid Build Coastguard Workerbb352: ; preds = %entry 91*9880d681SAndroid Build Coastguard Worker %tmp354 = icmp slt i32 0, 2 ; <i1> [#uses=1] 92*9880d681SAndroid Build Coastguard Worker br i1 %tmp354, label %bb341, label %return 93*9880d681SAndroid Build Coastguard Worker 94*9880d681SAndroid Build Coastguard Workerbb498: ; preds = %entry 95*9880d681SAndroid Build Coastguard Worker ret void 96*9880d681SAndroid Build Coastguard Worker 97*9880d681SAndroid Build Coastguard Workerreturn: ; preds = %bb352 98*9880d681SAndroid Build Coastguard Worker ret void 99*9880d681SAndroid Build Coastguard Worker} 100*9880d681SAndroid Build Coastguard Worker 101*9880d681SAndroid Build Coastguard Workerdefine void @getframebits(%struct.lame_global_flags* %gfp, i32* %bitsPerFrame, i32* %mean_bits) nounwind { 102*9880d681SAndroid Build Coastguard Workerentry: 103*9880d681SAndroid Build Coastguard Worker unreachable 104*9880d681SAndroid Build Coastguard Worker} 105*9880d681SAndroid Build Coastguard Worker 106*9880d681SAndroid Build Coastguard Workerdefine i32 @lame_encode_buffer(%struct.lame_global_flags* %gfp, i16* %buffer_l, i16* %buffer_r, i32 %nsamples, i8* %mp3buf, i32 %mp3buf_size) nounwind { 107*9880d681SAndroid Build Coastguard Workerentry: 108*9880d681SAndroid Build Coastguard Worker unreachable 109*9880d681SAndroid Build Coastguard Worker} 110