; LLVM IR from mncoppola/rpef :: utilities_src/squashfs2.1/lzma/C/7zip/Compress/LZMA (LZMAEncoder)

; 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::NLZMA::CEncoder" = type <{ %struct.ICompressCoder, %struct.ICompressSetOutStream, %struct.ICompressSetCoderProperties, %struct.ICompressWriteCoderProperties, %"class.NCompress::NLZMA::CBaseState", %class.CMyUnknownImp, [4096 x %"struct.NCompress::NLZMA::COptimal"], %class.CMyComPtr.5, %"class.NCompress::NRangeCoder::CEncoder", [12 x [16 x %"class.NCompress::NRangeCoder::CBitEncoder"]], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x %"class.NCompress::NRangeCoder::CBitEncoder"], [12 x [16 x %"class.NCompress::NRangeCoder::CBitEncoder"]], [4 x %"class.NCompress::NRangeCoder::CBitTreeEncoder.7"], [114 x %"class.NCompress::NRangeCoder::CBitEncoder"], %"class.NCompress::NRangeCoder::CBitTreeEncoder.8", %"class.NCompress::NLZMA::NLength::CPriceTableEncoder", %"class.NCompress::NLZMA::NLength::CPriceTableEncoder", %"class.NCompress::NLZMA::CLiteralEncoder", [274 x i32], i8, i8, [2 x i8], i32, i32, i32, i32, i32, i8, [3 x i8], [4 x [64 x i32]], [4 x [128 x i32]], [16 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i8, [7 x i8], ptr, i32, i8, i8, [2 x i8] }>
%struct.ICompressCoder = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.ICompressSetOutStream = type { %struct.IUnknown }
%struct.ICompressSetCoderProperties = type { %struct.IUnknown }
%struct.ICompressWriteCoderProperties = type { %struct.IUnknown }
%"class.NCompress::NLZMA::CBaseState" = type { %"class.NCompress::NLZMA::CState", i8, [4 x i32] }
%"class.NCompress::NLZMA::CState" = type { i8 }
%class.CMyUnknownImp = type { i32 }
%"struct.NCompress::NLZMA::COptimal" = type { %"class.NCompress::NLZMA::CState", i8, i8, i32, i32, i32, i32, i32, [4 x i32] }
%class.CMyComPtr.5 = type { ptr }
%"class.NCompress::NRangeCoder::CEncoder" = type { i32, i8, i64, i32, [4 x i8], %class.COutBuffer }
%class.COutBuffer = type <{ ptr, i32, i32, i32, i32, %class.CMyComPtr.6, i64, ptr, i8, [7 x i8] }>
%class.CMyComPtr.6 = type { ptr }
%"class.NCompress::NRangeCoder::CBitEncoder" = type { %"class.NCompress::NRangeCoder::CBitModel" }
%"class.NCompress::NRangeCoder::CBitModel" = type { i32 }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.7" = type { [64 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.8" = type { [16 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NLZMA::NLength::CPriceTableEncoder" = type { %"class.NCompress::NLZMA::NLength::CEncoder", [272 x [16 x i32]], i32, [16 x i32] }
%"class.NCompress::NLZMA::NLength::CEncoder" = type { %"class.NCompress::NRangeCoder::CBitEncoder", %"class.NCompress::NRangeCoder::CBitEncoder", [16 x %"class.NCompress::NRangeCoder::CBitTreeEncoder"], [16 x %"class.NCompress::NRangeCoder::CBitTreeEncoder"], %"class.NCompress::NRangeCoder::CBitTreeEncoder.4" }
%"class.NCompress::NRangeCoder::CBitTreeEncoder" = type { [8 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NRangeCoder::CBitTreeEncoder.4" = type { [256 x %"class.NCompress::NRangeCoder::CBitEncoder"] }
%"class.NCompress::NLZMA::CLiteralEncoder" = type <{ ptr, i32, i32, i32, [4 x i8] }>

; 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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678), i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder14GetOptimumFastEjRjS2_(ptr noundef nonnull align 8 dereferenceable(210678) %0, i32 noundef %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3) #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca [4 x i32], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %21 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 30
  %22 = load i8, ptr %21, align 8, !tbaa !11, !range !34, !noundef !35
  %23 = trunc i8 %22 to i1
  br i1 %23, label %34, label %24

24:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %25 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder18ReadMatchDistancesERj(ptr noundef nonnull align 8 dereferenceable(210678) %20, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i32 %25, ptr %11, align 4, !tbaa !9
  %26 = load i32, ptr %11, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %30

28:                                               ; preds = %24
  %29 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %29, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %31

30:                                               ; preds = %24
  store i32 0, ptr %12, align 4
  br label %31

31:                                               ; preds = %30, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %32 = load i32, ptr %12, align 4
  switch i32 %32, label %314 [
    i32 0, label %33
  ]

33:                                               ; preds = %31
  br label %38

34:                                               ; preds = %4
  %35 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %36 = load i32, ptr %35, align 8, !tbaa !36
  store i32 %36, ptr %10, align 4, !tbaa !9
  %37 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 30
  store i8 0, ptr %37, align 8, !tbaa !11
  br label %38

38:                                               ; preds = %34, %33
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %74, %38
  %40 = load i32, ptr %15, align 4, !tbaa !9
  %41 = icmp ult i32 %40, 4
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %77

43:                                               ; preds = %39
  %44 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 7
  %45 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = getelementptr inbounds i8, ptr %20, i64 32
  %47 = getelementptr inbounds %"class.NCompress::NLZMA::CBaseState", ptr %46, i32 0, i32 2
  %48 = load i32, ptr %15, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds [4 x i32], ptr %47, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = load ptr, ptr %45, align 8, !tbaa !37
  %53 = getelementptr inbounds ptr, ptr %52, i64 7
  %54 = load ptr, ptr %53, align 8
  %55 = call noundef i32 %54(ptr noundef nonnull align 8 dereferenceable(8) %45, i32 noundef -1, i32 noundef %51, i32 noundef 273)
  %56 = load i32, ptr %15, align 4, !tbaa !9
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %57
  store i32 %55, ptr %58, align 4, !tbaa !9
  %59 = load i32, ptr %15, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %71, label %61

61:                                               ; preds = %43
  %62 = load i32, ptr %15, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = icmp ugt i32 %65, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %61, %43
  %72 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %72, ptr %14, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %71, %61
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %15, align 4, !tbaa !9
  %76 = add i32 %75, 1
  store i32 %76, ptr %15, align 4, !tbaa !9
  br label %39, !llvm.loop !39

77:                                               ; preds = %42
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 25
  %83 = load i32, ptr %82, align 4, !tbaa !41
  %84 = icmp uge i32 %81, %83
  br i1 %84, label %85, label %97

85:                                               ; preds = %77
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %86, ptr %87, align 4, !tbaa !9
  %88 = load i32, ptr %14, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %91, ptr %92, align 4, !tbaa !9
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = sub i32 %94, 1
  %96 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %20, i32 noundef %95)
  store i32 %96, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %313

97:                                               ; preds = %77
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 25
  %100 = load i32, ptr %99, align 4, !tbaa !41
  %101 = icmp uge i32 %98, %100
  br i1 %101, label %102, label %116

102:                                              ; preds = %97
  %103 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %104 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 25
  %105 = load i32, ptr %104, align 4, !tbaa !41
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds [274 x i32], ptr %103, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = add i32 %108, 4
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %109, ptr %110, align 4, !tbaa !9
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %111, ptr %112, align 4, !tbaa !9
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = sub i32 %113, 1
  %115 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %20, i32 noundef %114)
  store i32 %115, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %313

116:                                              ; preds = %97
  br label %117

117:                                              ; preds = %134, %116
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = icmp ugt i32 %118, 2
  br i1 %119, label %120, label %137

120:                                              ; preds = %117
  %121 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %122 = load i32, ptr %10, align 4, !tbaa !9
  %123 = sub i32 %122, 1
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds [274 x i32], ptr %121, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds [274 x i32], ptr %127, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = call noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef %126, i32 noundef %131)
  br i1 %132, label %134, label %133

133:                                              ; preds = %120
  br label %137

134:                                              ; preds = %120
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = add i32 %135, -1
  store i32 %136, ptr %10, align 4, !tbaa !9
  br label %117, !llvm.loop !42

137:                                              ; preds = %133, %117
  %138 = load i32, ptr %10, align 4, !tbaa !9
  %139 = icmp eq i32 %138, 2
  br i1 %139, label %140, label %146

140:                                              ; preds = %137
  %141 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %142 = getelementptr inbounds [274 x i32], ptr %141, i64 0, i64 2
  %143 = load i32, ptr %142, align 8, !tbaa !9
  %144 = icmp uge i32 %143, 128
  br i1 %144, label %145, label %146

145:                                              ; preds = %140
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %145, %140, %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %147 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %148 = load i32, ptr %10, align 4, !tbaa !9
  %149 = zext i32 %148 to i64
  %150 = getelementptr inbounds [274 x i32], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !9
  store i32 %151, ptr %16, align 4, !tbaa !9
  %152 = load i32, ptr %14, align 4, !tbaa !9
  %153 = zext i32 %152 to i64
  %154 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !9
  %156 = icmp uge i32 %155, 2
  br i1 %156, label %157, label %189

157:                                              ; preds = %146
  %158 = load i32, ptr %14, align 4, !tbaa !9
  %159 = zext i32 %158 to i64
  %160 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !9
  %162 = add i32 %161, 1
  %163 = load i32, ptr %10, align 4, !tbaa !9
  %164 = icmp uge i32 %162, %163
  br i1 %164, label %176, label %165

165:                                              ; preds = %157
  %166 = load i32, ptr %14, align 4, !tbaa !9
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !9
  %170 = add i32 %169, 2
  %171 = load i32, ptr %10, align 4, !tbaa !9
  %172 = icmp uge i32 %170, %171
  br i1 %172, label %173, label %188

173:                                              ; preds = %165
  %174 = load i32, ptr %16, align 4, !tbaa !9
  %175 = icmp ugt i32 %174, 4096
  br i1 %175, label %176, label %188

176:                                              ; preds = %173, %157
  %177 = load i32, ptr %14, align 4, !tbaa !9
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %177, ptr %178, align 4, !tbaa !9
  %179 = load i32, ptr %14, align 4, !tbaa !9
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !9
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %182, ptr %183, align 4, !tbaa !9
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = load i32, ptr %184, align 4, !tbaa !9
  %186 = sub i32 %185, 1
  %187 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %20, i32 noundef %186)
  store i32 %187, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %312

