; 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.NHC3::CMatchFinderHC" = 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: mustprogress uwtable
define dso_local noundef i32 @_ZN4NHC314CMatchFinderHC15GetLongestMatchEPj(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %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
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %23 = getelementptr inbounds %class.CLZInWindow, ptr %22, i32 0, i32 8
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 6
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = add i32 %24, %26
  %28 = getelementptr inbounds i8, ptr %21, i64 16
  %29 = getelementptr inbounds %class.CLZInWindow, ptr %28, i32 0, i32 12
  %30 = load i32, ptr %29, align 4, !tbaa !21
  %31 = icmp ule i32 %27, %30
  br i1 %31, label %32, label %35

32:                                               ; preds = %2
  %33 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 6
  %34 = load i32, ptr %33, align 4, !tbaa !13
  store i32 %34, ptr %6, align 4, !tbaa !22
  br label %47

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

45:                                               ; preds = %35
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %277

46:                                               ; preds = %35
  br label %47

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

54:                                               ; preds = %47
  %55 = getelementptr inbounds i8, ptr %21, i64 16
  %56 = getelementptr inbounds %class.CLZInWindow, ptr %55, i32 0, i32 8
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 5
  %59 = load i32, ptr %58, align 8, !tbaa !23
  %60 = sub i32 %57, %59
  br label %62

61:                                               ; preds = %47
  br label %62

62:                                               ; preds = %61, %54
  %63 = phi i32 [ %60, %54 ], [ 0, %61 ]
  store i32 %63, ptr %8, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %64 = getelementptr inbounds i8, ptr %21, i64 16
  %65 = getelementptr inbounds %class.CLZInWindow, ptr %64, i32 0, i32 6
  %66 = load ptr, ptr %65, align 8, !tbaa !24
  %67 = getelementptr inbounds i8, ptr %21, i64 16
  %68 = getelementptr inbounds %class.CLZInWindow, ptr %67, i32 0, i32 8
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds i8, ptr %66, i64 %70
  store ptr %71, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = call noundef i32 @_ZN4NHC34HashEPKhRj(ptr noundef %72, ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i32 %73, ptr %12, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %74 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 7
  %75 = load ptr, ptr %74, align 8, !tbaa !25
  %76 = load i32, ptr %11, align 4, !tbaa !22
  %77 = add i32 65536, %76
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %75, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !22
  store i32 %80, ptr %13, align 4, !tbaa !22
  %81 = getelementptr inbounds i8, ptr %21, i64 16
  %82 = getelementptr inbounds %class.CLZInWindow, ptr %81, i32 0, i32 8
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 7
  %85 = load ptr, ptr %84, align 8, !tbaa !25
  %86 = load i32, ptr %11, align 4, !tbaa !22
  %87 = add i32 65536, %86
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %85, i64 %88
  store i32 %83, ptr %89, align 4, !tbaa !22
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds i32, ptr %90, i64 2
  store i32 -1, ptr %91, align 4, !tbaa !22
  %92 = load i32, ptr %13, align 4, !tbaa !22
  %93 = load i32, ptr %8, align 4, !tbaa !22
  %94 = icmp ugt i32 %92, %93
  br i1 %94, label %95, label %119

95:                                               ; preds = %62
  %96 = getelementptr inbounds i8, ptr %21, i64 16
  %97 = getelementptr inbounds %class.CLZInWindow, ptr %96, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !24
  %99 = load i32, ptr %13, align 4, !tbaa !22
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds i8, ptr %98, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !26
  %103 = zext i8 %102 to i32
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 0
  %106 = load i8, ptr %105, align 1, !tbaa !26
  %107 = zext i8 %106 to i32
  %108 = icmp eq i32 %103, %107
  br i1 %108, label %109, label %118

109:                                              ; preds = %95
  %110 = getelementptr inbounds i8, ptr %21, i64 16
  %111 = getelementptr inbounds %class.CLZInWindow, ptr %110, i32 0, i32 8
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = load i32, ptr %13, align 4, !tbaa !22
  %114 = sub i32 %112, %113
  %115 = sub i32 %114, 1
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds i32, ptr %116, i64 2
  store i32 %115, ptr %117, align 4, !tbaa !22
  store i32 2, ptr %10, align 4, !tbaa !22
  br label %118

118:                                              ; preds = %109, %95
  br label %119

119:                                              ; preds = %118, %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %120 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 7
  %121 = load ptr, ptr %120, align 8, !tbaa !25
  %122 = load i32, ptr %12, align 4, !tbaa !22
  %123 = zext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %121, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !22
  store i32 %125, ptr %14, align 4, !tbaa !22
  %126 = getelementptr inbounds i8, ptr %21, i64 16
  %127 = getelementptr inbounds %class.CLZInWindow, ptr %126, i32 0, i32 8
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 7
  %130 = load ptr, ptr %129, align 8, !tbaa !25
  %131 = load i32, ptr %12, align 4, !tbaa !22
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %130, i64 %132
  store i32 %128, ptr %133, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %134 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 7
  %135 = load ptr, ptr %134, align 8, !tbaa !25
  %136 = getelementptr inbounds i32, ptr %135, i64 66560
  store ptr %136, ptr %15, align 8, !tbaa !5
  %137 = load i32, ptr %14, align 4, !tbaa !22
  %138 = load ptr, ptr %15, align 8, !tbaa !5
  %139 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 4
  %140 = load i32, ptr %139, align 4, !tbaa !27
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr %138, i64 %141
  store i32 %137, ptr %142, align 4, !tbaa !22
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds i32, ptr %143, i64 3
  store i32 -1, ptr %144, align 4, !tbaa !22
  %145 = load i32, ptr %6, align 4, !tbaa !22
  %146 = icmp eq i32 %145, 0
  br i1 %146, label %147, label %169

147:                                              ; preds = %119
  %148 = load i32, ptr %14, align 4, !tbaa !22
  %149 = load i32, ptr %8, align 4, !tbaa !22
  %150 = icmp ugt i32 %148, %149
  br i1 %150, label %151, label %168

151:                                              ; preds = %147
  br label %152

152:                                              ; preds = %155, %151
  %153 = load i32, ptr %10, align 4, !tbaa !22
  %154 = icmp ult i32 %153, 0
  br i1 %154, label %155, label %167

155:                                              ; preds = %152
  %156 = getelementptr inbounds i8, ptr %21, i64 16
  %157 = getelementptr inbounds %class.CLZInWindow, ptr %156, i32 0, i32 8
  %158 = load i32, ptr %157, align 4, !tbaa !9
  %159 = load i32, ptr %14, align 4, !tbaa !22
  %160 = sub i32 %158, %159
  %161 = sub i32 %160, 1
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = load i32, ptr %10, align 4, !tbaa !22
  %164 = add i32 %163, 1
  store i32 %164, ptr %10, align 4, !tbaa !22
  %165 = zext i32 %164 to i64
  %166 = getelementptr inbounds i32, ptr %162, i64 %165
  store i32 %161, ptr %166, align 4, !tbaa !22
  br label %152, !llvm.loop !28

167:                                              ; preds = %152
  br label %168

168:                                              ; preds = %167, %147
  br label %261

169:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %170 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 8
  %171 = load i32, ptr %170, align 8, !tbaa !30
  store i32 %171, ptr %16, align 4, !tbaa !22
  br label %172

172:                                              ; preds = %256, %169
  %173 = load i32, ptr %14, align 4, !tbaa !22
  %174 = load i32, ptr %8, align 4, !tbaa !22
  %175 = icmp ule i32 %173, %174
  br i1 %175, label %176, label %177

176:                                              ; preds = %172
  br label %260

177:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %178 = getelementptr inbounds i8, ptr %21, i64 16
  %179 = getelementptr inbounds %class.CLZInWindow, ptr %178, i32 0, i32 6
  %180 = load ptr, ptr %179, align 8, !tbaa !24
  %181 = load i32, ptr %14, align 4, !tbaa !22
  %182 = zext i32 %181 to i64
  %183 = getelementptr inbounds i8, ptr %180, i64 %182
  store ptr %183, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !22
  br label %184

184:                                              ; preds = %200, %177
  %185 = load ptr, ptr %17, align 8, !tbaa !5
  %186 = load i32, ptr %18, align 4, !tbaa !22
  %187 = zext i32 %186 to i64
  %188 = getelementptr inbounds i8, ptr %185, i64 %187
  %189 = load i8, ptr %188, align 1, !tbaa !26
  %190 = zext i8 %189 to i32
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = load i32, ptr %18, align 4, !tbaa !22
  %193 = zext i32 %192 to i64
  %194 = getelementptr inbounds i8, ptr %191, i64 %193
  %195 = load i8, ptr %194, align 1, !tbaa !26
  %196 = zext i8 %195 to i32
  %197 = icmp ne i32 %190, %196
  br i1 %197, label %198, label %199

198:                                              ; preds = %184
  br label %205

199:                                              ; preds = %184
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %18, align 4, !tbaa !22
  %202 = add i32 %201, 1
  store i32 %202, ptr %18, align 4, !tbaa !22
  %203 = load i32, ptr %6, align 4, !tbaa !22
  %204 = icmp ne i32 %202, %203
  br i1 %204, label %184, label %205, !llvm.loop !31

205:                                              ; preds = %200, %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %206 = getelementptr inbounds i8, ptr %21, i64 16
  %207 = getelementptr inbounds %class.CLZInWindow, ptr %206, i32 0, i32 8
  %208 = load i32, ptr %207, align 4, !tbaa !9
  %209 = load i32, ptr %14, align 4, !tbaa !22
  %210 = sub i32 %208, %209
  store i32 %210, ptr %19, align 4, !tbaa !22
  br label %211

211:                                              ; preds = %215, %205
  %212 = load i32, ptr %10, align 4, !tbaa !22
  %213 = load i32, ptr %18, align 4, !tbaa !22
  %214 = icmp ult i32 %212, %213
  br i1 %214, label %215, label %223

215:                                              ; preds = %211
  %216 = load i32, ptr %19, align 4, !tbaa !22
  %217 = sub i32 %216, 1
  %218 = load ptr, ptr %5, align 8, !tbaa !5
  %219 = load i32, ptr %10, align 4, !tbaa !22
  %220 = add i32 %219, 1
  store i32 %220, ptr %10, align 4, !tbaa !22
  %221 = zext i32 %220 to i64
  %222 = getelementptr inbounds i32, ptr %218, i64 %221
  store i32 %217, ptr %222, align 4, !tbaa !22
  br label %211, !llvm.loop !32

223:                                              ; preds = %211
  %224 = load i32, ptr %18, align 4, !tbaa !22
  %225 = load i32, ptr %6, align 4, !tbaa !22
  %226 = icmp eq i32 %224, %225
  br i1 %226, label %227, label %228

227:                                              ; preds = %223
  store i32 4, ptr %7, align 4
  br label %253

228:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %229 = load i32, ptr %19, align 4, !tbaa !22
  %230 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 4
  %231 = load i32, ptr %230, align 4, !tbaa !27
  %232 = icmp ule i32 %229, %231
  br i1 %232, label %233, label %238

233:                                              ; preds = %228
  %234 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 4
  %235 = load i32, ptr %234, align 4, !tbaa !27
  %236 = load i32, ptr %19, align 4, !tbaa !22
  %237 = sub i32 %235, %236
  br label %246

238:                                              ; preds = %228
  %239 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 4
  %240 = load i32, ptr %239, align 4, !tbaa !27
  %241 = load i32, ptr %19, align 4, !tbaa !22
  %242 = sub i32 %240, %241
  %243 = getelementptr inbounds %"class.NHC3::CMatchFinderHC", ptr %21, i32 0, i32 5
  %244 = load i32, ptr %243, align 8, !tbaa !23
  %245 = add i32 %242, %244
  br label %246

246:                                              ; preds = %238, %233
  %247 = phi i32 [ %237, %233 ], [ %245, %238 ]
  store i32 %247, ptr %20, align 4, !tbaa !22
  %248 = load ptr, ptr %15, align 8, !tbaa !5
  %249 = load i32, ptr %20, align 4, !tbaa !22
  %250 = zext i32 %249 to i64
  %251 = getelementptr inbounds i32, ptr %248, i64 %250
  %252 = load i32, ptr %251, align 4, !tbaa !22
  store i32 %252, ptr %14, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  store i32 0, ptr %7, align 4
  br label %253

253:                                              ; preds = %246, %227
  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
  %254 = load i32, ptr %7, align 4
  switch i32 %254, label %279 [
    i32 0, label %255
    i32 4, label %260
  ]

255:                                              ; preds = %253
  br label %256

256:                                              ; preds = %255
  %257 = load i32, ptr %16, align 4, !tbaa !22
  %258 = add i32 %257, -1
  store i32 %258, ptr %16, align 4, !tbaa !22
  %259 = icmp ne i32 %258, 0
  br i1 %259, label %172, label %260, !llvm.loop !33

260:                                              ; preds = %256, %253, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %261

261:                                              ; preds = %260, %168
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = getelementptr inbounds i32, ptr %262, i64 3
  %264 = load i32, ptr %263, align 4, !tbaa !22
  %265 = load ptr, ptr %5, align 8, !tbaa !5
  %266 = getelementptr inbounds i32, ptr %265, i64 2
  %267 = load i32, ptr %266, align 4, !tbaa !22
  %268 = icmp ult i32 %264, %267
  br i1 %268, label %269, label %275

269:                                              ; preds = %261
  %270 = load ptr, ptr %5, align 8, !tbaa !5
  %271 = getelementptr inbounds i32, ptr %270, i64 3
  %272 = load i32, ptr %271, align 4, !tbaa !22
  %273 = load ptr, ptr %5, align 8, !tbaa !5
  %274 = getelementptr inbounds i32, ptr %273, i64 2
  store i32 %272, ptr %274, align 4, !tbaa !22
  br label %275

275:                                              ; preds = %269, %261
  %276 = load i32, ptr %10, align 4, !tbaa !22
  store i32 %276, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %277

277:                                              ; preds = %275, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %278 = load i32, ptr %3, align 4
  ret i32 %278

279:                                              ; preds = %253
  unreachable
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = !{!"_ZTSN4NHC314CMatchFinderHCE", !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 = !{!7, !7, i64 0}
!27 = !{!14, !11, i64 92}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!14, !11, i64 112}
!31 = distinct !{!31, !29}
!32 = distinct !{!32, !29}
!33 = distinct !{!33, !29}


; 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
define dso_local noundef i32 @_ZN4NHC314CMatchFinderHC15GetLongestMatchEPj(ptr nocapture noundef nonnull readonly align 8 dereferenceable(128) %0, ptr nocapture noundef %1) unnamed_addr #1 align 2 {
  %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 = %2
  %12 = sub i32 %10, %5
  %13 = icmp ult i32 %12, 3
  br i1 %13, label %96, label %14

14:                                               ; preds = %2, %11
  %.053 = phi i32 [ %12, %11 ], [ %7, %2 ]
  %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 %3) #4
  %21 = call noundef i32 @_ZN4NHC34HashEPKhRj(ptr noundef %20, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %22 = getelementptr inbounds i8, ptr %0, i64 104
  %23 = load ptr, ptr %22, align 8, !tbaa !23
  %24 = load i32, ptr %3, align 4, !tbaa !24
  %25 = add i32 %24, 65536
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr %23, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !24
  %29 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %29, ptr %27, align 4, !tbaa !24
  %30 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 -1, ptr %30, align 4, !tbaa !24
  %31 = icmp ugt i32 %28, %spec.select
  br i1 %31, label %32, label %43

32:                                               ; preds = %14
  %33 = load ptr, ptr %17, align 8, !tbaa !22
  %34 = zext i32 %28 to i64
  %35 = getelementptr inbounds i8, ptr %33, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !25
  %37 = load i8, ptr %20, align 1, !tbaa !25
  %38 = icmp eq i8 %36, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %32
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = xor i32 %28, -1
  %42 = add i32 %40, %41
  store i32 %42, ptr %30, align 4, !tbaa !24
  br label %43

43:                                               ; preds = %32, %39, %14
  %.057 = phi i32 [ 2, %39 ], [ 0, %32 ], [ 0, %14 ]
  %44 = zext i32 %21 to i64
  %45 = getelementptr inbounds i32, ptr %23, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !24
  %47 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %47, ptr %45, align 4, !tbaa !24
  %48 = getelementptr inbounds i8, ptr %23, i64 266240
  %49 = getelementptr inbounds i8, ptr %0, i64 92
  %50 = load i32, ptr %49, align 4, !tbaa !26
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %48, i64 %51
  store i32 %46, ptr %52, align 4, !tbaa !24
  %53 = getelementptr inbounds i8, ptr %1, i64 12
  store i32 -1, ptr %53, align 4, !tbaa !24
  %54 = icmp eq i32 %.053, 0
  br i1 %54, label %.thread.thread, label %55

55:                                               ; preds = %43
  %56 = getelementptr inbounds i8, ptr %0, i64 112
  %57 = load i32, ptr %56, align 8, !tbaa !27
  %58 = load ptr, ptr %17, align 8
  br label %59

59:                                               ; preds = %83, %55
  %.059 = phi i32 [ %46, %55 ], [ %91, %83 ]
  %.2 = phi i32 [ %.057, %55 ], [ %.3.lcssa, %83 ]
  %.056 = phi i32 [ %57, %55 ], [ %92, %83 ]
  %.not74 = icmp ugt i32 %.059, %spec.select
  br i1 %.not74, label %60, label %.thread

60:                                               ; preds = %59
  %61 = zext i32 %.059 to i64
  %62 = getelementptr inbounds i8, ptr %58, i64 %61
  br label %63

63:                                               ; preds = %69, %60
  %.054 = phi i32 [ 0, %60 ], [ %70, %69 ]
  %64 = zext i32 %.054 to i64
  %65 = getelementptr inbounds i8, ptr %62, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !25
  %67 = getelementptr inbounds i8, ptr %20, i64 %64
  %68 = load i8, ptr %67, align 1, !tbaa !25
  %.not75 = icmp eq i8 %66, %68
  br i1 %.not75, label %69, label %71

69:                                               ; preds = %63
  %70 = add nuw i32 %.054, 1
  %.not76 = icmp eq i32 %70, %.053
  br i1 %.not76, label %71, label %63, !llvm.loop !28

71:                                               ; preds = %63, %69
  %.1 = phi i32 [ %.054, %63 ], [ %.053, %69 ]
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sub i32 %72, %.059
  %74 = icmp ult i32 %.2, %.1
  br i1 %74, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %71
  %75 = add i32 %73, -1
  %76 = zext i32 %.2 to i64
  %wide.trip.count = zext i32 %.1 to i64
  %77 = sub nsw i64 %wide.trip.count, %76
  %min.iters.check = icmp ult i64 %77, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %77, -8
  %ind.end = add nsw i64 %n.vec, %76
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %75, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %invariant.gep = getelementptr i32, ptr %1, i64 %76
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %gep = getelementptr i32, ptr %invariant.gep, i64 %index
  %78 = getelementptr i8, ptr %gep, i64 4
  %79 = getelementptr i8, ptr %gep, i64 20
  store <4 x i32> %broadcast.splat, ptr %78, align 4, !tbaa !24
  store <4 x i32> %broadcast.splat, ptr %79, align 4, !tbaa !24
  %index.next = add nuw i64 %index, 8
  %80 = icmp eq i64 %index.next, %n.vec
  br i1 %80, label %middle.block, label %vector.body, !llvm.loop !30

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %77, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ %76, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %81 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next
  store i32 %75, ptr %81, align 4, !tbaa !24
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !33

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %71
  %.3.lcssa = phi i32 [ %.2, %71 ], [ %.1, %middle.block ], [ %.1, %scalar.ph ]
  %82 = icmp eq i32 %.1, %.053
  br i1 %82, label %.thread, label %83

83:                                               ; preds = %._crit_edge
  %84 = load i32, ptr %49, align 4, !tbaa !26
  %.not77 = icmp ugt i32 %73, %84
  %85 = sub i32 %84, %73
  %86 = load i32, ptr %15, align 8
  %87 = select i1 %.not77, i32 %86, i32 0
  %88 = add i32 %85, %87
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %48, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !24
  %92 = add i32 %.056, -1
  %.not78 = icmp eq i32 %92, 0
  br i1 %.not78, label %.thread, label %59, !llvm.loop !34

.thread:                                          ; preds = %._crit_edge, %59, %83
  %.5.ph = phi i32 [ %.2, %59 ], [ %.3.lcssa, %83 ], [ %.3.lcssa, %._crit_edge ]
  %.pre = load i32, ptr %53, align 4, !tbaa !24
  %93 = load i32, ptr %30, align 4, !tbaa !24
  %94 = icmp ult i32 %.pre, %93
  br i1 %94, label %95, label %.thread.thread

95:                                               ; preds = %.thread
  store i32 %.pre, ptr %30, align 4, !tbaa !24
  br label %.thread.thread

.thread.thread:                                   ; preds = %43, %95, %.thread
  %.587 = phi i32 [ %.5.ph, %95 ], [ %.5.ph, %.thread ], [ %.057, %43 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %96

96:                                               ; preds = %11, %.thread.thread
  %.0 = phi i32 [ %.587, %.thread.thread ], [ 0, %11 ]
  ret i32 %.0
}

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

; 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 = { 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 = { 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 #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 = !{!"_ZTSN4NHC314CMatchFinderHCE", !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 = !{!8, !8, i64 0}
!26 = !{!13, !10, i64 92}
!27 = !{!13, !10, i64 112}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29, !31, !32}
!31 = !{!"llvm.loop.isvectorized", i32 1}
!32 = !{!"llvm.loop.unroll.runtime.disable"}
!33 = distinct !{!33, !29, !32, !31}
!34 = distinct !{!34, !29}


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