; 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.CLZInWindow = type { ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32, i32, i32 }
%"class.NBT4::CMatchFinderBinTree" = type { %struct.IMatchFinder, %struct.IMatchFinderSetCallback, %class.CLZInWindow, %class.CMyUnknownImp, i32, i32, i32, ptr, i32, %class.CMyComPtr }
%struct.IMatchFinder = type { %struct.IInWindowStream }
%struct.IInWindowStream = type { %struct.IUnknown }
%struct.IUnknown = type { ptr }
%struct.IMatchFinderSetCallback = type { %struct.IUnknown }
%class.CMyUnknownImp = type { i32 }
%class.CMyComPtr = type { ptr }

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5MyMinIjET_S0_S0_(i32 noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4NBT44HashEPKhRjS2_(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4NBT419CMatchFinderBinTree17DummyLongestMatchEv(ptr noundef nonnull align 8 dereferenceable(128) %0) unnamed_addr #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %22 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %24 = getelementptr inbounds %class.CLZInWindow, ptr %23, i32 0, i32 8
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 6
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = add i32 %25, %27
  %29 = getelementptr inbounds i8, ptr %22, i64 16
  %30 = getelementptr inbounds %class.CLZInWindow, ptr %29, i32 0, i32 12
  %31 = load i32, ptr %30, align 4, !tbaa !21
  %32 = icmp ule i32 %28, %31
  br i1 %32, label %33, label %36

33:                                               ; preds = %1
  %34 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 6
  %35 = load i32, ptr %34, align 4, !tbaa !13
  store i32 %35, ptr %3, align 4, !tbaa !22
  br label %48

36:                                               ; preds = %1
  %37 = getelementptr inbounds i8, ptr %22, i64 16
  %38 = getelementptr inbounds %class.CLZInWindow, ptr %37, i32 0, i32 12
  %39 = load i32, ptr %38, align 4, !tbaa !21
  %40 = getelementptr inbounds i8, ptr %22, i64 16
  %41 = getelementptr inbounds %class.CLZInWindow, ptr %40, i32 0, i32 8
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = sub i32 %39, %42
  store i32 %43, ptr %3, align 4, !tbaa !22
  %44 = load i32, ptr %3, align 4, !tbaa !22
  %45 = icmp ult i32 %44, 4
  br i1 %45, label %46, label %47

46:                                               ; preds = %36
  store i32 1, ptr %4, align 4
  br label %253

47:                                               ; preds = %36
  br label %48

48:                                               ; preds = %47, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %49 = getelementptr inbounds i8, ptr %22, i64 16
  %50 = getelementptr inbounds %class.CLZInWindow, ptr %49, i32 0, i32 8
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 5
  %53 = load i32, ptr %52, align 8, !tbaa !23
  %54 = icmp ugt i32 %51, %53
  br i1 %54, label %55, label %62

55:                                               ; preds = %48
  %56 = getelementptr inbounds i8, ptr %22, i64 16
  %57 = getelementptr inbounds %class.CLZInWindow, ptr %56, i32 0, i32 8
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 5
  %60 = load i32, ptr %59, align 8, !tbaa !23
  %61 = sub i32 %58, %60
  br label %63

62:                                               ; preds = %48
  br label %63

63:                                               ; preds = %62, %55
  %64 = phi i32 [ %61, %55 ], [ 0, %62 ]
  store i32 %64, ptr %5, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %65 = getelementptr inbounds i8, ptr %22, i64 16
  %66 = getelementptr inbounds %class.CLZInWindow, ptr %65, i32 0, i32 6
  %67 = load ptr, ptr %66, align 8, !tbaa !24
  %68 = getelementptr inbounds i8, ptr %22, i64 16
  %69 = getelementptr inbounds %class.CLZInWindow, ptr %68, i32 0, i32 8
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %67, i64 %71
  store ptr %72, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = call noundef i32 @_ZN4NBT44HashEPKhRjS2_(ptr noundef %73, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i32 %74, ptr %9, align 4, !tbaa !22
  %75 = getelementptr inbounds i8, ptr %22, i64 16
  %76 = getelementptr inbounds %class.CLZInWindow, ptr %75, i32 0, i32 8
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 7
  %79 = load ptr, ptr %78, align 8, !tbaa !25
  %80 = load i32, ptr %8, align 4, !tbaa !22
  %81 = add i32 1049600, %80
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %79, i64 %82
  store i32 %77, ptr %83, align 4, !tbaa !22
  %84 = getelementptr inbounds i8, ptr %22, i64 16
  %85 = getelementptr inbounds %class.CLZInWindow, ptr %84, i32 0, i32 8
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 7
  %88 = load ptr, ptr %87, align 8, !tbaa !25
  %89 = load i32, ptr %7, align 4, !tbaa !22
  %90 = add i32 1048576, %89
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr %88, i64 %91
  store i32 %86, ptr %92, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %93 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 7
  %94 = load ptr, ptr %93, align 8, !tbaa !25
  %95 = load i32, ptr %9, align 4, !tbaa !22
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !22
  store i32 %98, ptr %10, align 4, !tbaa !22
  %99 = getelementptr inbounds i8, ptr %22, i64 16
  %100 = getelementptr inbounds %class.CLZInWindow, ptr %99, i32 0, i32 8
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 7
  %103 = load ptr, ptr %102, align 8, !tbaa !25
  %104 = load i32, ptr %9, align 4, !tbaa !22
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr %103, i64 %105
  store i32 %101, ptr %106, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %107 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 7
  %108 = load ptr, ptr %107, align 8, !tbaa !25
  %109 = getelementptr inbounds i32, ptr %108, i64 1311744
  store ptr %109, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 4
  %112 = load i32, ptr %111, align 4, !tbaa !26
  %113 = shl i32 %112, 1
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %110, i64 %114
  %116 = getelementptr inbounds i32, ptr %115, i64 1
  store ptr %116, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 4
  %119 = load i32, ptr %118, align 4, !tbaa !26
  %120 = shl i32 %119, 1
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds i32, ptr %117, i64 %121
  store ptr %122, ptr %13, align 8, !tbaa !5
  %123 = load i32, ptr %3, align 4, !tbaa !22
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %249

125:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !22
  store i32 0, ptr %14, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %126 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 8
  %127 = load i32, ptr %126, align 8, !tbaa !27
  store i32 %127, ptr %16, align 4, !tbaa !22
  br label %128

128:                                              ; preds = %244, %125
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %10, align 4, !tbaa !22
  %131 = load i32, ptr %5, align 4, !tbaa !22
  %132 = icmp ule i32 %130, %131
  br i1 %132, label %137, label %133

133:                                              ; preds = %129
  %134 = load i32, ptr %16, align 4, !tbaa !22
  %135 = add i32 %134, -1
  store i32 %135, ptr %16, align 4, !tbaa !22
  %136 = icmp eq i32 %134, 0
  br i1 %136, label %137, label %138

137:                                              ; preds = %133, %129
  br label %245

138:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %139 = getelementptr inbounds i8, ptr %22, i64 16
  %140 = getelementptr inbounds %class.CLZInWindow, ptr %139, i32 0, i32 6
  %141 = load ptr, ptr %140, align 8, !tbaa !24
  %142 = load i32, ptr %10, align 4, !tbaa !22
  %143 = zext i32 %142 to i64
  %144 = getelementptr inbounds i8, ptr %141, i64 %143
  store ptr %144, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %145 = load i32, ptr %14, align 4, !tbaa !22
  %146 = load i32, ptr %15, align 4, !tbaa !22
  %147 = call noundef i32 @_Z5MyMinIjET_S0_S0_(i32 noundef %145, i32 noundef %146)
  store i32 %147, ptr %18, align 4, !tbaa !22
  br label %148

148:                                              ; preds = %164, %138
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  %150 = load i32, ptr %18, align 4, !tbaa !22
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds i8, ptr %149, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !28
  %154 = zext i8 %153 to i32
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = load i32, ptr %18, align 4, !tbaa !22
  %157 = zext i32 %156 to i64
  %158 = getelementptr inbounds i8, ptr %155, i64 %157
  %159 = load i8, ptr %158, align 1, !tbaa !28
  %160 = zext i8 %159 to i32
  %161 = icmp ne i32 %154, %160
  br i1 %161, label %162, label %163

162:                                              ; preds = %148
  br label %169

163:                                              ; preds = %148
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %18, align 4, !tbaa !22
  %166 = add i32 %165, 1
  store i32 %166, ptr %18, align 4, !tbaa !22
  %167 = load i32, ptr %3, align 4, !tbaa !22
  %168 = icmp ne i32 %166, %167
  br i1 %168, label %148, label %169, !llvm.loop !29

169:                                              ; preds = %164, %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %170 = getelementptr inbounds i8, ptr %22, i64 16
  %171 = getelementptr inbounds %class.CLZInWindow, ptr %170, i32 0, i32 8
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = load i32, ptr %10, align 4, !tbaa !22
  %174 = sub i32 %172, %173
  store i32 %174, ptr %19, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %175 = load i32, ptr %19, align 4, !tbaa !22
  %176 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 4
  %177 = load i32, ptr %176, align 4, !tbaa !26
  %178 = icmp ule i32 %175, %177
  br i1 %178, label %179, label %184

179:                                              ; preds = %169
  %180 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 4
  %181 = load i32, ptr %180, align 4, !tbaa !26
  %182 = load i32, ptr %19, align 4, !tbaa !22
  %183 = sub i32 %181, %182
  br label %192

184:                                              ; preds = %169
  %185 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 4
  %186 = load i32, ptr %185, align 4, !tbaa !26
  %187 = load i32, ptr %19, align 4, !tbaa !22
  %188 = sub i32 %186, %187
  %189 = getelementptr inbounds %"class.NBT4::CMatchFinderBinTree", ptr %22, i32 0, i32 5
  %190 = load i32, ptr %189, align 8, !tbaa !23
  %191 = add i32 %188, %190
  br label %192

192:                                              ; preds = %184, %179
  %193 = phi i32 [ %183, %179 ], [ %191, %184 ]
  store i32 %193, ptr %20, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = load i32, ptr %20, align 4, !tbaa !22
  %196 = shl i32 %195, 1
  %197 = zext i32 %196 to i64
  %198 = getelementptr inbounds i32, ptr %194, i64 %197
  store ptr %198, ptr %21, align 8, !tbaa !5
  %199 = load i32, ptr %18, align 4, !tbaa !22
  %200 = load i32, ptr %3, align 4, !tbaa !22
  %201 = icmp ne i32 %199, %200
  br i1 %201, label %202, label %232

202:                                              ; preds = %192
  %203 = load ptr, ptr %17, align 8, !tbaa !5
  %204 = load i32, ptr %18, align 4, !tbaa !22
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds i8, ptr %203, i64 %205
  %207 = load i8, ptr %206, align 1, !tbaa !28
  %208 = zext i8 %207 to i32
  %209 = load ptr, ptr %6, align 8, !tbaa !5
  %210 = load i32, ptr %18, align 4, !tbaa !22
  %211 = zext i32 %210 to i64
  %212 = getelementptr inbounds i8, ptr %209, i64 %211
  %213 = load i8, ptr %212, align 1, !tbaa !28
  %214 = zext i8 %213 to i32
  %215 = icmp slt i32 %208, %214
  br i1 %215, label %216, label %224

216:                                              ; preds = %202
  %217 = load i32, ptr %10, align 4, !tbaa !22
  %218 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 %217, ptr %218, align 4, !tbaa !22
  %219 = load ptr, ptr %21, align 8, !tbaa !5
  %220 = getelementptr inbounds i32, ptr %219, i64 1
  store ptr %220, ptr %13, align 8, !tbaa !5
  %221 = load ptr, ptr %13, align 8, !tbaa !5
  %222 = load i32, ptr %221, align 4, !tbaa !22
  store i32 %222, ptr %10, align 4, !tbaa !22
  %223 = load i32, ptr %18, align 4, !tbaa !22
  store i32 %223, ptr %15, align 4, !tbaa !22
  br label %231

224:                                              ; preds = %202
  %225 = load i32, ptr %10, align 4, !tbaa !22
  %226 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %225, ptr %226, align 4, !tbaa !22
  %227 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %227, ptr %12, align 8, !tbaa !5
  %228 = load ptr, ptr %12, align 8, !tbaa !5
  %229 = load i32, ptr %228, align 4, !tbaa !22
  store i32 %229, ptr %10, align 4, !tbaa !22
  %230 = load i32, ptr %18, align 4, !tbaa !22
  store i32 %230, ptr %14, align 4, !tbaa !22
  br label %231

231:                                              ; preds = %224, %216
  br label %241

232:                                              ; preds = %192
  %233 = load ptr, ptr %21, align 8, !tbaa !5
  %234 = getelementptr inbounds i32, ptr %233, i64 0
  %235 = load i32, ptr %234, align 4, !tbaa !22
  %236 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 %235, ptr %236, align 4, !tbaa !22
  %237 = load ptr, ptr %21, align 8, !tbaa !5
  %238 = getelementptr inbounds i32, ptr %237, i64 1
  %239 = load i32, ptr %238, align 4, !tbaa !22
  %240 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %239, ptr %240, align 4, !tbaa !22
  store i32 1, ptr %4, align 4
  br label %242

241:                                              ; preds = %231
  store i32 0, ptr %4, align 4
  br label %242

242:                                              ; preds = %241, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  %243 = load i32, ptr %4, align 4
  switch i32 %243, label %246 [
    i32 0, label %244
  ]

244:                                              ; preds = %242
  br label %128, !llvm.loop !31

245:                                              ; preds = %137
  store i32 0, ptr %4, align 4
  br label %246

246:                                              ; preds = %245, %242
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %247 = load i32, ptr %4, align 4
  switch i32 %247, label %252 [
    i32 0, label %248
  ]

248:                                              ; preds = %246
  br label %249

249:                                              ; preds = %248, %63
  %250 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %250, align 4, !tbaa !22
  %251 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %251, align 4, !tbaa !22
  store i32 0, ptr %4, align 4
  br label %252

252:                                              ; preds = %249, %246
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %253

253:                                              ; preds = %252, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %254 = load i32, ptr %4, align 4
  switch i32 %254, label %256 [
    i32 0, label %255
    i32 1, label %255
  ]

255:                                              ; preds = %253, %253
  ret void

256:                                              ; preds = %253
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !11, i64 52}
!10 = !{!"_ZTS11CLZInWindow", !6, i64 8, !6, i64 16, !11, i64 24, !12, i64 28, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !11, i64 100}
!14 = !{!"_ZTSN4NBT419CMatchFinderBinTreeE", !15, i64 0, !18, i64 8, !10, i64 16, !19, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !6, i64 104, !11, i64 112, !20, i64 120}
!15 = !{!"_ZTS12IMatchFinder", !16, i64 0}
!16 = !{!"_ZTS15IInWindowStream", !17, i64 0}
!17 = !{!"_ZTS8IUnknown"}
!18 = !{!"_ZTS23IMatchFinderSetCallback", !17, i64 0}
!19 = !{!"_ZTS13CMyUnknownImp", !11, i64 0}
!20 = !{!"_ZTS9CMyComPtrI20IMatchFinderCallbackE", !6, i64 0}
!21 = !{!10, !11, i64 68}
!22 = !{!11, !11, i64 0}
!23 = !{!14, !11, i64 96}
!24 = !{!10, !6, i64 40}
!25 = !{!14, !6, i64 104}
!26 = !{!14, !11, i64 92}
!27 = !{!14, !11, i64 112}
!28 = !{!7, !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5MyMinIjET_S0_S0_(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4NBT44HashEPKhRjS2_(ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4NBT419CMatchFinderBinTree17DummyLongestMatchEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0) unnamed_addr #2 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 68
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 100
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = add i32 %7, %5
  %9 = getelementptr inbounds i8, ptr %0, i64 84
  %10 = load i32, ptr %9, align 4, !tbaa !20
  %.not = icmp ugt i32 %8, %10
  br i1 %.not, label %11, label %14

11:                                               ; preds = %1
  %12 = sub i32 %10, %5
  %13 = icmp ult i32 %12, 4
  br i1 %13, label %88, label %14

14:                                               ; preds = %1, %11
  %.0 = phi i32 [ %12, %11 ], [ %7, %1 ]
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load i32, ptr %15, align 8, !tbaa !21
  %spec.select = tail call i32 @llvm.usub.sat.i32(i32 %5, i32 %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  %18 = load ptr, ptr %17, align 8, !tbaa !22
  %19 = zext i32 %5 to i64
  %20 = getelementptr inbounds i8, ptr %18, i64 %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %21 = call noundef i32 @_ZN4NBT44HashEPKhRjS2_(ptr noundef %20, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  %24 = load ptr, ptr %23, align 8, !tbaa !23
  %25 = load i32, ptr %3, align 4, !tbaa !24
  %26 = add i32 %25, 1049600
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr %24, i64 %27
  store i32 %22, ptr %28, align 4, !tbaa !24
  %29 = load i32, ptr %2, align 4, !tbaa !24
  %30 = add i32 %29, 1048576
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %24, i64 %31
  store i32 %22, ptr %32, align 4, !tbaa !24
  %33 = zext i32 %21 to i64
  %34 = getelementptr inbounds i32, ptr %24, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !24
  %36 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %36, ptr %34, align 4, !tbaa !24
  %37 = getelementptr inbounds i8, ptr %24, i64 5246976
  %38 = getelementptr inbounds i8, ptr %0, i64 92
  %39 = load i32, ptr %38, align 4, !tbaa !25
  %40 = shl i32 %39, 1
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %37, i64 %41
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  %.not80 = icmp ne i32 %.0, 0
  %.not8197 = icmp ugt i32 %35, %spec.select
  %or.cond = select i1 %.not80, i1 %.not8197, i1 false
  br i1 %or.cond, label %.lr.ph.preheader, label %.thread91

.lr.ph.preheader:                                 ; preds = %14
  %44 = getelementptr inbounds i8, ptr %0, i64 112
  %45 = load i32, ptr %44, align 8
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %82
  %.051103 = phi i32 [ %.152, %82 ], [ %35, %.lr.ph.preheader ]
  %.055102 = phi ptr [ %.156, %82 ], [ %43, %.lr.ph.preheader ]
  %.058101 = phi i32 [ %46, %82 ], [ %45, %.lr.ph.preheader ]
  %.059100 = phi i32 [ %.160, %82 ], [ 0, %.lr.ph.preheader ]
  %.06299 = phi i32 [ %.163, %82 ], [ 0, %.lr.ph.preheader ]
  %.06598 = phi ptr [ %.166, %82 ], [ %42, %.lr.ph.preheader ]
  %46 = add i32 %.058101, -1
  %47 = icmp eq i32 %.058101, 0
  br i1 %47, label %.thread91, label %48

48:                                               ; preds = %.lr.ph
  %49 = load ptr, ptr %17, align 8, !tbaa !22
  %50 = zext i32 %.051103 to i64
  %51 = getelementptr inbounds i8, ptr %49, i64 %50
  %52 = call noundef i32 @_Z5MyMinIjET_S0_S0_(i32 noundef %.06299, i32 noundef %.059100)
  br label %53

53:                                               ; preds = %59, %48
  %.053 = phi i32 [ %52, %48 ], [ %60, %59 ]
  %54 = zext i32 %.053 to i64
  %55 = getelementptr inbounds i8, ptr %51, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !26
  %57 = getelementptr inbounds i8, ptr %20, i64 %54
  %58 = load i8, ptr %57, align 1, !tbaa !26
  %.not82 = icmp eq i8 %56, %58
  br i1 %.not82, label %59, label %61

59:                                               ; preds = %53
  %60 = add i32 %.053, 1
  %.not83 = icmp eq i32 %60, %.0
  br i1 %.not83, label %61, label %53, !llvm.loop !27

61:                                               ; preds = %53, %59
  %.154 = phi i32 [ %.053, %53 ], [ %.0, %59 ]
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sub i32 %62, %.051103
  %64 = load i32, ptr %38, align 4, !tbaa !25
  %.not84 = icmp ugt i32 %63, %64
  %65 = sub i32 %64, %63
  %66 = load i32, ptr %15, align 8
  %67 = select i1 %.not84, i32 %66, i32 0
  %68 = add i32 %65, %67
  %69 = shl i32 %68, 1
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %37, i64 %70
  %.not85.not = icmp eq i32 %.154, %.0
  br i1 %.not85.not, label %83, label %72

72:                                               ; preds = %61
  %73 = zext i32 %.154 to i64
  %74 = getelementptr inbounds i8, ptr %51, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !26
  %76 = getelementptr inbounds i8, ptr %20, i64 %73
  %77 = load i8, ptr %76, align 1, !tbaa !26
  %78 = icmp ult i8 %75, %77
  br i1 %78, label %79, label %81

79:                                               ; preds = %72
  store i32 %.051103, ptr %.06598, align 4, !tbaa !24
  %80 = getelementptr inbounds i8, ptr %71, i64 4
  br label %82

81:                                               ; preds = %72
  store i32 %.051103, ptr %.055102, align 4, !tbaa !24
  br label %82

82:                                               ; preds = %81, %79
  %.166 = phi ptr [ %80, %79 ], [ %.06598, %81 ]
  %.163 = phi i32 [ %.06299, %79 ], [ %.154, %81 ]
  %.160 = phi i32 [ %.154, %79 ], [ %.059100, %81 ]
  %.156 = phi ptr [ %.055102, %79 ], [ %71, %81 ]
  %.152.in = phi ptr [ %80, %79 ], [ %71, %81 ]
  %.152 = load i32, ptr %.152.in, align 4, !tbaa !24
  %.not81 = icmp ugt i32 %.152, %spec.select
  br i1 %.not81, label %.lr.ph, label %.thread91

83:                                               ; preds = %61
  %84 = load i32, ptr %71, align 4, !tbaa !24
  store i32 %84, ptr %.06598, align 4, !tbaa !24
  %85 = getelementptr inbounds i8, ptr %71, i64 4
  %86 = load i32, ptr %85, align 4, !tbaa !24
  store i32 %86, ptr %.055102, align 4, !tbaa !24
  br label %87

.thread91:                                        ; preds = %82, %.lr.ph, %14
  %.469 = phi ptr [ %42, %14 ], [ %.166, %82 ], [ %.06598, %.lr.ph ]
  %.4 = phi ptr [ %43, %14 ], [ %.156, %82 ], [ %.055102, %.lr.ph ]
  store i32 0, ptr %.4, align 4, !tbaa !24
  store i32 0, ptr %.469, align 4, !tbaa !24
  br label %87

87:                                               ; preds = %83, %.thread91
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  br label %88

88:                                               ; preds = %11, %87
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !10, i64 52}
!6 = !{!"_ZTS11CLZInWindow", !7, i64 8, !7, i64 16, !10, i64 24, !11, i64 28, !7, i64 32, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!13, !10, i64 100}
!13 = !{!"_ZTSN4NBT419CMatchFinderBinTreeE", !14, i64 0, !17, i64 8, !6, i64 16, !18, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !7, i64 104, !10, i64 112, !19, i64 120}
!14 = !{!"_ZTS12IMatchFinder", !15, i64 0}
!15 = !{!"_ZTS15IInWindowStream", !16, i64 0}
!16 = !{!"_ZTS8IUnknown"}
!17 = !{!"_ZTS23IMatchFinderSetCallback", !16, i64 0}
!18 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!19 = !{!"_ZTS9CMyComPtrI20IMatchFinderCallbackE", !7, i64 0}
!20 = !{!6, !10, i64 68}
!21 = !{!13, !10, i64 96}
!22 = !{!6, !7, i64 40}
!23 = !{!13, !7, i64 104}
!24 = !{!10, !10, i64 0}
!25 = !{!13, !10, i64 92}
!26 = !{!8, !8, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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