188:                                              ; preds = %173, %165
  br label %189

189:                                              ; preds = %188, %146
  %190 = load i32, ptr %10, align 4, !tbaa !9
  %191 = icmp uge i32 %190, 2
  br i1 %191, label %192, label %309

192:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %193 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %194 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder18ReadMatchDistancesERj(ptr noundef nonnull align 8 dereferenceable(210678) %20, ptr noundef nonnull align 4 dereferenceable(4) %193)
  store i32 %194, ptr %17, align 4, !tbaa !9
  %195 = load i32, ptr %17, align 4, !tbaa !9
  %196 = icmp ne i32 %195, 0
  br i1 %196, label %197, label %199

197:                                              ; preds = %192
  %198 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %198, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %200

199:                                              ; preds = %192
  store i32 0, ptr %12, align 4
  br label %200

200:                                              ; preds = %199, %197
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %201 = load i32, ptr %12, align 4
  switch i32 %201, label %312 [
    i32 0, label %202
  ]

202:                                              ; preds = %200
  %203 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %204 = load i32, ptr %203, align 8, !tbaa !36
  %205 = icmp uge i32 %204, 2
  br i1 %205, label %206, label %262

206:                                              ; preds = %202
  %207 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %208 = load i32, ptr %207, align 8, !tbaa !36
  %209 = load i32, ptr %10, align 4, !tbaa !9
  %210 = icmp uge i32 %208, %209
  br i1 %210, label %211, label %219

