; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/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" = type { %struct.ICompressCoder2, %struct.ICompressSetFinishMode, %struct.ICompressGetInStreamProcessedSize2, %struct.ICompressSetInStream2, %struct.ISequentialInStream, %struct.ICompressSetOutStreamSize, %struct.ICompressSetBufSize, %class.CMyUnknownImp, %"class.NCompress::NBcj2::CBaseCoder", [4 x i32], [4 x i64], [4 x i32], [4 x %class.CMyComPtr.0], i8, i8, i64, i64, %struct.CBcj2Dec }
%struct.ICompressCoder2 = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressSetFinishMode = type { %struct.IUnknown }
%struct.ICompressGetInStreamProcessedSize2 = type { %struct.IUnknown }
%struct.ICompressSetInStream2 = type { %struct.IUnknown }
%struct.ISequentialInStream = type { %struct.IUnknown }
%struct.ICompressSetOutStreamSize = type { %struct.IUnknown }
%struct.ICompressSetBufSize = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }
%"class.NCompress::NBcj2::CBaseCoder" = type { [5 x ptr], [5 x i32], [5 x i32] }
%class.CMyComPtr.0 = type { ptr }
%struct.CBcj2Dec = type { [4 x ptr], [4 x ptr], ptr, ptr, i32, i32, [4 x i8], i32, i32, [258 x i16] }

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

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

