; LLVM IR from IlyaGrebnov/libbsc :: libbsc/coder/qlfc/qlfc.ll (Z20bsc_qlfc_fast_decodePKhPhP21QlfcStatisticalModel2)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.RangeCoder = type { %"union.RangeCoder::ari", i32, i32, i32, i32, ptr, ptr, ptr, ptr }
%"union.RangeCoder::ari" = type { i64 }
%struct.QlfcStatisticalModel2 = type { %"struct.QlfcStatisticalModel2::Rank", %"struct.QlfcStatisticalModel2::Run" }
%"struct.QlfcStatisticalModel2::Rank" = type { [256 x [8 x i16]], [256 x [8 x [256 x i16]]] }
%"struct.QlfcStatisticalModel2::Run" = type { [256 x [32 x i16]], [256 x [32 x [32 x i16]]] }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi7EEEvjRsii(i32 noundef, ptr noundef nonnull align 2 dereferenceable(2), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi6EEEvjRsii(i32 noundef, ptr noundef nonnull align 2 dereferenceable(2), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvjRsii(i32 noundef, ptr noundef nonnull align 2 dereferenceable(2), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RangeCoder11InitDecoderEPKh(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN10RangeCoder10DecodeWordEv(ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z20bsc_qlfc_fast_decodePKhPhP21QlfcStatisticalModel2(ptr noundef %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [256 x i8], align 64
  %8 = alloca %class.RangeCoder, align 8
  %9 = alloca i32, align 4
  %10 = alloca [256 x i8], align 16
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %7) #5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 56, ptr %8) #5
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN10RangeCoder11InitDecoderEPKh(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %38 = call noundef i32 @_ZN10RangeCoder10DecodeWordEv(ptr noundef nonnull align 8 dereferenceable(56) %8)
  store i32 %38, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 256, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %47, %3
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = icmp slt i32 %40, 256
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %50

43:                                               ; preds = %39
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 %45
  store i8 0, ptr %46, align 1, !tbaa !11
  br label %47

47:                                               ; preds = %43
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %11, align 4, !tbaa !9
  br label %39, !llvm.loop !12

50:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 -1, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %156, %50
  %52 = load i32, ptr %13, align 4, !tbaa !9
  %53 = icmp slt i32 %52, 256
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  store i32 5, ptr %14, align 4
  br label %159

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 7, ptr %16, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %135, %55
  %57 = load i32, ptr %16, align 4, !tbaa !9
  %58 = icmp sge i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %138

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  store i8 0, ptr %17, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  store i8 0, ptr %18, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %101, %60
  %62 = load i32, ptr %19, align 4, !tbaa !9
  %63 = icmp slt i32 %62, 256
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 11, ptr %14, align 4
  br label %104

65:                                               ; preds = %61
  %66 = load i32, ptr %19, align 4, !tbaa !9
  %67 = load i32, ptr %12, align 4, !tbaa !9
  %68 = icmp eq i32 %66, %67
  br i1 %68, label %76, label %69

69:                                               ; preds = %65
  %70 = load i32, ptr %19, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = zext i8 %73 to i32
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %100

76:                                               ; preds = %69, %65
  %77 = load i32, ptr %15, align 4, !tbaa !9
  %78 = load i32, ptr %19, align 4, !tbaa !9
  %79 = load i32, ptr %16, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  %81 = ashr i32 %78, %80
  %82 = icmp eq i32 %77, %81
  br i1 %82, label %83, label %99

83:                                               ; preds = %76
  %84 = load i32, ptr %19, align 4, !tbaa !9
  %85 = load i32, ptr %16, align 4, !tbaa !9
  %86 = shl i32 1, %85
  %87 = and i32 %84, %86
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %83
  store i8 1, ptr %18, align 1, !tbaa !14
  br label %91

90:                                               ; preds = %83
  store i8 1, ptr %17, align 1, !tbaa !14
  br label %91

91:                                               ; preds = %90, %89
  %92 = load i8, ptr %17, align 1, !tbaa !14, !range !16, !noundef !17
  %93 = trunc i8 %92 to i1
  br i1 %93, label %94, label %98

94:                                               ; preds = %91
  %95 = load i8, ptr %18, align 1, !tbaa !14, !range !16, !noundef !17
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %98

97:                                               ; preds = %94
  store i32 11, ptr %14, align 4
  br label %104

98:                                               ; preds = %94, %91
  br label %99

99:                                               ; preds = %98, %76
  br label %100

100:                                              ; preds = %99, %69
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %19, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %19, align 4, !tbaa !9
  br label %61, !llvm.loop !18

104:                                              ; preds = %97, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %105

105:                                              ; preds = %104
  %106 = load i8, ptr %17, align 1, !tbaa !14, !range !16, !noundef !17
  %107 = trunc i8 %106 to i1
  br i1 %107, label %108, label %117

108:                                              ; preds = %105
  %109 = load i8, ptr %18, align 1, !tbaa !14, !range !16, !noundef !17
  %110 = trunc i8 %109 to i1
  br i1 %110, label %111, label %117

111:                                              ; preds = %108
  %112 = load i32, ptr %15, align 4, !tbaa !9
  %113 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi1EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef 1)
  %114 = add nsw i32 %112, %113
  %115 = load i32, ptr %15, align 4, !tbaa !9
  %116 = add nsw i32 %115, %114
  store i32 %116, ptr %15, align 4, !tbaa !9
  br label %134

117:                                              ; preds = %108, %105
  %118 = load i8, ptr %17, align 1, !tbaa !14, !range !16, !noundef !17
  %119 = trunc i8 %118 to i1
  br i1 %119, label %120, label %125

120:                                              ; preds = %117
  %121 = load i32, ptr %15, align 4, !tbaa !9
  %122 = add nsw i32 %121, 0
  %123 = load i32, ptr %15, align 4, !tbaa !9
  %124 = add nsw i32 %123, %122
  store i32 %124, ptr %15, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %120, %117
  %126 = load i8, ptr %18, align 1, !tbaa !14, !range !16, !noundef !17
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %133

128:                                              ; preds = %125
  %129 = load i32, ptr %15, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = add nsw i32 %131, %130
  store i32 %132, ptr %15, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %128, %125
  br label %134

134:                                              ; preds = %133, %111
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %16, align 4, !tbaa !9
  %137 = add nsw i32 %136, -1
  store i32 %137, ptr %16, align 4, !tbaa !9
  br label %56, !llvm.loop !19

138:                                              ; preds = %59
  %139 = load i32, ptr %15, align 4, !tbaa !9
  %140 = trunc i32 %139 to i8
  %141 = load i32, ptr %13, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 %142
  store i8 %140, ptr %143, align 1, !tbaa !11
  %144 = load i32, ptr %15, align 4, !tbaa !9
  %145 = load i32, ptr %12, align 4, !tbaa !9
  %146 = icmp eq i32 %144, %145
  br i1 %146, label %147, label %148

147:                                              ; preds = %138
  store i32 5, ptr %14, align 4
  br label %153

148:                                              ; preds = %138
  %149 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %149, ptr %12, align 4, !tbaa !9
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 %151
  store i8 1, ptr %152, align 1, !tbaa !11
  store i32 0, ptr %14, align 4
  br label %153

153:                                              ; preds = %148, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  %154 = load i32, ptr %14, align 4
  switch i32 %154, label %159 [
    i32 0, label %155
  ]

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %13, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %13, align 4, !tbaa !9
  br label %51, !llvm.loop !20

159:                                              ; preds = %153, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %160

160:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = load i32, ptr %9, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds i8, ptr %161, i64 %163
  store ptr %164, ptr %20, align 8, !tbaa !5
  br label %165

165:                                              ; preds = %429, %160
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load ptr, ptr %20, align 8, !tbaa !5
  %168 = icmp ult ptr %166, %167
  br i1 %168, label %169, label %430

169:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %170 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %171 = load i8, ptr %170, align 64, !tbaa !11
  %172 = zext i8 %171 to i32
  store i32 %172, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %173, i32 0, i32 0
  %175 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Rank", ptr %174, i32 0, i32 0
  %176 = load i32, ptr %21, align 4, !tbaa !9
  %177 = zext i32 %176 to i64
  %178 = getelementptr inbounds [256 x [8 x i16]], ptr %175, i64 0, i64 %177
  %179 = getelementptr inbounds [8 x i16], ptr %178, i64 0, i64 0
  store ptr %179, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %180 = load ptr, ptr %22, align 8, !tbaa !5
  %181 = getelementptr inbounds i16, ptr %180, i64 0
  %182 = load i16, ptr %181, align 2, !tbaa !21
  %183 = sext i16 %182 to i32
  store i32 %183, ptr %23, align 4, !tbaa !9
  %184 = load i32, ptr %23, align 4, !tbaa !9
  %185 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %184)
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %187, label %276

187:                                              ; preds = %169
  %188 = load ptr, ptr %22, align 8, !tbaa !5
  %189 = getelementptr inbounds i16, ptr %188, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %189, i32 noundef 83)
  %190 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %190)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 1, ptr %24, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %218, %187
  %192 = load i32, ptr %24, align 4, !tbaa !9
  %193 = icmp slt i32 %192, 7
  br i1 %193, label %194, label %219

194:                                              ; preds = %191
  %195 = load ptr, ptr %22, align 8, !tbaa !5
  %196 = load i32, ptr %24, align 4, !tbaa !9
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds i16, ptr %195, i64 %197
  %199 = load i16, ptr %198, align 2, !tbaa !21
  %200 = sext i16 %199 to i32
  store i32 %200, ptr %23, align 4, !tbaa !9
  %201 = load i32, ptr %23, align 4, !tbaa !9
  %202 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %201)
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %212

204:                                              ; preds = %194
  %205 = load ptr, ptr %22, align 8, !tbaa !5
  %206 = load i32, ptr %24, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds i16, ptr %205, i64 %207
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %208, i32 noundef 122)
  %209 = load i32, ptr %24, align 4, !tbaa !9
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %24, align 4, !tbaa !9
  %211 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %211)
  br label %218