211:                                              ; preds = %206
  %212 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %213 = load i32, ptr %10, align 4, !tbaa !9
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds [274 x i32], ptr %212, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !9
  %217 = load i32, ptr %16, align 4, !tbaa !9
  %218 = icmp ult i32 %216, %217
  br i1 %218, label %258, label %219

219:                                              ; preds = %211, %206
  %220 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %221 = load i32, ptr %220, align 8, !tbaa !36
  %222 = load i32, ptr %10, align 4, !tbaa !9
  %223 = add i32 %222, 1
  %224 = icmp eq i32 %221, %223
  br i1 %224, label %225, label %234

225:                                              ; preds = %219
  %226 = load i32, ptr %16, align 4, !tbaa !9
  %227 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %228 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %229 = load i32, ptr %228, align 8, !tbaa !36
  %230 = zext i32 %229 to i64
  %231 = getelementptr inbounds [274 x i32], ptr %227, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !9
  %233 = call noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef %226, i32 noundef %232)
  br i1 %233, label %234, label %258

234:                                              ; preds = %225, %219
  %235 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %236 = load i32, ptr %235, align 8, !tbaa !36
  %237 = load i32, ptr %10, align 4, !tbaa !9
  %238 = add i32 %237, 1
  %239 = icmp ugt i32 %236, %238
  br i1 %239, label %258, label %240

240:                                              ; preds = %234
  %241 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 26
  %242 = load i32, ptr %241, align 8, !tbaa !36
  %243 = add i32 %242, 1
  %244 = load i32, ptr %10, align 4, !tbaa !9
  %245 = icmp uge i32 %243, %244
  br i1 %245, label %246, label %262

246:                                              ; preds = %240
  %247 = load i32, ptr %10, align 4, !tbaa !9
  %248 = icmp uge i32 %247, 3
  br i1 %248, label %249, label %262

249:                                              ; preds = %246
  %250 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 21
  %251 = load i32, ptr %10, align 4, !tbaa !9
  %252 = sub i32 %251, 1
  %253 = zext i32 %252 to i64
  %254 = getelementptr inbounds [274 x i32], ptr %250, i64 0, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !9
  %256 = load i32, ptr %16, align 4, !tbaa !9
  %257 = call noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef %255, i32 noundef %256)
  br i1 %257, label %258, label %262

258:                                              ; preds = %249, %234, %225, %211
  %259 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 30
  store i8 1, ptr %259, align 8, !tbaa !11
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 -1, ptr %260, align 4, !tbaa !9
  %261 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 1, ptr %261, align 4, !tbaa !9
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %312

262:                                              ; preds = %249, %246, %240, %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %263

263:                                              ; preds = %295, %262
  %264 = load i32, ptr %18, align 4, !tbaa !9
  %265 = icmp ult i32 %264, 4
  br i1 %265, label %267, label %266

266:                                              ; preds = %263
  store i32 7, ptr %12, align 4
  br label %298

267:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %268 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 7
  %269 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %268)
  %270 = getelementptr inbounds i8, ptr %20, i64 32
  %271 = getelementptr inbounds %"class.NCompress::NLZMA::CBaseState", ptr %270, i32 0, i32 2
  %272 = load i32, ptr %18, align 4, !tbaa !9
  %273 = zext i32 %272 to i64
  %274 = getelementptr inbounds [4 x i32], ptr %271, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !9
  %276 = load ptr, ptr %269, align 8, !tbaa !37
  %277 = getelementptr inbounds ptr, ptr %276, i64 7
  %278 = load ptr, ptr %277, align 8
  %279 = call noundef i32 %278(ptr noundef nonnull align 8 dereferenceable(8) %269, i32 noundef -1, i32 noundef %275, i32 noundef 273)
  store i32 %279, ptr %19, align 4, !tbaa !9
  %280 = load i32, ptr %19, align 4, !tbaa !9
  %281 = icmp uge i32 %280, 2
  br i1 %281, label %282, label %291

282:                                              ; preds = %267
  %283 = load i32, ptr %19, align 4, !tbaa !9
  %284 = add i32 %283, 1
  %285 = load i32, ptr %10, align 4, !tbaa !9
  %286 = icmp uge i32 %284, %285
  br i1 %286, label %287, label %291

287:                                              ; preds = %282
  %288 = getelementptr inbounds %"class.NCompress::NLZMA::CEncoder", ptr %20, i32 0, i32 30
  store i8 1, ptr %288, align 8, !tbaa !11
  %289 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 -1, ptr %289, align 4, !tbaa !9
  %290 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 1, ptr %290, align 4, !tbaa !9
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %292

291:                                              ; preds = %282, %267
  store i32 0, ptr %12, align 4
  br label %292

292:                                              ; preds = %291, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %293 = load i32, ptr %12, align 4
  switch i32 %293, label %298 [
    i32 0, label %294
  ]

294:                                              ; preds = %292
  br label %295

295:                                              ; preds = %294
  %296 = load i32, ptr %18, align 4, !tbaa !9
  %297 = add i32 %296, 1
  store i32 %297, ptr %18, align 4, !tbaa !9
  br label %263, !llvm.loop !43

298:                                              ; preds = %292, %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  %299 = load i32, ptr %12, align 4
  switch i32 %299, label %312 [
    i32 7, label %300
  ]

300:                                              ; preds = %298
  %301 = load i32, ptr %16, align 4, !tbaa !9
  %302 = add i32 %301, 4
  %303 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %302, ptr %303, align 4, !tbaa !9
  %304 = load i32, ptr %10, align 4, !tbaa !9
  %305 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %304, ptr %305, align 4, !tbaa !9
  %306 = load i32, ptr %10, align 4, !tbaa !9
  %307 = sub i32 %306, 2
  %308 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %20, i32 noundef %307)
  store i32 %308, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %312

309:                                              ; preds = %189
  %310 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 -1, ptr %310, align 4, !tbaa !9
  %311 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 1, ptr %311, align 4, !tbaa !9
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %312

312:                                              ; preds = %309, %300, %298, %258, %200, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %313

313:                                              ; preds = %312, %102, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  br label %314

314:                                              ; preds = %313, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %315 = load i32, ptr %5, align 4
  ret i32 %315
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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, !26, i64 207464}
!12 = !{!"_ZTSN9NCompress5NLZMA8CEncoderE", !13, i64 0, !15, i64 8, !16, i64 16, !17, i64 24, !18, i64 32, !20, i64 52, !7, i64 56, !21, i64 163896, !22, i64 163904, !7, i64 163984, !7, i64 164752, !7, i64 164800, !7, i64 164848, !7, i64 164896, !7, i64 164944, !7, i64 165712, !7, i64 166736, !27, i64 167192, !28, i64 167256, !28, i64 186788, !33, i64 206320, !7, i64 206344, !26, i64 207440, !26, i64 207441, !10, i64 207444, !10, i64 207448, !10, i64 207452, !10, i64 207456, !10, i64 207460, !26, i64 207464, !7, i64 207468, !7, i64 208492, !7, i64 210540, !10, i64 210604, !10, i64 210608, !10, i64 210612, !10, i64 210616, !10, i64 210620, !10, i64 210624, !10, i64 210628, !10, i64 210632, !10, i64 210636, !23, i64 210640, !23, i64 210648, !26, i64 210656, !6, i64 210664, !10, i64 210672, !26, i64 210676, !26, i64 210677}
!13 = !{!"_ZTS14ICompressCoder", !14, i64 0}
!14 = !{!"_ZTS8IUnknown"}
!15 = !{!"_ZTS21ICompressSetOutStream", !14, i64 0}
!16 = !{!"_ZTS27ICompressSetCoderProperties", !14, i64 0}
!17 = !{!"_ZTS29ICompressWriteCoderProperties", !14, i64 0}
!18 = !{!"_ZTSN9NCompress5NLZMA10CBaseStateE", !19, i64 0, !7, i64 1, !7, i64 4}
!19 = !{!"_ZTSN9NCompress5NLZMA6CStateE", !7, i64 0}
!20 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!21 = !{!"_ZTS9CMyComPtrI12IMatchFinderE", !6, i64 0}
!22 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !10, i64 0, !7, i64 4, !23, i64 8, !10, i64 16, !24, i64 24}
!23 = !{!"long long", !7, i64 0}
!24 = !{!"_ZTS10COutBuffer", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !25, i64 24, !23, i64 32, !6, i64 40, !26, i64 48}
!25 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !6, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi4EEE", !7, i64 0}
!28 = !{!"_ZTSN9NCompress5NLZMA7NLength18CPriceTableEncoderE", !29, i64 0, !7, i64 2056, !10, i64 19464, !7, i64 19468}
!29 = !{!"_ZTSN9NCompress5NLZMA7NLength8CEncoderE", !30, i64 0, !30, i64 4, !7, i64 8, !7, i64 520, !32, i64 1032}
!30 = !{!"_ZTSN9NCompress11NRangeCoder11CBitEncoderILi5EEE", !31, i64 0}
!31 = !{!"_ZTSN9NCompress11NRangeCoder9CBitModelILi5EEE", !10, i64 0}
!32 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi8EEE", !7, i64 0}
!33 = !{!"_ZTSN9NCompress5NLZMA15CLiteralEncoderE", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!12, !10, i64 207448}
!37 = !{!38, !38, i64 0}
!38 = !{!"vtable pointer", !8, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!12, !10, i64 207444}
!42 = distinct !{!42, !40}
!43 = distinct !{!43, !40}


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

