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

; 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: mustprogress uwtable
declare dso_local noundef ptr @_Z18bsc_qlfc_transformPKhPhiS1_(ptr noalias noundef, ptr noalias noundef, i32 noundef, ptr noalias noundef) #0

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctlz.i32(i32, i1 immarg) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10RangeCoder8CheckEOBEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef <2 x i64> @_ZL13_mm_set1_epi8c(i8 noundef signext) #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL17_mm_movemask_epi8Dv2_x(<2 x i64> noundef) #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef <2 x i64> @_ZL14_mm_cmpeq_epi8Dv2_xS_(<2 x i64> noundef, <2 x i64> noundef) #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef <2 x i64> @_ZL15_mm_loadu_si128PKDv2_x(ptr noundef) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.cttz.i32(i32, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z20bsc_qlfc_fast_encodePKhPhS1_iiP21QlfcStatisticalModel2(ptr noalias noundef %0, ptr noalias noundef %1, ptr noalias noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5) #7 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca [256 x i8], align 16
  %15 = alloca ptr, align 8
  %16 = alloca %class.RangeCoder, align 8
  %17 = alloca [256 x i8], align 16
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i8, align 1
  %25 = alloca i8, align 1
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca <2 x i64>, align 16
  %34 = alloca i32, align 4
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca ptr, align 8
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca i32, align 4
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  %55 = alloca i32, align 4
  %56 = alloca i32, align 4
  %57 = alloca i32, align 4
  %58 = alloca i32, align 4
  %59 = alloca i32, align 4
  %60 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %14) #9
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef %61)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = getelementptr inbounds [256 x i8], ptr %14, i64 0, i64 0
  %66 = call noundef ptr @_Z18bsc_qlfc_transformPKhPhiS1_(ptr noundef %62, ptr noundef %63, i32 noundef %64, ptr noundef %65)
  store ptr %66, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #9
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = load i32, ptr %12, align 4, !tbaa !9
  call void @_ZN10RangeCoder11InitEncoderEPhi(ptr noundef nonnull align 8 dereferenceable(56) %16, ptr noundef %67, i32 noundef %68)
  %69 = load i32, ptr %11, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeWordEj(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %69)
  call void @llvm.lifetime.start.p0(i64 256, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %78, %6
  %71 = load i32, ptr %18, align 4, !tbaa !9
  %72 = icmp slt i32 %71, 256
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %81

74:                                               ; preds = %70
  %75 = load i32, ptr %18, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 %76
  store i8 0, ptr %77, align 1, !tbaa !11
  br label %78

78:                                               ; preds = %74
  %79 = load i32, ptr %18, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %18, align 4, !tbaa !9
  br label %70, !llvm.loop !12

81:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  store i32 -1, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %172, %81
  %83 = load i32, ptr %20, align 4, !tbaa !9
  %84 = icmp slt i32 %83, 256
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  store i32 5, ptr %21, align 4
  br label %175

86:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %87 = load i32, ptr %20, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [256 x i8], ptr %14, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !11
  %91 = zext i8 %90 to i32
  store i32 %91, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 7, ptr %23, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %156, %86
  %93 = load i32, ptr %23, align 4, !tbaa !9
  %94 = icmp sge i32 %93, 0
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  store i32 8, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %159

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #9
  store i8 0, ptr %24, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #9
  store i8 0, ptr %25, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %140, %96
  %98 = load i32, ptr %26, align 4, !tbaa !9
  %99 = icmp slt i32 %98, 256
  br i1 %99, label %101, label %100

100:                                              ; preds = %97
  store i32 11, ptr %21, align 4
  br label %143

101:                                              ; preds = %97
  %102 = load i32, ptr %26, align 4, !tbaa !9
  %103 = load i32, ptr %19, align 4, !tbaa !9
  %104 = icmp eq i32 %102, %103
  br i1 %104, label %112, label %105

105:                                              ; preds = %101
  %106 = load i32, ptr %26, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !11
  %110 = zext i8 %109 to i32
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %139

112:                                              ; preds = %105, %101
  %113 = load i32, ptr %22, align 4, !tbaa !9
  %114 = load i32, ptr %23, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  %116 = ashr i32 %113, %115
  %117 = load i32, ptr %26, align 4, !tbaa !9
  %118 = load i32, ptr %23, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  %120 = ashr i32 %117, %119
  %121 = icmp eq i32 %116, %120
  br i1 %121, label %122, label %138

122:                                              ; preds = %112
  %123 = load i32, ptr %26, align 4, !tbaa !9
  %124 = load i32, ptr %23, align 4, !tbaa !9
  %125 = shl i32 1, %124
  %126 = and i32 %123, %125
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %122
  store i8 1, ptr %25, align 1, !tbaa !14
  br label %130

129:                                              ; preds = %122
  store i8 1, ptr %24, align 1, !tbaa !14
  br label %130

130:                                              ; preds = %129, %128
  %131 = load i8, ptr %24, align 1, !tbaa !14, !range !16, !noundef !17
  %132 = trunc i8 %131 to i1
  br i1 %132, label %133, label %137

133:                                              ; preds = %130
  %134 = load i8, ptr %25, align 1, !tbaa !14, !range !16, !noundef !17
  %135 = trunc i8 %134 to i1
  br i1 %135, label %136, label %137

136:                                              ; preds = %133
  store i32 11, ptr %21, align 4
  br label %143

137:                                              ; preds = %133, %130
  br label %138

138:                                              ; preds = %137, %112
  br label %139

139:                                              ; preds = %138, %105
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %26, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %26, align 4, !tbaa !9
  br label %97, !llvm.loop !18

143:                                              ; preds = %136, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  br label %144

144:                                              ; preds = %143
  %145 = load i8, ptr %24, align 1, !tbaa !14, !range !16, !noundef !17
  %146 = trunc i8 %145 to i1
  br i1 %146, label %147, label %155

147:                                              ; preds = %144
  %148 = load i8, ptr %25, align 1, !tbaa !14, !range !16, !noundef !17
  %149 = trunc i8 %148 to i1
  br i1 %149, label %150, label %155

150:                                              ; preds = %147
  %151 = load i32, ptr %22, align 4, !tbaa !9
  %152 = load i32, ptr %23, align 4, !tbaa !9
  %153 = shl i32 1, %152
  %154 = and i32 %151, %153
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %154, i32 noundef 1)
  br label %155

155:                                              ; preds = %150, %147, %144
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #9
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %23, align 4, !tbaa !9
  %158 = add nsw i32 %157, -1
  store i32 %158, ptr %23, align 4, !tbaa !9
  br label %92, !llvm.loop !19

159:                                              ; preds = %95
  %160 = load i32, ptr %22, align 4, !tbaa !9
  %161 = load i32, ptr %19, align 4, !tbaa !9
  %162 = icmp eq i32 %160, %161
  br i1 %162, label %163, label %164

163:                                              ; preds = %159
  store i32 5, ptr %21, align 4
  br label %169

164:                                              ; preds = %159
  %165 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %165, ptr %19, align 4, !tbaa !9
  %166 = load i32, ptr %22, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 %167
  store i8 1, ptr %168, align 1, !tbaa !11
  store i32 0, ptr %21, align 4
  br label %169

169:                                              ; preds = %164, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  %170 = load i32, ptr %21, align 4
  switch i32 %170, label %175 [
    i32 0, label %171
  ]

171:                                              ; preds = %169
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %20, align 4, !tbaa !9
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %20, align 4, !tbaa !9
  br label %82, !llvm.loop !20

175:                                              ; preds = %169, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %176

176:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %177 = load ptr, ptr %8, align 8, !tbaa !5
  %178 = load i32, ptr %11, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i8, ptr %177, i64 %179
  store ptr %180, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %181 = load ptr, ptr %10, align 8, !tbaa !5
  %182 = load i32, ptr %11, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i8, ptr %181, i64 %183
  store ptr %184, ptr %28, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %503, %176
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  %187 = load ptr, ptr %28, align 8, !tbaa !5
  %188 = icmp ult ptr %186, %187
  br i1 %188, label %189, label %504

189:                                              ; preds = %185
  %190 = call noundef zeroext i1 @_ZN10RangeCoder8CheckEOBEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
  br i1 %190, label %191, label %192

191:                                              ; preds = %189
  store i32 -3, ptr %7, align 4
  store i32 1, ptr %21, align 4
  br label %506

192:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  %193 = load ptr, ptr %15, align 8, !tbaa !5
  %194 = getelementptr inbounds i8, ptr %193, i32 1
  store ptr %194, ptr %15, align 8, !tbaa !5
  %195 = load i8, ptr %193, align 1, !tbaa !11
  %196 = zext i8 %195 to i32
  store i32 %196, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = load i8, ptr %197, align 1, !tbaa !11
  %199 = zext i8 %198 to i32
  store i32 %199, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = getelementptr inbounds i8, ptr %200, i32 1
  store ptr %201, ptr %8, align 8, !tbaa !5
  store ptr %200, ptr %32, align 8, !tbaa !5
  %202 = load ptr, ptr %15, align 8, !tbaa !5
  %203 = load ptr, ptr %28, align 8, !tbaa !5
  %204 = getelementptr inbounds i8, ptr %203, i64 -16
  %205 = icmp ult ptr %202, %204
  br i1 %205, label %206, label %233

206:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #9
  %207 = load i32, ptr %30, align 4, !tbaa !9
  %208 = trunc i32 %207 to i8
  %209 = call noundef <2 x i64> @_ZL13_mm_set1_epi8c(i8 noundef signext %208)
  store <2 x i64> %209, ptr %33, align 16, !tbaa !11
  br label %210

