; LLVM IR from mncoppola/rpef :: utilities_src/squashfs4.2/lzma465/CPP/7zip/Compress (Bcj2Coder)

; 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"

%struct.GUID = type { i32, i16, i16, [8 x i8] }
%"class.NCompress::NBcj2::CEncoder::CCoderReleaser" = type { ptr }
%class.CMyComPtr.0 = type { ptr }
%"class.NCompress::NBcj2::CEncoder" = type { %struct.ICompressCoder2, %class.CMyUnknownImp, ptr, %class.COutBuffer, %class.COutBuffer, %class.COutBuffer, %"class.NCompress::NRangeCoder::CEncoder", [258 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%struct.ICompressCoder2 = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%class.CMyUnknownImp = type { i32 }
%class.COutBuffer = type <{ ptr, i32, i32, i32, i32, %class.CMyComPtr, i64, ptr, i8, [7 x i8] }>
%class.CMyComPtr = type { ptr }
%"class.NCompress::NRangeCoder::CEncoder" = type { i32, i8, i64, i32, [4 x i8], %class.COutBuffer }
%"class.NCompress::NRangeCoder::CBitEncoder" = type { %"class.NCompress::NRangeCoder::CBitModel" }
%"class.NCompress::NRangeCoder::CBitModel" = type { i32 }

@IID_ICompressGetSubStreamSize = external global %struct.GUID, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress5NBcj28CEncoder6CreateEv(ptr noundef nonnull align 8 dereferenceable(1304)) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NBcj28CEncoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(1304)) #0 align 2

; 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: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NBcj28CEncoder8CodeRealEPP19ISequentialInStreamPPKyjPP20ISequentialOutStreamS7_jP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(1304) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, ptr noundef %7) #0 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca %"class.NCompress::NBcj2::CEncoder::CCoderReleaser", align 8
  %23 = alloca %class.CMyComPtr.0, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i32, align 4
  %29 = alloca i8, align 1
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i8, align 1
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i8, align 1
  %43 = alloca i8, align 1
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i8, align 1
  %47 = alloca i64, align 8
  %48 = alloca i64, align 8
  %49 = alloca i32, align 4
  %50 = alloca i64, align 8
  %51 = alloca i32, align 4
  %52 = alloca ptr, align 8
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  %55 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store i32 %3, ptr %13, align 4, !tbaa !9
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store i32 %6, ptr %16, align 4, !tbaa !9
  store ptr %7, ptr %17, align 8, !tbaa !5
  %56 = load ptr, ptr %10, align 8
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 1
  br i1 %58, label %62, label %59

59:                                               ; preds = %8
  %60 = load i32, ptr %16, align 4, !tbaa !9
  %61 = icmp ne i32 %60, 4
  br i1 %61, label %62, label %63

62:                                               ; preds = %59, %8
  store i32 -2147024809, ptr %9, align 4
  br label %585

63:                                               ; preds = %59
  %64 = call noundef zeroext i1 @_ZN9NCompress5NBcj28CEncoder6CreateEv(ptr noundef nonnull align 8 dereferenceable(1304) %56)
  br i1 %64, label %66, label %65

65:                                               ; preds = %63
  store i32 -2147024882, ptr %9, align 4
  br label %585

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  store i8 0, ptr %18, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !13
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %84

69:                                               ; preds = %66
  %70 = load ptr, ptr %12, align 8, !tbaa !5
  %71 = getelementptr inbounds ptr, ptr %70, i64 0
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %83

74:                                               ; preds = %69
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds ptr, ptr %75, i64 0
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load i64, ptr %77, align 8, !tbaa !13
  store i64 %78, ptr %19, align 8, !tbaa !13
  %79 = load i64, ptr %19, align 8, !tbaa !13
  %80 = icmp ule i64 %79, 16777216
  br i1 %80, label %81, label %82

81:                                               ; preds = %74
  store i8 1, ptr %18, align 1, !tbaa !11
  br label %82

82:                                               ; preds = %81, %74
  br label %83

83:                                               ; preds = %82, %69
  br label %84

84:                                               ; preds = %83, %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds ptr, ptr %85, i64 0
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  store ptr %87, ptr %20, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 3
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds ptr, ptr %89, i64 0
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %88, ptr noundef %91)
  %92 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 3
  call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %92)
  %93 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 4
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds ptr, ptr %94, i64 1
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %93, ptr noundef %96)
  %97 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 4
  call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %97)
  %98 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 5
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds ptr, ptr %99, i64 2
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %98, ptr noundef %101)
  %102 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 5
  call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %102)
  %103 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 6
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = getelementptr inbounds ptr, ptr %104, i64 3
  %106 = load ptr, ptr %105, align 8, !tbaa !5
  call void @_ZN9NCompress11NRangeCoder8CEncoder9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(80) %103, ptr noundef %106)
  %107 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 6
  call void @_ZN9NCompress11NRangeCoder8CEncoder4InitEv(ptr noundef nonnull align 8 dereferenceable(80) %107)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %117, %84
  %109 = load i32, ptr %21, align 4, !tbaa !9
  %110 = icmp slt i32 %109, 258
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %120

112:                                              ; preds = %108
  %113 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 7
  %114 = load i32, ptr %21, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %113, i64 0, i64 %115
  call void @_ZN9NCompress11NRangeCoder9CBitModelILi5EE4InitEv(ptr noundef nonnull align 4 dereferenceable(4) %116)
  br label %117

117:                                              ; preds = %112
  %118 = load i32, ptr %21, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %21, align 4, !tbaa !9
  br label %108, !llvm.loop !15

120:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef %56)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  invoke void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %121 unwind label %139

121:                                              ; preds = %120
  %122 = load ptr, ptr %20, align 8, !tbaa !5
  %123 = invoke noundef ptr @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEadEv(ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %124 unwind label %143

124:                                              ; preds = %121
  %125 = load ptr, ptr %122, align 8, !tbaa !17
  %126 = getelementptr inbounds ptr, ptr %125, i64 0
  %127 = load ptr, ptr %126, align 8
  %128 = invoke noundef i32 %127(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef nonnull align 4 dereferenceable(16) @IID_ICompressGetSubStreamSize, ptr noundef %123)
          to label %129 unwind label %143

129:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  store i64 0, ptr %27, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #5
  store i8 0, ptr %29, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  store i64 0, ptr %30, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  store i64 0, ptr %31, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  store i64 0, ptr %32, align 8, !tbaa !13
  br label %130

130:                                              ; preds = %578, %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %184, %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  %132 = load i32, ptr %28, align 4, !tbaa !9
  %133 = load i32, ptr %33, align 4, !tbaa !9
  %134 = add i32 %132, %133
  %135 = sub i32 131072, %134
  store i32 %135, ptr %34, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %136 = load i32, ptr %34, align 4, !tbaa !9
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %147

138:                                              ; preds = %131
  store i32 7, ptr %36, align 4
  br label %182

139:                                              ; preds = %120
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %24, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %25, align 4
  br label %584

143:                                              ; preds = %124, %121
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %24, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %25, align 4
  br label %583

147:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  %149 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !20
  %151 = load i32, ptr %28, align 4, !tbaa !9
  %152 = zext i32 %151 to i64
  %153 = getelementptr inbounds i8, ptr %150, i64 %152
  %154 = load i32, ptr %33, align 4, !tbaa !9
  %155 = zext i32 %154 to i64
  %156 = getelementptr inbounds i8, ptr %153, i64 %155
  %157 = load i32, ptr %34, align 4, !tbaa !9
  %158 = load ptr, ptr %148, align 8, !tbaa !17
  %159 = getelementptr inbounds ptr, ptr %158, i64 5
  %160 = load ptr, ptr %159, align 8
  %161 = invoke noundef i32 %160(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef %156, i32 noundef %157, ptr noundef %35)
          to label %162 unwind label %167

162:                                              ; preds = %147
  store i32 %161, ptr %37, align 4, !tbaa !9
  %163 = load i32, ptr %37, align 4, !tbaa !9
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %171

165:                                              ; preds = %162
  %166 = load i32, ptr %37, align 4, !tbaa !9
  store i32 %166, ptr %9, align 4
  store i32 1, ptr %36, align 4
  br label %172

167:                                              ; preds = %147
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %24, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %581

171:                                              ; preds = %162
  store i32 0, ptr %36, align 4
  br label %172

172:                                              ; preds = %171, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  %173 = load i32, ptr %36, align 4
  switch i32 %173, label %182 [
    i32 0, label %174
  ]

174:                                              ; preds = %172
  %175 = load i32, ptr %35, align 4, !tbaa !9
  %176 = icmp eq i32 %175, 0
  br i1 %176, label %177, label %178

177:                                              ; preds = %174
  store i32 7, ptr %36, align 4
  br label %182

178:                                              ; preds = %174
  %179 = load i32, ptr %35, align 4, !tbaa !9
  %180 = load i32, ptr %33, align 4, !tbaa !9
  %181 = add i32 %180, %179
  store i32 %181, ptr %33, align 4, !tbaa !9
  store i32 0, ptr %36, align 4
  br label %182

182:                                              ; preds = %178, %177, %172, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  %183 = load i32, ptr %36, align 4
  switch i32 %183, label %576 [
    i32 0, label %184
    i32 7, label %185
  ]

184:                                              ; preds = %182
  br label %131, !llvm.loop !28

185:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #5
  %186 = load i32, ptr %28, align 4, !tbaa !9
  %187 = load i32, ptr %33, align 4, !tbaa !9
  %188 = add i32 %186, %187
  store i32 %188, ptr %38, align 4, !tbaa !9
  %189 = load i32, ptr %38, align 4, !tbaa !9
  %190 = icmp ult i32 %189, 5
  br i1 %190, label %191, label %257

191:                                              ; preds = %185
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %192

192:                                              ; preds = %246, %191
  %193 = load i32, ptr %28, align 4, !tbaa !9
  %194 = load i32, ptr %38, align 4, !tbaa !9
  %195 = icmp ult i32 %193, %194
  br i1 %195, label %196, label %250

196:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 1, ptr %39) #5
  %197 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %198 = load ptr, ptr %197, align 8, !tbaa !20
  %199 = load i32, ptr %28, align 4, !tbaa !9
  %200 = zext i32 %199 to i64
  %201 = getelementptr inbounds i8, ptr %198, i64 %200
  %202 = load i8, ptr %201, align 1, !tbaa !19
  store i8 %202, ptr %39, align 1, !tbaa !19
  %203 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 3
  %204 = load i8, ptr %39, align 1, !tbaa !19
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %203, i8 noundef zeroext %204)
          to label %205 unwind label %212

205:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #5
  %206 = load i8, ptr %39, align 1, !tbaa !19
  %207 = zext i8 %206 to i32
  %208 = icmp eq i32 %207, 232
  br i1 %208, label %209, label %216

209:                                              ; preds = %205
  %210 = load i8, ptr %29, align 1, !tbaa !19
  %211 = zext i8 %210 to i32
  store i32 %211, ptr %40, align 4, !tbaa !9
  br label %235

212:                                              ; preds = %196
  %213 = landingpad { ptr, i32 }
          cleanup
  %214 = extractvalue { ptr, i32 } %213, 0
  store ptr %214, ptr %24, align 8
  %215 = extractvalue { ptr, i32 } %213, 1
  store i32 %215, ptr %25, align 4
  br label %249

216:                                              ; preds = %205
  %217 = load i8, ptr %39, align 1, !tbaa !19
  %218 = zext i8 %217 to i32
  %219 = icmp eq i32 %218, 233
  br i1 %219, label %220, label %221

220:                                              ; preds = %216
  store i32 256, ptr %40, align 4, !tbaa !9
  br label %234

221:                                              ; preds = %216
  %222 = load i8, ptr %29, align 1, !tbaa !19
  %223 = load i8, ptr %39, align 1, !tbaa !19
  %224 = invoke noundef zeroext i1 @_ZN9NCompress5NBcj25IsJccEhh(i8 noundef zeroext %222, i8 noundef zeroext %223)
          to label %225 unwind label %227

225:                                              ; preds = %221
  br i1 %224, label %226, label %231

226:                                              ; preds = %225
  store i32 257, ptr %40, align 4, !tbaa !9
  br label %233

227:                                              ; preds = %235, %221
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %24, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #5
  br label %249

231:                                              ; preds = %225
  %232 = load i8, ptr %39, align 1, !tbaa !19
  store i8 %232, ptr %29, align 1, !tbaa !19
  store i32 11, ptr %36, align 4
  br label %243

233:                                              ; preds = %226
  br label %234

234:                                              ; preds = %233, %220
  br label %235

235:                                              ; preds = %234, %209
  %236 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 7
  %237 = load i32, ptr %40, align 4, !tbaa !9
  %238 = zext i32 %237 to i64
  %239 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %236, i64 0, i64 %238
  %240 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 6
  invoke void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4) %239, ptr noundef %240, i32 noundef 0)
          to label %241 unwind label %227

241:                                              ; preds = %235
  %242 = load i8, ptr %39, align 1, !tbaa !19
  store i8 %242, ptr %29, align 1, !tbaa !19
  store i32 0, ptr %36, align 4
  br label %243

243:                                              ; preds = %241, %231
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #5
  %244 = load i32, ptr %36, align 4
  switch i32 %244, label %592 [
    i32 0, label %245
    i32 11, label %246
  ]

245:                                              ; preds = %243
  br label %246

246:                                              ; preds = %245, %243
  %247 = load i32, ptr %28, align 4, !tbaa !9
  %248 = add i32 %247, 1
  store i32 %248, ptr %28, align 4, !tbaa !9
  br label %192, !llvm.loop !29

249:                                              ; preds = %227, %212
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #5
  br label %580

250:                                              ; preds = %192
  %251 = invoke noundef i32 @_ZN9NCompress5NBcj28CEncoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(1304) %56)
          to label %252 unwind label %253

252:                                              ; preds = %250
  store i32 %251, ptr %9, align 4
  store i32 1, ptr %36, align 4
  br label %575

253:                                              ; preds = %250
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %24, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %25, align 4
  br label %580

257:                                              ; preds = %185
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #5
  %258 = load i32, ptr %38, align 4, !tbaa !9
  %259 = sub i32 %258, 5
  store i32 %259, ptr %41, align 4, !tbaa !9
  br label %260

260:                                              ; preds = %520, %518, %257
  %261 = load i32, ptr %28, align 4, !tbaa !9
  %262 = load i32, ptr %41, align 4, !tbaa !9
  %263 = icmp ule i32 %261, %262
  br i1 %263, label %264, label %524

264:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 1, ptr %42) #5
  %265 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %266 = load ptr, ptr %265, align 8, !tbaa !20
  %267 = load i32, ptr %28, align 4, !tbaa !9
  %268 = zext i32 %267 to i64
  %269 = getelementptr inbounds i8, ptr %266, i64 %268
  %270 = load i8, ptr %269, align 1, !tbaa !19
  store i8 %270, ptr %42, align 1, !tbaa !19
  %271 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 3
  %272 = load i8, ptr %42, align 1, !tbaa !19
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %271, i8 noundef zeroext %272)
          to label %273 unwind label %282

273:                                              ; preds = %264
  %274 = load i8, ptr %29, align 1, !tbaa !19
  %275 = load i8, ptr %42, align 1, !tbaa !19
  %276 = invoke noundef zeroext i1 @_ZN9NCompress5NBcj23IsJEhh(i8 noundef zeroext %274, i8 noundef zeroext %275)
          to label %277 unwind label %282

277:                                              ; preds = %273
  br i1 %276, label %286, label %278

278:                                              ; preds = %277
  %279 = load i32, ptr %28, align 4, !tbaa !9
  %280 = add i32 %279, 1
  store i32 %280, ptr %28, align 4, !tbaa !9
  %281 = load i8, ptr %42, align 1, !tbaa !19
  store i8 %281, ptr %29, align 1, !tbaa !19
  store i32 12, ptr %36, align 4
  br label %518, !llvm.loop !30

282:                                              ; preds = %273, %264
  %283 = landingpad { ptr, i32 }
          cleanup
  %284 = extractvalue { ptr, i32 } %283, 0
  store ptr %284, ptr %24, align 8
  %285 = extractvalue { ptr, i32 } %283, 1
  store i32 %285, ptr %25, align 4
  br label %523

286:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 1, ptr %43) #5
  %287 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %288 = load ptr, ptr %287, align 8, !tbaa !20
  %289 = load i32, ptr %28, align 4, !tbaa !9
  %290 = add i32 %289, 4
  %291 = zext i32 %290 to i64
  %292 = getelementptr inbounds i8, ptr %288, i64 %291
  %293 = load i8, ptr %292, align 1, !tbaa !19
  store i8 %293, ptr %43, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #5
  %294 = load i8, ptr %43, align 1, !tbaa !19
  %295 = zext i8 %294 to i32
  %296 = shl i32 %295, 24
  %297 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %298 = load ptr, ptr %297, align 8, !tbaa !20
  %299 = load i32, ptr %28, align 4, !tbaa !9
  %300 = add i32 %299, 3
  %301 = zext i32 %300 to i64
  %302 = getelementptr inbounds i8, ptr %298, i64 %301
  %303 = load i8, ptr %302, align 1, !tbaa !19
  %304 = zext i8 %303 to i32
  %305 = shl i32 %304, 16
  %306 = or i32 %296, %305
  %307 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %308 = load ptr, ptr %307, align 8, !tbaa !20
  %309 = load i32, ptr %28, align 4, !tbaa !9
  %310 = add i32 %309, 2
  %311 = zext i32 %310 to i64
  %312 = getelementptr inbounds i8, ptr %308, i64 %311
  %313 = load i8, ptr %312, align 1, !tbaa !19
  %314 = zext i8 %313 to i32
  %315 = shl i32 %314, 8
  %316 = or i32 %306, %315
  %317 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %318 = load ptr, ptr %317, align 8, !tbaa !20
  %319 = load i32, ptr %28, align 4, !tbaa !9
  %320 = add i32 %319, 1
  %321 = zext i32 %320 to i64
  %322 = getelementptr inbounds i8, ptr %318, i64 %321
  %323 = load i8, ptr %322, align 1, !tbaa !19
  %324 = zext i8 %323 to i32
  %325 = or i32 %316, %324
  store i32 %325, ptr %44, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #5
  %326 = load i32, ptr %26, align 4, !tbaa !9
  %327 = load i32, ptr %28, align 4, !tbaa !9
  %328 = add i32 %326, %327
  %329 = add i32 %328, 5
  %330 = load i32, ptr %44, align 4, !tbaa !9
  %331 = add i32 %329, %330
  store i32 %331, ptr %45, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %46) #5
  %332 = invoke noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %333 unwind label %362

333:                                              ; preds = %286
  %334 = icmp ne ptr %332, null
  br i1 %334, label %335, label %442

335:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #5
  %336 = load i64, ptr %27, align 8, !tbaa !13
  %337 = load i32, ptr %28, align 4, !tbaa !9
  %338 = zext i32 %337 to i64
  %339 = add i64 %336, %338
  store i64 %339, ptr %47, align 8, !tbaa !13
  br label %340

340:                                              ; preds = %386, %335
  %341 = load i64, ptr %32, align 8, !tbaa !13
  %342 = load i64, ptr %47, align 8, !tbaa !13
  %343 = icmp ult i64 %341, %342
  br i1 %343, label %344, label %387

344:                                              ; preds = %340
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #5
  %345 = invoke noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %346 unwind label %366

346:                                              ; preds = %344
  %347 = load i64, ptr %30, align 8, !tbaa !13
  %348 = load ptr, ptr %345, align 8, !tbaa !17
  %349 = getelementptr inbounds ptr, ptr %348, i64 5
  %350 = load ptr, ptr %349, align 8
  %351 = invoke noundef i32 %350(ptr noundef nonnull align 8 dereferenceable(8) %345, i64 noundef %347, ptr noundef %48)
          to label %352 unwind label %366

352:                                              ; preds = %346
  store i32 %351, ptr %49, align 4, !tbaa !9
  %353 = load i32, ptr %49, align 4, !tbaa !9
  %354 = icmp eq i32 %353, 0
  br i1 %354, label %355, label %370

355:                                              ; preds = %352
  %356 = load i64, ptr %32, align 8, !tbaa !13
  store i64 %356, ptr %31, align 8, !tbaa !13
  %357 = load i64, ptr %48, align 8, !tbaa !13
  %358 = load i64, ptr %32, align 8, !tbaa !13
  %359 = add i64 %358, %357
  store i64 %359, ptr %32, align 8, !tbaa !13
  %360 = load i64, ptr %30, align 8, !tbaa !13
  %361 = add i64 %360, 1
  store i64 %361, ptr %30, align 8, !tbaa !13
  br label %383

362:                                              ; preds = %451, %286
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %24, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %25, align 4
  br label %522

366:                                              ; preds = %376, %346, %344
  %367 = landingpad { ptr, i32 }
          cleanup
  %368 = extractvalue { ptr, i32 } %367, 0
  store ptr %368, ptr %24, align 8
  %369 = extractvalue { ptr, i32 } %367, 1
  store i32 %369, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #5
  br label %441

370:                                              ; preds = %352
  %371 = load i32, ptr %49, align 4, !tbaa !9
  %372 = icmp eq i32 %371, 1
  br i1 %372, label %376, label %373

373:                                              ; preds = %370
  %374 = load i32, ptr %49, align 4, !tbaa !9
  %375 = icmp eq i32 %374, -2147467263
  br i1 %375, label %376, label %380

376:                                              ; preds = %373, %370
  invoke void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeE7ReleaseEv(ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %377 unwind label %366

377:                                              ; preds = %376
  store i64 0, ptr %31, align 8, !tbaa !13
  %378 = load i64, ptr %31, align 8, !tbaa !13
  %379 = sub i64 %378, 1
  store i64 %379, ptr %32, align 8, !tbaa !13
  br label %382

380:                                              ; preds = %373
  %381 = load i32, ptr %49, align 4, !tbaa !9
  store i32 %381, ptr %9, align 4
  store i32 1, ptr %36, align 4
  br label %384

382:                                              ; preds = %377
  br label %383

383:                                              ; preds = %382, %355
  store i32 0, ptr %36, align 4
  br label %384

384:                                              ; preds = %383, %380
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #5
  %385 = load i32, ptr %36, align 4
  switch i32 %385, label %438 [
    i32 0, label %386
  ]

386:                                              ; preds = %384
  br label %340, !llvm.loop !31

387:                                              ; preds = %340
  %388 = invoke noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %389 unwind label %400

389:                                              ; preds = %387
  %390 = icmp eq ptr %388, null
  br i1 %390, label %391, label %410

391:                                              ; preds = %389
  %392 = load i8, ptr %18, align 1, !tbaa !11, !range !32, !noundef !33
  %393 = trunc i8 %392 to i1
  br i1 %393, label %394, label %404

394:                                              ; preds = %391
  %395 = load i32, ptr %45, align 4, !tbaa !9
  %396 = zext i32 %395 to i64
  %397 = load i64, ptr %19, align 8, !tbaa !13
  %398 = icmp ult i64 %396, %397
  %399 = zext i1 %398 to i8
  store i8 %399, ptr %46, align 1, !tbaa !11
  br label %409

400:                                              ; preds = %415, %404, %387
  %401 = landingpad { ptr, i32 }
          cleanup
  %402 = extractvalue { ptr, i32 } %401, 0
  store ptr %402, ptr %24, align 8
  %403 = extractvalue { ptr, i32 } %401, 1
  store i32 %403, ptr %25, align 4
  br label %441

404:                                              ; preds = %391
  %405 = load i8, ptr %43, align 1, !tbaa !19
  %406 = invoke noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext %405)
          to label %407 unwind label %400

407:                                              ; preds = %404
  %408 = zext i1 %406 to i8
  store i8 %408, ptr %46, align 1, !tbaa !11
  br label %409

409:                                              ; preds = %407, %394
  br label %437

410:                                              ; preds = %389
  %411 = load i64, ptr %32, align 8, !tbaa !13
  %412 = load i64, ptr %31, align 8, !tbaa !13
  %413 = sub i64 %411, %412
  %414 = icmp ugt i64 %413, 16777216
  br i1 %414, label %415, label %420

415:                                              ; preds = %410
  %416 = load i8, ptr %43, align 1, !tbaa !19
  %417 = invoke noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext %416)
          to label %418 unwind label %400

418:                                              ; preds = %415
  %419 = zext i1 %417 to i8
  store i8 %419, ptr %46, align 1, !tbaa !11
  br label %436

420:                                              ; preds = %410
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #5
  %421 = load i64, ptr %47, align 8, !tbaa !13
  %422 = add i64 %421, 5
  %423 = load i32, ptr %44, align 4, !tbaa !9
  %424 = sext i32 %423 to i64
  %425 = add i64 %422, %424
  store i64 %425, ptr %50, align 8, !tbaa !13
  %426 = load i64, ptr %50, align 8, !tbaa !13
  %427 = load i64, ptr %31, align 8, !tbaa !13
  %428 = icmp uge i64 %426, %427
  br i1 %428, label %429, label %433

429:                                              ; preds = %420
  %430 = load i64, ptr %50, align 8, !tbaa !13
  %431 = load i64, ptr %32, align 8, !tbaa !13
  %432 = icmp ult i64 %430, %431
  br label %433