declare i32 @Bcj2Dec_Decode(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NBcj28CDecoder4ReadEPvjPj(ptr noundef nonnull align 8 dereferenceable(880) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) unnamed_addr #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %27

25:                                               ; preds = %4
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %25, %4
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  store i32 0, ptr %5, align 4
  br label %389

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  %32 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 14
  %33 = load i8, ptr %32, align 1, !tbaa !11, !range !26, !noundef !27
  %34 = trunc i8 %33 to i1
  br i1 %34, label %35, label %49

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %36 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 15
  %37 = load i64, ptr %36, align 8, !tbaa !28
  %38 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 16
  %39 = load i64, ptr %38, align 8, !tbaa !29
  %40 = sub i64 %37, %39
  store i64 %40, ptr %11, align 8, !tbaa !30
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = load i64, ptr %11, align 8, !tbaa !30
  %44 = icmp ugt i64 %42, %43
  br i1 %44, label %45, label %48

45:                                               ; preds = %35
  %46 = load i64, ptr %11, align 8, !tbaa !30
  %47 = trunc i64 %46 to i32
  store i32 %47, ptr %8, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %45, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %49

49:                                               ; preds = %48, %31
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %52 = getelementptr inbounds %struct.CBcj2Dec, ptr %51, i32 0, i32 2
  store ptr %50, ptr %52, align 8, !tbaa !31
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds i8, ptr %53, i64 %55
  %57 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %58 = getelementptr inbounds %struct.CBcj2Dec, ptr %57, i32 0, i32 3
  store ptr %56, ptr %58, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %353, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %60 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %61 = call i32 @Bcj2Dec_Decode(ptr noundef %60)
  store i32 %61, ptr %13, align 4, !tbaa !9
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %59
  store i32 1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %351

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %66 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %67 = getelementptr inbounds %struct.CBcj2Dec, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !31
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = ptrtoint ptr %68 to i64
  %71 = ptrtoint ptr %69 to i64
  %72 = sub i64 %70, %71
  %73 = trunc i64 %72 to i32
  store i32 %73, ptr %15, align 4, !tbaa !9
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %98

76:                                               ; preds = %65
  %77 = load i32, ptr %15, align 4, !tbaa !9
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = add i32 %78, %77
  store i32 %79, ptr %10, align 4, !tbaa !9
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %85

82:                                               ; preds = %76
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %83, ptr %84, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %82, %76
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = load i32, ptr %15, align 4, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  store ptr %89, ptr %7, align 8, !tbaa !5
  %90 = load i32, ptr %15, align 4, !tbaa !9
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = sub i32 %91, %90
  store i32 %92, ptr %8, align 4, !tbaa !9
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 16
  %96 = load i64, ptr %95, align 8, !tbaa !29
  %97 = add i64 %96, %94
  store i64 %97, ptr %95, align 8, !tbaa !29
  br label %98

98:                                               ; preds = %85, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  %99 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %100 = getelementptr inbounds %struct.CBcj2Dec, ptr %99, i32 0, i32 4
  %101 = load i32, ptr %100, align 8, !tbaa !33
  %102 = icmp uge i32 %101, 4
  br i1 %102, label %103, label %104

103:                                              ; preds = %98
  store i32 2, ptr %14, align 4
  br label %351

104:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %105 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 9
  %106 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %107 = getelementptr inbounds %struct.CBcj2Dec, ptr %106, i32 0, i32 4
  %108 = load i32, ptr %107, align 8, !tbaa !33
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [4 x i32], ptr %105, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  store i64 %112, ptr %16, align 8, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %113 = getelementptr inbounds i8, ptr %22, i64 64
  %114 = getelementptr inbounds %"class.NCompress::NBcj2::CBaseCoder", ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %116 = getelementptr inbounds %struct.CBcj2Dec, ptr %115, i32 0, i32 4
  %117 = load i32, ptr %116, align 8, !tbaa !33
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds [5 x ptr], ptr %114, i64 0, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  store ptr %120, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 0, ptr %18, align 8, !tbaa !34
  br label %121

121:                                              ; preds = %141, %104
  %122 = load i64, ptr %18, align 8, !tbaa !34
  %123 = load i64, ptr %16, align 8, !tbaa !34
  %124 = icmp ult i64 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 4, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %144

126:                                              ; preds = %121
  %127 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %128 = getelementptr inbounds %struct.CBcj2Dec, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %130 = getelementptr inbounds %struct.CBcj2Dec, ptr %129, i32 0, i32 4
  %131 = load i32, ptr %130, align 8, !tbaa !33
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds [4 x ptr], ptr %128, i64 0, i64 %132
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = load i64, ptr %18, align 8, !tbaa !34
  %136 = getelementptr inbounds i8, ptr %134, i64 %135
  %137 = load i8, ptr %136, align 1, !tbaa !36
  %138 = load ptr, ptr %17, align 8, !tbaa !5
  %139 = load i64, ptr %18, align 8, !tbaa !34
  %140 = getelementptr inbounds i8, ptr %138, i64 %139
  store i8 %137, ptr %140, align 1, !tbaa !36
  br label %141

141:                                              ; preds = %126
  %142 = load i64, ptr %18, align 8, !tbaa !34
  %143 = add i64 %142, 1
  store i64 %143, ptr %18, align 8, !tbaa !34
  br label %121, !llvm.loop !37

144:                                              ; preds = %125
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %147 = getelementptr inbounds %struct.CBcj2Dec, ptr %146, i32 0, i32 0
  %148 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %149 = getelementptr inbounds %struct.CBcj2Dec, ptr %148, i32 0, i32 4
  %150 = load i32, ptr %149, align 8, !tbaa !33
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds [4 x ptr], ptr %147, i64 0, i64 %151
  store ptr %145, ptr %152, align 8, !tbaa !5
  %153 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %154 = getelementptr inbounds %struct.CBcj2Dec, ptr %153, i32 0, i32 1
  %155 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %156 = getelementptr inbounds %struct.CBcj2Dec, ptr %155, i32 0, i32 4
  %157 = load i32, ptr %156, align 8, !tbaa !33
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds [4 x ptr], ptr %154, i64 0, i64 %158
  store ptr %145, ptr %159, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %160 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 11
  %161 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %162 = getelementptr inbounds %struct.CBcj2Dec, ptr %161, i32 0, i32 4
  %163 = load i32, ptr %162, align 8, !tbaa !33
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds [4 x i32], ptr %160, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !9
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %176

168:                                              ; preds = %144
  %169 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 11
  %170 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %171 = getelementptr inbounds %struct.CBcj2Dec, ptr %170, i32 0, i32 4
  %172 = load i32, ptr %171, align 8, !tbaa !33
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds [4 x i32], ptr %169, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !9
  store i32 %175, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %348

176:                                              ; preds = %144
  br label %177

177:                                              ; preds = %258, %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %178 = getelementptr inbounds i8, ptr %22, i64 64
  %179 = getelementptr inbounds %"class.NCompress::NBcj2::CBaseCoder", ptr %178, i32 0, i32 1
  %180 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %181 = getelementptr inbounds %struct.CBcj2Dec, ptr %180, i32 0, i32 4
  %182 = load i32, ptr %181, align 8, !tbaa !33
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds [5 x i32], ptr %179, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !9
  %186 = load i64, ptr %16, align 8, !tbaa !34
  %187 = trunc i64 %186 to i32
  %188 = sub i32 %185, %187
  store i32 %188, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %189 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 12
  %190 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %191 = getelementptr inbounds %struct.CBcj2Dec, ptr %190, i32 0, i32 4
  %192 = load i32, ptr %191, align 8, !tbaa !33
  %193 = zext i32 %192 to i64
  %194 = getelementptr inbounds [4 x %class.CMyComPtr.0], ptr %189, i64 0, i64 %193
  %195 = call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %194)
  %196 = getelementptr inbounds i8, ptr %22, i64 64
  %197 = getelementptr inbounds %"class.NCompress::NBcj2::CBaseCoder", ptr %196, i32 0, i32 0
  %198 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %199 = getelementptr inbounds %struct.CBcj2Dec, ptr %198, i32 0, i32 4
  %200 = load i32, ptr %199, align 8, !tbaa !33
  %201 = zext i32 %200 to i64
  %202 = getelementptr inbounds [5 x ptr], ptr %197, i64 0, i64 %201
  %203 = load ptr, ptr %202, align 8, !tbaa !5
  %204 = load i64, ptr %16, align 8, !tbaa !34
  %205 = getelementptr inbounds i8, ptr %203, i64 %204
  %206 = load i32, ptr %19, align 4, !tbaa !9
  %207 = load ptr, ptr %195, align 8, !tbaa !39
  %208 = getelementptr inbounds ptr, ptr %207, i64 5
  %209 = load ptr, ptr %208, align 8
  %210 = call noundef i32 %209(ptr noundef nonnull align 8 dereferenceable(8) %195, ptr noundef %205, i32 noundef %206, ptr noundef %19)
  store i32 %210, ptr %20, align 4, !tbaa !9
  %211 = load i32, ptr %20, align 4, !tbaa !9
  %212 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 11
  %213 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %214 = getelementptr inbounds %struct.CBcj2Dec, ptr %213, i32 0, i32 4
  %215 = load i32, ptr %214, align 8, !tbaa !33
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds [4 x i32], ptr %212, i64 0, i64 %216
  store i32 %211, ptr %217, align 4, !tbaa !9
  %218 = load i32, ptr %19, align 4, !tbaa !9
  %219 = icmp eq i32 %218, 0
  br i1 %219, label %220, label %221

