; 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.NPat2R::CPatricia" = type { %struct.IMatchFinder, %struct.IMatchFinderSetCallback, %class.CMyUnknownImp, %class.CLZInWindow, i32, i32, ptr, ptr, i32, i32, i8, i8, i32, ptr, %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.CLZInWindow = type { ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32, i32, i32 }
%class.CMyComPtr = type { ptr }
%"union.NPat2R::CDescendant" = type { i32 }
%"struct.NPat2R::CNode" = type { i32, i32, %union.anon.3 }
%union.anon.3 = type { [4 x %"union.NPat2R::CDescendant"] }

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6NPat2R9CPatricia11RemoveMatchEv(ptr noundef nonnull align 8 dereferenceable(152) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %25 = load ptr, ptr %2, align 8
  %26 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 10
  %27 = load i8, ptr %26, align 8, !tbaa !9, !range !20, !noundef !21
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %55

29:                                               ; preds = %1
  %30 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 5
  %31 = load i32, ptr %30, align 4, !tbaa !22
  %32 = sub i32 %31, 1
  %33 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 4
  %34 = load i32, ptr %33, align 8, !tbaa !23
  %35 = sub i32 %32, %34
  %36 = load ptr, ptr %25, align 8, !tbaa !24
  %37 = getelementptr inbounds ptr, ptr %36, i64 6
  %38 = load ptr, ptr %37, align 8
  %39 = call noundef zeroext i8 %38(ptr noundef nonnull align 8 dereferenceable(152) %25, i32 noundef %35)
  %40 = zext i8 %39 to i32
  %41 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 5
  %42 = load i32, ptr %41, align 4, !tbaa !22
  %43 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 4
  %44 = load i32, ptr %43, align 8, !tbaa !23
  %45 = sub i32 %42, %44
  %46 = load ptr, ptr %25, align 8, !tbaa !24
  %47 = getelementptr inbounds ptr, ptr %46, i64 6
  %48 = load ptr, ptr %47, align 8
  %49 = call noundef zeroext i8 %48(ptr noundef nonnull align 8 dereferenceable(152) %25, i32 noundef %45)
  %50 = zext i8 %49 to i32
  %51 = icmp eq i32 %40, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %29
  br label %367

53:                                               ; preds = %29
  %54 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 10
  store i8 0, ptr %54, align 8, !tbaa !9
  br label %55

55:                                               ; preds = %53, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %56 = getelementptr inbounds i8, ptr %25, i64 24
  %57 = getelementptr inbounds %class.CLZInWindow, ptr %56, i32 0, i32 8
  %58 = load i32, ptr %57, align 4, !tbaa !26
  %59 = add i32 %58, 2
  %60 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 4
  %61 = load i32, ptr %60, align 8, !tbaa !23
  %62 = sub i32 %59, %61
  store i32 %62, ptr %3, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %63 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 4
  %64 = load i32, ptr %63, align 8, !tbaa !23
  %65 = sub i32 1, %64
  %66 = load ptr, ptr %25, align 8, !tbaa !24
  %67 = getelementptr inbounds ptr, ptr %66, i64 6
  %68 = load ptr, ptr %67, align 8
  %69 = call noundef zeroext i8 %68(ptr noundef nonnull align 8 dereferenceable(152) %25, i32 noundef %65)
  %70 = zext i8 %69 to i32
  %71 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 4
  %72 = load i32, ptr %71, align 8, !tbaa !23
  %73 = sub i32 0, %72
  %74 = load ptr, ptr %25, align 8, !tbaa !24
  %75 = getelementptr inbounds ptr, ptr %74, i64 6
  %76 = load ptr, ptr %75, align 8
  %77 = call noundef zeroext i8 %76(ptr noundef nonnull align 8 dereferenceable(152) %25, i32 noundef %73)
  %78 = zext i8 %77 to i32
  %79 = shl i32 %78, 8
  %80 = or i32 %70, %79
  store i32 %80, ptr %4, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %81 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 6
  %82 = load ptr, ptr %81, align 8, !tbaa !28
  %83 = load i32, ptr %4, align 4, !tbaa !27
  %84 = zext i32 %83 to i64
  %85 = getelementptr inbounds %"union.NPat2R::CDescendant", ptr %82, i64 %84
  store ptr %85, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %86)
  br i1 %87, label %88, label %89

88:                                               ; preds = %55
  store i32 1, ptr %6, align 4
  br label %365

89:                                               ; preds = %55
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %90)
  br i1 %91, label %92, label %101

92:                                               ; preds = %89
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 4, !tbaa !29
  %95 = load i32, ptr %3, align 4, !tbaa !27
  %96 = add i32 %95, -2147483648
  %97 = icmp eq i32 %94, %96
  br i1 %97, label %98, label %100

98:                                               ; preds = %92
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN6NPat2R11CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %99)
  br label %100

100:                                              ; preds = %98, %92
  store i32 1, ptr %6, align 4
  br label %365

101:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %102 = getelementptr inbounds i8, ptr %25, i64 24
  %103 = getelementptr inbounds %class.CLZInWindow, ptr %102, i32 0, i32 6
  %104 = load ptr, ptr %103, align 8, !tbaa !30
  %105 = load i32, ptr %3, align 4, !tbaa !27
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds i8, ptr %104, i64 %106
  store ptr %107, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #4
  store i8 0, ptr %10, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %108, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %109 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 7
  %110 = load ptr, ptr %109, align 8, !tbaa !31
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = load i32, ptr %111, align 4, !tbaa !29
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %110, i64 %113
  store ptr %114, ptr %12, align 8, !tbaa !5
  br label %115

115:                                              ; preds = %189, %101
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %9, align 4, !tbaa !27
  %118 = icmp eq i32 %117, 0
  br i1 %118, label %119, label %123

119:                                              ; preds = %116
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i32 1
  store ptr %121, ptr %8, align 8, !tbaa !5
  %122 = load i8, ptr %120, align 1, !tbaa !29
  store i8 %122, ptr %10, align 1, !tbaa !29
  store i32 8, ptr %9, align 4, !tbaa !27
  br label %123

123:                                              ; preds = %119, %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !32
  store i32 %126, ptr %13, align 4, !tbaa !27
  %127 = load i32, ptr %13, align 4, !tbaa !27
  %128 = icmp ugt i32 %127, 0
  br i1 %128, label %129, label %156

129:                                              ; preds = %123
  %130 = load i32, ptr %9, align 4, !tbaa !27
  %131 = load i32, ptr %13, align 4, !tbaa !27
  %132 = icmp ule i32 %130, %131
  br i1 %132, label %133, label %147

133:                                              ; preds = %129
  %134 = load i32, ptr %9, align 4, !tbaa !27
  %135 = load i32, ptr %13, align 4, !tbaa !27
  %136 = sub i32 %135, %134
  store i32 %136, ptr %13, align 4, !tbaa !27
  %137 = load i32, ptr %13, align 4, !tbaa !27
  %138 = udiv i32 %137, 8
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = zext i32 %138 to i64
  %141 = getelementptr inbounds i8, ptr %139, i64 %140
  store ptr %141, ptr %8, align 8, !tbaa !5
  %142 = load i32, ptr %13, align 4, !tbaa !27
  %143 = urem i32 %142, 8
  store i32 %143, ptr %13, align 4, !tbaa !27
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds i8, ptr %144, i32 1
  store ptr %145, ptr %8, align 8, !tbaa !5
  %146 = load i8, ptr %144, align 1, !tbaa !29
  store i8 %146, ptr %10, align 1, !tbaa !29
  store i32 8, ptr %9, align 4, !tbaa !27
  br label %147

147:                                              ; preds = %133, %129
  %148 = load i32, ptr %13, align 4, !tbaa !27
  %149 = load i8, ptr %10, align 1, !tbaa !29
  %150 = zext i8 %149 to i32
  %151 = ashr i32 %150, %148
  %152 = trunc i32 %151 to i8
  store i8 %152, ptr %10, align 1, !tbaa !29
  %153 = load i32, ptr %13, align 4, !tbaa !27
  %154 = load i32, ptr %9, align 4, !tbaa !27
  %155 = sub i32 %154, %153
  store i32 %155, ptr %9, align 4, !tbaa !27
  br label %156

156:                                              ; preds = %147, %123
  %157 = load i8, ptr %10, align 1, !tbaa !29
  %158 = zext i8 %157 to i32
  %159 = and i32 %158, 3
  store i32 %159, ptr %7, align 4, !tbaa !27
  %160 = load i32, ptr %9, align 4, !tbaa !27
  %161 = sub i32 %160, 2
  store i32 %161, ptr %9, align 4, !tbaa !27
  %162 = load i8, ptr %10, align 1, !tbaa !29
  %163 = zext i8 %162 to i32
  %164 = ashr i32 %163, 2
  %165 = trunc i32 %164 to i8
  store i8 %165, ptr %10, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %166 = load ptr, ptr %12, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %166, i32 0, i32 2
  %168 = load i32, ptr %7, align 4, !tbaa !27
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %167, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !29
  store i32 %171, ptr %14, align 4, !tbaa !27
  %172 = load i32, ptr %14, align 4, !tbaa !27
  %173 = icmp ult i32 %172, 2147483647
  br i1 %173, label %174, label %185

174:                                              ; preds = %156
  %175 = load ptr, ptr %12, align 8, !tbaa !5
  %176 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %175, i32 0, i32 2
  %177 = load i32, ptr %7, align 4, !tbaa !27
  %178 = zext i32 %177 to i64
  %179 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %176, i64 0, i64 %178
  store ptr %179, ptr %11, align 8, !tbaa !5
  %180 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 7
  %181 = load ptr, ptr %180, align 8, !tbaa !31
  %182 = load i32, ptr %14, align 4, !tbaa !27
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %181, i64 %183
  store ptr %184, ptr %12, align 8, !tbaa !5
  br label %186

185:                                              ; preds = %156
  store i32 3, ptr %6, align 4
  br label %187

186:                                              ; preds = %174
  store i32 0, ptr %6, align 4
  br label %187