; 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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress5NLZMA8CEncoder14GetOptimumFastEjRjS2_(ptr noundef nonnull align 8 dereferenceable(210678) %0, i32 noundef %1, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %2, ptr nocapture noundef nonnull writeonly align 4 dereferenceable(4) %3) local_unnamed_addr #2 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca [4 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 207464
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !32, !noundef !33
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %12, label %10

10:                                               ; preds = %4
  %11 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder18ReadMatchDistancesERj(ptr noundef nonnull align 8 dereferenceable(210678) %0, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %15, label %195

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %0, i64 207448
  %14 = load i32, ptr %13, align 8, !tbaa !34
  store i32 %14, ptr %5, align 4, !tbaa !35
  store i8 0, ptr %7, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %12, %10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %16 = getelementptr inbounds i8, ptr %0, i64 163896
  %17 = getelementptr inbounds i8, ptr %0, i64 36
  %18 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %19 = load i32, ptr %17, align 4, !tbaa !35
  %20 = load ptr, ptr %18, align 8, !tbaa !36
  %21 = getelementptr inbounds i8, ptr %20, i64 56
  %22 = load ptr, ptr %21, align 8
  %23 = call noundef i32 %22(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef -1, i32 noundef %19, i32 noundef 273)
  store i32 %23, ptr %6, align 16, !tbaa !35
  %24 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %25 = getelementptr inbounds i8, ptr %0, i64 40
  %26 = load i32, ptr %25, align 8, !tbaa !35
  %27 = load ptr, ptr %24, align 8, !tbaa !36
  %28 = getelementptr inbounds i8, ptr %27, i64 56
  %29 = load ptr, ptr %28, align 8
  %30 = call noundef i32 %29(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef -1, i32 noundef %26, i32 noundef 273)
  %31 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %30, ptr %31, align 4, !tbaa !35
  %32 = icmp ugt i32 %30, %23
  %spec.select = zext i1 %32 to i32
  %33 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %34 = getelementptr inbounds i8, ptr %0, i64 44
  %35 = load i32, ptr %34, align 4, !tbaa !35
  %36 = load ptr, ptr %33, align 8, !tbaa !36
  %37 = getelementptr inbounds i8, ptr %36, i64 56
  %38 = load ptr, ptr %37, align 8
  %39 = call noundef i32 %38(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef -1, i32 noundef %35, i32 noundef 273)
  %40 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %39, ptr %40, align 8, !tbaa !35
  %41 = zext i1 %32 to i64
  %42 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !35
  %44 = icmp ugt i32 %39, %43
  %.163.2 = select i1 %44, i32 2, i32 %spec.select
  %45 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %46 = getelementptr inbounds i8, ptr %0, i64 48
  %47 = load i32, ptr %46, align 8, !tbaa !35
  %48 = load ptr, ptr %45, align 8, !tbaa !36
  %49 = getelementptr inbounds i8, ptr %48, i64 56
  %50 = load ptr, ptr %49, align 8
  %51 = call noundef i32 %50(ptr noundef nonnull align 8 dereferenceable(8) %45, i32 noundef -1, i32 noundef %47, i32 noundef 273)
  %52 = getelementptr inbounds i8, ptr %6, i64 12
  store i32 %51, ptr %52, align 4, !tbaa !35
  %53 = zext nneg i32 %.163.2 to i64
  %54 = getelementptr inbounds [4 x i32], ptr %6, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !35
  %56 = icmp ugt i32 %51, %55
  %57 = call i32 @llvm.umax.i32(i32 %51, i32 %55)
  %.163.3 = select i1 %56, i32 3, i32 %.163.2
  %58 = getelementptr inbounds i8, ptr %0, i64 207444
  %59 = load i32, ptr %58, align 4, !tbaa !38
  %.not75 = icmp ult i32 %57, %59
  br i1 %.not75, label %63, label %60

60:                                               ; preds = %15
  store i32 %.163.3, ptr %2, align 4, !tbaa !35
  store i32 %57, ptr %3, align 4, !tbaa !35
  %61 = add i32 %57, -1
  %62 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %0, i32 noundef %61)
  br label %194