220:                                              ; preds = %177
  store i32 7, ptr %14, align 4
  br label %240

221:                                              ; preds = %177
  %222 = load i32, ptr %19, align 4, !tbaa !9
  %223 = zext i32 %222 to i64
  %224 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 10
  %225 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %226 = getelementptr inbounds %struct.CBcj2Dec, ptr %225, i32 0, i32 4
  %227 = load i32, ptr %226, align 8, !tbaa !33
  %228 = zext i32 %227 to i64
  %229 = getelementptr inbounds [4 x i64], ptr %224, i64 0, i64 %228
  %230 = load i64, ptr %229, align 8, !tbaa !30
  %231 = add i64 %230, %223
  store i64 %231, ptr %229, align 8, !tbaa !30
  %232 = load i32, ptr %19, align 4, !tbaa !9
  %233 = zext i32 %232 to i64
  %234 = load i64, ptr %16, align 8, !tbaa !34
  %235 = add i64 %234, %233
  store i64 %235, ptr %16, align 8, !tbaa !34
  %236 = load i32, ptr %20, align 4, !tbaa !9
  %237 = icmp ne i32 %236, 0
  br i1 %237, label %238, label %239

238:                                              ; preds = %221
  store i32 7, ptr %14, align 4
  br label %240

239:                                              ; preds = %221
  store i32 0, ptr %14, align 4
  br label %240

240:                                              ; preds = %239, %238, %220
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %241 = load i32, ptr %14, align 4
  switch i32 %241, label %391 [
    i32 0, label %242
    i32 7, label %260
  ]

242:                                              ; preds = %240
  br label %243

243:                                              ; preds = %242
  %244 = load i64, ptr %16, align 8, !tbaa !34
  %245 = icmp ult i64 %244, 4
  br i1 %245, label %246, label %258

246:                                              ; preds = %243
  %247 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %248 = getelementptr inbounds %struct.CBcj2Dec, ptr %247, i32 0, i32 4
  %249 = load i32, ptr %248, align 8, !tbaa !33
  %250 = icmp eq i32 %249, 1
  br i1 %250, label %256, label %251

251:                                              ; preds = %246
  %252 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %253 = getelementptr inbounds %struct.CBcj2Dec, ptr %252, i32 0, i32 4
  %254 = load i32, ptr %253, align 8, !tbaa !33
  %255 = icmp eq i32 %254, 2
  br label %256

256:                                              ; preds = %251, %246
  %257 = phi i1 [ true, %246 ], [ %255, %251 ]
  br label %258

258:                                              ; preds = %256, %243
  %259 = phi i1 [ false, %243 ], [ %257, %256 ]
  br i1 %259, label %177, label %260, !llvm.loop !41

260:                                              ; preds = %258, %240
  %261 = load i64, ptr %16, align 8, !tbaa !34
  %262 = icmp eq i64 %261, 0
  br i1 %262, label %263, label %275

263:                                              ; preds = %260
  %264 = load i32, ptr %10, align 4, !tbaa !9
  %265 = icmp eq i32 %264, 0
  br i1 %265, label %266, label %274

266:                                              ; preds = %263
  %267 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 11
  %268 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %269 = getelementptr inbounds %struct.CBcj2Dec, ptr %268, i32 0, i32 4
  %270 = load i32, ptr %269, align 8, !tbaa !33
  %271 = zext i32 %270 to i64
  %272 = getelementptr inbounds [4 x i32], ptr %267, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !9
  store i32 %273, ptr %12, align 4, !tbaa !9
  br label %274

274:                                              ; preds = %266, %263
  store i32 2, ptr %14, align 4
  br label %348

275:                                              ; preds = %260
  %276 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %277 = getelementptr inbounds %struct.CBcj2Dec, ptr %276, i32 0, i32 4
  %278 = load i32, ptr %277, align 8, !tbaa !33
  %279 = icmp eq i32 %278, 1
  br i1 %279, label %285, label %280

280:                                              ; preds = %275
  %281 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %282 = getelementptr inbounds %struct.CBcj2Dec, ptr %281, i32 0, i32 4
  %283 = load i32, ptr %282, align 8, !tbaa !33
  %284 = icmp eq i32 %283, 2
  br i1 %284, label %285, label %330