187:                                              ; preds = %186, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %188 = load i32, ptr %6, align 4
  switch i32 %188, label %368 [
    i32 0, label %189
    i32 3, label %190
  ]

189:                                              ; preds = %187
  br label %115, !llvm.loop !34

190:                                              ; preds = %187
  %191 = load ptr, ptr %12, align 8, !tbaa !5
  %192 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %191, i32 0, i32 2
  %193 = load i32, ptr %7, align 4, !tbaa !27
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %192, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !29
  %197 = load i32, ptr %3, align 4, !tbaa !27
  %198 = add i32 %197, -2147483648
  %199 = icmp ne i32 %196, %198
  br i1 %199, label %200, label %240

200:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %201 = getelementptr inbounds i8, ptr %25, i64 24
  %202 = getelementptr inbounds %class.CLZInWindow, ptr %201, i32 0, i32 6
  %203 = load ptr, ptr %202, align 8, !tbaa !30
  %204 = getelementptr inbounds i8, ptr %25, i64 24
  %205 = getelementptr inbounds %class.CLZInWindow, ptr %204, i32 0, i32 8
  %206 = load i32, ptr %205, align 4, !tbaa !26
  %207 = zext i32 %206 to i64
  %208 = getelementptr inbounds i8, ptr %203, i64 %207
  %209 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 4
  %210 = load i32, ptr %209, align 8, !tbaa !23
  %211 = zext i32 %210 to i64
  %212 = sub i64 0, %211
  %213 = getelementptr inbounds i8, ptr %208, i64 %212
  store ptr %213, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %214 = load ptr, ptr %15, align 8, !tbaa !5
  %215 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 5
  %216 = load i32, ptr %215, align 4, !tbaa !22
  %217 = zext i32 %216 to i64
  %218 = getelementptr inbounds i8, ptr %214, i64 %217
  store ptr %218, ptr %16, align 8, !tbaa !5
  br label %219

219:                                              ; preds = %234, %200
  %220 = load ptr, ptr %15, align 8, !tbaa !5
  %221 = load ptr, ptr %16, align 8, !tbaa !5
  %222 = icmp ult ptr %220, %221
  br i1 %222, label %223, label %237

223:                                              ; preds = %219
  %224 = load ptr, ptr %15, align 8, !tbaa !5
  %225 = load i8, ptr %224, align 1, !tbaa !29
  %226 = zext i8 %225 to i32
  %227 = load ptr, ptr %15, align 8, !tbaa !5
  %228 = getelementptr inbounds i8, ptr %227, i64 1
  %229 = load i8, ptr %228, align 1, !tbaa !29
  %230 = zext i8 %229 to i32
  %231 = icmp ne i32 %226, %230
  br i1 %231, label %232, label %233

232:                                              ; preds = %223
  store i32 1, ptr %6, align 4
  br label %239

233:                                              ; preds = %223
  br label %234

234:                                              ; preds = %233
  %235 = load ptr, ptr %15, align 8, !tbaa !5
  %236 = getelementptr inbounds i8, ptr %235, i32 1
  store ptr %236, ptr %15, align 8, !tbaa !5
  br label %219, !llvm.loop !36

237:                                              ; preds = %219
  %238 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 10
  store i8 1, ptr %238, align 8, !tbaa !9
  store i32 1, ptr %6, align 4
  br label %239

239:                                              ; preds = %237, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %364

240:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !27
  br label %241

241:                                              ; preds = %264, %240
  %242 = load i32, ptr %19, align 4, !tbaa !27
  %243 = icmp ult i32 %242, 4
  br i1 %243, label %244, label %267

244:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %245 = load ptr, ptr %12, align 8, !tbaa !5
  %246 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %245, i32 0, i32 2
  %247 = load i32, ptr %19, align 4, !tbaa !27
  %248 = zext i32 %247 to i64
  %249 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %246, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !29
  store i32 %250, ptr %20, align 4, !tbaa !27
  %251 = load i32, ptr %20, align 4, !tbaa !27
  %252 = icmp ult i32 %251, 2147483647
  br i1 %252, label %253, label %256

253:                                              ; preds = %244
  %254 = load i32, ptr %17, align 4, !tbaa !27
  %255 = add i32 %254, 1
  store i32 %255, ptr %17, align 4, !tbaa !27
  br label %263

256:                                              ; preds = %244
  %257 = load i32, ptr %20, align 4, !tbaa !27
  %258 = icmp ugt i32 %257, 2147483647
  br i1 %258, label %259, label %262

259:                                              ; preds = %256
  %260 = load i32, ptr %18, align 4, !tbaa !27
  %261 = add i32 %260, 1
  store i32 %261, ptr %18, align 4, !tbaa !27
  br label %262

262:                                              ; preds = %259, %256
  br label %263

263:                                              ; preds = %262, %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %264

264:                                              ; preds = %263
  %265 = load i32, ptr %19, align 4, !tbaa !27
  %266 = add i32 %265, 1
  store i32 %266, ptr %19, align 4, !tbaa !27
  br label %241, !llvm.loop !37