210:                                              ; preds = %231, %206
  br label %211

211:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  %212 = load ptr, ptr %8, align 8, !tbaa !5
  %213 = call noundef <2 x i64> @_ZL15_mm_loadu_si128PKDv2_x(ptr noundef %212)
  %214 = load <2 x i64>, ptr %33, align 16, !tbaa !11
  %215 = call noundef <2 x i64> @_ZL14_mm_cmpeq_epi8Dv2_xS_(<2 x i64> noundef %213, <2 x i64> noundef %214)
  %216 = call noundef i32 @_ZL17_mm_movemask_epi8Dv2_x(<2 x i64> noundef %215)
  store i32 %216, ptr %34, align 4, !tbaa !9
  %217 = load i32, ptr %34, align 4, !tbaa !9
  %218 = icmp ne i32 %217, 65535
  br i1 %218, label %219, label %226

219:                                              ; preds = %211
  %220 = load i32, ptr %34, align 4, !tbaa !9
  %221 = xor i32 %220, -1
  %222 = call i32 @llvm.cttz.i32(i32 %221, i1 true)
  %223 = load ptr, ptr %8, align 8, !tbaa !5
  %224 = sext i32 %222 to i64
  %225 = getelementptr inbounds i8, ptr %223, i64 %224
  store ptr %225, ptr %8, align 8, !tbaa !5
  store i32 17, ptr %21, align 4
  br label %229

226:                                              ; preds = %211
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = getelementptr inbounds i8, ptr %227, i64 16
  store ptr %228, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %21, align 4
  br label %229

229:                                              ; preds = %226, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  %230 = load i32, ptr %21, align 4
  switch i32 %230, label %508 [
    i32 0, label %231
    i32 17, label %232
  ]

231:                                              ; preds = %229
  br label %210, !llvm.loop !21

232:                                              ; preds = %229
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #9
  br label %250

233:                                              ; preds = %192
  br label %234

234:                                              ; preds = %246, %233
  %235 = load ptr, ptr %8, align 8, !tbaa !5
  %236 = load ptr, ptr %27, align 8, !tbaa !5
  %237 = icmp ult ptr %235, %236
  br i1 %237, label %238, label %244

238:                                              ; preds = %234
  %239 = load ptr, ptr %8, align 8, !tbaa !5
  %240 = load i8, ptr %239, align 1, !tbaa !11
  %241 = zext i8 %240 to i32
  %242 = load i32, ptr %30, align 4, !tbaa !9
  %243 = icmp eq i32 %241, %242
  br label %244

244:                                              ; preds = %238, %234
  %245 = phi i1 [ false, %234 ], [ %243, %238 ]
  br i1 %245, label %246, label %249

246:                                              ; preds = %244
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  %248 = getelementptr inbounds i8, ptr %247, i32 1
  store ptr %248, ptr %8, align 8, !tbaa !5
  br label %234, !llvm.loop !22

249:                                              ; preds = %244
  br label %250

250:                                              ; preds = %249, %232
  %251 = load ptr, ptr %8, align 8, !tbaa !5
  %252 = load ptr, ptr %32, align 8, !tbaa !5
  %253 = ptrtoint ptr %251 to i64
  %254 = ptrtoint ptr %252 to i64
  %255 = sub i64 %253, %254
  %256 = trunc i64 %255 to i32
  store i32 %256, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %257 = load ptr, ptr %13, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %257, i32 0, i32 0
  %259 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Rank", ptr %258, i32 0, i32 0
  %260 = load i32, ptr %30, align 4, !tbaa !9
  %261 = zext i32 %260 to i64
  %262 = getelementptr inbounds [256 x [8 x i16]], ptr %259, i64 0, i64 %261
  %263 = getelementptr inbounds [8 x i16], ptr %262, i64 0, i64 0
  store ptr %263, ptr %35, align 8, !tbaa !5
  %264 = load i32, ptr %29, align 4, !tbaa !9
  %265 = icmp eq i32 %264, 1
  br i1 %265, label %266, label %274

266:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  %267 = load ptr, ptr %35, align 8, !tbaa !5
  %268 = getelementptr inbounds i16, ptr %267, i64 0
  %269 = load i16, ptr %268, align 2, !tbaa !23
  %270 = sext i16 %269 to i32
  store i32 %270, ptr %36, align 4, !tbaa !9
  %271 = load ptr, ptr %35, align 8, !tbaa !5
  %272 = getelementptr inbounds i16, ptr %271, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %272, i32 noundef 8016)
  %273 = load i32, ptr %36, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %273)
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %364

274:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #9
  %275 = load ptr, ptr %35, align 8, !tbaa !5
  %276 = getelementptr inbounds i16, ptr %275, i64 0
  %277 = load i16, ptr %276, align 2, !tbaa !23
  %278 = sext i16 %277 to i32
  store i32 %278, ptr %37, align 4, !tbaa !9
  %279 = load ptr, ptr %35, align 8, !tbaa !5
  %280 = getelementptr inbounds i16, ptr %279, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %280, i32 noundef 83)
  %281 = load i32, ptr %37, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %281)
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #9
  %282 = load i32, ptr %29, align 4, !tbaa !9
  %283 = call i32 @llvm.ctlz.i32(i32 %282, i1 true)
  %284 = xor i32 %283, 31
  store i32 %284, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  store i32 1, ptr %39, align 4, !tbaa !9
  br label %285

285:                                              ; preds = %302, %274
  %286 = load i32, ptr %39, align 4, !tbaa !9
  %287 = load i32, ptr %38, align 4, !tbaa !9
  %288 = icmp slt i32 %286, %287
  br i1 %288, label %290, label %289

289:                                              ; preds = %285
  store i32 20, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %305

290:                                              ; preds = %285
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  %291 = load ptr, ptr %35, align 8, !tbaa !5
  %292 = load i32, ptr %39, align 4, !tbaa !9
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds i16, ptr %291, i64 %293
  %295 = load i16, ptr %294, align 2, !tbaa !23
  %296 = sext i16 %295 to i32
  store i32 %296, ptr %40, align 4, !tbaa !9
  %297 = load ptr, ptr %35, align 8, !tbaa !5
  %298 = load i32, ptr %39, align 4, !tbaa !9
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds i16, ptr %297, i64 %299
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %300, i32 noundef 122)
  %301 = load i32, ptr %40, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %301)
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %302

302:                                              ; preds = %290
  %303 = load i32, ptr %39, align 4, !tbaa !9
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %39, align 4, !tbaa !9
  br label %285, !llvm.loop !25

305:                                              ; preds = %289
  %306 = load i32, ptr %38, align 4, !tbaa !9
  %307 = icmp slt i32 %306, 7
  br i1 %307, label %308, label %320

308:                                              ; preds = %305
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #9
  %309 = load ptr, ptr %35, align 8, !tbaa !5
  %310 = load i32, ptr %38, align 4, !tbaa !9
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds i16, ptr %309, i64 %311
  %313 = load i16, ptr %312, align 2, !tbaa !23
  %314 = sext i16 %313 to i32
  store i32 %314, ptr %41, align 4, !tbaa !9
  %315 = load ptr, ptr %35, align 8, !tbaa !5
  %316 = load i32, ptr %38, align 4, !tbaa !9
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds i16, ptr %315, i64 %317
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %318, i32 noundef 8114)
  %319 = load i32, ptr %41, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %319)
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #9
  br label %320

320:                                              ; preds = %308, %305
  %321 = load ptr, ptr %13, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %321, i32 0, i32 0
  %323 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Rank", ptr %322, i32 0, i32 1
  %324 = load i32, ptr %30, align 4, !tbaa !9
  %325 = zext i32 %324 to i64
  %326 = getelementptr inbounds [256 x [8 x [256 x i16]]], ptr %323, i64 0, i64 %325
  %327 = load i32, ptr %38, align 4, !tbaa !9
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [8 x [256 x i16]], ptr %326, i64 0, i64 %328
  %330 = getelementptr inbounds [256 x i16], ptr %329, i64 0, i64 0
  store ptr %330, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  store i32 1, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #9
  %331 = load i32, ptr %38, align 4, !tbaa !9
  %332 = sub nsw i32 %331, 1
  store i32 %332, ptr %43, align 4, !tbaa !9
  br label %333

333:                                              ; preds = %360, %320
  %334 = load i32, ptr %43, align 4, !tbaa !9
  %335 = icmp sge i32 %334, 0
  br i1 %335, label %337, label %336

336:                                              ; preds = %333
  store i32 23, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  br label %363

337:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #9
  %338 = load i32, ptr %29, align 4, !tbaa !9
  %339 = load i32, ptr %43, align 4, !tbaa !9
  %340 = lshr i32 %338, %339
  %341 = and i32 %340, 1
  store i32 %341, ptr %44, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #9
  %342 = load ptr, ptr %35, align 8, !tbaa !5
  %343 = load i32, ptr %42, align 4, !tbaa !9
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds i16, ptr %342, i64 %344
  %346 = load i16, ptr %345, align 2, !tbaa !23
  %347 = sext i16 %346 to i32
  store i32 %347, ptr %45, align 4, !tbaa !9
  %348 = load i32, ptr %44, align 4, !tbaa !9
  %349 = load ptr, ptr %35, align 8, !tbaa !5
  %350 = load i32, ptr %42, align 4, !tbaa !9
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds i16, ptr %349, i64 %351
  call void @_ZN18ProbabilityCounter9UpdateBitILi7EEEvjRsii(i32 noundef %348, ptr noundef nonnull align 2 dereferenceable(2) %352, i32 noundef 7999, i32 noundef 235)
  %353 = load i32, ptr %44, align 4, !tbaa !9
  %354 = load i32, ptr %45, align 4, !tbaa !9
  call void @_ZN10RangeCoder9EncodeBitILi13EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %353, i32 noundef %354)
  %355 = load i32, ptr %42, align 4, !tbaa !9
  %356 = load i32, ptr %44, align 4, !tbaa !9
  %357 = add i32 %355, %356
  %358 = load i32, ptr %42, align 4, !tbaa !9
  %359 = add i32 %358, %357
  store i32 %359, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  br label %360