285:                                              ; preds = %280, %275
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %286 = load i64, ptr %16, align 8, !tbaa !34
  %287 = trunc i64 %286 to i32
  %288 = and i32 %287, 3
  store i32 %288, ptr %21, align 4, !tbaa !9
  %289 = load i32, ptr %21, align 4, !tbaa !9
  %290 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 9
  %291 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %292 = getelementptr inbounds %struct.CBcj2Dec, ptr %291, i32 0, i32 4
  %293 = load i32, ptr %292, align 8, !tbaa !33
  %294 = zext i32 %293 to i64
  %295 = getelementptr inbounds [4 x i32], ptr %290, i64 0, i64 %294
  store i32 %289, ptr %295, align 4, !tbaa !9
  %296 = load i64, ptr %16, align 8, !tbaa !34
  %297 = icmp ult i64 %296, 4
  br i1 %297, label %298, label %322

298:                                              ; preds = %285
  %299 = load i32, ptr %10, align 4, !tbaa !9
  %300 = icmp ne i32 %299, 0
  br i1 %300, label %301, label %302

301:                                              ; preds = %298
  store i32 0, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %327

302:                                              ; preds = %298
  %303 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 11
  %304 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %305 = getelementptr inbounds %struct.CBcj2Dec, ptr %304, i32 0, i32 4
  %306 = load i32, ptr %305, align 8, !tbaa !33
  %307 = zext i32 %306 to i64
  %308 = getelementptr inbounds [4 x i32], ptr %303, i64 0, i64 %307
  %309 = load i32, ptr %308, align 4, !tbaa !9
  %310 = icmp ne i32 %309, 0
  br i1 %310, label %311, label %319

311:                                              ; preds = %302
  %312 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 11
  %313 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %314 = getelementptr inbounds %struct.CBcj2Dec, ptr %313, i32 0, i32 4
  %315 = load i32, ptr %314, align 8, !tbaa !33
  %316 = zext i32 %315 to i64
  %317 = getelementptr inbounds [4 x i32], ptr %312, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !9
  br label %320

319:                                              ; preds = %302
  br label %320

320:                                              ; preds = %319, %311
  %321 = phi i32 [ %318, %311 ], [ 1, %319 ]
  store i32 %321, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %327

322:                                              ; preds = %285
  %323 = load i32, ptr %21, align 4, !tbaa !9
  %324 = zext i32 %323 to i64
  %325 = load i64, ptr %16, align 8, !tbaa !34
  %326 = sub i64 %325, %324
  store i64 %326, ptr %16, align 8, !tbaa !34
  store i32 0, ptr %14, align 4
  br label %327

327:                                              ; preds = %322, %320, %301
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  %328 = load i32, ptr %14, align 4
  switch i32 %328, label %348 [
    i32 0, label %329
  ]

329:                                              ; preds = %327
  br label %330

330:                                              ; preds = %329, %280
  %331 = getelementptr inbounds i8, ptr %22, i64 64
  %332 = getelementptr inbounds %"class.NCompress::NBcj2::CBaseCoder", ptr %331, i32 0, i32 0
  %333 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %334 = getelementptr inbounds %struct.CBcj2Dec, ptr %333, i32 0, i32 4
  %335 = load i32, ptr %334, align 8, !tbaa !33
  %336 = zext i32 %335 to i64
  %337 = getelementptr inbounds [5 x ptr], ptr %332, i64 0, i64 %336
  %338 = load ptr, ptr %337, align 8, !tbaa !5
  %339 = load i64, ptr %16, align 8, !tbaa !34
  %340 = getelementptr inbounds i8, ptr %338, i64 %339
  %341 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %342 = getelementptr inbounds %struct.CBcj2Dec, ptr %341, i32 0, i32 1
  %343 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %344 = getelementptr inbounds %struct.CBcj2Dec, ptr %343, i32 0, i32 4
  %345 = load i32, ptr %344, align 8, !tbaa !33
  %346 = zext i32 %345 to i64
  %347 = getelementptr inbounds [4 x ptr], ptr %342, i64 0, i64 %346
  store ptr %340, ptr %347, align 8, !tbaa !5
  store i32 0, ptr %14, align 4
  br label %348

348:                                              ; preds = %330, %327, %274, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %349 = load i32, ptr %14, align 4
  switch i32 %349, label %351 [
    i32 0, label %350
  ]

350:                                              ; preds = %348
  store i32 0, ptr %14, align 4
  br label %351

351:                                              ; preds = %350, %348, %103, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %352 = load i32, ptr %14, align 4
  switch i32 %352, label %388 [
    i32 0, label %353
    i32 2, label %354
  ]

353:                                              ; preds = %351
  br label %59, !llvm.loop !42

354:                                              ; preds = %351
  %355 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 13
  %356 = load i8, ptr %355, align 8, !tbaa !43, !range !26, !noundef !27
  %357 = trunc i8 %356 to i1
  br i1 %357, label %358, label %386

358:                                              ; preds = %354
  %359 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 14
  %360 = load i8, ptr %359, align 1, !tbaa !11, !range !26, !noundef !27
  %361 = trunc i8 %360 to i1
  br i1 %361, label %362, label %386

362:                                              ; preds = %358
  %363 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 15
  %364 = load i64, ptr %363, align 8, !tbaa !28
  %365 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 16
  %366 = load i64, ptr %365, align 8, !tbaa !29
  %367 = icmp eq i64 %364, %366
  br i1 %367, label %368, label %386

368:                                              ; preds = %362
  %369 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %370 = getelementptr inbounds %struct.CBcj2Dec, ptr %369, i32 0, i32 8
  %371 = load i32, ptr %370, align 8, !tbaa !44
  %372 = icmp eq i32 %371, 0
  br i1 %372, label %374, label %373