267:                                              ; preds = %241
  %268 = load i32, ptr %18, align 4, !tbaa !27
  %269 = sub i32 %268, 1
  store i32 %269, ptr %18, align 4, !tbaa !27
  %270 = load i32, ptr %17, align 4, !tbaa !27
  %271 = load i32, ptr %18, align 4, !tbaa !27
  %272 = add i32 %270, %271
  %273 = icmp ugt i32 %272, 1
  br i1 %273, label %274, label %280

274:                                              ; preds = %267
  %275 = load ptr, ptr %12, align 8, !tbaa !5
  %276 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %275, i32 0, i32 2
  %277 = load i32, ptr %7, align 4, !tbaa !27
  %278 = zext i32 %277 to i64
  %279 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %276, i64 0, i64 %278
  call void @_ZN6NPat2R11CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %279)
  store i32 1, ptr %6, align 4
  br label %363

280:                                              ; preds = %267
  %281 = load i32, ptr %17, align 4, !tbaa !27
  %282 = icmp eq i32 %281, 1
  br i1 %282, label %283, label %327

283:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !27
  br label %284

284:                                              ; preds = %296, %283
  %285 = load i32, ptr %21, align 4, !tbaa !27
  %286 = icmp ult i32 %285, 4
  br i1 %286, label %287, label %299

287:                                              ; preds = %284
  %288 = load ptr, ptr %12, align 8, !tbaa !5
  %289 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %288, i32 0, i32 2
  %290 = load i32, ptr %21, align 4, !tbaa !27
  %291 = zext i32 %290 to i64
  %292 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %289, i64 0, i64 %291
  %293 = call noundef zeroext i1 @_ZNK6NPat2R11CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %292)
  br i1 %293, label %294, label %295

294:                                              ; preds = %287
  br label %299

295:                                              ; preds = %287
  br label %296

296:                                              ; preds = %295
  %297 = load i32, ptr %21, align 4, !tbaa !27
  %298 = add i32 %297, 1
  store i32 %298, ptr %21, align 4, !tbaa !27
  br label %284, !llvm.loop !38

299:                                              ; preds = %294, %284
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %300 = load ptr, ptr %12, align 8, !tbaa !5
  %301 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %300, i32 0, i32 2
  %302 = load i32, ptr %21, align 4, !tbaa !27
  %303 = zext i32 %302 to i64
  %304 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %301, i64 0, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !29
  store i32 %305, ptr %22, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %306 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 7
  %307 = load ptr, ptr %306, align 8, !tbaa !31
  %308 = load i32, ptr %22, align 4, !tbaa !27
  %309 = zext i32 %308 to i64
  %310 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %307, i64 %309
  store ptr %310, ptr %23, align 8, !tbaa !5
  %311 = load ptr, ptr %12, align 8, !tbaa !5
  %312 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %311, i32 0, i32 1
  %313 = load i32, ptr %312, align 4, !tbaa !32
  %314 = add i32 %313, 2
  %315 = load ptr, ptr %23, align 8, !tbaa !5
  %316 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %315, i32 0, i32 1
  %317 = load i32, ptr %316, align 4, !tbaa !32
  %318 = add i32 %317, %314
  store i32 %318, ptr %316, align 4, !tbaa !32
  %319 = load ptr, ptr %23, align 8, !tbaa !5
  %320 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %320, ptr align 4 %319, i64 24, i1 false), !tbaa.struct !39
  %321 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 8
  %322 = load i32, ptr %321, align 8, !tbaa !40
  %323 = load ptr, ptr %23, align 8, !tbaa !5
  %324 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %323, i32 0, i32 2
  store i32 %322, ptr %324, align 4, !tbaa !29
  %325 = load i32, ptr %22, align 4, !tbaa !27
  %326 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 8
  store i32 %325, ptr %326, align 8, !tbaa !40
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %363

327:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !27
  store i32 0, ptr %19, align 4, !tbaa !27
  br label %328

328:                                              ; preds = %350, %327
  %329 = load i32, ptr %19, align 4, !tbaa !27
  %330 = icmp ult i32 %329, 4
  br i1 %330, label %331, label %353

331:                                              ; preds = %328
  %332 = load ptr, ptr %12, align 8, !tbaa !5
  %333 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %332, i32 0, i32 2
  %334 = load i32, ptr %19, align 4, !tbaa !27
  %335 = zext i32 %334 to i64
  %336 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %333, i64 0, i64 %335
  %337 = call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %336)
  br i1 %337, label %338, label %349

338:                                              ; preds = %331
  %339 = load i32, ptr %19, align 4, !tbaa !27
  %340 = load i32, ptr %7, align 4, !tbaa !27
  %341 = icmp ne i32 %339, %340
  br i1 %341, label %342, label %349

342:                                              ; preds = %338
  %343 = load ptr, ptr %12, align 8, !tbaa !5
  %344 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %343, i32 0, i32 2
  %345 = load i32, ptr %19, align 4, !tbaa !27
  %346 = zext i32 %345 to i64
  %347 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %344, i64 0, i64 %346
  %348 = load i32, ptr %347, align 4, !tbaa !29
  store i32 %348, ptr %24, align 4, !tbaa !27
  br label %353