360:                                              ; preds = %337
  %361 = load i32, ptr %43, align 4, !tbaa !9
  %362 = add nsw i32 %361, -1
  store i32 %362, ptr %43, align 4, !tbaa !9
  br label %333, !llvm.loop !26

363:                                              ; preds = %336
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  br label %364

364:                                              ; preds = %363, %266
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #9
  %365 = load ptr, ptr %13, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %365, i32 0, i32 1
  %367 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Run", ptr %366, i32 0, i32 0
  %368 = load i32, ptr %30, align 4, !tbaa !9
  %369 = zext i32 %368 to i64
  %370 = getelementptr inbounds [256 x [32 x i16]], ptr %367, i64 0, i64 %369
  %371 = getelementptr inbounds [32 x i16], ptr %370, i64 0, i64 0
  store ptr %371, ptr %46, align 8, !tbaa !5
  %372 = load i32, ptr %31, align 4, !tbaa !9
  %373 = icmp eq i32 %372, 1
  br i1 %373, label %374, label %382

374:                                              ; preds = %364
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #9
  %375 = load ptr, ptr %46, align 8, !tbaa !5
  %376 = getelementptr inbounds i16, ptr %375, i64 0
  %377 = load i16, ptr %376, align 2, !tbaa !23
  %378 = sext i16 %377 to i32
  store i32 %378, ptr %47, align 4, !tbaa !9
  %379 = load ptr, ptr %46, align 8, !tbaa !5
  %380 = getelementptr inbounds i16, ptr %379, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %380, i32 noundef 2025)
  %381 = load i32, ptr %47, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %381)
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #9
  br label %503

382:                                              ; preds = %364
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #9
  %383 = load ptr, ptr %46, align 8, !tbaa !5
  %384 = getelementptr inbounds i16, ptr %383, i64 0
  %385 = load i16, ptr %384, align 2, !tbaa !23
  %386 = sext i16 %385 to i32
  store i32 %386, ptr %48, align 4, !tbaa !9
  %387 = load ptr, ptr %46, align 8, !tbaa !5
  %388 = getelementptr inbounds i16, ptr %387, i64 0
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %388, i32 noundef 42)
  %389 = load i32, ptr %48, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %389)
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #9
  %390 = load i32, ptr %31, align 4, !tbaa !9
  %391 = call i32 @llvm.ctlz.i32(i32 %390, i1 true)
  %392 = xor i32 %391, 31
  store i32 %392, ptr %49, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #9
  store i32 1, ptr %50, align 4, !tbaa !9
  br label %393

393:                                              ; preds = %410, %382
  %394 = load i32, ptr %50, align 4, !tbaa !9
  %395 = load i32, ptr %49, align 4, !tbaa !9
  %396 = icmp slt i32 %394, %395
  br i1 %396, label %398, label %397

397:                                              ; preds = %393
  store i32 26, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #9
  br label %413

398:                                              ; preds = %393
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #9
  %399 = load ptr, ptr %46, align 8, !tbaa !5
  %400 = load i32, ptr %50, align 4, !tbaa !9
  %401 = sext i32 %400 to i64
  %402 = getelementptr inbounds i16, ptr %399, i64 %401
  %403 = load i16, ptr %402, align 2, !tbaa !23
  %404 = sext i16 %403 to i32
  store i32 %404, ptr %51, align 4, !tbaa !9
  %405 = load ptr, ptr %46, align 8, !tbaa !5
  %406 = load i32, ptr %50, align 4, !tbaa !9
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds i16, ptr %405, i64 %407
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %408, i32 noundef 142)
  %409 = load i32, ptr %51, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %409)
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #9
  br label %410

410:                                              ; preds = %398
  %411 = load i32, ptr %50, align 4, !tbaa !9
  %412 = add nsw i32 %411, 1
  store i32 %412, ptr %50, align 4, !tbaa !9
  br label %393, !llvm.loop !27

413:                                              ; preds = %397
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #9
  %414 = load ptr, ptr %46, align 8, !tbaa !5
  %415 = load i32, ptr %49, align 4, !tbaa !9
  %416 = sext i32 %415 to i64
  %417 = getelementptr inbounds i16, ptr %414, i64 %416
  %418 = load i16, ptr %417, align 2, !tbaa !23
  %419 = sext i16 %418 to i32
  store i32 %419, ptr %52, align 4, !tbaa !9
  %420 = load ptr, ptr %46, align 8, !tbaa !5
  %421 = load i32, ptr %49, align 4, !tbaa !9
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds i16, ptr %420, i64 %422
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %423, i32 noundef 1962)
  %424 = load i32, ptr %52, align 4, !tbaa !9
  call void @_ZN10RangeCoder10EncodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %424)
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #9
  %425 = load ptr, ptr %13, align 8, !tbaa !5
  %426 = getelementptr inbounds %struct.QlfcStatisticalModel2, ptr %425, i32 0, i32 1
  %427 = getelementptr inbounds %"struct.QlfcStatisticalModel2::Run", ptr %426, i32 0, i32 1
  %428 = load i32, ptr %30, align 4, !tbaa !9
  %429 = zext i32 %428 to i64
  %430 = getelementptr inbounds [256 x [32 x [32 x i16]]], ptr %427, i64 0, i64 %429
  %431 = load i32, ptr %49, align 4, !tbaa !9
  %432 = sext i32 %431 to i64
  %433 = getelementptr inbounds [32 x [32 x i16]], ptr %430, i64 0, i64 %432
  %434 = getelementptr inbounds [32 x i16], ptr %433, i64 0, i64 0
  store ptr %434, ptr %46, align 8, !tbaa !5
  %435 = load i32, ptr %49, align 4, !tbaa !9
  %436 = icmp sle i32 %435, 5
  br i1 %436, label %437, label %471

437:                                              ; preds = %413
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #9
  store i32 1, ptr %53, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #9
  %438 = load i32, ptr %49, align 4, !tbaa !9
  %439 = sub nsw i32 %438, 1
  store i32 %439, ptr %54, align 4, !tbaa !9
  br label %440

440:                                              ; preds = %467, %437
  %441 = load i32, ptr %54, align 4, !tbaa !9
  %442 = icmp sge i32 %441, 0
  br i1 %442, label %444, label %443

443:                                              ; preds = %440
  store i32 29, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #9
  br label %470

444:                                              ; preds = %440
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #9
  %445 = load i32, ptr %31, align 4, !tbaa !9
  %446 = load i32, ptr %54, align 4, !tbaa !9
  %447 = lshr i32 %445, %446
  %448 = and i32 %447, 1
  store i32 %448, ptr %55, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #9
  %449 = load ptr, ptr %46, align 8, !tbaa !5
  %450 = load i32, ptr %53, align 4, !tbaa !9
  %451 = sext i32 %450 to i64
  %452 = getelementptr inbounds i16, ptr %449, i64 %451
  %453 = load i16, ptr %452, align 2, !tbaa !23
  %454 = sext i16 %453 to i32
  store i32 %454, ptr %56, align 4, !tbaa !9
  %455 = load i32, ptr %55, align 4, !tbaa !9
  %456 = load ptr, ptr %46, align 8, !tbaa !5
  %457 = load i32, ptr %53, align 4, !tbaa !9
  %458 = sext i32 %457 to i64
  %459 = getelementptr inbounds i16, ptr %456, i64 %458
  call void @_ZN18ProbabilityCounter9UpdateBitILi6EEEvjRsii(i32 noundef %455, ptr noundef nonnull align 2 dereferenceable(2) %459, i32 noundef 1951, i32 noundef 147)
  %460 = load i32, ptr %55, align 4, !tbaa !9
  %461 = load i32, ptr %56, align 4, !tbaa !9
  call void @_ZN10RangeCoder9EncodeBitILi11EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %460, i32 noundef %461)
  %462 = load i32, ptr %53, align 4, !tbaa !9
  %463 = load i32, ptr %55, align 4, !tbaa !9
  %464 = add i32 %462, %463
  %465 = load i32, ptr %53, align 4, !tbaa !9
  %466 = add i32 %465, %464
  store i32 %466, ptr %53, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #9
  br label %467

467:                                              ; preds = %444
  %468 = load i32, ptr %54, align 4, !tbaa !9
  %469 = add nsw i32 %468, -1
  store i32 %469, ptr %54, align 4, !tbaa !9
  br label %440, !llvm.loop !28

470:                                              ; preds = %443
  br label %502

471:                                              ; preds = %413
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #9
  store i32 1, ptr %57, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %58) #9
  %472 = load i32, ptr %49, align 4, !tbaa !9
  %473 = sub nsw i32 %472, 1
  store i32 %473, ptr %58, align 4, !tbaa !9
  br label %474

474:                                              ; preds = %498, %471
  %475 = load i32, ptr %58, align 4, !tbaa !9
  %476 = icmp sge i32 %475, 0
  br i1 %476, label %478, label %477