212:                                              ; preds = %194
  %213 = load ptr, ptr %22, align 8, !tbaa !5
  %214 = load i32, ptr %24, align 4, !tbaa !9
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds i16, ptr %213, i64 %215
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %216, i32 noundef 8114)
  %217 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %217)
  br label %219

218:                                              ; preds = %204
  br label %191, !llvm.loop !23

219:                                              ; preds = %212, %191
  %220 = load ptr, ptr %6, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %220, i32 0, i32 0
  %222 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Rank", ptr %221, i32 0, i32 1
  %223 = load i32, ptr %21, align 4, !tbaa !9
  %224 = zext i32 %223 to i64
  %225 = getelementptr inbounds [256 x [8 x [256 x i16]]], ptr %222, i64 0, i64 %224
  %226 = load i32, ptr %24, align 4, !tbaa !9
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [8 x [256 x i16]], ptr %225, i64 0, i64 %227
  %229 = getelementptr inbounds [256 x i16], ptr %228, i64 0, i64 0
  store ptr %229, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 1, ptr %25, align 4, !tbaa !9
  br label %230

230:                                              ; preds = %234, %219
  %231 = load i32, ptr %24, align 4, !tbaa !9
  %232 = add nsw i32 %231, -1
  store i32 %232, ptr %24, align 4, !tbaa !9
  %233 = icmp sge i32 %232, 0
  br i1 %233, label %234, label %252

234:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %235 = load ptr, ptr %22, align 8, !tbaa !5
  %236 = load i32, ptr %25, align 4, !tbaa !9
  %237 = zext i32 %236 to i64
  %238 = getelementptr inbounds i16, ptr %235, i64 %237
  %239 = load i16, ptr %238, align 2, !tbaa !21
  %240 = sext i16 %239 to i32
  %241 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %240)
  store i32 %241, ptr %26, align 4, !tbaa !9
  %242 = load i32, ptr %26, align 4, !tbaa !9
  %243 = load ptr, ptr %22, align 8, !tbaa !5
  %244 = load i32, ptr %25, align 4, !tbaa !9
  %245 = zext i32 %244 to i64
  %246 = getelementptr inbounds i16, ptr %243, i64 %245
  call void @_ZN18ProbabilityCounter9UpdateBitILi7EEEvjRsii(i32 noundef %242, ptr noundef nonnull align 2 dereferenceable(2) %246, i32 noundef 7999, i32 noundef 235)
  %247 = load i32, ptr %25, align 4, !tbaa !9
  %248 = load i32, ptr %26, align 4, !tbaa !9
  %249 = add i32 %247, %248
  %250 = load i32, ptr %25, align 4, !tbaa !9
  %251 = add i32 %250, %249
  store i32 %251, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %230, !llvm.loop !24

252:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %253

253:                                              ; preds = %267, %252
  %254 = load i32, ptr %27, align 4, !tbaa !9
  %255 = load i32, ptr %25, align 4, !tbaa !9
  %256 = icmp ult i32 %254, %255
  br i1 %256, label %258, label %257

257:                                              ; preds = %253
  store i32 20, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %270

258:                                              ; preds = %253
  %259 = load i32, ptr %27, align 4, !tbaa !9
  %260 = add i32 %259, 1
  %261 = zext i32 %260 to i64
  %262 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 %261
  %263 = load i8, ptr %262, align 1, !tbaa !11
  %264 = load i32, ptr %27, align 4, !tbaa !9
  %265 = zext i32 %264 to i64
  %266 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 %265
  store i8 %263, ptr %266, align 1, !tbaa !11
  br label %267

267:                                              ; preds = %258
  %268 = load i32, ptr %27, align 4, !tbaa !9
  %269 = add i32 %268, 1
  store i32 %269, ptr %27, align 4, !tbaa !9
  br label %253, !llvm.loop !25

270:                                              ; preds = %257
  %271 = load i32, ptr %21, align 4, !tbaa !9
  %272 = trunc i32 %271 to i8
  %273 = load i32, ptr %25, align 4, !tbaa !9
  %274 = zext i32 %273 to i64
  %275 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 %274
  store i8 %272, ptr %275, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %286

276:                                              ; preds = %169
  %277 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 1
  %278 = load i8, ptr %277, align 1, !tbaa !11
  %279 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  store i8 %278, ptr %279, align 64, !tbaa !11
  %280 = load i32, ptr %21, align 4, !tbaa !9
  %281 = trunc i32 %280 to i8
  %282 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 1
  store i8 %281, ptr %282, align 1, !tbaa !11
  %283 = load ptr, ptr %22, align 8, !tbaa !5
  %284 = getelementptr inbounds i16, ptr %283, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %284, i32 noundef 8016)
  %285 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %285)
  br label %286

286:                                              ; preds = %276, %270
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %287 = load ptr, ptr %6, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %287, i32 0, i32 1
  %289 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Run", ptr %288, i32 0, i32 0
  %290 = load i32, ptr %21, align 4, !tbaa !9
  %291 = zext i32 %290 to i64
  %292 = getelementptr inbounds [256 x [32 x i16]], ptr %289, i64 0, i64 %291
  %293 = getelementptr inbounds [32 x i16], ptr %292, i64 0, i64 0
  store ptr %293, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %294 = load ptr, ptr %28, align 8, !tbaa !5
  %295 = getelementptr inbounds i16, ptr %294, i64 0
  %296 = load i16, ptr %295, align 2, !tbaa !21
  %297 = sext i16 %296 to i32
  store i32 %297, ptr %29, align 4, !tbaa !9
  %298 = load i32, ptr %29, align 4, !tbaa !9
  %299 = call noundef i32 @_ZN10RangeCoder7PeakBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %298)
  %300 = icmp ne i32 %299, 0
  br i1 %300, label %301, label %421

301:                                              ; preds = %286
  %302 = load ptr, ptr %28, align 8, !tbaa !5
  %303 = getelementptr inbounds i16, ptr %302, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %303, i32 noundef 42)
  %304 = load i32, ptr %29, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %304)
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store i32 1, ptr %30, align 4, !tbaa !9
  br label %305

305:                                              ; preds = %330, %301
  br label %306

306:                                              ; preds = %305
  %307 = load ptr, ptr %28, align 8, !tbaa !5
  %308 = load i32, ptr %30, align 4, !tbaa !9
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds i16, ptr %307, i64 %309
  %311 = load i16, ptr %310, align 2, !tbaa !21
  %312 = sext i16 %311 to i32
  store i32 %312, ptr %29, align 4, !tbaa !9
  %313 = load i32, ptr %29, align 4, !tbaa !9
  %314 = call noundef i32 @_ZN10RangeCoder7PeakBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %313)
  %315 = icmp ne i32 %314, 0
  br i1 %315, label %316, label %324

316:                                              ; preds = %306
  %317 = load ptr, ptr %28, align 8, !tbaa !5
  %318 = load i32, ptr %30, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds i16, ptr %317, i64 %319
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %320, i32 noundef 142)
  %321 = load i32, ptr %30, align 4, !tbaa !9
  %322 = add nsw i32 %321, 1
  store i32 %322, ptr %30, align 4, !tbaa !9
  %323 = load i32, ptr %29, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %323)
  br label %330

324:                                              ; preds = %306
  %325 = load ptr, ptr %28, align 8, !tbaa !5
  %326 = load i32, ptr %30, align 4, !tbaa !9
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds i16, ptr %325, i64 %327
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %328, i32 noundef 1962)
  %329 = load i32, ptr %29, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %329)
  br label %331

330:                                              ; preds = %316
  br label %305, !llvm.loop !26