349:                                              ; preds = %338, %331
  br label %350

350:                                              ; preds = %349
  %351 = load i32, ptr %19, align 4, !tbaa !27
  %352 = add i32 %351, 1
  store i32 %352, ptr %19, align 4, !tbaa !27
  br label %328, !llvm.loop !41

353:                                              ; preds = %342, %328
  %354 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 8
  %355 = load i32, ptr %354, align 8, !tbaa !40
  %356 = load ptr, ptr %12, align 8, !tbaa !5
  %357 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %356, i32 0, i32 2
  store i32 %355, ptr %357, align 4, !tbaa !29
  %358 = load ptr, ptr %11, align 8, !tbaa !5
  %359 = load i32, ptr %358, align 4, !tbaa !27
  %360 = getelementptr inbounds %"class.NPat2R::CPatricia", ptr %25, i32 0, i32 8
  store i32 %359, ptr %360, align 8, !tbaa !40
  %361 = load i32, ptr %24, align 4, !tbaa !27
  %362 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %361, ptr %362, align 4, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  store i32 0, ptr %6, align 4
  br label %363

363:                                              ; preds = %353, %299, %274
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %364

364:                                              ; preds = %363, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %365

365:                                              ; preds = %364, %100, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %366 = load i32, ptr %6, align 4
  switch i32 %366, label %368 [
    i32 0, label %367
    i32 1, label %367
  ]

367:                                              ; preds = %365, %365, %52
  ret void

368:                                              ; preds = %365, %187
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !18, i64 128}
!10 = !{!"_ZTSN6NPat2R9CPatriciaE", !11, i64 0, !14, i64 8, !15, i64 16, !17, i64 24, !16, i64 96, !16, i64 100, !6, i64 104, !6, i64 112, !16, i64 120, !16, i64 124, !18, i64 128, !18, i64 129, !16, i64 132, !6, i64 136, !19, i64 144}
!11 = !{!"_ZTS12IMatchFinder", !12, i64 0}
!12 = !{!"_ZTS15IInWindowStream", !13, i64 0}
!13 = !{!"_ZTS8IUnknown"}
!14 = !{!"_ZTS23IMatchFinderSetCallback", !13, i64 0}
!15 = !{!"_ZTS13CMyUnknownImp", !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTS11CLZInWindow", !6, i64 8, !6, i64 16, !16, i64 24, !18, i64 28, !6, i64 32, !6, i64 40, !16, i64 48, !16, i64 52, !16, i64 56, !16, i64 60, !16, i64 64, !16, i64 68}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS9CMyComPtrI20IMatchFinderCallbackE", !6, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!10, !16, i64 100}
!23 = !{!10, !16, i64 96}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !8, i64 0}
!26 = !{!17, !16, i64 52}
!27 = !{!16, !16, i64 0}
!28 = !{!10, !6, i64 104}
!29 = !{!7, !7, i64 0}
!30 = !{!17, !6, i64 40}
!31 = !{!10, !6, i64 112}
!32 = !{!33, !16, i64 4}
!33 = !{!"_ZTSN6NPat2R5CNodeE", !16, i64 0, !16, i64 4, !7, i64 8}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = distinct !{!36, !35}
!37 = distinct !{!37, !35}
!38 = distinct !{!38, !35}
!39 = !{i64 0, i64 4, !27, i64 4, i64 4, !27, i64 8, i64 16, !29}
!40 = !{!10, !16, i64 120}
!41 = distinct !{!41, !35}


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

%"union.NPat2R::CDescendant" = type { i32 }
%"struct.NPat2R::CNode" = type { i32, i32, %union.anon.3 }
%union.anon.3 = type { [4 x %"union.NPat2R::CDescendant"] }

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6NPat2R11CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6NPat2R9CPatricia11RemoveMatchEv(ptr noundef nonnull align 8 dereferenceable(152) %0) local_unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 128
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !19, !noundef !20
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %5, label %25

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 100
  %7 = load i32, ptr %6, align 4, !tbaa !21
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  %9 = load i32, ptr %8, align 8, !tbaa !22
  %10 = xor i32 %9, -1
  %11 = add i32 %7, %10
  %12 = load ptr, ptr %0, align 8, !tbaa !23
  %13 = getelementptr inbounds i8, ptr %12, i64 48
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef zeroext i8 %14(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 noundef %11)
  %16 = load i32, ptr %6, align 4, !tbaa !21
  %17 = load i32, ptr %8, align 8, !tbaa !22
  %18 = sub i32 %16, %17
  %19 = load ptr, ptr %0, align 8, !tbaa !23
  %20 = getelementptr inbounds i8, ptr %19, i64 48
  %21 = load ptr, ptr %20, align 8
  %22 = tail call noundef zeroext i8 %21(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 noundef %18)
  %23 = icmp eq i8 %15, %22
  br i1 %23, label %.loopexit116, label %24