63:                                               ; preds = %15
  %64 = load i32, ptr %5, align 4, !tbaa !35
  %.not76 = icmp ult i32 %64, %59
  br i1 %.not76, label %.preheader, label %67

.preheader:                                       ; preds = %63
  %65 = icmp ugt i32 %64, 2
  br i1 %65, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %66 = getelementptr inbounds i8, ptr %0, i64 206344
  br label %75

67:                                               ; preds = %63
  %68 = getelementptr inbounds i8, ptr %0, i64 206344
  %69 = zext i32 %59 to i64
  %70 = getelementptr inbounds [274 x i32], ptr %68, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !35
  %72 = add i32 %71, 4
  store i32 %72, ptr %2, align 4, !tbaa !35
  store i32 %64, ptr %3, align 4, !tbaa !35
  %73 = add i32 %64, -1
  %74 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %0, i32 noundef %73)
  br label %194

75:                                               ; preds = %.lr.ph, %85
  %76 = phi i32 [ %64, %.lr.ph ], [ %86, %85 ]
  %77 = add i32 %76, -1
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds [274 x i32], ptr %66, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !35
  %81 = zext i32 %76 to i64
  %82 = getelementptr inbounds [274 x i32], ptr %66, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !35
  %84 = call noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef %80, i32 noundef %83)
  %.pre100.pre = load i32, ptr %5, align 4, !tbaa !35
  br i1 %84, label %85, label %._crit_edge

85:                                               ; preds = %75
  %86 = add i32 %.pre100.pre, -1
  store i32 %86, ptr %5, align 4, !tbaa !35
  %87 = icmp ugt i32 %86, 2
  br i1 %87, label %75, label %._crit_edge, !llvm.loop !39

._crit_edge:                                      ; preds = %85, %75, %.preheader
  %.pr = phi i32 [ %64, %.preheader ], [ %86, %85 ], [ %.pre100.pre, %75 ]
  %88 = icmp eq i32 %.pr, 2
  %89 = getelementptr inbounds i8, ptr %0, i64 206352
  %90 = load i32, ptr %89, align 8
  %91 = icmp ugt i32 %90, 127
  %or.cond83 = select i1 %88, i1 %91, i1 false
  br i1 %or.cond83, label %92, label %thread-pre-split

92:                                               ; preds = %._crit_edge
  store i32 1, ptr %5, align 4, !tbaa !35
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %._crit_edge, %92
  %93 = phi i32 [ 1, %92 ], [ %.pr, %._crit_edge ]
  %94 = getelementptr inbounds i8, ptr %0, i64 206344
  %95 = zext i32 %93 to i64
  %96 = getelementptr inbounds [274 x i32], ptr %94, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !35
  %98 = icmp ugt i32 %57, 1
  br i1 %98, label %99, label %108

99:                                               ; preds = %thread-pre-split
  %100 = add i32 %57, 1
  %.not77 = icmp ult i32 %100, %93
  br i1 %.not77, label %101, label %105

101:                                              ; preds = %99
  %102 = add i32 %57, 2
  %103 = icmp uge i32 %102, %93
  %104 = icmp ugt i32 %97, 4096
  %or.cond = select i1 %103, i1 %104, i1 false
  br i1 %or.cond, label %105, label %108

105:                                              ; preds = %101, %99
  store i32 %.163.3, ptr %2, align 4, !tbaa !35
  store i32 %57, ptr %3, align 4, !tbaa !35
  %106 = add i32 %57, -1
  %107 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %0, i32 noundef %106)
  br label %194

108:                                              ; preds = %101, %thread-pre-split
  %109 = icmp ugt i32 %93, 1
  br i1 %109, label %110, label %193

110:                                              ; preds = %108
  %111 = getelementptr inbounds i8, ptr %0, i64 207448
  %112 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder18ReadMatchDistancesERj(ptr noundef nonnull align 8 dereferenceable(210678) %0, ptr noundef nonnull align 4 dereferenceable(4) %111)
  %.not78 = icmp eq i32 %112, 0
  br i1 %.not78, label %113, label %194

113:                                              ; preds = %110
  %114 = load i32, ptr %111, align 8, !tbaa !34
  %115 = icmp ugt i32 %114, 1
  br i1 %115, label %116, label %146

116:                                              ; preds = %113
  %117 = load i32, ptr %5, align 4
  %.not79 = icmp ult i32 %114, %117
  br i1 %.not79, label %123, label %118

118:                                              ; preds = %116
  %119 = zext i32 %117 to i64
  %120 = getelementptr inbounds [274 x i32], ptr %94, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !35
  %122 = icmp ult i32 %121, %97
  br i1 %122, label %145, label %123

123:                                              ; preds = %118, %116
  %124 = add i32 %117, 1
  %125 = icmp eq i32 %114, %124
  br i1 %125, label %126, label %131

126:                                              ; preds = %123
  %127 = zext i32 %114 to i64
  %128 = getelementptr inbounds [274 x i32], ptr %94, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !35
  %130 = call noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef %97, i32 noundef %129)
  br i1 %130, label %._crit_edge101, label %145