331:                                              ; preds = %324
  %332 = load ptr, ptr %6, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %332, i32 0, i32 1
  %334 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Run", ptr %333, i32 0, i32 1
  %335 = load i32, ptr %21, align 4, !tbaa !9
  %336 = zext i32 %335 to i64
  %337 = getelementptr inbounds [256 x [32 x [32 x i16]]], ptr %334, i64 0, i64 %336
  %338 = load i32, ptr %30, align 4, !tbaa !9
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [32 x [32 x i16]], ptr %337, i64 0, i64 %339
  %341 = getelementptr inbounds [32 x i16], ptr %340, i64 0, i64 0
  store ptr %341, ptr %28, align 8, !tbaa !5
  %342 = load i32, ptr %30, align 4, !tbaa !9
  %343 = icmp sle i32 %342, 5
  br i1 %343, label %344, label %380

344:                                              ; preds = %331
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  store i32 1, ptr %31, align 4, !tbaa !9
  br label %345

345:                                              ; preds = %349, %344
  %346 = load i32, ptr %30, align 4, !tbaa !9
  %347 = add nsw i32 %346, -1
  store i32 %347, ptr %30, align 4, !tbaa !9
  %348 = icmp sge i32 %347, 0
  br i1 %348, label %349, label %367

349:                                              ; preds = %345
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %350 = load ptr, ptr %28, align 8, !tbaa !5
  %351 = load i32, ptr %31, align 4, !tbaa !9
  %352 = zext i32 %351 to i64
  %353 = getelementptr inbounds i16, ptr %350, i64 %352
  %354 = load i16, ptr %353, align 2, !tbaa !21
  %355 = sext i16 %354 to i32
  %356 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %355)
  store i32 %356, ptr %32, align 4, !tbaa !9
  %357 = load i32, ptr %32, align 4, !tbaa !9
  %358 = load ptr, ptr %28, align 8, !tbaa !5
  %359 = load i32, ptr %31, align 4, !tbaa !9
  %360 = zext i32 %359 to i64
  %361 = getelementptr inbounds i16, ptr %358, i64 %360
  call void @_ZN18ProbabilityCounter9UpdateBitILi6EEEvjRsii(i32 noundef %357, ptr noundef nonnull align 2 dereferenceable(2) %361, i32 noundef 1951, i32 noundef 147)
  %362 = load i32, ptr %31, align 4, !tbaa !9
  %363 = load i32, ptr %32, align 4, !tbaa !9
  %364 = add i32 %362, %363
  %365 = load i32, ptr %31, align 4, !tbaa !9
  %366 = add i32 %365, %364
  store i32 %366, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %345, !llvm.loop !27

367:                                              ; preds = %345
  br label %368

368:                                              ; preds = %376, %367
  %369 = load i32, ptr %31, align 4, !tbaa !9
  %370 = icmp ugt i32 %369, 0
  br i1 %370, label %371, label %379

371:                                              ; preds = %368
  %372 = load i32, ptr %21, align 4, !tbaa !9
  %373 = trunc i32 %372 to i8
  %374 = load ptr, ptr %5, align 8, !tbaa !5
  %375 = getelementptr inbounds i8, ptr %374, i32 1
  store ptr %375, ptr %5, align 8, !tbaa !5
  store i8 %373, ptr %374, align 1, !tbaa !11
  br label %376

376:                                              ; preds = %371
  %377 = load i32, ptr %31, align 4, !tbaa !9
  %378 = add i32 %377, -1
  store i32 %378, ptr %31, align 4, !tbaa !9
  br label %368, !llvm.loop !28

379:                                              ; preds = %368
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %420

380:                                              ; preds = %331
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  store i32 1, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  store i32 1, ptr %34, align 4, !tbaa !9
  br label %381

381:                                              ; preds = %404, %380
  %382 = load i32, ptr %34, align 4, !tbaa !9
  %383 = load i32, ptr %30, align 4, !tbaa !9
  %384 = icmp sle i32 %382, %383
  br i1 %384, label %386, label %385

385:                                              ; preds = %381
  store i32 30, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %407

386:                                              ; preds = %381
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %387 = load ptr, ptr %28, align 8, !tbaa !5
  %388 = load i32, ptr %34, align 4, !tbaa !9
  %389 = sext i32 %388 to i64
  %390 = getelementptr inbounds i16, ptr %387, i64 %389
  %391 = load i16, ptr %390, align 2, !tbaa !21
  %392 = sext i16 %391 to i32
  %393 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %392)
  store i32 %393, ptr %35, align 4, !tbaa !9
  %394 = load i32, ptr %35, align 4, !tbaa !9
  %395 = load ptr, ptr %28, align 8, !tbaa !5
  %396 = load i32, ptr %34, align 4, !tbaa !9
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds i16, ptr %395, i64 %397
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvjRsii(i32 noundef %394, ptr noundef nonnull align 2 dereferenceable(2) %398, i32 noundef 1987, i32 noundef 46)
  %399 = load i32, ptr %33, align 4, !tbaa !9
  %400 = load i32, ptr %35, align 4, !tbaa !9
  %401 = add i32 %399, %400
  %402 = load i32, ptr %33, align 4, !tbaa !9
  %403 = add i32 %402, %401
  store i32 %403, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %404

404:                                              ; preds = %386
  %405 = load i32, ptr %34, align 4, !tbaa !9
  %406 = add nsw i32 %405, 1
  store i32 %406, ptr %34, align 4, !tbaa !9
  br label %381, !llvm.loop !29

407:                                              ; preds = %385
  br label %408

408:                                              ; preds = %416, %407
  %409 = load i32, ptr %33, align 4, !tbaa !9
  %410 = icmp ugt i32 %409, 0
  br i1 %410, label %411, label %419

411:                                              ; preds = %408
  %412 = load i32, ptr %21, align 4, !tbaa !9
  %413 = trunc i32 %412 to i8
  %414 = load ptr, ptr %5, align 8, !tbaa !5
  %415 = getelementptr inbounds i8, ptr %414, i32 1
  store ptr %415, ptr %5, align 8, !tbaa !5
  store i8 %413, ptr %414, align 1, !tbaa !11
  br label %416