24:                                               ; preds = %5
  store i8 0, ptr %2, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %24, %1
  %26 = getelementptr inbounds i8, ptr %0, i64 76
  %27 = load i32, ptr %26, align 4, !tbaa !25
  %28 = add i32 %27, 2
  %29 = getelementptr inbounds i8, ptr %0, i64 96
  %30 = load i32, ptr %29, align 8, !tbaa !22
  %31 = sub i32 %28, %30
  %32 = sub i32 1, %30
  %33 = load ptr, ptr %0, align 8, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %33, i64 48
  %35 = load ptr, ptr %34, align 8
  %36 = tail call noundef zeroext i8 %35(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 noundef %32)
  %37 = zext i8 %36 to i64
  %38 = load i32, ptr %29, align 8, !tbaa !22
  %39 = sub i32 0, %38
  %40 = load ptr, ptr %0, align 8, !tbaa !23
  %41 = getelementptr inbounds i8, ptr %40, i64 48
  %42 = load ptr, ptr %41, align 8
  %43 = tail call noundef zeroext i8 %42(ptr noundef nonnull align 8 dereferenceable(152) %0, i32 noundef %39)
  %44 = zext i8 %43 to i64
  %45 = shl nuw nsw i64 %44, 8
  %46 = or disjoint i64 %45, %37
  %47 = getelementptr inbounds i8, ptr %0, i64 104
  %48 = load ptr, ptr %47, align 8, !tbaa !26
  %49 = getelementptr inbounds %"union.NPat2R::CDescendant", ptr %48, i64 %46
  %50 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  br i1 %50, label %.loopexit116, label %51

51:                                               ; preds = %25
  %52 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  br i1 %52, label %53, label %58

53:                                               ; preds = %51
  %54 = load i32, ptr %49, align 4, !tbaa !27
  %55 = xor i32 %54, %31
  %56 = icmp eq i32 %55, -2147483648
  br i1 %56, label %57, label %.loopexit116

57:                                               ; preds = %53
  tail call void @_ZN6NPat2R11CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  br label %.loopexit116

58:                                               ; preds = %51
  %59 = getelementptr inbounds i8, ptr %0, i64 64
  %60 = load ptr, ptr %59, align 8, !tbaa !28
  %61 = zext i32 %31 to i64
  %62 = getelementptr inbounds i8, ptr %60, i64 %61
  %63 = getelementptr inbounds i8, ptr %0, i64 112
  %64 = load ptr, ptr %63, align 8
  %65 = load i32, ptr %49, align 4, !tbaa !27
  br label %66

66:                                               ; preds = %88, %58
  %.pn.in = phi i32 [ %65, %58 ], [ %95, %88 ]
  %.0101 = phi ptr [ %49, %58 ], [ %94, %88 ]
  %.096 = phi i8 [ 0, %58 ], [ %91, %88 ]
  %.086 = phi i32 [ 0, %58 ], [ %90, %88 ]
  %.084 = phi ptr [ %62, %58 ], [ %.3, %88 ]
  %.pn = zext i32 %.pn.in to i64
  %.0104 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %64, i64 %.pn
  %67 = icmp eq i32 %.086, 0
  br i1 %67, label %68, label %71

68:                                               ; preds = %66
  %69 = getelementptr inbounds i8, ptr %.084, i64 1
  %70 = load i8, ptr %.084, align 1, !tbaa !27
  br label %71

71:                                               ; preds = %68, %66
  %.197 = phi i8 [ %70, %68 ], [ %.096, %66 ]
  %.187 = phi i32 [ 8, %68 ], [ %.086, %66 ]
  %.1 = phi ptr [ %69, %68 ], [ %.084, %66 ]
  %72 = getelementptr inbounds i8, ptr %.0104, i64 4
  %73 = load i32, ptr %72, align 4, !tbaa !29
  %.not = icmp eq i32 %73, 0
  br i1 %.not, label %88, label %74

74:                                               ; preds = %71
  %.not109 = icmp ugt i32 %.187, %73
  br i1 %.not109, label %83, label %75

75:                                               ; preds = %74
  %76 = sub i32 %73, %.187
  %77 = lshr i32 %76, 3
  %78 = zext nneg i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %.1, i64 %78
  %80 = and i32 %76, 7
  %81 = getelementptr inbounds i8, ptr %79, i64 1
  %82 = load i8, ptr %79, align 1, !tbaa !27
  br label %83

83:                                               ; preds = %75, %74
  %.0103 = phi i32 [ %80, %75 ], [ %73, %74 ]
  %.298 = phi i8 [ %82, %75 ], [ %.197, %74 ]
  %.288 = phi i32 [ 8, %75 ], [ %.187, %74 ]
  %.2 = phi ptr [ %81, %75 ], [ %.1, %74 ]
  %84 = zext i8 %.298 to i32
  %85 = lshr i32 %84, %.0103
  %86 = trunc nuw i32 %85 to i8
  %87 = sub i32 %.288, %.0103
  br label %88