477:                                              ; preds = %474
  store i32 32, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #9
  br label %501

478:                                              ; preds = %474
  call void @llvm.lifetime.start.p0(i64 4, ptr %59) #9
  %479 = load i32, ptr %31, align 4, !tbaa !9
  %480 = load i32, ptr %58, align 4, !tbaa !9
  %481 = lshr i32 %479, %480
  %482 = and i32 %481, 1
  store i32 %482, ptr %59, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %60) #9
  %483 = load ptr, ptr %46, align 8, !tbaa !5
  %484 = load i32, ptr %57, align 4, !tbaa !9
  %485 = sext i32 %484 to i64
  %486 = getelementptr inbounds i16, ptr %483, i64 %485
  %487 = load i16, ptr %486, align 2, !tbaa !23
  %488 = sext i16 %487 to i32
  store i32 %488, ptr %60, align 4, !tbaa !9
  %489 = load i32, ptr %59, align 4, !tbaa !9
  %490 = load ptr, ptr %46, align 8, !tbaa !5
  %491 = load i32, ptr %57, align 4, !tbaa !9
  %492 = sext i32 %491 to i64
  %493 = getelementptr inbounds i16, ptr %490, i64 %492
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvjRsii(i32 noundef %489, ptr noundef nonnull align 2 dereferenceable(2) %493, i32 noundef 1987, i32 noundef 46)
  %494 = load i32, ptr %59, align 4, !tbaa !9
  %495 = load i32, ptr %60, align 4, !tbaa !9
  call void @_ZN10RangeCoder9EncodeBitILi11EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %16, i32 noundef %494, i32 noundef %495)
  %496 = load i32, ptr %57, align 4, !tbaa !9
  %497 = add nsw i32 %496, 1
  store i32 %497, ptr %57, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %60) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %59) #9
  br label %498

498:                                              ; preds = %478
  %499 = load i32, ptr %58, align 4, !tbaa !9
  %500 = add nsw i32 %499, -1
  store i32 %500, ptr %58, align 4, !tbaa !9
  br label %474, !llvm.loop !29

501:                                              ; preds = %477
  br label %502

502:                                              ; preds = %501, %470
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #9
  br label %503

503:                                              ; preds = %502, %374
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %185, !llvm.loop !30

504:                                              ; preds = %185
  %505 = call noundef i32 @_ZN10RangeCoder13FinishEncoderEv(ptr noundef nonnull align 8 dereferenceable(56) %16)
  store i32 %505, ptr %7, align 4
  store i32 1, ptr %21, align 4
  br label %506

506:                                              ; preds = %504, %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 256, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 256, ptr %14) #9
  %507 = load i32, ptr %7, align 4
  ret i32 %507

508:                                              ; preds = %229
  unreachable
}

declare void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef) #8

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