373:                                              ; preds = %368
  store i32 1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %388

374:                                              ; preds = %368
  %375 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %376 = getelementptr inbounds %struct.CBcj2Dec, ptr %375, i32 0, i32 4
  %377 = load i32, ptr %376, align 8, !tbaa !33
  %378 = icmp ne i32 %377, 0
  br i1 %378, label %379, label %385

379:                                              ; preds = %374
  %380 = getelementptr inbounds %"class.NCompress::NBcj2::CDecoder", ptr %22, i32 0, i32 17
  %381 = getelementptr inbounds %struct.CBcj2Dec, ptr %380, i32 0, i32 4
  %382 = load i32, ptr %381, align 8, !tbaa !33
  %383 = icmp ne i32 %382, 8
  br i1 %383, label %384, label %385

384:                                              ; preds = %379
  store i32 1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %388

385:                                              ; preds = %379, %374
  br label %386

386:                                              ; preds = %385, %362, %358, %354
  %387 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %387, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %388

388:                                              ; preds = %386, %384, %373, %351
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %389

389:                                              ; preds = %388, %30
  %390 = load i32, ptr %5, align 4
  ret i32 %390

391:                                              ; preds = %240
  unreachable
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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, !23, i64 241}
!12 = !{!"_ZTSN9NCompress5NBcj28CDecoderE", !13, i64 0, !15, i64 8, !16, i64 16, !17, i64 24, !18, i64 32, !19, i64 40, !20, i64 48, !21, i64 56, !22, i64 64, !7, i64 144, !7, i64 160, !7, i64 192, !7, i64 208, !23, i64 240, !23, i64 241, !24, i64 248, !24, i64 256, !25, i64 264}
!13 = !{!"_ZTS15ICompressCoder2", !14, i64 0}
!14 = !{!"_ZTS8IUnknown"}
!15 = !{!"_ZTS22ICompressSetFinishMode", !14, i64 0}
!16 = !{!"_ZTS34ICompressGetInStreamProcessedSize2", !14, i64 0}
!17 = !{!"_ZTS21ICompressSetInStream2", !14, i64 0}
!18 = !{!"_ZTS19ISequentialInStream", !14, i64 0}
!19 = !{!"_ZTS25ICompressSetOutStreamSize", !14, i64 0}
!20 = !{!"_ZTS19ICompressSetBufSize", !14, i64 0}
!21 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!22 = !{!"_ZTSN9NCompress5NBcj210CBaseCoderE", !7, i64 0, !7, i64 40, !7, i64 60}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"long long", !7, i64 0}
!25 = !{!"_ZTS8CBcj2Dec", !7, i64 0, !7, i64 32, !6, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !7, i64 88, !10, i64 92, !10, i64 96, !7, i64 100}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!12, !24, i64 248}
!29 = !{!12, !24, i64 256}
!30 = !{!24, !24, i64 0}
!31 = !{!12, !6, i64 328}
!32 = !{!12, !6, i64 336}
!33 = !{!12, !10, i64 344}
!34 = !{!35, !35, i64 0}
!35 = !{!"long", !7, i64 0}
!36 = !{!7, !7, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!40, !40, i64 0}
!40 = !{!"vtable pointer", !8, i64 0}
!41 = distinct !{!41, !38}
!42 = distinct !{!42, !38}
!43 = !{!12, !23, i64 240}
!44 = !{!12, !10, i64 360}


; 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.CMyComPtr.0 = type { ptr }

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

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