416:                                              ; preds = %411
  %417 = load i32, ptr %33, align 4, !tbaa !9
  %418 = add i32 %417, -1
  store i32 %418, ptr %33, align 4, !tbaa !9
  br label %408, !llvm.loop !30

419:                                              ; preds = %408
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  br label %420

420:                                              ; preds = %419, %379
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %429

421:                                              ; preds = %286
  %422 = load i32, ptr %21, align 4, !tbaa !9
  %423 = trunc i32 %422 to i8
  %424 = load ptr, ptr %5, align 8, !tbaa !5
  %425 = getelementptr inbounds i8, ptr %424, i32 1
  store ptr %425, ptr %5, align 8, !tbaa !5
  store i8 %423, ptr %424, align 1, !tbaa !11
  %426 = load ptr, ptr %28, align 8, !tbaa !5
  %427 = getelementptr inbounds i16, ptr %426, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %427, i32 noundef 2025)
  %428 = load i32, ptr %29, align 4, !tbaa !9
  call void @_ZN10RangeCoder10DecodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %8, i32 noundef %428)
  br label %429

429:                                              ; preds = %421, %420
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %165, !llvm.loop !31

430:                                              ; preds = %165
  %431 = load i32, ptr %9, align 4, !tbaa !9
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #5
  ret i32 %431
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder9DecodeBitILi1EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder9DecodeBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder7PeakBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder9DecodeBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13}
!27 = distinct !{!27, !13}
!28 = distinct !{!28, !13}
!29 = distinct !{!29, !13}
!30 = distinct !{!30, !13}
!31 = distinct !{!31, !13}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.RangeCoder = type { %"union.RangeCoder::ari", i32, i32, i32, i32, ptr, ptr, ptr, ptr }
%"union.RangeCoder::ari" = type { i64 }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi7EEEvjRsii(i32 noundef, ptr noundef nonnull align 2 dereferenceable(2), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi6EEEvjRsii(i32 noundef, ptr noundef nonnull align 2 dereferenceable(2), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvjRsii(i32 noundef, ptr noundef nonnull align 2 dereferenceable(2), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RangeCoder11InitDecoderEPKh(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN10RangeCoder10DecodeWordEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z20bsc_qlfc_fast_decodePKhPhP21QlfcStatisticalModel2(ptr noundef %0, ptr noundef writeonly %1, ptr noundef %2) local_unnamed_addr #4 {
.preheader184.preheader:
  %3 = alloca [256 x i8], align 64
  %4 = alloca %class.RangeCoder, align 8
  %5 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #7
  tail call void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #7
  call void @_ZN10RangeCoder11InitDecoderEPKh(ptr noundef nonnull align 8 dereferenceable(56) %4, ptr noundef %0)
  %6 = call noundef i32 @_ZN10RangeCoder10DecodeWordEv(ptr noundef nonnull align 8 dereferenceable(56) %4)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %5, i8 0, i64 256, i1 false), !tbaa !5
  br label %.preheader184

.preheader184:                                    ; preds = %.preheader184.preheader, %43
  %indvars.iv247 = phi i64 [ 0, %.preheader184.preheader ], [ %indvars.iv.next248, %43 ]
  %.0142199 = phi i32 [ -1, %.preheader184.preheader ], [ %.2161, %43 ]
  %7 = zext i32 %.0142199 to i64
  br label %.preheader183

.preheader183:                                    ; preds = %.preheader184, %41
  %.0158197 = phi i32 [ 7, %.preheader184 ], [ %42, %41 ]
  %.0159196 = phi i32 [ 0, %.preheader184 ], [ %.2161, %41 ]
  %8 = add nuw nsw i32 %.0158197, 1
  %9 = shl nuw i32 1, %.0158197
  %.old = lshr i32 %.0142199, %8
  %.old229 = icmp eq i32 %.0159196, %.old
  br label %13

10:                                               ; preds = %41
  %11 = trunc i32 %.2161 to i8
  %12 = getelementptr inbounds [256 x i8], ptr %3, i64 0, i64 %indvars.iv247
  store i8 %11, ptr %12, align 1, !tbaa !5
  %.not = icmp eq i32 %.2161, %.0142199
  br i1 %.not, label %.thread, label %43

13:                                               ; preds = %.preheader183, %28
  %indvars.iv = phi i64 [ 0, %.preheader183 ], [ %indvars.iv.next, %28 ]
  %.0150194 = phi i8 [ 0, %.preheader183 ], [ %.2152, %28 ]
  %.0154193 = phi i8 [ 0, %.preheader183 ], [ %.2156, %28 ]
  %14 = icmp eq i64 %indvars.iv, %7
  br i1 %14, label %22, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %indvars.iv
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = icmp eq i8 %17, 0
  %19 = trunc nuw nsw i64 %indvars.iv to i32
  %20 = lshr i32 %19, %8
  %21 = icmp eq i32 %.0159196, %20
  %or.cond = select i1 %18, i1 %21, i1 false
  br i1 %or.cond, label %23, label %28

22:                                               ; preds = %13
  br i1 %.old229, label %._crit_edge272, label %28

._crit_edge272:                                   ; preds = %22
  %.pre = trunc nuw nsw i64 %indvars.iv to i32
  br label %23

23:                                               ; preds = %._crit_edge272, %15
  %.pre-phi = phi i32 [ %.pre, %._crit_edge272 ], [ %19, %15 ]
  %24 = and i32 %.pre-phi, %9
  %.not173 = icmp eq i32 %24, 0
  %..0154 = select i1 %.not173, i8 1, i8 %.0154193
  %.0150. = select i1 %.not173, i8 %.0150194, i8 1
  %25 = trunc nuw i8 %..0154 to i1
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = trunc nuw i8 %.0150. to i1
  br i1 %27, label %29, label %28

28:                                               ; preds = %15, %23, %26, %22
  %.2156 = phi i8 [ %..0154, %26 ], [ %..0154, %23 ], [ %.0154193, %22 ], [ %.0154193, %15 ]
  %.2152 = phi i8 [ %.0150., %26 ], [ %.0150., %23 ], [ %.0150194, %22 ], [ %.0150194, %15 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %29, label %13, !llvm.loop !8

29:                                               ; preds = %26, %28
  %.3157 = phi i8 [ %.2156, %28 ], [ %..0154, %26 ]
  %.3153 = phi i8 [ %.2152, %28 ], [ %.0150., %26 ]
  %30 = trunc nuw i8 %.3157 to i1
  %31 = trunc i8 %.3153 to i1
  br i1 %30, label %32, label %37

32:                                               ; preds = %29
  br i1 %31, label %34, label %.thread276

.thread276:                                       ; preds = %32
  %.mask278 = and i8 %.3157, 1
  %33 = zext nneg i8 %.mask278 to i32
  %spec.select279 = shl nsw i32 %.0159196, %33
  br label %41

34:                                               ; preds = %32
  %35 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi1EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef 1)
  %reass.add175 = shl i32 %.0159196, 1
  %36 = add i32 %35, %reass.add175
  br label %41

37:                                               ; preds = %29
  %.mask = and i8 %.3157, 1
  %38 = zext nneg i8 %.mask to i32
  %spec.select = shl nsw i32 %.0159196, %38
  br i1 %31, label %39, label %41

39:                                               ; preds = %37
  %reass.add174 = shl i32 %spec.select, 1
  %40 = or disjoint i32 %reass.add174, 1
  br label %41

41:                                               ; preds = %.thread276, %37, %39, %34
  %.2161 = phi i32 [ %36, %34 ], [ %40, %39 ], [ %spec.select, %37 ], [ %spec.select279, %.thread276 ]
  %42 = add nsw i32 %.0158197, -1
  %.not275 = icmp eq i32 %.0158197, 0
  br i1 %.not275, label %10, label %.preheader183, !llvm.loop !10

43:                                               ; preds = %10
  %44 = sext i32 %.2161 to i64
  %45 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %44
  store i8 1, ptr %45, align 1, !tbaa !5
  %indvars.iv.next248 = add nuw nsw i64 %indvars.iv247, 1
  %exitcond250.not = icmp eq i64 %indvars.iv.next248, 256
  br i1 %exitcond250.not, label %.thread, label %.preheader184, !llvm.loop !11

.thread:                                          ; preds = %10, %43
  %46 = sext i32 %6 to i64
  %47 = getelementptr inbounds i8, ptr %1, i64 %46
  %48 = icmp sgt i32 %6, 0
  br i1 %48, label %.lr.ph227, label %._crit_edge228

.lr.ph227:                                        ; preds = %.thread
  %49 = getelementptr inbounds i8, ptr %2, i64 4096
  %50 = getelementptr inbounds i8, ptr %3, i64 1
  %51 = getelementptr inbounds i8, ptr %2, i64 1052672
  %52 = getelementptr inbounds i8, ptr %2, i64 1069056
  br label %53

53:                                               ; preds = %.lr.ph227, %.loopexit
  %.0226 = phi ptr [ %1, %.lr.ph227 ], [ %.4, %.loopexit ]
  %54 = load i8, ptr %3, align 64, !tbaa !5
  %55 = zext i8 %54 to i64
  %56 = getelementptr inbounds [256 x [8 x i16]], ptr %2, i64 0, i64 %55
  %57 = load i16, ptr %56, align 2, !tbaa !12
  %58 = sext i16 %57 to i32
  %59 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %58)
  %.not164 = icmp eq i32 %59, 0
  br i1 %.not164, label %108, label %60

60:                                               ; preds = %53
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %56, i32 noundef 83)
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %58)
  %61 = getelementptr inbounds i8, ptr %56, i64 2
  %62 = load i16, ptr %61, align 2, !tbaa !12
  %63 = sext i16 %62 to i32
  %64 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %63)
  %.not165 = icmp eq i32 %64, 0
  br i1 %.not165, label %90, label %65