; 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 uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 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 uwtable
declare dso_local void @_ZN10RangeCoder9EncodeBitILi13EEEvji(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) #3 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 uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 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 uwtable
declare dso_local void @_ZN10RangeCoder9EncodeBitILi11EEEvji(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) #3 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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 #6 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 #7 = { mustprogress uwtable "min-legal-vector-width"="128" "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 #8 = { "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 #9 = { 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 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = !{!24, !24, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13}
!27 = distinct !{!27, !13}
!28 = distinct !{!28, !13}
!29 = distinct !{!29, !13}
!30 = distinct !{!30, !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 uwtable
declare dso_local noundef ptr @_Z18bsc_qlfc_transformPKhPhiS1_(ptr noalias noundef, ptr noalias noundef, i32 noundef, ptr noalias noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctlz.i32(i32, i1 immarg) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10RangeCoder8CheckEOBEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef <2 x i64> @_ZL13_mm_set1_epi8c(i8 noundef signext) local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL17_mm_movemask_epi8Dv2_x(<2 x i64> noundef) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef <2 x i64> @_ZL14_mm_cmpeq_epi8Dv2_xS_(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef <2 x i64> @_ZL15_mm_loadu_si128PKDv2_x(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.cttz.i32(i32, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN10RangeCoder13FinishEncoderEv(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_encodePKhPhS1_iiP21QlfcStatisticalModel2(ptr noalias noundef %0, ptr noalias noundef %1, ptr noalias noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5) local_unnamed_addr #7 {
.preheader202.preheader:
  %6 = alloca [256 x i8], align 16
  %7 = alloca %class.RangeCoder, align 8
  %8 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #10
  tail call void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef %5)
  %9 = call noundef ptr @_Z18bsc_qlfc_transformPKhPhiS1_(ptr noundef %0, ptr noundef %2, i32 noundef %3, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #10
  call void @_ZN10RangeCoder11InitEncoderEPhi(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef %1, i32 noundef %4)
  call void @_ZN10RangeCoder10EncodeWordEj(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %3)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %8) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %8, i8 0, i64 256, i1 false), !tbaa !5
  br label %.preheader202

.preheader202:                                    ; preds = %.preheader202.preheader, %195
  %indvars.iv244 = phi i64 [ 0, %.preheader202.preheader ], [ %indvars.iv.next245, %195 ]
  %.0167209 = phi i32 [ -1, %.preheader202.preheader ], [ %12, %195 ]
  %10 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 %indvars.iv244
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = zext i8 %11 to i32
  %13 = zext i32 %.0167209 to i64
  %.old237 = icmp ult i32 %.0167209, 256
  br label %14

14:                                               ; preds = %.preheader202, %26
  %indvars.iv = phi i64 [ 0, %.preheader202 ], [ %indvars.iv.next, %26 ]
  %.0174206 = phi i8 [ 0, %.preheader202 ], [ %.2176, %26 ]
  %.0178205 = phi i8 [ 0, %.preheader202 ], [ %.2180, %26 ]
  %15 = icmp eq i64 %indvars.iv, %13
  br i1 %15, label %21, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %19 = icmp eq i8 %18, 0
  %20 = icmp ult i64 %indvars.iv, 256
  %or.cond = and i1 %19, %20
  br i1 %or.cond, label %._crit_edge269, label %26

21:                                               ; preds = %14
  br i1 %.old237, label %._crit_edge269, label %26

._crit_edge269:                                   ; preds = %21, %16
  %22 = and i64 %indvars.iv, 128
  %.not195 = icmp eq i64 %22, 0
  %.0178. = select i1 %.not195, i8 %.0178205, i8 1
  %..0174 = select i1 %.not195, i8 1, i8 %.0174206
  %23 = trunc nuw i8 %..0174 to i1
  br i1 %23, label %24, label %26

24:                                               ; preds = %._crit_edge269
  %25 = trunc nuw i8 %.0178. to i1
  br i1 %25, label %27, label %26

26:                                               ; preds = %16, %._crit_edge269, %24, %21
  %.2180 = phi i8 [ %.0178., %24 ], [ %.0178., %._crit_edge269 ], [ %.0178205, %21 ], [ %.0178205, %16 ]
  %.2176 = phi i8 [ %..0174, %24 ], [ %..0174, %._crit_edge269 ], [ %.0174206, %21 ], [ %.0174206, %16 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %27, label %14, !llvm.loop !8

27:                                               ; preds = %24, %26
  %.3181 = phi i8 [ %.2180, %26 ], [ %.0178., %24 ]
  %.3177 = phi i8 [ %.2176, %26 ], [ %..0174, %24 ]
  %28 = trunc nuw i8 %.3177 to i1
  br i1 %28, label %29, label %.preheader201.1

29:                                               ; preds = %27
  %30 = trunc i8 %.3181 to i1
  br i1 %30, label %31, label %.preheader201.1

31:                                               ; preds = %29
  %32 = and i32 %12, 128
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %32, i32 noundef 1)
  br label %.preheader201.1

.preheader201.1:                                  ; preds = %31, %29, %27
  %33 = lshr i32 %12, 7
  %.old.1 = lshr i32 %.0167209, 7
  %.old237.1 = icmp eq i32 %33, %.old.1
  br label %34

34:                                               ; preds = %49, %.preheader201.1
  %indvars.iv.1 = phi i64 [ 0, %.preheader201.1 ], [ %indvars.iv.next.1, %49 ]
  %.0174206.1 = phi i8 [ 0, %.preheader201.1 ], [ %.2176.1, %49 ]
  %.0178205.1 = phi i8 [ 0, %.preheader201.1 ], [ %.2180.1, %49 ]
  %35 = icmp eq i64 %indvars.iv.1, %13
  br i1 %35, label %43, label %36

36:                                               ; preds = %34
  %37 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv.1
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = icmp eq i8 %38, 0
  %40 = trunc nuw nsw i64 %indvars.iv.1 to i32
  %41 = lshr i32 %40, 7
  %42 = icmp eq i32 %33, %41
  %or.cond.1 = select i1 %39, i1 %42, i1 false
  br i1 %or.cond.1, label %44, label %49

43:                                               ; preds = %34
  br i1 %.old237.1, label %._crit_edge268, label %49

._crit_edge268:                                   ; preds = %43
  %.pre270 = trunc nuw nsw i64 %indvars.iv.1 to i32
  br label %44

44:                                               ; preds = %._crit_edge268, %36
  %.pre-phi271 = phi i32 [ %.pre270, %._crit_edge268 ], [ %40, %36 ]
  %45 = and i32 %.pre-phi271, 64
  %.not195.1 = icmp eq i32 %45, 0
  %.0178..1 = select i1 %.not195.1, i8 %.0178205.1, i8 1
  %..0174.1 = select i1 %.not195.1, i8 1, i8 %.0174206.1
  %46 = trunc nuw i8 %..0174.1 to i1
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = trunc nuw i8 %.0178..1 to i1
  br i1 %48, label %50, label %49

49:                                               ; preds = %47, %44, %43, %36
  %.2180.1 = phi i8 [ %.0178..1, %47 ], [ %.0178..1, %44 ], [ %.0178205.1, %43 ], [ %.0178205.1, %36 ]
  %.2176.1 = phi i8 [ %..0174.1, %47 ], [ %..0174.1, %44 ], [ %.0174206.1, %43 ], [ %.0174206.1, %36 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, 256
  br i1 %exitcond.1.not, label %50, label %34, !llvm.loop !8

50:                                               ; preds = %49, %47
  %.3181.1 = phi i8 [ %.2180.1, %49 ], [ %.0178..1, %47 ]
  %.3177.1 = phi i8 [ %.2176.1, %49 ], [ %..0174.1, %47 ]
  %51 = trunc nuw i8 %.3177.1 to i1
  br i1 %51, label %52, label %.preheader201.2

52:                                               ; preds = %50
  %53 = trunc i8 %.3181.1 to i1
  br i1 %53, label %54, label %.preheader201.2

54:                                               ; preds = %52
  %55 = and i32 %12, 64
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %55, i32 noundef 1)
  br label %.preheader201.2

.preheader201.2:                                  ; preds = %54, %52, %50
  %56 = lshr i32 %12, 6
  %.old.2 = lshr i32 %.0167209, 6
  %.old237.2 = icmp eq i32 %56, %.old.2
  br label %57

57:                                               ; preds = %72, %.preheader201.2
  %indvars.iv.2 = phi i64 [ 0, %.preheader201.2 ], [ %indvars.iv.next.2, %72 ]
  %.0174206.2 = phi i8 [ 0, %.preheader201.2 ], [ %.2176.2, %72 ]
  %.0178205.2 = phi i8 [ 0, %.preheader201.2 ], [ %.2180.2, %72 ]
  %58 = icmp eq i64 %indvars.iv.2, %13
  br i1 %58, label %66, label %59

59:                                               ; preds = %57
  %60 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv.2
  %61 = load i8, ptr %60, align 1, !tbaa !5
  %62 = icmp eq i8 %61, 0
  %63 = trunc nuw nsw i64 %indvars.iv.2 to i32
  %64 = lshr i32 %63, 6
  %65 = icmp eq i32 %56, %64
  %or.cond.2 = select i1 %62, i1 %65, i1 false
  br i1 %or.cond.2, label %67, label %72

66:                                               ; preds = %57
  br i1 %.old237.2, label %._crit_edge267, label %72

._crit_edge267:                                   ; preds = %66
  %.pre272 = trunc nuw nsw i64 %indvars.iv.2 to i32
  br label %67

67:                                               ; preds = %._crit_edge267, %59
  %.pre-phi273 = phi i32 [ %.pre272, %._crit_edge267 ], [ %63, %59 ]
  %68 = and i32 %.pre-phi273, 32
  %.not195.2 = icmp eq i32 %68, 0
  %.0178..2 = select i1 %.not195.2, i8 %.0178205.2, i8 1
  %..0174.2 = select i1 %.not195.2, i8 1, i8 %.0174206.2
  %69 = trunc nuw i8 %..0174.2 to i1
  br i1 %69, label %70, label %72

70:                                               ; preds = %67
  %71 = trunc nuw i8 %.0178..2 to i1
  br i1 %71, label %73, label %72

72:                                               ; preds = %70, %67, %66, %59
  %.2180.2 = phi i8 [ %.0178..2, %70 ], [ %.0178..2, %67 ], [ %.0178205.2, %66 ], [ %.0178205.2, %59 ]
  %.2176.2 = phi i8 [ %..0174.2, %70 ], [ %..0174.2, %67 ], [ %.0174206.2, %66 ], [ %.0174206.2, %59 ]
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %exitcond.2.not = icmp eq i64 %indvars.iv.next.2, 256
  br i1 %exitcond.2.not, label %73, label %57, !llvm.loop !8

73:                                               ; preds = %72, %70
  %.3181.2 = phi i8 [ %.2180.2, %72 ], [ %.0178..2, %70 ]
  %.3177.2 = phi i8 [ %.2176.2, %72 ], [ %..0174.2, %70 ]
  %74 = trunc nuw i8 %.3177.2 to i1
  br i1 %74, label %75, label %.preheader201.3

75:                                               ; preds = %73
  %76 = trunc i8 %.3181.2 to i1
  br i1 %76, label %77, label %.preheader201.3

77:                                               ; preds = %75
  %78 = and i32 %12, 32
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %78, i32 noundef 1)
  br label %.preheader201.3

.preheader201.3:                                  ; preds = %77, %75, %73
  %79 = lshr i32 %12, 5
  %.old.3 = lshr i32 %.0167209, 5
  %.old237.3 = icmp eq i32 %79, %.old.3
  br label %80

80:                                               ; preds = %95, %.preheader201.3
  %indvars.iv.3 = phi i64 [ 0, %.preheader201.3 ], [ %indvars.iv.next.3, %95 ]
  %.0174206.3 = phi i8 [ 0, %.preheader201.3 ], [ %.2176.3, %95 ]
  %.0178205.3 = phi i8 [ 0, %.preheader201.3 ], [ %.2180.3, %95 ]
  %81 = icmp eq i64 %indvars.iv.3, %13
  br i1 %81, label %89, label %82

82:                                               ; preds = %80
  %83 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv.3
  %84 = load i8, ptr %83, align 1, !tbaa !5
  %85 = icmp eq i8 %84, 0
  %86 = trunc nuw nsw i64 %indvars.iv.3 to i32
  %87 = lshr i32 %86, 5
  %88 = icmp eq i32 %79, %87
  %or.cond.3 = select i1 %85, i1 %88, i1 false
  br i1 %or.cond.3, label %90, label %95

89:                                               ; preds = %80
  br i1 %.old237.3, label %._crit_edge266, label %95

._crit_edge266:                                   ; preds = %89
  %.pre274 = trunc nuw nsw i64 %indvars.iv.3 to i32
  br label %90

90:                                               ; preds = %._crit_edge266, %82
  %.pre-phi275 = phi i32 [ %.pre274, %._crit_edge266 ], [ %86, %82 ]
  %91 = and i32 %.pre-phi275, 16
  %.not195.3 = icmp eq i32 %91, 0
  %.0178..3 = select i1 %.not195.3, i8 %.0178205.3, i8 1
  %..0174.3 = select i1 %.not195.3, i8 1, i8 %.0174206.3
  %92 = trunc nuw i8 %..0174.3 to i1
  br i1 %92, label %93, label %95

93:                                               ; preds = %90
  %94 = trunc nuw i8 %.0178..3 to i1
  br i1 %94, label %96, label %95

95:                                               ; preds = %93, %90, %89, %82
  %.2180.3 = phi i8 [ %.0178..3, %93 ], [ %.0178..3, %90 ], [ %.0178205.3, %89 ], [ %.0178205.3, %82 ]
  %.2176.3 = phi i8 [ %..0174.3, %93 ], [ %..0174.3, %90 ], [ %.0174206.3, %89 ], [ %.0174206.3, %82 ]
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %exitcond.3.not = icmp eq i64 %indvars.iv.next.3, 256
  br i1 %exitcond.3.not, label %96, label %80, !llvm.loop !8

96:                                               ; preds = %95, %93
  %.3181.3 = phi i8 [ %.2180.3, %95 ], [ %.0178..3, %93 ]
  %.3177.3 = phi i8 [ %.2176.3, %95 ], [ %..0174.3, %93 ]
  %97 = trunc nuw i8 %.3177.3 to i1
  br i1 %97, label %98, label %.preheader201.4

98:                                               ; preds = %96
  %99 = trunc i8 %.3181.3 to i1
  br i1 %99, label %100, label %.preheader201.4

100:                                              ; preds = %98
  %101 = and i32 %12, 16
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %101, i32 noundef 1)
  br label %.preheader201.4

.preheader201.4:                                  ; preds = %100, %98, %96
  %102 = lshr i32 %12, 4
  %.old.4 = lshr i32 %.0167209, 4
  %.old237.4 = icmp eq i32 %102, %.old.4
  br label %103

103:                                              ; preds = %118, %.preheader201.4
  %indvars.iv.4 = phi i64 [ 0, %.preheader201.4 ], [ %indvars.iv.next.4, %118 ]
  %.0174206.4 = phi i8 [ 0, %.preheader201.4 ], [ %.2176.4, %118 ]
  %.0178205.4 = phi i8 [ 0, %.preheader201.4 ], [ %.2180.4, %118 ]
  %104 = icmp eq i64 %indvars.iv.4, %13
  br i1 %104, label %112, label %105

105:                                              ; preds = %103
  %106 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv.4
  %107 = load i8, ptr %106, align 1, !tbaa !5
  %108 = icmp eq i8 %107, 0
  %109 = trunc nuw nsw i64 %indvars.iv.4 to i32
  %110 = lshr i32 %109, 4
  %111 = icmp eq i32 %102, %110
  %or.cond.4 = select i1 %108, i1 %111, i1 false
  br i1 %or.cond.4, label %113, label %118

112:                                              ; preds = %103
  br i1 %.old237.4, label %._crit_edge265, label %118

._crit_edge265:                                   ; preds = %112
  %.pre276 = trunc nuw nsw i64 %indvars.iv.4 to i32
  br label %113

113:                                              ; preds = %._crit_edge265, %105
  %.pre-phi277 = phi i32 [ %.pre276, %._crit_edge265 ], [ %109, %105 ]
  %114 = and i32 %.pre-phi277, 8
  %.not195.4 = icmp eq i32 %114, 0
  %.0178..4 = select i1 %.not195.4, i8 %.0178205.4, i8 1
  %..0174.4 = select i1 %.not195.4, i8 1, i8 %.0174206.4
  %115 = trunc nuw i8 %..0174.4 to i1
  br i1 %115, label %116, label %118

116:                                              ; preds = %113
  %117 = trunc nuw i8 %.0178..4 to i1
  br i1 %117, label %119, label %118

118:                                              ; preds = %116, %113, %112, %105
  %.2180.4 = phi i8 [ %.0178..4, %116 ], [ %.0178..4, %113 ], [ %.0178205.4, %112 ], [ %.0178205.4, %105 ]
  %.2176.4 = phi i8 [ %..0174.4, %116 ], [ %..0174.4, %113 ], [ %.0174206.4, %112 ], [ %.0174206.4, %105 ]
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
  %exitcond.4.not = icmp eq i64 %indvars.iv.next.4, 256
  br i1 %exitcond.4.not, label %119, label %103, !llvm.loop !8

119:                                              ; preds = %118, %116
  %.3181.4 = phi i8 [ %.2180.4, %118 ], [ %.0178..4, %116 ]
  %.3177.4 = phi i8 [ %.2176.4, %118 ], [ %..0174.4, %116 ]
  %120 = trunc nuw i8 %.3177.4 to i1
  br i1 %120, label %121, label %.preheader201.5

121:                                              ; preds = %119
  %122 = trunc i8 %.3181.4 to i1
  br i1 %122, label %123, label %.preheader201.5

123:                                              ; preds = %121
  %124 = and i32 %12, 8
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %124, i32 noundef 1)
  br label %.preheader201.5

.preheader201.5:                                  ; preds = %123, %121, %119
  %125 = lshr i32 %12, 3
  %.old.5 = lshr i32 %.0167209, 3
  %.old237.5 = icmp eq i32 %125, %.old.5
  br label %126

126:                                              ; preds = %141, %.preheader201.5
  %indvars.iv.5 = phi i64 [ 0, %.preheader201.5 ], [ %indvars.iv.next.5, %141 ]
  %.0174206.5 = phi i8 [ 0, %.preheader201.5 ], [ %.2176.5, %141 ]
  %.0178205.5 = phi i8 [ 0, %.preheader201.5 ], [ %.2180.5, %141 ]
  %127 = icmp eq i64 %indvars.iv.5, %13
  br i1 %127, label %135, label %128

128:                                              ; preds = %126
  %129 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv.5
  %130 = load i8, ptr %129, align 1, !tbaa !5
  %131 = icmp eq i8 %130, 0
  %132 = trunc nuw nsw i64 %indvars.iv.5 to i32
  %133 = lshr i32 %132, 3
  %134 = icmp eq i32 %125, %133
  %or.cond.5 = select i1 %131, i1 %134, i1 false
  br i1 %or.cond.5, label %136, label %141

135:                                              ; preds = %126
  br i1 %.old237.5, label %._crit_edge264, label %141

._crit_edge264:                                   ; preds = %135
  %.pre278 = trunc nuw nsw i64 %indvars.iv.5 to i32
  br label %136

136:                                              ; preds = %._crit_edge264, %128
  %.pre-phi279 = phi i32 [ %.pre278, %._crit_edge264 ], [ %132, %128 ]
  %137 = and i32 %.pre-phi279, 4
  %.not195.5 = icmp eq i32 %137, 0
  %.0178..5 = select i1 %.not195.5, i8 %.0178205.5, i8 1
  %..0174.5 = select i1 %.not195.5, i8 1, i8 %.0174206.5
  %138 = trunc nuw i8 %..0174.5 to i1
  br i1 %138, label %139, label %141

139:                                              ; preds = %136
  %140 = trunc nuw i8 %.0178..5 to i1
  br i1 %140, label %142, label %141

141:                                              ; preds = %139, %136, %135, %128
  %.2180.5 = phi i8 [ %.0178..5, %139 ], [ %.0178..5, %136 ], [ %.0178205.5, %135 ], [ %.0178205.5, %128 ]
  %.2176.5 = phi i8 [ %..0174.5, %139 ], [ %..0174.5, %136 ], [ %.0174206.5, %135 ], [ %.0174206.5, %128 ]
  %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
  %exitcond.5.not = icmp eq i64 %indvars.iv.next.5, 256
  br i1 %exitcond.5.not, label %142, label %126, !llvm.loop !8

142:                                              ; preds = %141, %139
  %.3181.5 = phi i8 [ %.2180.5, %141 ], [ %.0178..5, %139 ]
  %.3177.5 = phi i8 [ %.2176.5, %141 ], [ %..0174.5, %139 ]
  %143 = trunc nuw i8 %.3177.5 to i1
  br i1 %143, label %144, label %.preheader201.6

144:                                              ; preds = %142
  %145 = trunc i8 %.3181.5 to i1
  br i1 %145, label %146, label %.preheader201.6

146:                                              ; preds = %144
  %147 = and i32 %12, 4
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %147, i32 noundef 1)
  br label %.preheader201.6