433:                                              ; preds = %429, %420
  %434 = phi i1 [ false, %420 ], [ %432, %429 ]
  %435 = zext i1 %434 to i8
  store i8 %435, ptr %46, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #5
  br label %436

436:                                              ; preds = %433, %418
  br label %437

437:                                              ; preds = %436, %409
  store i32 0, ptr %36, align 4
  br label %438

438:                                              ; preds = %437, %384
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #5
  %439 = load i32, ptr %36, align 4
  switch i32 %439, label %517 [
    i32 0, label %440
  ]

440:                                              ; preds = %438
  br label %457

441:                                              ; preds = %400, %366
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #5
  br label %522

442:                                              ; preds = %333
  %443 = load i8, ptr %18, align 1, !tbaa !11, !range !32, !noundef !33
  %444 = trunc i8 %443 to i1
  br i1 %444, label %445, label %451

445:                                              ; preds = %442
  %446 = load i32, ptr %45, align 4, !tbaa !9
  %447 = zext i32 %446 to i64
  %448 = load i64, ptr %19, align 8, !tbaa !13
  %449 = icmp ult i64 %447, %448
  %450 = zext i1 %449 to i8
  store i8 %450, ptr %46, align 1, !tbaa !11
  br label %456

451:                                              ; preds = %442
  %452 = load i8, ptr %43, align 1, !tbaa !19
  %453 = invoke noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext %452)
          to label %454 unwind label %362

454:                                              ; preds = %451
  %455 = zext i1 %453 to i8
  store i8 %455, ptr %46, align 1, !tbaa !11
  br label %456

456:                                              ; preds = %454, %445
  br label %457

457:                                              ; preds = %456, %440
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #5
  %458 = load i8, ptr %29, align 1, !tbaa !19
  %459 = load i8, ptr %42, align 1, !tbaa !19
  %460 = invoke noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %458, i8 noundef zeroext %459)
          to label %461 unwind label %486

461:                                              ; preds = %457
  store i32 %460, ptr %51, align 4, !tbaa !9
  %462 = load i8, ptr %46, align 1, !tbaa !11, !range !32, !noundef !33
  %463 = trunc i8 %462 to i1
  br i1 %463, label %464, label %506

464:                                              ; preds = %461
  %465 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 7
  %466 = load i32, ptr %51, align 4, !tbaa !9
  %467 = zext i32 %466 to i64
  %468 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %465, i64 0, i64 %467
  %469 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 6
  invoke void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4) %468, ptr noundef %469, i32 noundef 1)
          to label %470 unwind label %486

470:                                              ; preds = %464
  %471 = load i32, ptr %28, align 4, !tbaa !9
  %472 = add i32 %471, 5
  store i32 %472, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #5
  %473 = load i8, ptr %42, align 1, !tbaa !19
  %474 = zext i8 %473 to i32
  %475 = icmp eq i32 %474, 232
  br i1 %475, label %476, label %478

476:                                              ; preds = %470
  %477 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 4
  br label %480

478:                                              ; preds = %470
  %479 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 5
  br label %480

480:                                              ; preds = %478, %476
  %481 = phi ptr [ %477, %476 ], [ %479, %478 ]
  store ptr %481, ptr %52, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #5
  store i32 24, ptr %53, align 4, !tbaa !9
  br label %482

482:                                              ; preds = %497, %480
  %483 = load i32, ptr %53, align 4, !tbaa !9
  %484 = icmp sge i32 %483, 0
  br i1 %484, label %490, label %485

485:                                              ; preds = %482
  store i32 16, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  br label %504

486:                                              ; preds = %506, %464, %457
  %487 = landingpad { ptr, i32 }
          cleanup
  %488 = extractvalue { ptr, i32 } %487, 0
  store ptr %488, ptr %24, align 8
  %489 = extractvalue { ptr, i32 } %487, 1
  store i32 %489, ptr %25, align 4
  br label %521

490:                                              ; preds = %482
  %491 = load ptr, ptr %52, align 8, !tbaa !5
  %492 = load i32, ptr %45, align 4, !tbaa !9
  %493 = load i32, ptr %53, align 4, !tbaa !9
  %494 = lshr i32 %492, %493
  %495 = trunc i32 %494 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %491, i8 noundef zeroext %495)
          to label %496 unwind label %500

496:                                              ; preds = %490
  br label %497

497:                                              ; preds = %496
  %498 = load i32, ptr %53, align 4, !tbaa !9
  %499 = sub nsw i32 %498, 8
  store i32 %499, ptr %53, align 4, !tbaa !9
  br label %482, !llvm.loop !34

500:                                              ; preds = %490
  %501 = landingpad { ptr, i32 }
          cleanup
  %502 = extractvalue { ptr, i32 } %501, 0
  store ptr %502, ptr %24, align 8
  %503 = extractvalue { ptr, i32 } %501, 1
  store i32 %503, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #5
  br label %521

504:                                              ; preds = %485
  %505 = load i8, ptr %43, align 1, !tbaa !19
  store i8 %505, ptr %29, align 1, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #5
  br label %516

506:                                              ; preds = %461
  %507 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 7
  %508 = load i32, ptr %51, align 4, !tbaa !9
  %509 = zext i32 %508 to i64
  %510 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %507, i64 0, i64 %509
  %511 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 6
  invoke void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4) %510, ptr noundef %511, i32 noundef 0)
          to label %512 unwind label %486

512:                                              ; preds = %506
  %513 = load i32, ptr %28, align 4, !tbaa !9
  %514 = add i32 %513, 1
  store i32 %514, ptr %28, align 4, !tbaa !9
  %515 = load i8, ptr %42, align 1, !tbaa !19
  store i8 %515, ptr %29, align 1, !tbaa !19
  br label %516

516:                                              ; preds = %512, %504
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #5
  store i32 0, ptr %36, align 4
  br label %517

517:                                              ; preds = %516, %438
  call void @llvm.lifetime.end.p0(i64 1, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #5
  br label %518

518:                                              ; preds = %517, %278
  call void @llvm.lifetime.end.p0(i64 1, ptr %42) #5
  %519 = load i32, ptr %36, align 4
  switch i32 %519, label %574 [
    i32 0, label %520
    i32 12, label %260
  ]

520:                                              ; preds = %518
  br label %260, !llvm.loop !30

521:                                              ; preds = %500, %486
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #5
  br label %522

522:                                              ; preds = %521, %441, %362
  call void @llvm.lifetime.end.p0(i64 1, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %43) #5
  br label %523

523:                                              ; preds = %522, %282
  call void @llvm.lifetime.end.p0(i64 1, ptr %42) #5
  br label %579

524:                                              ; preds = %260
  %525 = load i32, ptr %28, align 4, !tbaa !9
  %526 = load i32, ptr %26, align 4, !tbaa !9
  %527 = add i32 %526, %525
  store i32 %527, ptr %26, align 4, !tbaa !9
  %528 = load i32, ptr %28, align 4, !tbaa !9
  %529 = zext i32 %528 to i64
  %530 = load i64, ptr %27, align 8, !tbaa !13
  %531 = add i64 %530, %529
  store i64 %531, ptr %27, align 8, !tbaa !13
  %532 = load ptr, ptr %17, align 8, !tbaa !5
  %533 = icmp ne ptr %532, null
  br i1 %533, label %534, label %553

534:                                              ; preds = %524
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #5
  %535 = load ptr, ptr %17, align 8, !tbaa !5
  %536 = load ptr, ptr %535, align 8, !tbaa !17
  %537 = getelementptr inbounds ptr, ptr %536, i64 5
  %538 = load ptr, ptr %537, align 8
  %539 = invoke noundef i32 %538(ptr noundef nonnull align 8 dereferenceable(8) %535, ptr noundef %27, ptr noundef null)
          to label %540 unwind label %545

540:                                              ; preds = %534
  store i32 %539, ptr %54, align 4, !tbaa !9
  %541 = load i32, ptr %54, align 4, !tbaa !9
  %542 = icmp ne i32 %541, 0
  br i1 %542, label %543, label %549

543:                                              ; preds = %540
  %544 = load i32, ptr %54, align 4, !tbaa !9
  store i32 %544, ptr %9, align 4
  store i32 1, ptr %36, align 4
  br label %550

545:                                              ; preds = %534
  %546 = landingpad { ptr, i32 }
          cleanup
  %547 = extractvalue { ptr, i32 } %546, 0
  store ptr %547, ptr %24, align 8
  %548 = extractvalue { ptr, i32 } %546, 1
  store i32 %548, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  br label %579

549:                                              ; preds = %540
  store i32 0, ptr %36, align 4
  br label %550

550:                                              ; preds = %549, %543
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  %551 = load i32, ptr %36, align 4
  switch i32 %551, label %574 [
    i32 0, label %552
  ]

552:                                              ; preds = %550
  br label %553

553:                                              ; preds = %552, %524
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #5
  store i32 0, ptr %55, align 4, !tbaa !9
  br label %554

554:                                              ; preds = %558, %553
  %555 = load i32, ptr %28, align 4, !tbaa !9
  %556 = load i32, ptr %38, align 4, !tbaa !9
  %557 = icmp ult i32 %555, %556
  br i1 %557, label %558, label %572

558:                                              ; preds = %554
  %559 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %560 = load ptr, ptr %559, align 8, !tbaa !20
  %561 = load i32, ptr %28, align 4, !tbaa !9
  %562 = add i32 %561, 1
  store i32 %562, ptr %28, align 4, !tbaa !9
  %563 = zext i32 %561 to i64
  %564 = getelementptr inbounds i8, ptr %560, i64 %563
  %565 = load i8, ptr %564, align 1, !tbaa !19
  %566 = getelementptr inbounds %"class.NCompress::NBcj2::CEncoder", ptr %56, i32 0, i32 2
  %567 = load ptr, ptr %566, align 8, !tbaa !20
  %568 = load i32, ptr %55, align 4, !tbaa !9
  %569 = add i32 %568, 1
  store i32 %569, ptr %55, align 4, !tbaa !9
  %570 = zext i32 %568 to i64
  %571 = getelementptr inbounds i8, ptr %567, i64 %570
  store i8 %565, ptr %571, align 1, !tbaa !19
  br label %554, !llvm.loop !35

572:                                              ; preds = %554
  %573 = load i32, ptr %55, align 4, !tbaa !9
  store i32 %573, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #5
  store i32 0, ptr %36, align 4
  br label %574

574:                                              ; preds = %572, %550, %518
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #5
  br label %575

575:                                              ; preds = %574, %252
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  br label %576

576:                                              ; preds = %575, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  %577 = load i32, ptr %36, align 4
  switch i32 %577, label %582 [
    i32 0, label %578
  ]

578:                                              ; preds = %576
  br label %130, !llvm.loop !36

579:                                              ; preds = %545, %523
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #5
  br label %580

580:                                              ; preds = %579, %253, %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  br label %581

581:                                              ; preds = %580, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %583

582:                                              ; preds = %576
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  br label %585

583:                                              ; preds = %581, %143
  call void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  br label %584

584:                                              ; preds = %583, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  br label %587

585:                                              ; preds = %582, %65, %62
  %586 = load i32, ptr %9, align 4
  ret i32 %586

587:                                              ; preds = %584
  %588 = load ptr, ptr %24, align 8
  %589 = load i32, ptr %25, align 4
  %590 = insertvalue { ptr, i32 } poison, ptr %588, 0
  %591 = insertvalue { ptr, i32 } %590, i32 %589, 1
  resume { ptr, i32 } %591

592:                                              ; preds = %243
  unreachable
}

declare void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef) #2

declare void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder8CEncoder9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder8CEncoder4InitEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder9CBitModelILi5EE4InitEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEadEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49), i8 noundef zeroext) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress5NBcj25IsJccEhh(i8 noundef zeroext, i8 noundef zeroext) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress5NBcj23IsJEhh(i8 noundef zeroext, i8 noundef zeroext) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeE7ReleaseEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext, i8 noundef zeroext) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 = { "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 = { 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 #4 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !6, i64 16}
!21 = !{!"_ZTSN9NCompress5NBcj28CEncoderE", !22, i64 0, !24, i64 8, !6, i64 16, !25, i64 24, !25, i64 80, !25, i64 136, !27, i64 192, !7, i64 272}
!22 = !{!"_ZTS15ICompressCoder2", !23, i64 0}
!23 = !{!"_ZTS8IUnknown"}
!24 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!25 = !{!"_ZTS10COutBuffer", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !26, i64 24, !14, i64 32, !6, i64 40, !12, i64 48}
!26 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!27 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !10, i64 0, !7, i64 4, !14, i64 8, !10, i64 16, !25, i64 24}
!28 = distinct !{!28, !16}
!29 = distinct !{!29, !16}
!30 = distinct !{!30, !16}
!31 = distinct !{!31, !16}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = distinct !{!34, !16}
!35 = distinct !{!35, !16}
!36 = distinct !{!36, !16}


; 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"

%struct.GUID = type { i32, i16, i16, [8 x i8] }
%"class.NCompress::NBcj2::CEncoder::CCoderReleaser" = type { ptr }
%class.CMyComPtr.0 = type { ptr }
%"class.NCompress::NRangeCoder::CBitEncoder" = type { %"class.NCompress::NRangeCoder::CBitModel" }
%"class.NCompress::NRangeCoder::CBitModel" = type { i32 }

@IID_ICompressGetSubStreamSize = external global %struct.GUID, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress5NBcj28CEncoder6CreateEv(ptr noundef nonnull align 8 dereferenceable(1304)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NBcj28CEncoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(1304)) local_unnamed_addr #0 align 2

; 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: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NBcj28CEncoder8CodeRealEPP19ISequentialInStreamPPKyjPP20ISequentialOutStreamS7_jP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(1304) %0, ptr nocapture noundef readonly %1, ptr noundef readonly %2, i32 noundef %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readnone %5, i32 noundef %6, ptr noundef %7) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca %"class.NCompress::NBcj2::CEncoder::CCoderReleaser", align 8
  %10 = alloca %class.CMyComPtr.0, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = icmp ne i32 %3, 1
  %15 = icmp ne i32 %6, 4
  %or.cond = or i1 %14, %15
  br i1 %or.cond, label %256, label %16

16:                                               ; preds = %8
  %17 = tail call noundef zeroext i1 @_ZN9NCompress5NBcj28CEncoder6CreateEv(ptr noundef nonnull align 8 dereferenceable(1304) %0)
  br i1 %17, label %18, label %256

18:                                               ; preds = %16
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %24, label %19

19:                                               ; preds = %18
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %.not249 = icmp eq ptr %20, null
  br i1 %.not249, label %24, label %21

21:                                               ; preds = %19
  %22 = load i64, ptr %20, align 8, !tbaa !9
  %23 = icmp ult i64 %22, 16777217
  br label %24

24:                                               ; preds = %21, %19, %18
  %.0134 = phi i64 [ 0, %19 ], [ 0, %18 ], [ %22, %21 ]
  %.0133 = phi i1 [ false, %19 ], [ false, %18 ], [ %23, %21 ]
  %25 = load ptr, ptr %1, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  tail call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %26, ptr noundef %27)
  tail call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %26)
  %28 = getelementptr inbounds i8, ptr %0, i64 80
  %29 = getelementptr inbounds i8, ptr %4, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  tail call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %28, ptr noundef %30)
  tail call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %28)
  %31 = getelementptr inbounds i8, ptr %0, i64 136
  %32 = getelementptr inbounds i8, ptr %4, i64 16
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  tail call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %31, ptr noundef %33)
  tail call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %31)
  %34 = getelementptr inbounds i8, ptr %0, i64 192
  %35 = getelementptr inbounds i8, ptr %4, i64 24
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  tail call void @_ZN9NCompress11NRangeCoder8CEncoder9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(80) %34, ptr noundef %36)
  tail call void @_ZN9NCompress11NRangeCoder8CEncoder4InitEv(ptr noundef nonnull align 8 dereferenceable(80) %34)
  %37 = getelementptr inbounds i8, ptr %0, i64 272
  br label %43

38:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %39 = call noundef ptr @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEadEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %40 = load ptr, ptr %25, align 8, !tbaa !11
  %41 = load ptr, ptr %40, align 8
  %42 = invoke noundef i32 %41(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(16) @IID_ICompressGetSubStreamSize, ptr noundef %39)
          to label %45 unwind label %54

43:                                               ; preds = %24, %43
  %indvars.iv = phi i64 [ 0, %24 ], [ %indvars.iv.next, %43 ]
  %44 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %37, i64 0, i64 %indvars.iv
  tail call void @_ZN9NCompress11NRangeCoder9CBitModelILi5EE4InitEv(ptr noundef nonnull align 4 dereferenceable(4) %44)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 258
  br i1 %exitcond.not, label %38, label %43, !llvm.loop !13

45:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  store i64 0, ptr %11, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %0, i64 16
  %.not252 = icmp eq ptr %7, null
  br label %.loopexit307

.loopexit307.loopexit.unr-lcssa:                  ; preds = %.lr.ph385, %.lr.ph385.preheader
  %indvars.iv418.unr = phi i64 [ %218, %.lr.ph385.preheader ], [ %indvars.iv.next419.3, %.lr.ph385 ]
  %indvars.iv416.unr = phi i64 [ 0, %.lr.ph385.preheader ], [ %indvars.iv.next417.3, %.lr.ph385 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit307.loopexit, label %.lr.ph385.epil

.lr.ph385.epil:                                   ; preds = %.loopexit307.loopexit.unr-lcssa, %.lr.ph385.epil
  %indvars.iv418.epil = phi i64 [ %indvars.iv.next419.epil, %.lr.ph385.epil ], [ %indvars.iv418.unr, %.loopexit307.loopexit.unr-lcssa ]
  %indvars.iv416.epil = phi i64 [ %indvars.iv.next417.epil, %.lr.ph385.epil ], [ %indvars.iv416.unr, %.loopexit307.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph385.epil ], [ 0, %.loopexit307.loopexit.unr-lcssa ]
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %indvars.iv.next419.epil = add nuw nsw i64 %indvars.iv418.epil, 1
  %48 = getelementptr inbounds i8, ptr %47, i64 %indvars.iv418.epil
  %49 = load i8, ptr %48, align 1, !tbaa !25
  %indvars.iv.next417.epil = add nuw nsw i64 %indvars.iv416.epil, 1
  %50 = getelementptr inbounds i8, ptr %47, i64 %indvars.iv416.epil
  store i8 %49, ptr %50, align 1, !tbaa !25
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.loopexit307.loopexit, label %.lr.ph385.epil, !llvm.loop !26

.loopexit307.loopexit:                            ; preds = %.lr.ph385.epil, %.loopexit307.loopexit.unr-lcssa
  %51 = sub i32 %77, %.5171
  br label %.loopexit307.backedge

.loopexit307.backedge:                            ; preds = %.loopexit307.loopexit, %229
  %.0166.be = phi i32 [ %51, %.loopexit307.loopexit ], [ 0, %229 ]
  br label %.loopexit307, !llvm.loop !28

.loopexit307:                                     ; preds = %.loopexit307.backedge, %45
  %.0211 = phi i64 [ 0, %45 ], [ %.8219, %.loopexit307.backedge ]
  %.0198 = phi i64 [ 0, %45 ], [ %.8206, %.loopexit307.backedge ]
  %.0186 = phi i64 [ 0, %45 ], [ %.8194, %.loopexit307.backedge ]
  %.0176 = phi i8 [ 0, %45 ], [ %.6182, %.loopexit307.backedge ]
  %.0166 = phi i32 [ 0, %45 ], [ %.0166.be, %.loopexit307.backedge ]
  %.0162 = phi i32 [ 0, %45 ], [ %217, %.loopexit307.backedge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %52 = icmp eq i32 %.0166, 131072
  br i1 %52, label %select.unfold, label %.lr.ph

.lr.ph:                                           ; preds = %.loopexit307
  %53 = zext i32 %.0166 to i64
  br label %56

54:                                               ; preds = %38
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %255

56:                                               ; preds = %.lr.ph, %74
  %.0223365 = phi i32 [ 0, %.lr.ph ], [ %73, %74 ]
  %57 = add i32 %.0223365, %.0166
  %58 = sub i32 131072, %57
  %59 = load ptr, ptr %46, align 8, !tbaa !15
  %60 = getelementptr inbounds i8, ptr %59, i64 %53
  %61 = zext i32 %.0223365 to i64
  %62 = getelementptr inbounds i8, ptr %60, i64 %61
  %63 = load ptr, ptr %25, align 8, !tbaa !11
  %64 = getelementptr inbounds i8, ptr %63, i64 40
  %65 = load ptr, ptr %64, align 8
  %66 = invoke noundef i32 %65(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef %62, i32 noundef %58, ptr noundef nonnull %12)
          to label %67 unwind label %68

67:                                               ; preds = %56
  %.not250 = icmp eq i32 %66, 0
  br i1 %.not250, label %70, label %.thread272

.thread272:                                       ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  br label %.loopexit308

68:                                               ; preds = %56
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  br label %254

70:                                               ; preds = %67
  %71 = load i32, ptr %12, align 4, !tbaa !29
  %72 = icmp eq i32 %71, 0
  %73 = add i32 %71, %.0223365
  br i1 %72, label %select.unfold, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  %75 = add i32 %73, %.0166
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %76 = icmp eq i32 %75, 131072
  br i1 %76, label %select.unfold, label %56

select.unfold:                                    ; preds = %74, %70, %.loopexit307
  %.1224.ph = phi i32 [ 0, %.loopexit307 ], [ %73, %70 ], [ %73, %74 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  %77 = add i32 %.1224.ph, %.0166
  %78 = icmp ult i32 %77, 5
  br i1 %78, label %.preheader, label %98

.preheader:                                       ; preds = %select.unfold
  %.not391 = icmp eq i32 %77, 0
  br i1 %.not391, label %._crit_edge390, label %.lr.ph389

.lr.ph389:                                        ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %77 to i64
  br label %79

79:                                               ; preds = %.lr.ph389, %94
  %indvars.iv424 = phi i64 [ 0, %.lr.ph389 ], [ %indvars.iv.next425, %94 ]
  %.1177387 = phi i8 [ %.0176, %.lr.ph389 ], [ %82, %94 ]
  %80 = load ptr, ptr %46, align 8, !tbaa !15
  %81 = getelementptr inbounds i8, ptr %80, i64 %indvars.iv424
  %82 = load i8, ptr %81, align 1, !tbaa !25
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %26, i8 noundef zeroext %82)
          to label %83 unwind label %86

83:                                               ; preds = %79
  switch i8 %82, label %88 [
    i8 -24, label %84
    i8 -23, label %92
  ]

84:                                               ; preds = %83
  %85 = zext i8 %.1177387 to i64
  br label %92

86:                                               ; preds = %79
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %254

88:                                               ; preds = %83
  %89 = call noundef zeroext i1 @_ZN9NCompress5NBcj25IsJccEhh(i8 noundef zeroext %.1177387, i8 noundef zeroext %82)
  br i1 %89, label %92, label %94

90:                                               ; preds = %92
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %254

92:                                               ; preds = %88, %83, %84
  %.0210 = phi i64 [ %85, %84 ], [ 256, %83 ], [ 257, %88 ]
  %93 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %37, i64 0, i64 %.0210
  invoke void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4) %93, ptr noundef nonnull %34, i32 noundef 0)
          to label %94 unwind label %90

94:                                               ; preds = %92, %88
  %indvars.iv.next425 = add nuw nsw i64 %indvars.iv424, 1
  %exitcond426.not = icmp eq i64 %indvars.iv.next425, %wide.trip.count
  br i1 %exitcond426.not, label %._crit_edge390, label %79, !llvm.loop !30

._crit_edge390:                                   ; preds = %94, %.preheader
  %95 = invoke noundef i32 @_ZN9NCompress5NBcj28CEncoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(1304) %0)
          to label %.loopexit308 unwind label %96

96:                                               ; preds = %._crit_edge390
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %254

98:                                               ; preds = %select.unfold
  %99 = add i32 %77, -5
  %100 = add i32 %.0162, 5
  br label %101

101:                                              ; preds = %98, %.loopexit
  %.2168380 = phi i32 [ 0, %98 ], [ %.5171, %.loopexit ]
  %.3179379 = phi i8 [ %.0176, %98 ], [ %.6182, %.loopexit ]
  %.1187378 = phi i64 [ %.0186, %98 ], [ %.8194, %.loopexit ]
  %.1199377 = phi i64 [ %.0198, %98 ], [ %.8206, %.loopexit ]
  %.1212376 = phi i64 [ %.0211, %98 ], [ %.8219, %.loopexit ]
  %102 = load ptr, ptr %46, align 8, !tbaa !15
  %103 = zext i32 %.2168380 to i64
  %104 = getelementptr inbounds i8, ptr %102, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !25
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %26, i8 noundef zeroext %105)
          to label %106 unwind label %110

106:                                              ; preds = %101
  %107 = call noundef zeroext i1 @_ZN9NCompress5NBcj23IsJEhh(i8 noundef zeroext %.3179379, i8 noundef zeroext %105)
  br i1 %107, label %112, label %108

108:                                              ; preds = %106
  %109 = add nuw i32 %.2168380, 1
  br label %.loopexit, !llvm.loop !31

110:                                              ; preds = %101
  %111 = landingpad { ptr, i32 }
          cleanup
  br label %254

112:                                              ; preds = %106
  %113 = load ptr, ptr %46, align 8, !tbaa !15
  %114 = add nuw i32 %.2168380, 4
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds i8, ptr %113, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !25
  %118 = zext i8 %117 to i32
  %119 = shl nuw i32 %118, 24
  %120 = add nuw i32 %.2168380, 3
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds i8, ptr %113, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !25
  %124 = zext i8 %123 to i32
  %125 = shl nuw nsw i32 %124, 16
  %126 = or disjoint i32 %125, %119
  %127 = add nuw i32 %.2168380, 2
  %128 = zext i32 %127 to i64
  %129 = getelementptr inbounds i8, ptr %113, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !25
  %131 = zext i8 %130 to i32
  %132 = shl nuw nsw i32 %131, 8
  %133 = or disjoint i32 %126, %132
  %134 = add nuw i32 %.2168380, 1
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds i8, ptr %113, i64 %135
  %137 = load i8, ptr %136, align 1, !tbaa !25
  %138 = zext i8 %137 to i32
  %139 = or disjoint i32 %133, %138
  %140 = add i32 %100, %.2168380
  %141 = add i32 %140, %139
  %142 = call noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %.not254 = icmp eq ptr %142, null
  br i1 %.not254, label %179, label %143

143:                                              ; preds = %112
  %144 = load i64, ptr %11, align 8, !tbaa !9
  %145 = add i64 %144, %103
  %.not255368 = icmp ult i64 %.1212376, %145
  br i1 %.not255368, label %.lr.ph371, label %._crit_edge

.lr.ph371:                                        ; preds = %143, %154
  %.2188370 = phi i64 [ %157, %154 ], [ %.1187378, %143 ]
  %.2213369 = phi i64 [ %156, %154 ], [ %.1212376, %143 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %146 = call noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %147 = load ptr, ptr %146, align 8, !tbaa !11
  %148 = getelementptr inbounds i8, ptr %147, i64 40
  %149 = load ptr, ptr %148, align 8
  %150 = invoke noundef i32 %149(ptr noundef nonnull align 8 dereferenceable(8) %146, i64 noundef %.2188370, ptr noundef nonnull %13)
          to label %151 unwind label %.loopexit440

151:                                              ; preds = %.lr.ph371
  switch i32 %150, label %.thread285 [
    i32 0, label %154
    i32 -2147467263, label %153
    i32 1, label %153
  ]

.thread285:                                       ; preds = %151
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %.loopexit308

.loopexit440:                                     ; preds = %.lr.ph371
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %152

.loopexit.split-lp:                               ; preds = %153
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %152

152:                                              ; preds = %.loopexit.split-lp, %.loopexit440
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit440 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %254

153:                                              ; preds = %151, %151
  invoke void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeE7ReleaseEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %.thread unwind label %.loopexit.split-lp

.thread:                                          ; preds = %153
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %._crit_edge

154:                                              ; preds = %151
  %155 = load i64, ptr %13, align 8, !tbaa !9
  %156 = add i64 %155, %.2213369
  %157 = add i64 %.2188370, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  %.not255 = icmp ult i64 %156, %145
  br i1 %.not255, label %.lr.ph371, label %._crit_edge, !llvm.loop !32

._crit_edge:                                      ; preds = %154, %.thread, %143
  %.2213.lcssa = phi i64 [ %.1212376, %143 ], [ -1, %.thread ], [ %156, %154 ]
  %.2200.lcssa = phi i64 [ %.1199377, %143 ], [ 0, %.thread ], [ %.2213369, %154 ]
  %.2188.lcssa = phi i64 [ %.1187378, %143 ], [ %.2188370, %.thread ], [ %157, %154 ]
  %158 = call noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %159 = icmp eq ptr %158, null
  br i1 %159, label %160, label %168

160:                                              ; preds = %._crit_edge
  br i1 %.0133, label %161, label %165

161:                                              ; preds = %160
  %162 = zext i32 %141 to i64
  %163 = icmp ugt i64 %.0134, %162
  %164 = call noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %.3179379, i8 noundef zeroext %105)
  br i1 %163, label %190, label %212

165:                                              ; preds = %160
  %166 = call noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext %117)
  %167 = call noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %.3179379, i8 noundef zeroext %105)
  br i1 %166, label %190, label %212

168:                                              ; preds = %._crit_edge
  %169 = sub i64 %.2213.lcssa, %.2200.lcssa
  %170 = icmp ugt i64 %169, 16777216
  br i1 %170, label %187, label %171

171:                                              ; preds = %168
  %172 = sext i32 %139 to i64
  %173 = add nsw i64 %172, 5
  %174 = add i64 %173, %145
  %175 = icmp uge i64 %174, %.2200.lcssa
  %176 = icmp ult i64 %174, %.2213.lcssa
  %177 = and i1 %176, %175
  %178 = call noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %.3179379, i8 noundef zeroext %105)
  br i1 %177, label %190, label %212

179:                                              ; preds = %112
  br i1 %.0133, label %180, label %184

180:                                              ; preds = %179
  %181 = zext i32 %141 to i64
  %182 = icmp ugt i64 %.0134, %181
  %183 = call noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %.3179379, i8 noundef zeroext %105)
  br i1 %182, label %190, label %212

184:                                              ; preds = %179
  %185 = call noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext %117)
  %186 = call noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %.3179379, i8 noundef zeroext %105)
  br i1 %185, label %190, label %212

187:                                              ; preds = %168
  %188 = call noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext %117)
  %189 = call noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %.3179379, i8 noundef zeroext %105)
  br i1 %188, label %190, label %212

190:                                              ; preds = %171, %161, %165, %184, %180, %187
  %191 = phi i32 [ %183, %180 ], [ %189, %187 ], [ %186, %184 ], [ %167, %165 ], [ %164, %161 ], [ %178, %171 ]
  %.6192439 = phi i64 [ %.1187378, %180 ], [ %.2188.lcssa, %187 ], [ %.1187378, %184 ], [ %.2188.lcssa, %165 ], [ %.2188.lcssa, %161 ], [ %.2188.lcssa, %171 ]
  %.6204437 = phi i64 [ %.1199377, %180 ], [ %.2200.lcssa, %187 ], [ %.1199377, %184 ], [ %.2200.lcssa, %165 ], [ %.2200.lcssa, %161 ], [ %.2200.lcssa, %171 ]
  %.6217435 = phi i64 [ %.1212376, %180 ], [ %.2213.lcssa, %187 ], [ %.1212376, %184 ], [ %.2213.lcssa, %165 ], [ %.2213.lcssa, %161 ], [ %.2213.lcssa, %171 ]
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %37, i64 0, i64 %192
  invoke void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4) %193, ptr noundef nonnull %34, i32 noundef 1)
          to label %194 unwind label %200

194:                                              ; preds = %190
  %195 = add nuw i32 %.2168380, 5
  %196 = icmp eq i8 %105, -24
  %197 = select i1 %196, ptr %28, ptr %31
  %198 = lshr i32 %141, 24
  %199 = trunc nuw i32 %198 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %197, i8 noundef zeroext %199)
          to label %202 unwind label %210

200:                                              ; preds = %212, %190
  %201 = landingpad { ptr, i32 }
          cleanup
  br label %254

202:                                              ; preds = %194
  %203 = lshr i32 %141, 16
  %204 = trunc i32 %203 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %197, i8 noundef zeroext %204)
          to label %205 unwind label %210

205:                                              ; preds = %202
  %206 = lshr i32 %141, 8
  %207 = trunc i32 %206 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %197, i8 noundef zeroext %207)
          to label %208 unwind label %210

208:                                              ; preds = %205
  %209 = trunc i32 %141 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %197, i8 noundef zeroext %209)
          to label %.loopexit unwind label %210

210:                                              ; preds = %208, %205, %202, %194
  %211 = landingpad { ptr, i32 }
          cleanup
  br label %254

212:                                              ; preds = %171, %161, %165, %184, %180, %187
  %213 = phi i32 [ %183, %180 ], [ %189, %187 ], [ %186, %184 ], [ %167, %165 ], [ %164, %161 ], [ %178, %171 ]
  %.6192438 = phi i64 [ %.1187378, %180 ], [ %.2188.lcssa, %187 ], [ %.1187378, %184 ], [ %.2188.lcssa, %165 ], [ %.2188.lcssa, %161 ], [ %.2188.lcssa, %171 ]
  %.6204436 = phi i64 [ %.1199377, %180 ], [ %.2200.lcssa, %187 ], [ %.1199377, %184 ], [ %.2200.lcssa, %165 ], [ %.2200.lcssa, %161 ], [ %.2200.lcssa, %171 ]
  %.6217434 = phi i64 [ %.1212376, %180 ], [ %.2213.lcssa, %187 ], [ %.1212376, %184 ], [ %.2213.lcssa, %165 ], [ %.2213.lcssa, %161 ], [ %.2213.lcssa, %171 ]
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitEncoder"], ptr %37, i64 0, i64 %214
  invoke void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4) %215, ptr noundef nonnull %34, i32 noundef 0)
          to label %.loopexit unwind label %200