65:                                               ; preds = %60
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %61, i32 noundef 122)
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %63)
  %66 = getelementptr inbounds i8, ptr %56, i64 4
  %67 = load i16, ptr %66, align 2, !tbaa !12
  %68 = sext i16 %67 to i32
  %69 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %68)
  %.not165.1 = icmp eq i32 %69, 0
  br i1 %.not165.1, label %90, label %70

70:                                               ; preds = %65
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %66, i32 noundef 122)
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %68)
  %71 = getelementptr inbounds i8, ptr %56, i64 6
  %72 = load i16, ptr %71, align 2, !tbaa !12
  %73 = sext i16 %72 to i32
  %74 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %73)
  %.not165.2 = icmp eq i32 %74, 0
  br i1 %.not165.2, label %90, label %75

75:                                               ; preds = %70
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %71, i32 noundef 122)
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %73)
  %76 = getelementptr inbounds i8, ptr %56, i64 8
  %77 = load i16, ptr %76, align 2, !tbaa !12
  %78 = sext i16 %77 to i32
  %79 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %78)
  %.not165.3 = icmp eq i32 %79, 0
  br i1 %.not165.3, label %90, label %80

80:                                               ; preds = %75
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %76, i32 noundef 122)
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %78)
  %81 = getelementptr inbounds i8, ptr %56, i64 10
  %82 = load i16, ptr %81, align 2, !tbaa !12
  %83 = sext i16 %82 to i32
  %84 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %83)
  %.not165.4 = icmp eq i32 %84, 0
  br i1 %.not165.4, label %90, label %85