.preheader201.6:                                  ; preds = %146, %144, %142
  %148 = lshr i32 %12, 2
  %.old.6 = lshr i32 %.0167209, 2
  %.old237.6 = icmp eq i32 %148, %.old.6
  br label %149

149:                                              ; preds = %164, %.preheader201.6
  %indvars.iv.6 = phi i64 [ 0, %.preheader201.6 ], [ %indvars.iv.next.6, %164 ]
  %.0174206.6 = phi i8 [ 0, %.preheader201.6 ], [ %.2176.6, %164 ]
  %.0178205.6 = phi i8 [ 0, %.preheader201.6 ], [ %.2180.6, %164 ]
  %150 = icmp eq i64 %indvars.iv.6, %13
  br i1 %150, label %158, label %151

151:                                              ; preds = %149
  %152 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv.6
  %153 = load i8, ptr %152, align 1, !tbaa !5
  %154 = icmp eq i8 %153, 0
  %155 = trunc nuw nsw i64 %indvars.iv.6 to i32
  %156 = lshr i32 %155, 2
  %157 = icmp eq i32 %148, %156
  %or.cond.6 = select i1 %154, i1 %157, i1 false
  br i1 %or.cond.6, label %159, label %164

158:                                              ; preds = %149
  br i1 %.old237.6, label %._crit_edge263, label %164

._crit_edge263:                                   ; preds = %158
  %.pre280 = trunc nuw nsw i64 %indvars.iv.6 to i32
  br label %159

159:                                              ; preds = %._crit_edge263, %151
  %.pre-phi281 = phi i32 [ %.pre280, %._crit_edge263 ], [ %155, %151 ]
  %160 = and i32 %.pre-phi281, 2
  %.not195.6 = icmp eq i32 %160, 0
  %.0178..6 = select i1 %.not195.6, i8 %.0178205.6, i8 1
  %..0174.6 = select i1 %.not195.6, i8 1, i8 %.0174206.6
  %161 = trunc nuw i8 %..0174.6 to i1
  br i1 %161, label %162, label %164

162:                                              ; preds = %159
  %163 = trunc nuw i8 %.0178..6 to i1
  br i1 %163, label %165, label %164

164:                                              ; preds = %162, %159, %158, %151
  %.2180.6 = phi i8 [ %.0178..6, %162 ], [ %.0178..6, %159 ], [ %.0178205.6, %158 ], [ %.0178205.6, %151 ]
  %.2176.6 = phi i8 [ %..0174.6, %162 ], [ %..0174.6, %159 ], [ %.0174206.6, %158 ], [ %.0174206.6, %151 ]
  %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
  %exitcond.6.not = icmp eq i64 %indvars.iv.next.6, 256
  br i1 %exitcond.6.not, label %165, label %149, !llvm.loop !8

165:                                              ; preds = %164, %162
  %.3181.6 = phi i8 [ %.2180.6, %164 ], [ %.0178..6, %162 ]
  %.3177.6 = phi i8 [ %.2176.6, %164 ], [ %..0174.6, %162 ]
  %166 = trunc nuw i8 %.3177.6 to i1
  br i1 %166, label %167, label %.preheader201.7

167:                                              ; preds = %165
  %168 = trunc i8 %.3181.6 to i1
  br i1 %168, label %169, label %.preheader201.7

169:                                              ; preds = %167
  %170 = and i32 %12, 2
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %170, i32 noundef 1)
  br label %.preheader201.7

.preheader201.7:                                  ; preds = %169, %167, %165
  %171 = lshr i32 %12, 1
  %.old.7 = lshr i32 %.0167209, 1
  %.old237.7 = icmp eq i32 %171, %.old.7
  br label %172

172:                                              ; preds = %187, %.preheader201.7
  %indvars.iv.7 = phi i64 [ 0, %.preheader201.7 ], [ %indvars.iv.next.7, %187 ]
  %.0174206.7 = phi i8 [ 0, %.preheader201.7 ], [ %.2176.7, %187 ]
  %.0178205.7 = phi i8 [ 0, %.preheader201.7 ], [ %.2180.7, %187 ]
  %173 = icmp eq i64 %indvars.iv.7, %13
  br i1 %173, label %181, label %174