88:                                               ; preds = %83, %71
  %.399 = phi i8 [ %86, %83 ], [ %.197, %71 ]
  %.389 = phi i32 [ %87, %83 ], [ %.187, %71 ]
  %.3 = phi ptr [ %.2, %83 ], [ %.1, %71 ]
  %89 = and i8 %.399, 3
  %90 = add i32 %.389, -2
  %91 = lshr i8 %.399, 2
  %92 = getelementptr inbounds i8, ptr %.0104, i64 8
  %93 = zext nneg i8 %89 to i64
  %94 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %92, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !27
  %96 = icmp ult i32 %95, 2147483647
  br i1 %96, label %66, label %97

97:                                               ; preds = %88
  %98 = getelementptr inbounds i8, ptr %.0104, i64 4
  %99 = xor i32 %95, %31
  %.not110 = icmp eq i32 %99, -2147483648
  br i1 %.not110, label %.preheader115.preheader, label %122

.preheader115.preheader:                          ; preds = %97
  %100 = load i32, ptr %92, align 4, !tbaa !27
  %101 = icmp ult i32 %100, 2147483647
  %102 = lshr i32 %100, 31
  %103 = zext i1 %101 to i32
  %104 = getelementptr inbounds i8, ptr %.0104, i64 12
  %105 = load i32, ptr %104, align 4, !tbaa !27
  %106 = icmp ult i32 %105, 2147483647
  %107 = lshr i32 %105, 31
  %108 = zext i1 %106 to i32
  %.195.1 = add nuw nsw i32 %103, %108
  %.193.1 = add nuw nsw i32 %107, %102
  %109 = getelementptr inbounds i8, ptr %.0104, i64 16
  %110 = load i32, ptr %109, align 4, !tbaa !27
  %111 = icmp ult i32 %110, 2147483647
  %112 = lshr i32 %110, 31
  %113 = zext i1 %111 to i32
  %.195.2 = add nuw nsw i32 %.195.1, %113
  %.193.2 = add nuw nsw i32 %112, %.193.1
  %114 = getelementptr inbounds i8, ptr %.0104, i64 20
  %115 = load i32, ptr %114, align 4, !tbaa !27
  %116 = icmp ult i32 %115, 2147483647
  %117 = lshr i32 %115, 31
  %118 = zext i1 %116 to i32
  %.195.3 = add nuw nsw i32 %.195.2, %118
  %.193.3 = add nuw nsw i32 %117, %.193.2
  %119 = add nsw i32 %.195.3, -1
  %120 = add nsw i32 %119, %.193.3
  %121 = icmp ugt i32 %120, 1
  br i1 %121, label %141, label %142

122:                                              ; preds = %97
  %123 = load i32, ptr %26, align 4, !tbaa !25
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds i8, ptr %60, i64 %124
  %126 = load i32, ptr %29, align 8, !tbaa !22
  %127 = zext i32 %126 to i64
  %128 = sub nsw i64 0, %127
  %129 = getelementptr inbounds i8, ptr %125, i64 %128
  %130 = getelementptr inbounds i8, ptr %0, i64 100
  %131 = load i32, ptr %130, align 4, !tbaa !21
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds i8, ptr %129, i64 %132
  br label %134

134:                                              ; preds = %136, %122
  %.0100 = phi ptr [ %129, %122 ], [ %138, %136 ]
  %135 = icmp ult ptr %.0100, %133
  br i1 %135, label %136, label %140

136:                                              ; preds = %134
  %137 = load i8, ptr %.0100, align 1, !tbaa !27
  %138 = getelementptr inbounds i8, ptr %.0100, i64 1
  %139 = load i8, ptr %138, align 1, !tbaa !27
  %.not112 = icmp eq i8 %137, %139
  br i1 %.not112, label %134, label %.loopexit116, !llvm.loop !31

140:                                              ; preds = %134
  store i8 1, ptr %2, align 8, !tbaa !5
  br label %.loopexit116

141:                                              ; preds = %.preheader115.preheader
  tail call void @_ZN6NPat2R11CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %94)
  br label %.loopexit116

142:                                              ; preds = %.preheader115.preheader
  %143 = icmp eq i32 %.195.3, 1
  br i1 %143, label %.preheader.preheader, label %.preheader114.preheader

.preheader114.preheader:                          ; preds = %142
  %144 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %92)
  %.not111 = icmp ne i8 %89, 0
  %or.cond.not = and i1 %144, %.not111
  br i1 %or.cond.not, label %166, label %.preheader114.1

.preheader.preheader:                             ; preds = %142
  %145 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %92)
  br i1 %145, label %149, label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.preheader
  %146 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %104)
  br i1 %146, label %149, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %147 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %109)
  br i1 %147, label %149, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  %148 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %114)
  %spec.select = select i1 %148, i64 3, i64 4
  br label %149