declare i32 @Bcj2Dec_Decode(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NBcj28CDecoder4ReadEPvjPj(ptr noundef nonnull align 8 dereferenceable(880) %0, ptr noundef %1, i32 noundef %2, ptr noundef writeonly %3) unnamed_addr #2 align 2 {
  %5 = alloca i32, align 4
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %7, label %6

6:                                                ; preds = %4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %6, %4
  %8 = icmp eq i32 %2, 0
  br i1 %8, label %.thread111, label %9

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 241
  %11 = load i8, ptr %10, align 1, !tbaa !9, !range !25, !noundef !26
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %22

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 248
  %15 = load i64, ptr %14, align 8, !tbaa !27
  %16 = getelementptr inbounds i8, ptr %0, i64 256
  %17 = load i64, ptr %16, align 8, !tbaa !28
  %18 = sub i64 %15, %17
  %19 = zext i32 %2 to i64
  %20 = icmp ult i64 %18, %19
  %21 = trunc nuw i64 %18 to i32
  %spec.select = select i1 %20, i32 %21, i32 %2
  br label %22

22:                                               ; preds = %13, %9
  %.158 = phi i32 [ %spec.select, %13 ], [ %2, %9 ]
  %23 = getelementptr inbounds i8, ptr %0, i64 264
  %24 = getelementptr inbounds i8, ptr %0, i64 328
  store ptr %1, ptr %24, align 8, !tbaa !29
  %25 = zext i32 %.158 to i64
  %26 = getelementptr inbounds i8, ptr %1, i64 %25
  %27 = getelementptr inbounds i8, ptr %0, i64 336
  store ptr %26, ptr %27, align 8, !tbaa !30
  %28 = tail call i32 @Bcj2Dec_Decode(ptr noundef nonnull %23)
  %.not90136 = icmp eq i32 %28, 0
  br i1 %.not90136, label %.lr.ph141, label %.thread111

.lr.ph141:                                        ; preds = %22
  %29 = getelementptr inbounds i8, ptr %0, i64 256
  %30 = getelementptr inbounds i8, ptr %0, i64 344
  %31 = getelementptr inbounds i8, ptr %0, i64 144
  %32 = getelementptr inbounds i8, ptr %0, i64 64
  %33 = getelementptr inbounds i8, ptr %0, i64 296
  %34 = getelementptr inbounds i8, ptr %0, i64 192
  %35 = getelementptr inbounds i8, ptr %0, i64 104
  %36 = getelementptr inbounds i8, ptr %0, i64 208
  %37 = getelementptr inbounds i8, ptr %0, i64 160
  br label %38

38:                                               ; preds = %.lr.ph141, %164
  %.053139 = phi ptr [ %1, %.lr.ph141 ], [ %.154, %164 ]
  %.066137 = phi i32 [ 0, %.lr.ph141 ], [ %.167, %164 ]
  %39 = load ptr, ptr %24, align 8, !tbaa !29
  %40 = ptrtoint ptr %39 to i64
  %41 = ptrtoint ptr %.053139 to i64
  %42 = sub i64 %40, %41
  %43 = trunc i64 %42 to i32
  %.not91 = icmp eq i32 %43, 0
  br i1 %.not91, label %52, label %44

44:                                               ; preds = %38
  %45 = add i32 %.066137, %43
  br i1 %.not, label %47, label %46

46:                                               ; preds = %44
  store i32 %45, ptr %3, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %46, %44
  %48 = and i64 %42, 4294967295
  %49 = getelementptr inbounds i8, ptr %.053139, i64 %48
  %50 = load i64, ptr %29, align 8, !tbaa !28
  %51 = add i64 %50, %48
  store i64 %51, ptr %29, align 8, !tbaa !28
  br label %52

52:                                               ; preds = %47, %38
  %.167 = phi i32 [ %45, %47 ], [ %.066137, %38 ]
  %.154 = phi ptr [ %49, %47 ], [ %.053139, %38 ]
  %53 = load i32, ptr %30, align 8, !tbaa !31
  %54 = icmp ugt i32 %53, 3
  br i1 %54, label %.loopexit, label %55

55:                                               ; preds = %52
  %56 = zext nneg i32 %53 to i64
  %57 = getelementptr inbounds [4 x i32], ptr %31, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds [5 x ptr], ptr %32, i64 0, i64 %56
  %61 = load ptr, ptr %60, align 8, !tbaa !32
  %.not144 = icmp eq i32 %58, 0
  br i1 %.not144, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %55
  %xtraiter = and i64 %59, 3
  %62 = icmp ult i32 %58, 4
  br i1 %62, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %59, 4294967292
  br label %.lr.ph

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.056135.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %107, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %.056135.epil = phi i64 [ %70, %.lr.ph.epil ], [ %.056135.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %63 = load i32, ptr %30, align 8, !tbaa !31
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds [4 x ptr], ptr %23, i64 0, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !32
  %67 = getelementptr inbounds i8, ptr %66, i64 %.056135.epil
  %68 = load i8, ptr %67, align 1, !tbaa !33
  %69 = getelementptr inbounds i8, ptr %61, i64 %.056135.epil
  store i8 %68, ptr %69, align 1, !tbaa !33
  %70 = add nuw nsw i64 %.056135.epil, 1
  %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 %._crit_edge.loopexit, label %.lr.ph.epil, !llvm.loop !34

._crit_edge.loopexit:                             ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa
  %.pre = load i32, ptr %30, align 8, !tbaa !31
  %.pre150 = zext i32 %.pre to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %55
  %.pre-phi = phi i64 [ %.pre150, %._crit_edge.loopexit ], [ %56, %55 ]
  %71 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %53, %55 ]
  %72 = getelementptr inbounds [4 x ptr], ptr %23, i64 0, i64 %.pre-phi
  store ptr %61, ptr %72, align 8, !tbaa !32
  %73 = getelementptr inbounds [4 x ptr], ptr %33, i64 0, i64 %.pre-phi
  store ptr %61, ptr %73, align 8, !tbaa !32
  %74 = getelementptr inbounds [4 x i32], ptr %34, i64 0, i64 %.pre-phi
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %.not92 = icmp eq i32 %75, 0
  br i1 %.not92, label %.critedge3, label %.thread111

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.056135 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %107, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %76 = load i32, ptr %30, align 8, !tbaa !31
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds [4 x ptr], ptr %23, i64 0, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !32
  %80 = getelementptr inbounds i8, ptr %79, i64 %.056135
  %81 = load i8, ptr %80, align 1, !tbaa !33
  %82 = getelementptr inbounds i8, ptr %61, i64 %.056135
  store i8 %81, ptr %82, align 1, !tbaa !33
  %83 = or disjoint i64 %.056135, 1
  %84 = load i32, ptr %30, align 8, !tbaa !31
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds [4 x ptr], ptr %23, i64 0, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !32
  %88 = getelementptr inbounds i8, ptr %87, i64 %83
  %89 = load i8, ptr %88, align 1, !tbaa !33
  %90 = getelementptr inbounds i8, ptr %61, i64 %83
  store i8 %89, ptr %90, align 1, !tbaa !33
  %91 = or disjoint i64 %.056135, 2
  %92 = load i32, ptr %30, align 8, !tbaa !31
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds [4 x ptr], ptr %23, i64 0, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !32
  %96 = getelementptr inbounds i8, ptr %95, i64 %91
  %97 = load i8, ptr %96, align 1, !tbaa !33
  %98 = getelementptr inbounds i8, ptr %61, i64 %91
  store i8 %97, ptr %98, align 1, !tbaa !33
  %99 = or disjoint i64 %.056135, 3
  %100 = load i32, ptr %30, align 8, !tbaa !31
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds [4 x ptr], ptr %23, i64 0, i64 %101
  %103 = load ptr, ptr %102, align 8, !tbaa !32
  %104 = getelementptr inbounds i8, ptr %103, i64 %99
  %105 = load i8, ptr %104, align 1, !tbaa !33
  %106 = getelementptr inbounds i8, ptr %61, i64 %99
  store i8 %105, ptr %106, align 1, !tbaa !33
  %107 = add nuw nsw i64 %.056135, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !36

.critedge3:                                       ; preds = %._crit_edge, %131
  %108 = phi i32 [ %133, %131 ], [ %71, %._crit_edge ]
  %.062 = phi i64 [ %138, %131 ], [ %59, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [5 x i32], ptr %35, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = trunc i64 %.062 to i32
  %113 = sub i32 %111, %112
  store i32 %113, ptr %5, align 4, !tbaa !5
  %114 = getelementptr inbounds [4 x %class.CMyComPtr.0], ptr %36, i64 0, i64 %109
  %115 = call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEptEv(ptr noundef nonnull align 8 dereferenceable(8) %114)
  %116 = load i32, ptr %30, align 8, !tbaa !31
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds [5 x ptr], ptr %32, i64 0, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !32
  %120 = getelementptr inbounds i8, ptr %119, i64 %.062
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = load ptr, ptr %115, align 8, !tbaa !38
  %123 = getelementptr inbounds i8, ptr %122, i64 40
  %124 = load ptr, ptr %123, align 8
  %125 = call noundef i32 %124(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef %120, i32 noundef %121, ptr noundef nonnull %5)
  %126 = load i32, ptr %30, align 8, !tbaa !31
  %127 = zext i32 %126 to i64
  %128 = getelementptr inbounds [4 x i32], ptr %34, i64 0, i64 %127
  store i32 %125, ptr %128, align 4, !tbaa !5
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %.thread, label %131

.thread:                                          ; preds = %.critedge3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %.critedge

131:                                              ; preds = %.critedge3
  %132 = zext i32 %129 to i64
  %133 = load i32, ptr %30, align 8, !tbaa !31
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds [4 x i64], ptr %37, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !40
  %137 = add i64 %136, %132
  store i64 %137, ptr %135, align 8, !tbaa !40
  %138 = add i64 %.062, %132
  %.not93 = icmp eq i32 %125, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  %139 = icmp ult i64 %138, 4
  %or.cond = select i1 %.not93, i1 %139, i1 false
  %.off = add i32 %133, -1
  %switch99 = icmp ult i32 %.off, 2
  %or.cond155 = and i1 %or.cond, %switch99
  br i1 %or.cond155, label %.critedge3, label %.critedge

.critedge:                                        ; preds = %131, %.thread
  %.163106 = phi i64 [ %.062, %.thread ], [ %138, %131 ]
  %140 = icmp eq i64 %.163106, 0
  br i1 %140, label %141, label %148

141:                                              ; preds = %.critedge
  %142 = icmp eq i32 %.167, 0
  br i1 %142, label %143, label %.loopexit

143:                                              ; preds = %141
  %144 = load i32, ptr %30, align 8, !tbaa !31
  %145 = zext i32 %144 to i64
  %146 = getelementptr inbounds [4 x i32], ptr %34, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  br label %.loopexit

148:                                              ; preds = %.critedge
  %149 = load i32, ptr %30, align 8, !tbaa !31
  %.off100 = add i32 %149, -1
  %switch101 = icmp ult i32 %.off100, 2
  br i1 %switch101, label %150, label %164

150:                                              ; preds = %148
  %151 = trunc i64 %.163106 to i32
  %152 = and i32 %151, 3
  %153 = zext nneg i32 %149 to i64
  %154 = getelementptr inbounds [4 x i32], ptr %31, i64 0, i64 %153
  store i32 %152, ptr %154, align 4, !tbaa !5
  %155 = icmp ugt i64 %.163106, 3
  br i1 %155, label %162, label %156

156:                                              ; preds = %150
  %.not94 = icmp eq i32 %.167, 0
  br i1 %.not94, label %157, label %.thread111

157:                                              ; preds = %156
  %158 = load i32, ptr %30, align 8, !tbaa !31
  %159 = zext i32 %158 to i64
  %160 = getelementptr inbounds [4 x i32], ptr %34, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %spec.select98 = call i32 @llvm.umax.i32(i32 %161, i32 1)
  br label %.thread111

162:                                              ; preds = %150
  %163 = and i64 %.163106, -4
  %.pre149 = load i32, ptr %30, align 8, !tbaa !31
  br label %164

164:                                              ; preds = %148, %162
  %165 = phi i32 [ %.pre149, %162 ], [ %149, %148 ]
  %.365 = phi i64 [ %163, %162 ], [ %.163106, %148 ]
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds [5 x ptr], ptr %32, i64 0, i64 %166
  %168 = load ptr, ptr %167, align 8, !tbaa !32
  %169 = getelementptr inbounds i8, ptr %168, i64 %.365
  %170 = getelementptr inbounds [4 x ptr], ptr %33, i64 0, i64 %166
  store ptr %169, ptr %170, align 8, !tbaa !32
  %171 = call i32 @Bcj2Dec_Decode(ptr noundef nonnull %23)
  %.not90 = icmp eq i32 %171, 0
  br i1 %.not90, label %38, label %.thread111

.loopexit:                                        ; preds = %52, %143, %141
  %.376.ph = phi i32 [ 0, %141 ], [ %147, %143 ], [ 0, %52 ]
  %172 = getelementptr inbounds i8, ptr %0, i64 240
  %173 = load i8, ptr %172, align 8, !tbaa !41, !range !25, !noundef !26
  %174 = trunc nuw i8 %173 to i1
  br i1 %174, label %175, label %189

175:                                              ; preds = %.loopexit
  %176 = load i8, ptr %10, align 1, !tbaa !9, !range !25, !noundef !26
  %177 = trunc nuw i8 %176 to i1
  br i1 %177, label %178, label %189

178:                                              ; preds = %175
  %179 = getelementptr inbounds i8, ptr %0, i64 248
  %180 = load i64, ptr %179, align 8, !tbaa !27
  %181 = load i64, ptr %29, align 8, !tbaa !28
  %182 = icmp eq i64 %180, %181
  br i1 %182, label %183, label %189

183:                                              ; preds = %178
  %184 = getelementptr inbounds i8, ptr %0, i64 360
  %185 = load i32, ptr %184, align 8, !tbaa !42
  %186 = icmp eq i32 %185, 0
  br i1 %186, label %187, label %.thread111

187:                                              ; preds = %183
  %188 = load i32, ptr %30, align 8, !tbaa !31
  switch i32 %188, label %.thread111 [
    i32 0, label %189
    i32 8, label %189
  ]

189:                                              ; preds = %187, %187, %178, %175, %.loopexit
  br label %.thread111

.thread111:                                       ; preds = %164, %._crit_edge, %22, %157, %156, %189, %183, %187, %7
  %.6 = phi i32 [ 0, %7 ], [ %.376.ph, %189 ], [ 1, %183 ], [ 1, %187 ], [ 0, %156 ], [ %spec.select98, %157 ], [ 1, %22 ], [ 1, %164 ], [ %75, %._crit_edge ]
  ret i32 %.6
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !21, i64 241}
!10 = !{!"_ZTSN9NCompress5NBcj28CDecoderE", !11, i64 0, !13, i64 8, !14, i64 16, !15, i64 24, !16, i64 32, !17, i64 40, !18, i64 48, !19, i64 56, !20, i64 64, !7, i64 144, !7, i64 160, !7, i64 192, !7, i64 208, !21, i64 240, !21, i64 241, !22, i64 248, !22, i64 256, !23, i64 264}
!11 = !{!"_ZTS15ICompressCoder2", !12, i64 0}
!12 = !{!"_ZTS8IUnknown"}
!13 = !{!"_ZTS22ICompressSetFinishMode", !12, i64 0}
!14 = !{!"_ZTS34ICompressGetInStreamProcessedSize2", !12, i64 0}
!15 = !{!"_ZTS21ICompressSetInStream2", !12, i64 0}
!16 = !{!"_ZTS19ISequentialInStream", !12, i64 0}
!17 = !{!"_ZTS25ICompressSetOutStreamSize", !12, i64 0}
!18 = !{!"_ZTS19ICompressSetBufSize", !12, i64 0}
!19 = !{!"_ZTS13CMyUnknownImp", !6, i64 0}
!20 = !{!"_ZTSN9NCompress5NBcj210CBaseCoderE", !7, i64 0, !7, i64 40, !7, i64 60}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"long long", !7, i64 0}
!23 = !{!"_ZTS8CBcj2Dec", !7, i64 0, !7, i64 32, !24, i64 64, !24, i64 72, !6, i64 80, !6, i64 84, !7, i64 88, !6, i64 92, !6, i64 96, !7, i64 100}
!24 = !{!"any pointer", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!10, !22, i64 248}
!28 = !{!10, !22, i64 256}
!29 = !{!10, !24, i64 328}
!30 = !{!10, !24, i64 336}
!31 = !{!10, !6, i64 344}
!32 = !{!24, !24, i64 0}
!33 = !{!7, !7, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.unroll.disable"}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!39, !39, i64 0}
!39 = !{!"vtable pointer", !8, i64 0}
!40 = !{!22, !22, i64 0}
!41 = !{!10, !21, i64 240}
!42 = !{!10, !6, i64 360}


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