174:                                              ; preds = %172
  %175 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %indvars.iv.7
  %176 = load i8, ptr %175, align 1, !tbaa !5
  %177 = icmp eq i8 %176, 0
  %178 = trunc nuw nsw i64 %indvars.iv.7 to i32
  %179 = lshr i32 %178, 1
  %180 = icmp eq i32 %171, %179
  %or.cond.7 = select i1 %177, i1 %180, i1 false
  br i1 %or.cond.7, label %182, label %187

181:                                              ; preds = %172
  br i1 %.old237.7, label %._crit_edge262, label %187

._crit_edge262:                                   ; preds = %181
  %.pre282 = trunc nuw nsw i64 %indvars.iv.7 to i32
  br label %182

182:                                              ; preds = %._crit_edge262, %174
  %.pre-phi283 = phi i32 [ %.pre282, %._crit_edge262 ], [ %178, %174 ]
  %183 = and i32 %.pre-phi283, 1
  %.not195.7 = icmp eq i32 %183, 0
  %.0178..7 = select i1 %.not195.7, i8 %.0178205.7, i8 1
  %..0174.7 = select i1 %.not195.7, i8 1, i8 %.0174206.7
  %184 = trunc nuw i8 %..0174.7 to i1
  br i1 %184, label %185, label %187

185:                                              ; preds = %182
  %186 = trunc nuw i8 %.0178..7 to i1
  br i1 %186, label %188, label %187

187:                                              ; preds = %185, %182, %181, %174
  %.2180.7 = phi i8 [ %.0178..7, %185 ], [ %.0178..7, %182 ], [ %.0178205.7, %181 ], [ %.0178205.7, %174 ]
  %.2176.7 = phi i8 [ %..0174.7, %185 ], [ %..0174.7, %182 ], [ %.0174206.7, %181 ], [ %.0174206.7, %174 ]
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
  %exitcond.7.not = icmp eq i64 %indvars.iv.next.7, 256
  br i1 %exitcond.7.not, label %188, label %172, !llvm.loop !8

188:                                              ; preds = %187, %185
  %.3181.7 = phi i8 [ %.2180.7, %187 ], [ %.0178..7, %185 ]
  %.3177.7 = phi i8 [ %.2176.7, %187 ], [ %..0174.7, %185 ]
  %189 = trunc nuw i8 %.3177.7 to i1
  br i1 %189, label %190, label %194

190:                                              ; preds = %188
  %191 = trunc nuw i8 %.3181.7 to i1
  br i1 %191, label %192, label %194

192:                                              ; preds = %190
  %193 = and i32 %12, 1
  call void @_ZN10RangeCoder9EncodeBitILi1EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %193, i32 noundef 1)
  br label %194

194:                                              ; preds = %192, %190, %188
  %.not = icmp eq i32 %.0167209, %12
  br i1 %.not, label %.thread, label %195

195:                                              ; preds = %194
  %196 = zext i8 %11 to i64
  %197 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 %196
  store i8 1, ptr %197, align 1, !tbaa !5
  %indvars.iv.next245 = add nuw nsw i64 %indvars.iv244, 1
  %exitcond247.not = icmp eq i64 %indvars.iv.next245, 256
  br i1 %exitcond247.not, label %.thread, label %.preheader202, !llvm.loop !10

.thread:                                          ; preds = %194, %195
  %198 = sext i32 %3 to i64
  %199 = getelementptr inbounds i8, ptr %0, i64 %198
  %200 = getelementptr inbounds i8, ptr %2, i64 %198
  %201 = icmp ult ptr %9, %200
  br i1 %201, label %.lr.ph235, label %._crit_edge236

.lr.ph235:                                        ; preds = %.thread
  %202 = getelementptr inbounds i8, ptr %200, i64 -16
  %203 = getelementptr inbounds i8, ptr %5, i64 4096
  %204 = getelementptr inbounds i8, ptr %5, i64 1052672
  %205 = getelementptr inbounds i8, ptr %5, i64 1069056
  br label %206

206:                                              ; preds = %.lr.ph235, %.loopexit
  %.0160234 = phi ptr [ %0, %.lr.ph235 ], [ %.4, %.loopexit ]
  %.0163233 = phi ptr [ %9, %.lr.ph235 ], [ %209, %.loopexit ]
  %207 = call noundef zeroext i1 @_ZN10RangeCoder8CheckEOBEv(ptr noundef nonnull align 8 dereferenceable(56) %7)
  br i1 %207, label %.loopexit200, label %208

208:                                              ; preds = %206
  %209 = getelementptr inbounds i8, ptr %.0163233, i64 1
  %210 = load i8, ptr %.0163233, align 1, !tbaa !5
  %211 = zext i8 %210 to i32
  %212 = load i8, ptr %.0160234, align 1, !tbaa !5
  %213 = getelementptr inbounds i8, ptr %.0160234, i64 1
  %214 = icmp ult ptr %209, %202
  br i1 %214, label %216, label %.preheader

.preheader:                                       ; preds = %208
  %215 = icmp ult ptr %213, %199
  br i1 %215, label %.lr.ph, label %.critedge

216:                                              ; preds = %208
  %217 = call noundef <2 x i64> @_ZL13_mm_set1_epi8c(i8 noundef signext %212)
  br label %218

218:                                              ; preds = %218, %216
  %.1 = phi ptr [ %213, %216 ], [ %222, %218 ]
  %219 = call noundef <2 x i64> @_ZL15_mm_loadu_si128PKDv2_x(ptr noundef nonnull %.1)
  %220 = call noundef <2 x i64> @_ZL14_mm_cmpeq_epi8Dv2_xS_(<2 x i64> noundef %219, <2 x i64> noundef %217)
  %221 = call noundef i32 @_ZL17_mm_movemask_epi8Dv2_x(<2 x i64> noundef %220)
  %.not193 = icmp eq i32 %221, 65535
  %222 = getelementptr inbounds i8, ptr %.1, i64 16
  br i1 %.not193, label %218, label %.critedge.loopexit

.lr.ph:                                           ; preds = %.preheader, %225
  %.3210 = phi ptr [ %226, %225 ], [ %213, %.preheader ]
  %223 = load i8, ptr %.3210, align 1, !tbaa !5
  %224 = icmp eq i8 %223, %212
  br i1 %224, label %225, label %.critedge

225:                                              ; preds = %.lr.ph
  %226 = getelementptr inbounds i8, ptr %.3210, i64 1
  %227 = icmp ult ptr %226, %199
  br i1 %227, label %.lr.ph, label %.critedge, !llvm.loop !11

.critedge.loopexit:                               ; preds = %218
  %228 = xor i32 %221, -1
  %229 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %228, i1 true)
  %230 = zext nneg i32 %229 to i64
  %231 = getelementptr inbounds i8, ptr %.1, i64 %230
  br label %.critedge

.critedge:                                        ; preds = %225, %.lr.ph, %.preheader, %.critedge.loopexit
  %.4 = phi ptr [ %231, %.critedge.loopexit ], [ %213, %.preheader ], [ %226, %225 ], [ %.3210, %.lr.ph ]
  %232 = ptrtoint ptr %.4 to i64
  %233 = ptrtoint ptr %.0160234 to i64
  %234 = sub i64 %232, %233
  %235 = trunc i64 %234 to i32
  %236 = zext i8 %212 to i64
  %237 = getelementptr inbounds [256 x [8 x i16]], ptr %5, i64 0, i64 %236
  %238 = icmp eq i8 %210, 1
  %239 = load i16, ptr %237, align 2, !tbaa !12
  %240 = sext i16 %239 to i32
  br i1 %238, label %241, label %242

241:                                              ; preds = %.critedge
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %237, i32 noundef 8016)
  call void @_ZN10RangeCoder10EncodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %240)
  br label %.loopexit198

242:                                              ; preds = %.critedge
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %237, i32 noundef 83)
  call void @_ZN10RangeCoder10EncodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %240)
  %243 = call range(i32 24, 33) i32 @llvm.ctlz.i32(i32 %211, i1 true)
  %244 = xor i32 %243, 31
  %245 = icmp ugt i32 %244, 1
  br i1 %245, label %.lr.ph216.preheader, label %._crit_edge.thread

.lr.ph216.preheader:                              ; preds = %242
  %wide.trip.count = zext nneg i32 %244 to i64
  br label %.lr.ph216

._crit_edge:                                      ; preds = %.lr.ph216
  %246 = icmp ult i32 %244, 7
  br i1 %246, label %._crit_edge.thread, label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge
  %.pre286 = zext nneg i32 %244 to i64
  br label %254

.lr.ph216:                                        ; preds = %.lr.ph216.preheader, %.lr.ph216
  %indvars.iv248 = phi i64 [ 1, %.lr.ph216.preheader ], [ %indvars.iv.next249, %.lr.ph216 ]
  %247 = getelementptr inbounds i16, ptr %237, i64 %indvars.iv248
  %248 = load i16, ptr %247, align 2, !tbaa !12
  %249 = sext i16 %248 to i32
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %247, i32 noundef 122)
  call void @_ZN10RangeCoder10EncodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %249)
  %indvars.iv.next249 = add nuw nsw i64 %indvars.iv248, 1
  %exitcond251.not = icmp eq i64 %indvars.iv.next249, %wide.trip.count
  br i1 %exitcond251.not, label %._crit_edge, label %.lr.ph216, !llvm.loop !14

._crit_edge.thread:                               ; preds = %242, %._crit_edge
  %250 = zext nneg i32 %244 to i64
  %251 = getelementptr inbounds i16, ptr %237, i64 %250
  %252 = load i16, ptr %251, align 2, !tbaa !12
  %253 = sext i16 %252 to i32
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %251, i32 noundef 8114)
  call void @_ZN10RangeCoder10EncodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %253)
  br label %254