85:                                               ; preds = %80
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %81, i32 noundef 122)
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %83)
  %86 = getelementptr inbounds i8, ptr %56, i64 12
  %87 = load i16, ptr %86, align 2, !tbaa !12
  %88 = sext i16 %87 to i32
  %89 = call noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %88)
  %.not165.5 = icmp eq i32 %89, 0
  br i1 %.not165.5, label %90, label %.loopexit182.loopexit

.loopexit182.loopexit:                            ; preds = %85
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %86, i32 noundef 122)
  call void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %88)
  br label %.loopexit182

90:                                               ; preds = %85, %80, %75, %70, %65, %60
  %.0145200.lcssa.wide = phi i32 [ 1, %60 ], [ 2, %65 ], [ 3, %70 ], [ 4, %75 ], [ 5, %80 ], [ 6, %85 ]
  %.lcssa233 = phi ptr [ %61, %60 ], [ %66, %65 ], [ %71, %70 ], [ %76, %75 ], [ %81, %80 ], [ %86, %85 ]
  %.lcssa = phi i32 [ %63, %60 ], [ %68, %65 ], [ %73, %70 ], [ %78, %75 ], [ %83, %80 ], [ %88, %85 ]
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %.lcssa233, i32 noundef 8114)
  call void @_ZN10RangeCoder10DecodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %.lcssa)
  br label %.loopexit182

.loopexit182:                                     ; preds = %.loopexit182.loopexit, %90
  %.0145187 = phi i32 [ %.0145200.lcssa.wide, %90 ], [ 7, %.loopexit182.loopexit ]
  %91 = zext nneg i32 %.0145187 to i64
  %92 = getelementptr inbounds [256 x [8 x [256 x i16]]], ptr %49, i64 0, i64 %55, i64 %91
  br label %97

.preheader181:                                    ; preds = %97
  %.not230 = icmp eq i32 %104, 0
  br i1 %.not230, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader181
  %93 = add i32 %103, -1
  %94 = add i32 %93, %reass.add172
  %95 = zext i32 %94 to i64
  %96 = add nuw nsw i64 %95, 1
  call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 64 dereferenceable(1) %3, ptr noundef nonnull align 1 dereferenceable(1) %50, i64 %96, i1 false), !tbaa !5
  br label %._crit_edge

97:                                               ; preds = %.loopexit182, %97
  %.0144202 = phi i32 [ 1, %.loopexit182 ], [ %104, %97 ]
  %.1146201 = phi i32 [ %.0145187, %.loopexit182 ], [ %98, %97 ]
  %98 = add nsw i32 %.1146201, -1
  %99 = zext i32 %.0144202 to i64
  %100 = getelementptr inbounds i16, ptr %92, i64 %99
  %101 = load i16, ptr %100, align 2, !tbaa !12
  %102 = sext i16 %101 to i32
  %103 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %102)
  call void @_ZN18ProbabilityCounter9UpdateBitILi7EEEvjRsii(i32 noundef %103, ptr noundef nonnull align 2 dereferenceable(2) %100, i32 noundef 7999, i32 noundef 235)
  %reass.add172 = shl i32 %.0144202, 1
  %104 = add i32 %103, %reass.add172
  %105 = icmp ugt i32 %.1146201, 1
  br i1 %105, label %97, label %.preheader181, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.preheader181
  %106 = zext i32 %104 to i64
  %107 = getelementptr inbounds [256 x i8], ptr %3, i64 0, i64 %106
  store i8 %54, ptr %107, align 1, !tbaa !5
  br label %110

108:                                              ; preds = %53
  %109 = load i8, ptr %50, align 1, !tbaa !5
  store i8 %109, ptr %3, align 64, !tbaa !5
  store i8 %54, ptr %50, align 1, !tbaa !5
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %56, i32 noundef 8016)
  call void @_ZN10RangeCoder10DecodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %58)
  br label %110

110:                                              ; preds = %108, %._crit_edge
  %111 = getelementptr inbounds [256 x [32 x i16]], ptr %51, i64 0, i64 %55
  %112 = load i16, ptr %111, align 2, !tbaa !12
  %113 = sext i16 %112 to i32
  %114 = call noundef i32 @_ZN10RangeCoder7PeakBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %113)
  %.not166 = icmp eq i32 %114, 0
  br i1 %.not166, label %151, label %115

115:                                              ; preds = %110
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %111, i32 noundef 42)
  call void @_ZN10RangeCoder10DecodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %113)
  %116 = getelementptr inbounds i8, ptr %111, i64 2
  %117 = load i16, ptr %116, align 2, !tbaa !12
  %118 = sext i16 %117 to i32
  %119 = call noundef i32 @_ZN10RangeCoder7PeakBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %118)
  %.not167204 = icmp eq i32 %119, 0
  br i1 %.not167204, label %._crit_edge208, label %.lr.ph207

.lr.ph207:                                        ; preds = %115, %.lr.ph207
  %indvars.iv259 = phi i64 [ %indvars.iv.next260, %.lr.ph207 ], [ 1, %115 ]
  %120 = phi i32 [ %124, %.lr.ph207 ], [ %118, %115 ]
  %121 = phi ptr [ %122, %.lr.ph207 ], [ %116, %115 ]
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %121, i32 noundef 142)
  %indvars.iv.next260 = add nuw nsw i64 %indvars.iv259, 1
  call void @_ZN10RangeCoder10DecodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %120)
  %122 = getelementptr inbounds i16, ptr %111, i64 %indvars.iv.next260
  %123 = load i16, ptr %122, align 2, !tbaa !12
  %124 = sext i16 %123 to i32
  %125 = call noundef i32 @_ZN10RangeCoder7PeakBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %124)
  %.not167 = icmp eq i32 %125, 0
  br i1 %.not167, label %._crit_edge208.loopexit, label %.lr.ph207, !llvm.loop !15

._crit_edge208.loopexit:                          ; preds = %.lr.ph207
  %126 = trunc nuw i64 %indvars.iv.next260 to i32
  br label %._crit_edge208