149:                                              ; preds = %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %.085.lcssa = phi i64 [ 0, %.preheader.preheader ], [ 1, %.preheader.1 ], [ 2, %.preheader.2 ], [ %spec.select, %.preheader.3 ]
  %150 = getelementptr inbounds [4 x %"union.NPat2R::CDescendant"], ptr %92, i64 0, i64 %.085.lcssa
  %151 = load i32, ptr %150, align 4, !tbaa !27
  %152 = load ptr, ptr %63, align 8, !tbaa !33
  %153 = zext i32 %151 to i64
  %154 = getelementptr inbounds %"struct.NPat2R::CNode", ptr %152, i64 %153
  %155 = load i32, ptr %98, align 4, !tbaa !29
  %156 = add i32 %155, 2
  %157 = getelementptr inbounds i8, ptr %154, i64 4
  %158 = load i32, ptr %157, align 4, !tbaa !29
  %159 = add i32 %156, %158
  store i32 %159, ptr %157, align 4, !tbaa !29
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %.0104, ptr noundef nonnull align 4 dereferenceable(24) %154, i64 24, i1 false), !tbaa.struct !34
  %160 = getelementptr inbounds i8, ptr %0, i64 120
  %161 = load i32, ptr %160, align 8, !tbaa !36
  %162 = getelementptr inbounds i8, ptr %154, i64 8
  store i32 %161, ptr %162, align 4, !tbaa !27
  store i32 %151, ptr %160, align 8, !tbaa !36
  br label %.loopexit116

.preheader114.1:                                  ; preds = %.preheader114.preheader
  %163 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %104)
  %.not111.1 = icmp ne i8 %89, 1
  %or.cond.not.1 = and i1 %163, %.not111.1
  br i1 %or.cond.not.1, label %166, label %.preheader114.2

.preheader114.2:                                  ; preds = %.preheader114.1
  %164 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %109)
  %.not111.2 = icmp ne i8 %89, 2
  %or.cond.not.2 = and i1 %164, %.not111.2
  br i1 %or.cond.not.2, label %166, label %.preheader114.3

.preheader114.3:                                  ; preds = %.preheader114.2
  %165 = tail call noundef zeroext i1 @_ZNK6NPat2R11CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %114)
  %.not111.3 = icmp ne i8 %89, 3
  %or.cond.not.3 = and i1 %165, %.not111.3
  br i1 %or.cond.not.3, label %166, label %.loopexit

166:                                              ; preds = %.preheader114.3, %.preheader114.2, %.preheader114.1, %.preheader114.preheader
  %.lcssa = phi ptr [ %92, %.preheader114.preheader ], [ %104, %.preheader114.1 ], [ %109, %.preheader114.2 ], [ %114, %.preheader114.3 ]
  %167 = load i32, ptr %.lcssa, align 4, !tbaa !27
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader114.3, %166
  %.0 = phi i32 [ %167, %166 ], [ 0, %.preheader114.3 ]
  %168 = getelementptr inbounds i8, ptr %0, i64 120
  %169 = load i32, ptr %168, align 8, !tbaa !36
  store i32 %169, ptr %92, align 4, !tbaa !27
  %170 = load i32, ptr %.0101, align 4, !tbaa !35
  store i32 %170, ptr %168, align 8, !tbaa !36
  store i32 %.0, ptr %.0101, align 4, !tbaa !35
  br label %.loopexit116

.loopexit116:                                     ; preds = %136, %25, %57, %53, %141, %149, %.loopexit, %140, %5
  ret void
}

attributes #0 = { mustprogress nocallback nofree 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" }

!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, !17, i64 128}
!6 = !{!"_ZTSN6NPat2R9CPatriciaE", !7, i64 0, !10, i64 8, !11, i64 16, !15, i64 24, !12, i64 96, !12, i64 100, !16, i64 104, !16, i64 112, !12, i64 120, !12, i64 124, !17, i64 128, !17, i64 129, !12, i64 132, !16, i64 136, !18, i64 144}
!7 = !{!"_ZTS12IMatchFinder", !8, i64 0}
!8 = !{!"_ZTS15IInWindowStream", !9, i64 0}
!9 = !{!"_ZTS8IUnknown"}
!10 = !{!"_ZTS23IMatchFinderSetCallback", !9, i64 0}
!11 = !{!"_ZTS13CMyUnknownImp", !12, i64 0}
!12 = !{!"int", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"_ZTS11CLZInWindow", !16, i64 8, !16, i64 16, !12, i64 24, !17, i64 28, !16, i64 32, !16, i64 40, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68}
!16 = !{!"any pointer", !13, i64 0}
!17 = !{!"bool", !13, i64 0}
!18 = !{!"_ZTS9CMyComPtrI20IMatchFinderCallbackE", !16, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!6, !12, i64 100}
!22 = !{!6, !12, i64 96}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !14, i64 0}
!25 = !{!15, !12, i64 52}
!26 = !{!6, !16, i64 104}
!27 = !{!13, !13, i64 0}
!28 = !{!15, !16, i64 40}
!29 = !{!30, !12, i64 4}
!30 = !{!"_ZTSN6NPat2R5CNodeE", !12, i64 0, !12, i64 4, !13, i64 8}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!6, !16, i64 112}
!34 = !{i64 0, i64 4, !35, i64 4, i64 4, !35, i64 8, i64 16, !27}
!35 = !{!12, !12, i64 0}
!36 = !{!6, !12, i64 120}


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