254:                                              ; preds = %._crit_edge._crit_edge, %._crit_edge.thread
  %.pre-phi287 = phi i64 [ %.pre286, %._crit_edge._crit_edge ], [ %250, %._crit_edge.thread ]
  %255 = getelementptr inbounds [256 x [8 x [256 x i16]]], ptr %203, i64 0, i64 %236, i64 %.pre-phi287
  %.not238 = icmp eq i32 %243, 31
  br i1 %.not238, label %.loopexit198, label %.lr.ph220.preheader

.lr.ph220.preheader:                              ; preds = %254
  %256 = sub nsw i32 30, %243
  br label %.lr.ph220

.lr.ph220:                                        ; preds = %.lr.ph220.preheader, %.lr.ph220
  %.0183218 = phi i32 [ %264, %.lr.ph220 ], [ %256, %.lr.ph220.preheader ]
  %.0184217 = phi i32 [ %263, %.lr.ph220 ], [ 1, %.lr.ph220.preheader ]
  %257 = lshr i32 %211, %.0183218
  %258 = and i32 %257, 1
  %259 = sext i32 %.0184217 to i64
  %260 = getelementptr inbounds i16, ptr %255, i64 %259
  %261 = load i16, ptr %260, align 2, !tbaa !12
  %262 = sext i16 %261 to i32
  call void @_ZN18ProbabilityCounter9UpdateBitILi7EEEvjRsii(i32 noundef %258, ptr noundef nonnull align 2 dereferenceable(2) %260, i32 noundef 7999, i32 noundef 235)
  call void @_ZN10RangeCoder9EncodeBitILi13EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %258, i32 noundef %262)
  %reass.add = shl i32 %.0184217, 1
  %263 = or disjoint i32 %258, %reass.add
  %264 = add nsw i32 %.0183218, -1
  %265 = icmp sgt i32 %.0183218, 0
  br i1 %265, label %.lr.ph220, label %.loopexit198, !llvm.loop !15

.loopexit198:                                     ; preds = %.lr.ph220, %254, %241
  %266 = getelementptr inbounds [256 x [32 x i16]], ptr %204, i64 0, i64 %236
  %267 = icmp eq i32 %235, 1
  %268 = load i16, ptr %266, align 2, !tbaa !12
  %269 = sext i16 %268 to i32
  br i1 %267, label %270, label %271

270:                                              ; preds = %.loopexit198
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %266, i32 noundef 2025)
  call void @_ZN10RangeCoder10EncodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %269)
  br label %.loopexit

271:                                              ; preds = %.loopexit198
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %266, i32 noundef 42)
  call void @_ZN10RangeCoder10EncodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %269)
  %272 = call range(i32 0, 33) i32 @llvm.ctlz.i32(i32 %235, i1 true)
  %273 = xor i32 %272, 31
  %274 = icmp ugt i32 %273, 1
  br i1 %274, label %.lr.ph223.preheader, label %._crit_edge224

.lr.ph223.preheader:                              ; preds = %271
  %wide.trip.count255 = zext nneg i32 %273 to i64
  br label %.lr.ph223

._crit_edge224:                                   ; preds = %.lr.ph223, %271
  %.pre-phi285 = phi i64 [ 1, %271 ], [ %wide.trip.count255, %.lr.ph223 ]
  %275 = getelementptr inbounds i16, ptr %266, i64 %.pre-phi285
  %276 = load i16, ptr %275, align 2, !tbaa !12
  %277 = sext i16 %276 to i32
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %275, i32 noundef 1962)
  call void @_ZN10RangeCoder10EncodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %277)
  %278 = getelementptr inbounds [256 x [32 x [32 x i16]]], ptr %205, i64 0, i64 %236, i64 %.pre-phi285
  %279 = icmp ult i32 %273, 6
  %.not240 = icmp eq i32 %272, 31
  br i1 %279, label %283, label %294

.lr.ph223:                                        ; preds = %.lr.ph223.preheader, %.lr.ph223
  %indvars.iv252 = phi i64 [ 1, %.lr.ph223.preheader ], [ %indvars.iv.next253, %.lr.ph223 ]
  %280 = getelementptr inbounds i16, ptr %266, i64 %indvars.iv252
  %281 = load i16, ptr %280, align 2, !tbaa !12
  %282 = sext i16 %281 to i32
  call void @_ZN18ProbabilityCounter9UpdateBitILi4EEEvRsi(ptr noundef nonnull align 2 dereferenceable(2) %280, i32 noundef 142)
  call void @_ZN10RangeCoder10EncodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %282)
  %indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 1
  %exitcond256.not = icmp eq i64 %indvars.iv.next253, %wide.trip.count255
  br i1 %exitcond256.not, label %._crit_edge224, label %.lr.ph223, !llvm.loop !16

283:                                              ; preds = %._crit_edge224
  br i1 %.not240, label %.loopexit, label %.lr.ph232.preheader

.lr.ph232.preheader:                              ; preds = %283
  %284 = sub nsw i32 30, %272
  br label %.lr.ph232

.lr.ph232:                                        ; preds = %.lr.ph232.preheader, %.lr.ph232
  %.0165230 = phi i32 [ %292, %.lr.ph232 ], [ %284, %.lr.ph232.preheader ]
  %.0166229 = phi i32 [ %291, %.lr.ph232 ], [ 1, %.lr.ph232.preheader ]
  %285 = lshr i32 %235, %.0165230
  %286 = and i32 %285, 1
  %287 = sext i32 %.0166229 to i64
  %288 = getelementptr inbounds i16, ptr %278, i64 %287
  %289 = load i16, ptr %288, align 2, !tbaa !12
  %290 = sext i16 %289 to i32
  call void @_ZN18ProbabilityCounter9UpdateBitILi6EEEvjRsii(i32 noundef %286, ptr noundef nonnull align 2 dereferenceable(2) %288, i32 noundef 1951, i32 noundef 147)
  call void @_ZN10RangeCoder9EncodeBitILi11EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %286, i32 noundef %290)
  %reass.add194 = shl i32 %.0166229, 1
  %291 = or disjoint i32 %286, %reass.add194
  %292 = add nsw i32 %.0165230, -1
  %293 = icmp sgt i32 %.0165230, 0
  br i1 %293, label %.lr.ph232, label %.loopexit, !llvm.loop !17

294:                                              ; preds = %._crit_edge224
  br i1 %.not240, label %.loopexit, label %.lr.ph228.preheader

.lr.ph228.preheader:                              ; preds = %294
  %295 = sub nsw i32 30, %272
  %296 = sub nuw nsw i32 32, %272
  %wide.trip.count260 = zext nneg i32 %296 to i64
  br label %.lr.ph228

.lr.ph228:                                        ; preds = %.lr.ph228.preheader, %.lr.ph228
  %indvars.iv257 = phi i64 [ 1, %.lr.ph228.preheader ], [ %indvars.iv.next258, %.lr.ph228 ]
  %.0161226 = phi i32 [ %295, %.lr.ph228.preheader ], [ %302, %.lr.ph228 ]
  %297 = lshr i32 %235, %.0161226
  %298 = and i32 %297, 1
  %299 = getelementptr inbounds i16, ptr %278, i64 %indvars.iv257
  %300 = load i16, ptr %299, align 2, !tbaa !12
  %301 = sext i16 %300 to i32
  call void @_ZN18ProbabilityCounter9UpdateBitILi5EEEvjRsii(i32 noundef %298, ptr noundef nonnull align 2 dereferenceable(2) %299, i32 noundef 1987, i32 noundef 46)
  call void @_ZN10RangeCoder9EncodeBitILi11EEEvji(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %298, i32 noundef %301)
  %indvars.iv.next258 = add nuw nsw i64 %indvars.iv257, 1
  %302 = add nsw i32 %.0161226, -1
  %exitcond261.not = icmp eq i64 %indvars.iv.next258, %wide.trip.count260
  br i1 %exitcond261.not, label %.loopexit, label %.lr.ph228, !llvm.loop !18

.loopexit:                                        ; preds = %.lr.ph228, %.lr.ph232, %294, %283, %270
  %303 = icmp ult ptr %209, %200
  br i1 %303, label %206, label %._crit_edge236, !llvm.loop !19

._crit_edge236:                                   ; preds = %.loopexit, %.thread
  %304 = call noundef i32 @_ZN10RangeCoder13FinishEncoderEv(ptr noundef nonnull align 8 dereferenceable(56) %7)
  br label %.loopexit200

.loopexit200:                                     ; preds = %206, %._crit_edge236
  %.0 = phi i32 [ %304, %._crit_edge236 ], [ -3, %206 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #10
  ret i32 %.0
}

declare void @_Z19bsc_qlfc_init_modelP21QlfcStatisticalModel2(ptr noundef) local_unnamed_addr #8

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

; 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 uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit0ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit1ILi13EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3 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 uwtable
declare dso_local void @_ZN10RangeCoder9EncodeBitILi13EEEvji(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) local_unnamed_addr #3 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 uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit0ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RangeCoder10EncodeBit1ILi11EEEvi(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) local_unnamed_addr #3 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 uwtable
declare dso_local void @_ZN10RangeCoder9EncodeBitILi11EEEvji(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) local_unnamed_addr #3 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 #6 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 #7 = { mustprogress uwtable "min-legal-vector-width"="128" "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 #8 = { "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 #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { 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}
!19 = distinct !{!19, !9}


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