._crit_edge208:                                   ; preds = %._crit_edge208.loopexit, %115
  %.0139.lcssa = phi i32 [ 1, %115 ], [ %126, %._crit_edge208.loopexit ]
  %.lcssa191 = phi i64 [ 1, %115 ], [ %indvars.iv.next260, %._crit_edge208.loopexit ]
  %.lcssa190 = phi ptr [ %116, %115 ], [ %122, %._crit_edge208.loopexit ]
  %.lcssa189 = phi i32 [ %118, %115 ], [ %124, %._crit_edge208.loopexit ]
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %.lcssa190, i32 noundef 1962)
  call void @_ZN10RangeCoder10DecodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %.lcssa189)
  %127 = getelementptr inbounds [256 x [32 x [32 x i16]]], ptr %52, i64 0, i64 %55, i64 %.lcssa191
  %128 = icmp ult i32 %.0139.lcssa, 6
  br i1 %128, label %.preheader177, label %.preheader180.preheader

.preheader180.preheader:                          ; preds = %._crit_edge208
  %129 = add i32 %.0139.lcssa, 1
  %wide.trip.count = zext i32 %129 to i64
  br label %.preheader180

.preheader:                                       ; preds = %.preheader177
  %.not170221 = icmp eq i32 %140, 0
  br i1 %.not170221, label %.loopexit, label %.lr.ph224.preheader

.lr.ph224.preheader:                              ; preds = %.preheader
  %130 = add i32 %139, -1
  %131 = add i32 %130, %reass.add171
  %132 = zext i32 %131 to i64
  %133 = add nuw nsw i64 %132, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %.0226, i8 %54, i64 %133, i1 false), !tbaa !5
  %scevgep269 = getelementptr i8, ptr %.0226, i64 1
  %scevgep270 = getelementptr i8, ptr %scevgep269, i64 %132
  br label %.loopexit

.preheader177:                                    ; preds = %._crit_edge208, %.preheader177
  %.0137220 = phi i32 [ %140, %.preheader177 ], [ 1, %._crit_edge208 ]
  %.1140219 = phi i32 [ %134, %.preheader177 ], [ %.0139.lcssa, %._crit_edge208 ]
  %134 = add nsw i32 %.1140219, -1
  %135 = zext i32 %.0137220 to i64
  %136 = getelementptr inbounds i16, ptr %127, i64 %135
  %137 = load i16, ptr %136, align 2, !tbaa !12
  %138 = sext i16 %137 to i32
  %139 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %138)
  call void @_ZN18ProbabilityCounter9UpdateBitILi6EEEvjRsii(i32 noundef %139, ptr noundef nonnull align 2 dereferenceable(2) %136, i32 noundef 1951, i32 noundef 147)
  %reass.add171 = shl i32 %.0137220, 1
  %140 = add i32 %139, %reass.add171
  %141 = icmp ugt i32 %.1140219, 1
  br i1 %141, label %.preheader177, label %.preheader, !llvm.loop !16

.preheader178:                                    ; preds = %.preheader180
  %.not169214 = icmp eq i32 %150, 0
  br i1 %.not169214, label %.loopexit, label %.lr.ph217.preheader

.lr.ph217.preheader:                              ; preds = %.preheader178
  %142 = add i32 %149, -1
  %143 = add i32 %142, %reass.add
  %144 = zext i32 %143 to i64
  %145 = add nuw nsw i64 %144, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %.0226, i8 %54, i64 %145, i1 false), !tbaa !5
  %scevgep = getelementptr i8, ptr %.0226, i64 1
  %scevgep267 = getelementptr i8, ptr %scevgep, i64 %144
  br label %.loopexit

.preheader180:                                    ; preds = %.preheader180.preheader, %.preheader180
  %indvars.iv262 = phi i64 [ 1, %.preheader180.preheader ], [ %indvars.iv.next263, %.preheader180 ]
  %.0134212 = phi i32 [ 1, %.preheader180.preheader ], [ %150, %.preheader180 ]
  %146 = getelementptr inbounds i16, ptr %127, i64 %indvars.iv262
  %147 = load i16, ptr %146, align 2, !tbaa !12
  %148 = sext i16 %147 to i32
  %149 = call noundef i32 @_ZN10RangeCoder9DecodeBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %148)
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvjRsii(i32 noundef %149, ptr noundef nonnull align 2 dereferenceable(2) %146, i32 noundef 1987, i32 noundef 46)
  %reass.add = shl i32 %.0134212, 1
  %150 = add i32 %149, %reass.add
  %indvars.iv.next263 = add nuw nsw i64 %indvars.iv262, 1
  %exitcond265.not = icmp eq i64 %indvars.iv.next263, %wide.trip.count
  br i1 %exitcond265.not, label %.preheader178, label %.preheader180, !llvm.loop !17

151:                                              ; preds = %110
  %152 = getelementptr inbounds i8, ptr %.0226, i64 1
  store i8 %54, ptr %.0226, align 1, !tbaa !5
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %111, i32 noundef 2025)
  call void @_ZN10RangeCoder10DecodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %113)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph217.preheader, %.lr.ph224.preheader, %.preheader178, %.preheader, %151
  %.4 = phi ptr [ %152, %151 ], [ %.0226, %.preheader ], [ %.0226, %.preheader178 ], [ %scevgep270, %.lr.ph224.preheader ], [ %scevgep267, %.lr.ph217.preheader ]
  %153 = icmp ult ptr %.4, %47
  br i1 %153, label %53, label %._crit_edge228, !llvm.loop !18

._crit_edge228:                                   ; preds = %.loopexit, %.thread
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #7
  ret i32 %6
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder9DecodeBitILi1EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder7PeakBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder9DecodeBitILi13EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder7PeakBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeCoder10DecodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10RangeCoder9DecodeBitILi11EEEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !6, i64 0}
!14 = distinct !{!14, !9}
!15 = distinct !{!15, !9}
!16 = distinct !{!16, !9}
!17 = distinct !{!17, !9}
!18 = distinct !{!18, !9}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass