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

%"class.NCompress::NBcj2::CDecoder::CCoderReleaser" = type { ptr }
%"class.NCompress::NBcj2::CDecoder" = type { %struct.ICompressCoder2, %class.CMyUnknownImp, [4 x i8], %class.CInBuffer, %class.CInBuffer, %class.CInBuffer, %"class.NCompress::NRangeCoder::CDecoder", [258 x %"class.NCompress::NRangeCoder::CBitDecoder"], %class.COutBuffer }
%struct.ICompressCoder2 = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%class.CMyUnknownImp = type { i32 }
%class.CInBuffer = type <{ ptr, ptr, ptr, %class.CMyComPtr.1, i64, i32, i8, [3 x i8] }>
%class.CMyComPtr.1 = type { ptr }
%"class.NCompress::NRangeCoder::CDecoder" = type { %class.CInBuffer, i32, i32 }
%"class.NCompress::NRangeCoder::CBitDecoder" = type { %"class.NCompress::NRangeCoder::CBitModel" }
%"class.NCompress::NRangeCoder::CBitModel" = type { i32 }
%class.COutBuffer = type <{ ptr, i32, i32, i32, i32, %class.CMyComPtr, i64, ptr, i8, [7 x i8] }>
%class.CMyComPtr = type { ptr }

declare noundef zeroext i1 @_ZN10COutBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(49), i32 noundef) #0

declare i32 @__gxx_personality_v0(...)

; 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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress5NBcj23IsJEhh(i8 noundef zeroext, 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 uwtable
define dso_local noundef i32 @_ZN9NCompress5NBcj28CDecoder8CodeRealEPP19ISequentialInStreamPPKyjPP20ISequentialOutStreamS7_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) #3 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 i32, align 4
  %19 = alloca %"class.NCompress::NBcj2::CDecoder::CCoderReleaser", align 8
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i8, align 1
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca i32, align 4
  %34 = alloca i8, align 1
  %35 = 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
  %36 = load ptr, ptr %10, align 8
  %37 = load i32, ptr %13, align 4, !tbaa !9
  %38 = icmp ne i32 %37, 4
  br i1 %38, label %42, label %39

39:                                               ; preds = %8
  %40 = load i32, ptr %16, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 1
  br i1 %41, label %42, label %43

42:                                               ; preds = %39, %8
  store i32 -2147024809, ptr %9, align 4
  br label %280

43:                                               ; preds = %39
  %44 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 3
  %45 = call noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45) %44, i32 noundef 65536)
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  store i32 -2147024882, ptr %9, align 4
  br label %280

47:                                               ; preds = %43
  %48 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 4
  %49 = call noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45) %48, i32 noundef 1048576)
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  store i32 -2147024882, ptr %9, align 4
  br label %280

51:                                               ; preds = %47
  %52 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 5
  %53 = call noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45) %52, i32 noundef 65536)
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  store i32 -2147024882, ptr %9, align 4
  br label %280

55:                                               ; preds = %51
  %56 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 6
  %57 = call noundef zeroext i1 @_ZN9NCompress11NRangeCoder8CDecoder6CreateEj(ptr noundef nonnull align 8 dereferenceable(56) %56, i32 noundef 1048576)
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 -2147024882, ptr %9, align 4
  br label %280

59:                                               ; preds = %55
  %60 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %61 = call noundef zeroext i1 @_ZN10COutBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(49) %60, i32 noundef 65536)
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  store i32 -2147024882, ptr %9, align 4
  br label %280

63:                                               ; preds = %59
  %64 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 3
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds ptr, ptr %65, i64 0
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  call void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45) %64, ptr noundef %67)
  %68 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 4
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds ptr, ptr %69, i64 1
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  call void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45) %68, ptr noundef %71)
  %72 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 5
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds ptr, ptr %73, i64 2
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  call void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45) %72, ptr noundef %75)
  %76 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 6
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds ptr, ptr %77, i64 3
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  call void @_ZN9NCompress11NRangeCoder8CDecoder9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(56) %76, ptr noundef %79)
  %80 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = getelementptr inbounds ptr, ptr %81, i64 0
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %80, ptr noundef %83)
  %84 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 3
  call void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45) %84)
  %85 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 4
  call void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45) %85)
  %86 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 5
  call void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45) %86)
  %87 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 6
  call void @_ZN9NCompress11NRangeCoder8CDecoder4InitEv(ptr noundef nonnull align 8 dereferenceable(56) %87)
  %88 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %88)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %98, %63
  %90 = load i32, ptr %18, align 4, !tbaa !9
  %91 = icmp slt i32 %90, 258
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %101

93:                                               ; preds = %89
  %94 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 7
  %95 = load i32, ptr %18, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitDecoder"], ptr %94, i64 0, i64 %96
  call void @_ZN9NCompress11NRangeCoder9CBitModelILi5EE4InitEv(ptr noundef nonnull align 4 dereferenceable(4) %97)
  br label %98

98:                                               ; preds = %93
  %99 = load i32, ptr %18, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %18, align 4, !tbaa !9
  br label %89, !llvm.loop !11

101:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @_ZN9NCompress5NBcj28CDecoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #5
  store i8 0, ptr %20, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %275, %273, %101
  %103 = load i32, ptr %21, align 4, !tbaa !9
  %104 = icmp uge i32 %103, 1048576
  br i1 %104, label %105, label %138

105:                                              ; preds = %102
  %106 = load ptr, ptr %17, align 8, !tbaa !5
  %107 = icmp ne ptr %106, null
  br i1 %107, label %108, label %138

108:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %109 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %110 = invoke noundef i64 @_ZNK10COutBuffer16GetProcessedSizeEv(ptr noundef nonnull align 8 dereferenceable(49) %109)
          to label %111 unwind label %122

111:                                              ; preds = %108
  store i64 %110, ptr %22, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %112 = load ptr, ptr %17, align 8, !tbaa !5
  %113 = load ptr, ptr %112, align 8, !tbaa !16
  %114 = getelementptr inbounds ptr, ptr %113, i64 5
  %115 = load ptr, ptr %114, align 8
  %116 = invoke noundef i32 %115(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef null, ptr noundef %22)
          to label %117 unwind label %126

117:                                              ; preds = %111
  store i32 %116, ptr %25, align 4, !tbaa !9
  %118 = load i32, ptr %25, align 4, !tbaa !9
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %130

120:                                              ; preds = %117
  %121 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %121, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %131

122:                                              ; preds = %108
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %23, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %24, align 4
  br label %137

126:                                              ; preds = %111
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %23, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %137

130:                                              ; preds = %117
  store i32 0, ptr %26, align 4
  br label %131

131:                                              ; preds = %130, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  %132 = load i32, ptr %26, align 4
  switch i32 %132, label %134 [
    i32 0, label %133
  ]

133:                                              ; preds = %131
  store i32 0, ptr %21, align 4, !tbaa !9
  store i32 0, ptr %26, align 4
  br label %134

134:                                              ; preds = %133, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %135 = load i32, ptr %26, align 4
  switch i32 %135, label %278 [
    i32 0, label %136
  ]

136:                                              ; preds = %134
  br label %138

137:                                              ; preds = %126, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %279

138:                                              ; preds = %136, %105, %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #5
  store i8 0, ptr %28, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 262144, ptr %29, align 4, !tbaa !9
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %164, %138
  %140 = load i32, ptr %27, align 4, !tbaa !9
  %141 = icmp ult i32 %140, 262144
  br i1 %141, label %142, label %167

142:                                              ; preds = %139
  %143 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 3
  %144 = invoke noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45) %143, ptr noundef nonnull align 1 dereferenceable(1) %28)
          to label %145 unwind label %149

145:                                              ; preds = %142
  br i1 %144, label %153, label %146

146:                                              ; preds = %145
  %147 = invoke noundef i32 @_ZN9NCompress5NBcj28CDecoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(1304) %36)
          to label %148 unwind label %149

148:                                              ; preds = %146
  store i32 %147, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %273

149:                                              ; preds = %156, %153, %146, %142
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %23, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %24, align 4
  br label %277

153:                                              ; preds = %145
  %154 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %155 = load i8, ptr %28, align 1, !tbaa !13
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %154, i8 noundef zeroext %155)
          to label %156 unwind label %149

156:                                              ; preds = %153
  %157 = load i8, ptr %20, align 1, !tbaa !13
  %158 = load i8, ptr %28, align 1, !tbaa !13
  %159 = invoke noundef zeroext i1 @_ZN9NCompress5NBcj23IsJEhh(i8 noundef zeroext %157, i8 noundef zeroext %158)
          to label %160 unwind label %149

160:                                              ; preds = %156
  br i1 %159, label %161, label %162

161:                                              ; preds = %160
  br label %167

162:                                              ; preds = %160
  %163 = load i8, ptr %28, align 1, !tbaa !13
  store i8 %163, ptr %20, align 1, !tbaa !13
  br label %164

164:                                              ; preds = %162
  %165 = load i32, ptr %27, align 4, !tbaa !9
  %166 = add i32 %165, 1
  store i32 %166, ptr %27, align 4, !tbaa !9
  br label %139, !llvm.loop !18

167:                                              ; preds = %161, %139
  %168 = load i32, ptr %27, align 4, !tbaa !9
  %169 = load i32, ptr %21, align 4, !tbaa !9
  %170 = add i32 %169, %168
  store i32 %170, ptr %21, align 4, !tbaa !9
  %171 = load i32, ptr %27, align 4, !tbaa !9
  %172 = icmp eq i32 %171, 262144
  br i1 %172, label %173, label %174

173:                                              ; preds = %167
  store i32 6, ptr %26, align 4
  br label %273, !llvm.loop !19

174:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %175 = load i8, ptr %20, align 1, !tbaa !13
  %176 = load i8, ptr %28, align 1, !tbaa !13
  %177 = invoke noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %175, i8 noundef zeroext %176)
          to label %178 unwind label %201

178:                                              ; preds = %174
  store i32 %177, ptr %30, align 4, !tbaa !9
  %179 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 7
  %180 = load i32, ptr %30, align 4, !tbaa !9
  %181 = zext i32 %180 to i64
  %182 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitDecoder"], ptr %179, i64 0, i64 %181
  %183 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 6
  %184 = invoke noundef i32 @_ZN9NCompress11NRangeCoder11CBitDecoderILi5EE6DecodeEPNS0_8CDecoderE(ptr noundef nonnull align 4 dereferenceable(4) %182, ptr noundef %183)
          to label %185 unwind label %201

185:                                              ; preds = %178
  %186 = icmp eq i32 %184, 1
  br i1 %186, label %187, label %269

187:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  store i32 0, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %188 = load i8, ptr %28, align 1, !tbaa !13
  %189 = zext i8 %188 to i32
  %190 = icmp eq i32 %189, 232
  br i1 %190, label %191, label %193

191:                                              ; preds = %187
  %192 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 4
  br label %195

193:                                              ; preds = %187
  %194 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 5
  br label %195

195:                                              ; preds = %193, %191
  %196 = phi ptr [ %192, %191 ], [ %194, %193 ]
  store ptr %196, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %197

197:                                              ; preds = %224, %195
  %198 = load i32, ptr %33, align 4, !tbaa !9
  %199 = icmp slt i32 %198, 4
  br i1 %199, label %205, label %200

200:                                              ; preds = %197
  store i32 10, ptr %26, align 4
  br label %227

201:                                              ; preds = %178, %174
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %23, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %24, align 4
  br label %276

205:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #5
  %206 = load ptr, ptr %32, align 8, !tbaa !5
  %207 = invoke noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45) %206, ptr noundef nonnull align 1 dereferenceable(1) %34)
          to label %208 unwind label %210

208:                                              ; preds = %205
  br i1 %207, label %214, label %209

209:                                              ; preds = %208
  store i32 1, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %221

210:                                              ; preds = %205
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %23, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  br label %268

214:                                              ; preds = %208
  %215 = load i32, ptr %31, align 4, !tbaa !9
  %216 = shl i32 %215, 8
  store i32 %216, ptr %31, align 4, !tbaa !9
  %217 = load i8, ptr %34, align 1, !tbaa !13
  %218 = zext i8 %217 to i32
  %219 = load i32, ptr %31, align 4, !tbaa !9
  %220 = or i32 %219, %218
  store i32 %220, ptr %31, align 4, !tbaa !9
  store i32 0, ptr %26, align 4
  br label %221

221:                                              ; preds = %214, %209
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #5
  %222 = load i32, ptr %26, align 4
  switch i32 %222, label %227 [
    i32 0, label %223
  ]

223:                                              ; preds = %221
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %33, align 4, !tbaa !9
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %33, align 4, !tbaa !9
  br label %197, !llvm.loop !20

227:                                              ; preds = %221, %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  %228 = load i32, ptr %26, align 4
  switch i32 %228, label %261 [
    i32 10, label %229
  ]

229:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %230 = load i32, ptr %31, align 4, !tbaa !9
  %231 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %232 = invoke noundef i64 @_ZNK10COutBuffer16GetProcessedSizeEv(ptr noundef nonnull align 8 dereferenceable(49) %231)
          to label %233 unwind label %264

233:                                              ; preds = %229
  %234 = trunc i64 %232 to i32
  %235 = add i32 %234, 4
  %236 = sub i32 %230, %235
  store i32 %236, ptr %35, align 4, !tbaa !9
  %237 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %238 = load i32, ptr %35, align 4, !tbaa !9
  %239 = trunc i32 %238 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %237, i8 noundef zeroext %239)
          to label %240 unwind label %264

240:                                              ; preds = %233
  %241 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %242 = load i32, ptr %35, align 4, !tbaa !9
  %243 = lshr i32 %242, 8
  %244 = trunc i32 %243 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %241, i8 noundef zeroext %244)
          to label %245 unwind label %264

245:                                              ; preds = %240
  %246 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %247 = load i32, ptr %35, align 4, !tbaa !9
  %248 = lshr i32 %247, 16
  %249 = trunc i32 %248 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %246, i8 noundef zeroext %249)
          to label %250 unwind label %264

250:                                              ; preds = %245
  %251 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %36, i32 0, i32 8
  %252 = load i32, ptr %35, align 4, !tbaa !9
  %253 = lshr i32 %252, 24
  %254 = trunc i32 %253 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %251, i8 noundef zeroext %254)
          to label %255 unwind label %264

255:                                              ; preds = %250
  %256 = load i32, ptr %35, align 4, !tbaa !9
  %257 = lshr i32 %256, 24
  %258 = trunc i32 %257 to i8
  store i8 %258, ptr %20, align 1, !tbaa !13
  %259 = load i32, ptr %21, align 4, !tbaa !9
  %260 = add i32 %259, 4
  store i32 %260, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  store i32 0, ptr %26, align 4
  br label %261

261:                                              ; preds = %255, %227
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  %262 = load i32, ptr %26, align 4
  switch i32 %262, label %272 [
    i32 0, label %263
  ]

263:                                              ; preds = %261
  br label %271

264:                                              ; preds = %250, %245, %240, %233, %229
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %23, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %268

268:                                              ; preds = %264, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %276

269:                                              ; preds = %185
  %270 = load i8, ptr %28, align 1, !tbaa !13
  store i8 %270, ptr %20, align 1, !tbaa !13
  br label %271

271:                                              ; preds = %269, %263
  store i32 0, ptr %26, align 4
  br label %272

272:                                              ; preds = %271, %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %273

273:                                              ; preds = %272, %173, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  %274 = load i32, ptr %26, align 4
  switch i32 %274, label %278 [
    i32 0, label %275
    i32 6, label %102
  ]

275:                                              ; preds = %273
  br label %102, !llvm.loop !19

276:                                              ; preds = %268, %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %277

277:                                              ; preds = %276, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %279

278:                                              ; preds = %273, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  call void @_ZN9NCompress5NBcj28CDecoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %280

279:                                              ; preds = %277, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  call void @_ZN9NCompress5NBcj28CDecoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %282

280:                                              ; preds = %278, %62, %58, %54, %50, %46, %42
  %281 = load i32, ptr %9, align 4
  ret i32 %281

282:                                              ; preds = %279
  %283 = load ptr, ptr %23, align 8
  %284 = load i32, ptr %24, align 4
  %285 = insertvalue { ptr, i32 } poison, ptr %283, 0
  %286 = insertvalue { ptr, i32 } %285, i32 %284, 1
  resume { ptr, i32 } %286
}

declare noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45), i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9NCompress11NRangeCoder8CDecoder6CreateEj(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef) #3 align 2

declare void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45), ptr noundef) #0

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

declare void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45)) #0

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

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

declare noundef i64 @_ZNK10COutBuffer16GetProcessedSizeEv(ptr noundef nonnull align 8 dereferenceable(49)) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45), ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

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

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

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

attributes #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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

%"class.NCompress::NBcj2::CDecoder::CCoderReleaser" = type { ptr }
%"class.NCompress::NRangeCoder::CBitDecoder" = type { %"class.NCompress::NRangeCoder::CBitModel" }
%"class.NCompress::NRangeCoder::CBitModel" = type { i32 }

declare noundef zeroext i1 @_ZN10COutBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(49), i32 noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; 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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49), i8 noundef zeroext) local_unnamed_addr #3 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NBcj28CDecoder8CodeRealEPP19ISequentialInStreamPPKyjPP20ISequentialOutStreamS7_jP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(1304) %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readnone %2, i32 noundef %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readnone %5, i32 noundef %6, ptr noundef %7) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca %"class.NCompress::NBcj2::CDecoder::CCoderReleaser", align 8
  %10 = alloca i64, align 8
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = icmp ne i32 %3, 4
  %14 = icmp ne i32 %6, 1
  %or.cond = or i1 %13, %14
  br i1 %or.cond, label %137, label %15

15:                                               ; preds = %8
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = tail call noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45) %16, i32 noundef 65536)
  br i1 %17, label %18, label %137

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 64
  %20 = tail call noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45) %19, i32 noundef 1048576)
  br i1 %20, label %21, label %137

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %0, i64 112
  %23 = tail call noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45) %22, i32 noundef 65536)
  br i1 %23, label %24, label %137

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %0, i64 160
  %26 = tail call noundef zeroext i1 @_ZN9NCompress11NRangeCoder8CDecoder6CreateEj(ptr noundef nonnull align 8 dereferenceable(56) %25, i32 noundef 1048576)
  br i1 %26, label %27, label %137

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %0, i64 1248
  %29 = tail call noundef zeroext i1 @_ZN10COutBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(49) %28, i32 noundef 65536)
  br i1 %29, label %30, label %137

30:                                               ; preds = %27
  %31 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45) %16, ptr noundef %31)
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  tail call void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45) %19, ptr noundef %33)
  %34 = getelementptr inbounds i8, ptr %1, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  tail call void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45) %22, ptr noundef %35)
  %36 = getelementptr inbounds i8, ptr %1, i64 24
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  tail call void @_ZN9NCompress11NRangeCoder8CDecoder9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(56) %25, ptr noundef %37)
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  tail call void @_ZN10COutBuffer9SetStreamEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(49) %28, ptr noundef %38)
  tail call void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45) %16)
  tail call void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45) %19)
  tail call void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45) %22)
  tail call void @_ZN9NCompress11NRangeCoder8CDecoder4InitEv(ptr noundef nonnull align 8 dereferenceable(56) %25)
  tail call void @_ZN10COutBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(49) %28)
  %39 = getelementptr inbounds i8, ptr %0, i64 216
  br label %42

40:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @_ZN9NCompress5NBcj28CDecoder14CCoderReleaserC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull %0)
  %41 = icmp ne ptr %7, null
  br label %44

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

44:                                               ; preds = %.backedge, %40
  %.062 = phi i32 [ 0, %40 ], [ %.668, %.backedge ]
  %.056 = phi i8 [ 0, %40 ], [ %.561, %.backedge ]
  %45 = icmp ugt i32 %.062, 1048575
  %or.cond7 = and i1 %41, %45
  br i1 %or.cond7, label %46, label %59

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %47 = invoke noundef i64 @_ZNK10COutBuffer16GetProcessedSizeEv(ptr noundef nonnull align 8 dereferenceable(49) %28)
          to label %48 unwind label %54

48:                                               ; preds = %46
  store i64 %47, ptr %10, align 8, !tbaa !11
  %49 = load ptr, ptr %7, align 8, !tbaa !13
  %50 = getelementptr inbounds i8, ptr %49, i64 40
  %51 = load ptr, ptr %50, align 8
  %52 = invoke noundef i32 %51(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef null, ptr noundef nonnull %10)
          to label %53 unwind label %56

53:                                               ; preds = %48
  %.not = icmp eq i32 %52, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %.not, label %59, label %.loopexit109

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

56:                                               ; preds = %48
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %58

58:                                               ; preds = %56, %54
  %.pn = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %136

59:                                               ; preds = %53, %44
  %.264 = phi i32 [ 0, %53 ], [ %.062, %44 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #5
  store i8 0, ptr %11, align 1, !tbaa !15
  br label %60

60:                                               ; preds = %59, %70
  %.157121 = phi i8 [ %.056, %59 ], [ %71, %70 ]
  %.069120 = phi i32 [ 0, %59 ], [ %72, %70 ]
  %61 = invoke noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45) %16, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %62 unwind label %.loopexit108

62:                                               ; preds = %60
  br i1 %61, label %65, label %63

63:                                               ; preds = %62
  %64 = invoke noundef i32 @_ZN9NCompress5NBcj28CDecoder5FlushEv(ptr noundef nonnull align 8 dereferenceable(1304) %0)
          to label %.thread102 unwind label %.loopexit.split-lp

.thread102:                                       ; preds = %63
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  br label %.loopexit109

.loopexit108:                                     ; preds = %60, %65
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %135

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

65:                                               ; preds = %62
  %66 = load i8, ptr %11, align 1, !tbaa !15
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %28, i8 noundef zeroext %66)
          to label %67 unwind label %.loopexit108

67:                                               ; preds = %65
  %68 = load i8, ptr %11, align 1, !tbaa !15
  %69 = call noundef zeroext i1 @_ZN9NCompress5NBcj23IsJEhh(i8 noundef zeroext %.157121, i8 noundef zeroext %68)
  br i1 %69, label %75, label %70

70:                                               ; preds = %67
  %71 = load i8, ptr %11, align 1, !tbaa !15
  %72 = add nuw nsw i32 %.069120, 1
  %exitcond133.not = icmp eq i32 %72, 262144
  br i1 %exitcond133.not, label %73, label %60, !llvm.loop !16

73:                                               ; preds = %70
  %74 = add i32 %.264, 262144
  br label %.backedge

75:                                               ; preds = %67
  %76 = add i32 %.069120, %.264
  %.pre = load i8, ptr %11, align 1, !tbaa !15
  %77 = call noundef i32 @_ZN9NCompress5NBcj28GetIndexEhh(i8 noundef zeroext %.157121, i8 noundef zeroext %.pre)
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds [258 x %"class.NCompress::NRangeCoder::CBitDecoder"], ptr %39, i64 0, i64 %78
  %80 = invoke noundef i32 @_ZN9NCompress11NRangeCoder11CBitDecoderILi5EE6DecodeEPNS0_8CDecoderE(ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef nonnull %25)
          to label %81 unwind label %88

81:                                               ; preds = %75
  %82 = icmp eq i32 %80, 1
  %83 = load i8, ptr %11, align 1, !tbaa !15
  br i1 %82, label %84, label %.backedge

84:                                               ; preds = %81
  %85 = icmp eq i8 %83, -24
  %86 = select i1 %85, ptr %19, ptr %22
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #5
  %87 = invoke noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45) %86, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %90 unwind label %92

88:                                               ; preds = %75
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %135

90:                                               ; preds = %84
  %91 = load i8, ptr %12, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #5
  br i1 %87, label %94, label %.loopexit.thread

92:                                               ; preds = %104, %99, %94, %84
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #5
  br label %135

94:                                               ; preds = %90
  %95 = zext i8 %91 to i32
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #5
  %96 = invoke noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45) %86, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %97 unwind label %92

97:                                               ; preds = %94
  %98 = load i8, ptr %12, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #5
  br i1 %96, label %99, label %.loopexit.thread

99:                                               ; preds = %97
  %100 = zext i8 %98 to i32
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #5
  %101 = invoke noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45) %86, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %102 unwind label %92

102:                                              ; preds = %99
  %103 = load i8, ptr %12, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #5
  br i1 %101, label %104, label %.loopexit.thread

104:                                              ; preds = %102
  %105 = shl nuw nsw i32 %95, 16
  %106 = shl nuw nsw i32 %100, 8
  %107 = or disjoint i32 %105, %106
  %108 = zext i8 %103 to i32
  %109 = or disjoint i32 %107, %108
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #5
  %110 = invoke noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45) %86, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %111 unwind label %92

111:                                              ; preds = %104
  %112 = load i8, ptr %12, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #5
  br i1 %110, label %113, label %.loopexit.thread

113:                                              ; preds = %111
  %114 = invoke noundef i64 @_ZNK10COutBuffer16GetProcessedSizeEv(ptr noundef nonnull align 8 dereferenceable(49) %28)
          to label %115 unwind label %133

115:                                              ; preds = %113
  %116 = shl nuw i32 %109, 8
  %117 = zext i8 %112 to i32
  %118 = or disjoint i32 %116, %117
  %119 = trunc i64 %114 to i32
  %.neg107 = add i32 %118, -4
  %120 = sub i32 %.neg107, %119
  %121 = trunc i32 %120 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %28, i8 noundef zeroext %121)
          to label %122 unwind label %133

122:                                              ; preds = %115
  %123 = lshr i32 %120, 8
  %124 = trunc i32 %123 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %28, i8 noundef zeroext %124)
          to label %125 unwind label %133

125:                                              ; preds = %122
  %126 = lshr i32 %120, 16
  %127 = trunc i32 %126 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %28, i8 noundef zeroext %127)
          to label %128 unwind label %133

128:                                              ; preds = %125
  %129 = lshr i32 %120, 24
  %130 = trunc nuw i32 %129 to i8
  invoke void @_ZN10COutBuffer9WriteByteEh(ptr noundef nonnull align 8 dereferenceable(49) %28, i8 noundef zeroext %130)
          to label %131 unwind label %133

131:                                              ; preds = %128
  %132 = add i32 %76, 4
  br label %.backedge

133:                                              ; preds = %128, %125, %122, %115, %113
  %134 = landingpad { ptr, i32 }
          cleanup
  br label %135

.loopexit.thread:                                 ; preds = %111, %102, %97, %90
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  br label %.loopexit109

.backedge:                                        ; preds = %81, %131, %73
  %.668 = phi i32 [ %74, %73 ], [ %132, %131 ], [ %76, %81 ]
  %.561 = phi i8 [ %71, %73 ], [ %130, %131 ], [ %83, %81 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  br label %44, !llvm.loop !17

135:                                              ; preds = %.loopexit108, %.loopexit.split-lp, %88, %133, %92
  %.pn90.pn.pn = phi { ptr, i32 } [ %89, %88 ], [ %134, %133 ], [ %93, %92 ], [ %lpad.loopexit, %.loopexit108 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  br label %136

.loopexit109:                                     ; preds = %53, %.loopexit.thread, %.thread102
  %.9 = phi i32 [ %64, %.thread102 ], [ 1, %.loopexit.thread ], [ %52, %53 ]
  call void @_ZN9NCompress5NBcj28CDecoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %137

136:                                              ; preds = %135, %58
  %.pn90.pn.pn.pn = phi { ptr, i32 } [ %.pn90.pn.pn, %135 ], [ %.pn, %58 ]
  call void @_ZN9NCompress5NBcj28CDecoder14CCoderReleaserD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  resume { ptr, i32 } %.pn90.pn.pn.pn

137:                                              ; preds = %27, %24, %21, %18, %15, %8, %.loopexit109
  %.10 = phi i32 [ %.9, %.loopexit109 ], [ -2147024809, %8 ], [ -2147024882, %15 ], [ -2147024882, %18 ], [ -2147024882, %21 ], [ -2147024882, %24 ], [ -2147024882, %27 ]
  ret i32 %.10
}

declare noundef zeroext i1 @_ZN9CInBuffer6CreateEj(ptr noundef nonnull align 8 dereferenceable(45), i32 noundef) local_unnamed_addr #0

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

declare void @_ZN9CInBuffer9SetStreamEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(45), ptr noundef) local_unnamed_addr #0

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

declare void @_ZN9CInBuffer4InitEv(ptr noundef nonnull align 8 dereferenceable(45)) local_unnamed_addr #0

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

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

declare noundef i64 @_ZNK10COutBuffer16GetProcessedSizeEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9CInBuffer8ReadByteERh(ptr noundef nonnull align 8 dereferenceable(45), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 align 2

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

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

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

attributes #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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