._crit_edge101:                                   ; preds = %126
  %.pre102 = load i32, ptr %111, align 8, !tbaa !34
  %.pre103 = load i32, ptr %5, align 4
  %.pre = add i32 %.pre103, 1
  br label %131

131:                                              ; preds = %._crit_edge101, %123
  %.pre-phi = phi i32 [ %.pre, %._crit_edge101 ], [ %124, %123 ]
  %132 = phi i32 [ %.pre103, %._crit_edge101 ], [ %117, %123 ]
  %133 = phi i32 [ %.pre102, %._crit_edge101 ], [ %114, %123 ]
  %134 = icmp ugt i32 %133, %.pre-phi
  br i1 %134, label %145, label %135

135:                                              ; preds = %131
  %136 = add i32 %133, 1
  %137 = icmp uge i32 %136, %132
  %138 = icmp ugt i32 %132, 2
  %or.cond6 = and i1 %137, %138
  br i1 %or.cond6, label %139, label %146

139:                                              ; preds = %135
  %140 = add i32 %132, -1
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds [274 x i32], ptr %94, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !35
  %144 = call noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef %143, i32 noundef %97)
  br i1 %144, label %145, label %146

145:                                              ; preds = %139, %131, %126, %118
  store i8 1, ptr %7, align 8, !tbaa !5
  store i32 -1, ptr %2, align 4, !tbaa !35
  store i32 1, ptr %3, align 4, !tbaa !35
  br label %194

146:                                              ; preds = %139, %135, %113
  %147 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %148 = load i32, ptr %17, align 4, !tbaa !35
  %149 = load ptr, ptr %147, align 8, !tbaa !36
  %150 = getelementptr inbounds i8, ptr %149, i64 56
  %151 = load ptr, ptr %150, align 8
  %152 = call noundef i32 %151(ptr noundef nonnull align 8 dereferenceable(8) %147, i32 noundef -1, i32 noundef %148, i32 noundef 273)
  %153 = icmp ugt i32 %152, 1
  br i1 %153, label %154, label %157

154:                                              ; preds = %146
  %155 = add i32 %152, 1
  %156 = load i32, ptr %5, align 4, !tbaa !35
  %.not80 = icmp ult i32 %155, %156
  br i1 %.not80, label %157, label %192

157:                                              ; preds = %154, %146
  %158 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %159 = load i32, ptr %25, align 8, !tbaa !35
  %160 = load ptr, ptr %158, align 8, !tbaa !36
  %161 = getelementptr inbounds i8, ptr %160, i64 56
  %162 = load ptr, ptr %161, align 8
  %163 = call noundef i32 %162(ptr noundef nonnull align 8 dereferenceable(8) %158, i32 noundef -1, i32 noundef %159, i32 noundef 273)
  %164 = icmp ugt i32 %163, 1
  br i1 %164, label %165, label %168

165:                                              ; preds = %157
  %166 = add i32 %163, 1
  %167 = load i32, ptr %5, align 4, !tbaa !35
  %.not80.1 = icmp ult i32 %166, %167
  br i1 %.not80.1, label %168, label %192

168:                                              ; preds = %165, %157
  %169 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %170 = load i32, ptr %34, align 4, !tbaa !35
  %171 = load ptr, ptr %169, align 8, !tbaa !36
  %172 = getelementptr inbounds i8, ptr %171, i64 56
  %173 = load ptr, ptr %172, align 8
  %174 = call noundef i32 %173(ptr noundef nonnull align 8 dereferenceable(8) %169, i32 noundef -1, i32 noundef %170, i32 noundef 273)
  %175 = icmp ugt i32 %174, 1
  br i1 %175, label %176, label %179

176:                                              ; preds = %168
  %177 = add i32 %174, 1
  %178 = load i32, ptr %5, align 4, !tbaa !35
  %.not80.2 = icmp ult i32 %177, %178
  br i1 %.not80.2, label %179, label %192

179:                                              ; preds = %176, %168
  %180 = call noundef ptr @_ZNK9CMyComPtrI12IMatchFinderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %181 = load i32, ptr %46, align 8, !tbaa !35
  %182 = load ptr, ptr %180, align 8, !tbaa !36
  %183 = getelementptr inbounds i8, ptr %182, i64 56
  %184 = load ptr, ptr %183, align 8
  %185 = call noundef i32 %184(ptr noundef nonnull align 8 dereferenceable(8) %180, i32 noundef -1, i32 noundef %181, i32 noundef 273)
  %186 = icmp ult i32 %185, 2
  %.pre104 = load i32, ptr %5, align 4, !tbaa !35
  %187 = add i32 %185, 1
  %.not80.3 = icmp ult i32 %187, %.pre104
  %or.cond106 = select i1 %186, i1 true, i1 %.not80.3
  br i1 %or.cond106, label %188, label %192