.loopexit:                                        ; preds = %208, %212, %108
  %.8219 = phi i64 [ %.1212376, %108 ], [ %.6217434, %212 ], [ %.6217435, %208 ]
  %.8206 = phi i64 [ %.1199377, %108 ], [ %.6204436, %212 ], [ %.6204437, %208 ]
  %.8194 = phi i64 [ %.1187378, %108 ], [ %.6192438, %212 ], [ %.6192439, %208 ]
  %.6182 = phi i8 [ %105, %108 ], [ %105, %212 ], [ %117, %208 ]
  %.5171 = phi i32 [ %109, %108 ], [ %134, %212 ], [ %195, %208 ]
  %.not251 = icmp ugt i32 %.5171, %99
  br i1 %.not251, label %216, label %101

216:                                              ; preds = %.loopexit
  %217 = add i32 %.5171, %.0162
  %218 = zext i32 %.5171 to i64
  %219 = load i64, ptr %11, align 8, !tbaa !9
  %220 = add i64 %219, %218
  store i64 %220, ptr %11, align 8, !tbaa !9
  br i1 %.not252, label %229, label %221

221:                                              ; preds = %216
  %222 = load ptr, ptr %7, align 8, !tbaa !11
  %223 = getelementptr inbounds i8, ptr %222, i64 40
  %224 = load ptr, ptr %223, align 8
  %225 = invoke noundef i32 %224(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %11, ptr noundef null)
          to label %226 unwind label %227

226:                                              ; preds = %221
  %.not253 = icmp eq i32 %225, 0
  br i1 %.not253, label %229, label %.loopexit308

227:                                              ; preds = %221
  %228 = landingpad { ptr, i32 }
          cleanup
  br label %254

229:                                              ; preds = %226, %216
  %230 = icmp ult i32 %.5171, %77
  br i1 %230, label %.lr.ph385.preheader, label %.loopexit307.backedge

.lr.ph385.preheader:                              ; preds = %229
  %231 = zext i32 %77 to i64
  %232 = sub nsw i64 %231, %218
  %xtraiter = and i64 %232, 3
  %233 = sub nsw i64 %218, %231
  %234 = icmp ugt i64 %233, -4
  br i1 %234, label %.loopexit307.loopexit.unr-lcssa, label %.lr.ph385.preheader.new

.lr.ph385.preheader.new:                          ; preds = %.lr.ph385.preheader
  %unroll_iter = and i64 %232, -4
  br label %.lr.ph385

.lr.ph385:                                        ; preds = %.lr.ph385, %.lr.ph385.preheader.new
  %indvars.iv418 = phi i64 [ %218, %.lr.ph385.preheader.new ], [ %indvars.iv.next419.3, %.lr.ph385 ]
  %indvars.iv416 = phi i64 [ 0, %.lr.ph385.preheader.new ], [ %indvars.iv.next417.3, %.lr.ph385 ]
  %niter = phi i64 [ 0, %.lr.ph385.preheader.new ], [ %niter.next.3, %.lr.ph385 ]
  %235 = load ptr, ptr %46, align 8, !tbaa !15
  %236 = getelementptr inbounds i8, ptr %235, i64 %indvars.iv418
  %237 = load i8, ptr %236, align 1, !tbaa !25
  %indvars.iv.next417 = or disjoint i64 %indvars.iv416, 1
  %238 = getelementptr inbounds i8, ptr %235, i64 %indvars.iv416
  store i8 %237, ptr %238, align 1, !tbaa !25
  %239 = load ptr, ptr %46, align 8, !tbaa !15
  %240 = getelementptr inbounds i8, ptr %239, i64 %indvars.iv418
  %241 = getelementptr inbounds i8, ptr %240, i64 1
  %242 = load i8, ptr %241, align 1, !tbaa !25
  %indvars.iv.next417.1 = or disjoint i64 %indvars.iv416, 2
  %243 = getelementptr inbounds i8, ptr %239, i64 %indvars.iv.next417
  store i8 %242, ptr %243, align 1, !tbaa !25
  %244 = load ptr, ptr %46, align 8, !tbaa !15
  %245 = getelementptr inbounds i8, ptr %244, i64 %indvars.iv418
  %246 = getelementptr inbounds i8, ptr %245, i64 2
  %247 = load i8, ptr %246, align 1, !tbaa !25
  %indvars.iv.next417.2 = or disjoint i64 %indvars.iv416, 3
  %248 = getelementptr inbounds i8, ptr %244, i64 %indvars.iv.next417.1
  store i8 %247, ptr %248, align 1, !tbaa !25
  %249 = load ptr, ptr %46, align 8, !tbaa !15
  %indvars.iv.next419.3 = add nuw nsw i64 %indvars.iv418, 4
  %250 = getelementptr inbounds i8, ptr %249, i64 %indvars.iv418
  %251 = getelementptr inbounds i8, ptr %250, i64 3
  %252 = load i8, ptr %251, align 1, !tbaa !25
  %indvars.iv.next417.3 = add nuw nsw i64 %indvars.iv416, 4
  %253 = getelementptr inbounds i8, ptr %249, i64 %indvars.iv.next417.2
  store i8 %252, ptr %253, align 1, !tbaa !25
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.loopexit307.loopexit.unr-lcssa, label %.lr.ph385, !llvm.loop !33

254:                                              ; preds = %96, %90, %86, %110, %200, %210, %152, %227, %68
  %.pn260.pn.pn = phi { ptr, i32 } [ %69, %68 ], [ %97, %96 ], [ %91, %90 ], [ %87, %86 ], [ %228, %227 ], [ %111, %110 ], [ %lpad.phi, %152 ], [ %211, %210 ], [ %201, %200 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %255

.loopexit308:                                     ; preds = %226, %._crit_edge390, %.thread272, %.thread285
  %.15.ph = phi i32 [ %150, %.thread285 ], [ %66, %.thread272 ], [ %95, %._crit_edge390 ], [ %225, %226 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %256

255:                                              ; preds = %254, %54
  %.pn260.pn.pn.pn = phi { ptr, i32 } [ %.pn260.pn.pn, %254 ], [ %55, %54 ]
  call void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  resume { ptr, i32 } %.pn260.pn.pn.pn

256:                                              ; preds = %16, %8, %.loopexit308
  %.16 = phi i32 [ %.15.ph, %.loopexit308 ], [ -2147024809, %8 ], [ -2147024882, %16 ]
  ret i32 %.16
}

declare void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49), ptr noundef) local_unnamed_addr #2

declare void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder8CEncoder9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder8CEncoder4InitEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder9CBitModelILi5EE4InitEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9CMyComPtrI25ICompressGetSubStreamSizeEadEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49), i8 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress5NBcj25IsJccEhh(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9NCompress11NRangeCoder11CBitEncoderILi5EE6EncodeEPNS0_8CEncoderEj(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress5NBcj23IsJEhh(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9CMyComPtrI25ICompressGetSubStreamSizeEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeE7ReleaseEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN9NCompress5NBcj2L12Test86MSByteEh(i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9CMyComPtrI25ICompressGetSubStreamSizeED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9NCompress5NBcj28CEncoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTSN9NCompress5NBcj28CEncoderE", !17, i64 0, !19, i64 8, !6, i64 16, !21, i64 24, !21, i64 80, !21, i64 136, !24, i64 192, !7, i64 272}
!17 = !{!"_ZTS15ICompressCoder2", !18, i64 0}
!18 = !{!"_ZTS8IUnknown"}
!19 = !{!"_ZTS13CMyUnknownImp", !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTS10COutBuffer", !6, i64 0, !20, i64 8, !20, i64 12, !20, i64 16, !20, i64 20, !22, i64 24, !10, i64 32, !6, i64 40, !23, i64 48}
!22 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !20, i64 0, !7, i64 4, !10, i64 8, !20, i64 16, !21, i64 24}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.unroll.disable"}
!28 = distinct !{!28, !14}
!29 = !{!20, !20, i64 0}
!30 = distinct !{!30, !14}
!31 = distinct !{!31, !14}
!32 = distinct !{!32, !14}
!33 = distinct !{!33, !14}


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