188:                                              ; preds = %179
  %189 = add i32 %97, 4
  store i32 %189, ptr %2, align 4, !tbaa !35
  store i32 %.pre104, ptr %3, align 4, !tbaa !35
  %190 = add i32 %.pre104, -2
  %191 = call noundef i32 @_ZN9NCompress5NLZMA8CEncoder7MovePosEj(ptr noundef nonnull align 8 dereferenceable(210678) %0, i32 noundef %190)
  br label %194

192:                                              ; preds = %179, %176, %165, %154
  store i8 1, ptr %7, align 8, !tbaa !5
  store i32 -1, ptr %2, align 4, !tbaa !35
  store i32 1, ptr %3, align 4, !tbaa !35
  br label %194

193:                                              ; preds = %108
  store i32 -1, ptr %2, align 4, !tbaa !35
  store i32 1, ptr %3, align 4, !tbaa !35
  br label %194

194:                                              ; preds = %192, %105, %145, %188, %193, %110, %67, %60
  %.7 = phi i32 [ %62, %60 ], [ %74, %67 ], [ %107, %105 ], [ 0, %145 ], [ %191, %188 ], [ 0, %192 ], [ %112, %110 ], [ 0, %193 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %195

195:                                              ; preds = %10, %194
  %.8 = phi i32 [ %.7, %194 ], [ %11, %10 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  ret i32 %.8
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN9NCompress5NLZMAL10ChangePairEjj(i32 noundef, i32 noundef) local_unnamed_addr #3

; 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 = { 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 #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 = { 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 #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, !24, i64 207464}
!6 = !{!"_ZTSN9NCompress5NLZMA8CEncoderE", !7, i64 0, !9, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !16, i64 52, !14, i64 56, !18, i64 163896, !20, i64 163904, !14, i64 163984, !14, i64 164752, !14, i64 164800, !14, i64 164848, !14, i64 164896, !14, i64 164944, !14, i64 165712, !14, i64 166736, !25, i64 167192, !26, i64 167256, !26, i64 186788, !31, i64 206320, !14, i64 206344, !24, i64 207440, !24, i64 207441, !17, i64 207444, !17, i64 207448, !17, i64 207452, !17, i64 207456, !17, i64 207460, !24, i64 207464, !14, i64 207468, !14, i64 208492, !14, i64 210540, !17, i64 210604, !17, i64 210608, !17, i64 210612, !17, i64 210616, !17, i64 210620, !17, i64 210624, !17, i64 210628, !17, i64 210632, !17, i64 210636, !21, i64 210640, !21, i64 210648, !24, i64 210656, !19, i64 210664, !17, i64 210672, !24, i64 210676, !24, i64 210677}
!7 = !{!"_ZTS14ICompressCoder", !8, i64 0}
!8 = !{!"_ZTS8IUnknown"}
!9 = !{!"_ZTS21ICompressSetOutStream", !8, i64 0}
!10 = !{!"_ZTS27ICompressSetCoderProperties", !8, i64 0}
!11 = !{!"_ZTS29ICompressWriteCoderProperties", !8, i64 0}
!12 = !{!"_ZTSN9NCompress5NLZMA10CBaseStateE", !13, i64 0, !14, i64 1, !14, i64 4}
!13 = !{!"_ZTSN9NCompress5NLZMA6CStateE", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C++ TBAA"}
!16 = !{!"_ZTS13CMyUnknownImp", !17, i64 0}
!17 = !{!"int", !14, i64 0}
!18 = !{!"_ZTS9CMyComPtrI12IMatchFinderE", !19, i64 0}
!19 = !{!"any pointer", !14, i64 0}
!20 = !{!"_ZTSN9NCompress11NRangeCoder8CEncoderE", !17, i64 0, !14, i64 4, !21, i64 8, !17, i64 16, !22, i64 24}
!21 = !{!"long long", !14, i64 0}
!22 = !{!"_ZTS10COutBuffer", !19, i64 0, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !23, i64 24, !21, i64 32, !19, i64 40, !24, i64 48}
!23 = !{!"_ZTS9CMyComPtrI20ISequentialOutStreamE", !19, i64 0}
!24 = !{!"bool", !14, i64 0}
!25 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi4EEE", !14, i64 0}
!26 = !{!"_ZTSN9NCompress5NLZMA7NLength18CPriceTableEncoderE", !27, i64 0, !14, i64 2056, !17, i64 19464, !14, i64 19468}
!27 = !{!"_ZTSN9NCompress5NLZMA7NLength8CEncoderE", !28, i64 0, !28, i64 4, !14, i64 8, !14, i64 520, !30, i64 1032}
!28 = !{!"_ZTSN9NCompress11NRangeCoder11CBitEncoderILi5EEE", !29, i64 0}
!29 = !{!"_ZTSN9NCompress11NRangeCoder9CBitModelILi5EEE", !17, i64 0}
!30 = !{!"_ZTSN9NCompress11NRangeCoder15CBitTreeEncoderILi5ELi8EEE", !14, i64 0}
!31 = !{!"_ZTSN9NCompress5NLZMA15CLiteralEncoderE", !19, i64 0, !17, i64 8, !17, i64 12, !17, i64 16}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!6, !17, i64 207448}
!35 = !{!17, !17, i64 0}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !15, i64 0}
!38 = !{!6, !17, i64 207444}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


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