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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5NPat29CPatricia20TestRemoveDescendantERNS_11CDescendantEj(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %16 = getelementptr inbounds %"class.NPat2::CPatricia", ptr %15, i32 0, i32 7
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = load i32, ptr %18, align 4, !tbaa !21
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds %"struct.NPat2::CNode", ptr %17, i64 %20
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %64, %3
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = icmp ult i32 %23, 4
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %67

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.NPat2::CNode", ptr %27, i32 0, i32 2
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds [4 x %"union.NPat2::CDescendant"], ptr %28, i64 0, i64 %30
  store ptr %31, ptr %12, align 8, !tbaa !5
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %32)
  br i1 %33, label %34, label %35

34:                                               ; preds = %26
  store i32 4, ptr %11, align 4
  br label %61

35:                                               ; preds = %26
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %36)
  br i1 %37, label %38, label %50

38:                                               ; preds = %35
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = load i32, ptr %39, align 4, !tbaa !21
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = icmp ult i32 %40, %41
  br i1 %42, label %43, label %45

43:                                               ; preds = %38
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN5NPat211CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %44)
  br label %49

45:                                               ; preds = %38
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = add i32 %46, 1
  store i32 %47, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %48, ptr %9, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %45, %43
  br label %60

50:                                               ; preds = %35
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN5NPat29CPatricia20TestRemoveDescendantERNS_11CDescendantEj(ptr noundef nonnull align 8 dereferenceable(160) %15, ptr noundef nonnull align 4 dereferenceable(4) %51, i32 noundef %52)
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %53)
  br i1 %54, label %59, label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = add i32 %56, 1
  store i32 %57, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %58, ptr %9, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %55, %50
  br label %60

60:                                               ; preds = %59, %49
  store i32 0, ptr %11, align 4
  br label %61

61:                                               ; preds = %60, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %62 = load i32, ptr %11, align 4
  switch i32 %62, label %116 [
    i32 0, label %63
    i32 4, label %64
  ]

63:                                               ; preds = %61
  br label %64

64:                                               ; preds = %63, %61
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = add i32 %65, 1
  store i32 %66, ptr %10, align 4, !tbaa !9
  br label %22, !llvm.loop !22

67:                                               ; preds = %25
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = icmp ugt i32 %68, 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  store i32 1, ptr %11, align 4
  br label %113

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load i32, ptr %72, align 4, !tbaa !21
  store i32 %73, ptr %13, align 4, !tbaa !9
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %76, label %101

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.NPat2::CNode", ptr %77, i32 0, i32 2
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds [4 x %"union.NPat2::CDescendant"], ptr %78, i64 0, i64 %80
  store ptr %81, ptr %14, align 8, !tbaa !5
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = call noundef zeroext i1 @_ZNK5NPat211CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %82)
  br i1 %83, label %84, label %98

84:                                               ; preds = %76
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.NPat2::CNode", ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !24
  %88 = add i32 %87, 2
  %89 = getelementptr inbounds %"class.NPat2::CPatricia", ptr %15, i32 0, i32 7
  %90 = load ptr, ptr %89, align 8, !tbaa !11
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = load i32, ptr %91, align 4, !tbaa !21
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds %"struct.NPat2::CNode", ptr %90, i64 %93
  %95 = getelementptr inbounds %"struct.NPat2::CNode", ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !24
  %97 = add i32 %96, %88
  store i32 %97, ptr %95, align 4, !tbaa !24
  br label %98

98:                                               ; preds = %84, %76
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %100, ptr align 4 %99, i64 4, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %103

101:                                              ; preds = %71
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN5NPat211CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %102)
  br label %103

103:                                              ; preds = %101, %98
  %104 = getelementptr inbounds %"class.NPat2::CPatricia", ptr %15, i32 0, i32 8
  %105 = load i32, ptr %104, align 8, !tbaa !27
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.NPat2::CNode", ptr %106, i32 0, i32 2
  store i32 %105, ptr %107, align 4, !tbaa !21
  %108 = load i32, ptr %13, align 4, !tbaa !9
  %109 = getelementptr inbounds %"class.NPat2::CPatricia", ptr %15, i32 0, i32 8
  store i32 %108, ptr %109, align 8, !tbaa !27
  %110 = getelementptr inbounds %"class.NPat2::CPatricia", ptr %15, i32 0, i32 10
  %111 = load i32, ptr %110, align 8, !tbaa !28
  %112 = add i32 %111, -1
  store i32 %112, ptr %110, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  store i32 0, ptr %11, align 4
  br label %113

113:                                              ; preds = %103, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %114 = load i32, ptr %11, align 4
  switch i32 %114, label %116 [
    i32 0, label %115
    i32 1, label %115
  ]

115:                                              ; preds = %113, %113
  ret void

116:                                              ; preds = %113, %61
  unreachable
}

; 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) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 112}
!12 = !{!"_ZTSN5NPat29CPatriciaE", !13, i64 0, !16, i64 8, !17, i64 16, !18, i64 24, !10, i64 96, !10, i64 100, !6, i64 104, !6, i64 112, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !19, i64 136, !10, i64 140, !6, i64 144, !20, i64 152}
!13 = !{!"_ZTS12IMatchFinder", !14, i64 0}
!14 = !{!"_ZTS15IInWindowStream", !15, i64 0}
!15 = !{!"_ZTS8IUnknown"}
!16 = !{!"_ZTS23IMatchFinderSetCallback", !15, i64 0}
!17 = !{!"_ZTS13CMyUnknownImp", !10, i64 0}
!18 = !{!"_ZTS11CLZInWindow", !6, i64 8, !6, i64 16, !10, i64 24, !19, i64 28, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTS9CMyComPtrI20IMatchFinderCallbackE", !6, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !10, i64 4}
!25 = !{!"_ZTSN5NPat25CNodeE", !10, i64 0, !10, i64 4, !7, i64 8}
!26 = !{i64 0, i64 4, !21}
!27 = !{!12, !10, i64 120}
!28 = !{!12, !10, i64 128}


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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5NPat29CPatricia20TestRemoveDescendantERNS_11CDescendantEj(ptr nocapture noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %2) local_unnamed_addr #0 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 112
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = load i32, ptr %1, align 4, !tbaa !19
  %7 = zext i32 %6 to i64
  %8 = getelementptr inbounds %"struct.NPat2::CNode", ptr %5, i64 %7
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  %10 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  br i1 %10, label %20, label %11

11:                                               ; preds = %3
  %12 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  br i1 %12, label %13, label %17

13:                                               ; preds = %11
  %14 = load i32, ptr %9, align 4, !tbaa !19
  %15 = icmp ult i32 %14, %2
  br i1 %15, label %16, label %20

16:                                               ; preds = %13
  tail call void @_ZN5NPat211CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  br label %20

17:                                               ; preds = %11
  tail call void @_ZN5NPat29CPatricia20TestRemoveDescendantERNS_11CDescendantEj(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 4 dereferenceable(4) %9, i32 noundef %2)
  %18 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %9)
  %not. = xor i1 %18, true
  %19 = zext i1 %not. to i32
  br label %20

20:                                               ; preds = %13, %17, %16, %3
  %.2 = phi i32 [ 0, %3 ], [ 0, %16 ], [ %19, %17 ], [ 1, %13 ]
  %21 = getelementptr inbounds i8, ptr %8, i64 12
  %22 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %21)
  br i1 %22, label %34, label %23

23:                                               ; preds = %20
  %24 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %21)
  br i1 %24, label %28, label %25

25:                                               ; preds = %23
  tail call void @_ZN5NPat29CPatricia20TestRemoveDescendantERNS_11CDescendantEj(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 4 dereferenceable(4) %21, i32 noundef %2)
  %26 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %21)
  %not.39 = xor i1 %26, true
  %spec.select.1 = zext i1 %not.39 to i32
  %not..1 = xor i1 %26, true
  %27 = zext i1 %not..1 to i32
  %spec.select34.1 = add nuw nsw i32 %.2, %27
  br label %34

28:                                               ; preds = %23
  %29 = load i32, ptr %21, align 4, !tbaa !19
  %30 = icmp ult i32 %29, %2
  br i1 %30, label %33, label %31

31:                                               ; preds = %28
  %32 = add nuw nsw i32 %.2, 1
  br label %34

33:                                               ; preds = %28
  tail call void @_ZN5NPat211CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %21)
  br label %34

34:                                               ; preds = %33, %31, %25, %20
  %.232.1 = phi i32 [ 0, %20 ], [ 0, %33 ], [ 1, %31 ], [ %spec.select.1, %25 ]
  %.2.1 = phi i32 [ %.2, %20 ], [ %.2, %33 ], [ %32, %31 ], [ %spec.select34.1, %25 ]
  %35 = getelementptr inbounds i8, ptr %8, i64 16
  %36 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %35)
  br i1 %36, label %48, label %37

37:                                               ; preds = %34
  %38 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsMatchEv(ptr noundef nonnull align 4 dereferenceable(4) %35)
  br i1 %38, label %42, label %39

39:                                               ; preds = %37
  tail call void @_ZN5NPat29CPatricia20TestRemoveDescendantERNS_11CDescendantEj(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 4 dereferenceable(4) %35, i32 noundef %2)
  %40 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %35)
  %spec.select.2 = select i1 %40, i32 %.232.1, i32 2
  %not..2 = xor i1 %40, true
  %41 = zext i1 %not..2 to i32
  %spec.select34.2 = add nuw nsw i32 %.2.1, %41
  br label %48

42:                                               ; preds = %37
  %43 = load i32, ptr %35, align 4, !tbaa !19
  %44 = icmp ult i32 %43, %2
  br i1 %44, label %47, label %45

45:                                               ; preds = %42
  %46 = add nuw nsw i32 %.2.1, 1
  br label %48

47:                                               ; preds = %42
  tail call void @_ZN5NPat211CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %35)
  br label %48

48:                                               ; preds = %47, %45, %39, %34
  %.232.2 = phi i32 [ %.232.1, %34 ], [ %.232.1, %47 ], [ 2, %45 ], [ %spec.select.2, %39 ]
  %.2.2 = phi i32 [ %.2.1, %34 ], [ %.2.1, %47 ], [ %46, %45 ], [ %spec.select34.2, %39 ]
  %49 = getelementptr inbounds i8, ptr %8, i64 20
  %50 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  br i1 %50, label %62, label %51

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

53:                                               ; preds = %51
  tail call void @_ZN5NPat29CPatricia20TestRemoveDescendantERNS_11CDescendantEj(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef nonnull align 4 dereferenceable(4) %49, i32 noundef %2)
  %54 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant7IsEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  %spec.select.3 = select i1 %54, i32 %.232.2, i32 3
  %not..3 = xor i1 %54, true
  %55 = zext i1 %not..3 to i32
  %spec.select34.3 = add nuw nsw i32 %.2.2, %55
  br label %62

56:                                               ; preds = %51
  %57 = load i32, ptr %49, align 4, !tbaa !19
  %58 = icmp ult i32 %57, %2
  br i1 %58, label %61, label %59

59:                                               ; preds = %56
  %60 = add nuw nsw i32 %.2.2, 1
  br label %62

61:                                               ; preds = %56
  tail call void @_ZN5NPat211CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %49)
  br label %62

62:                                               ; preds = %61, %59, %53, %48
  %.232.3 = phi i32 [ %.232.2, %48 ], [ %.232.2, %61 ], [ 3, %59 ], [ %spec.select.3, %53 ]
  %.2.3 = phi i32 [ %.2.2, %48 ], [ %.2.2, %61 ], [ %60, %59 ], [ %spec.select34.3, %53 ]
  %63 = icmp ugt i32 %.2.3, 1
  br i1 %63, label %90, label %64

64:                                               ; preds = %62
  %65 = load i32, ptr %1, align 4, !tbaa !19
  %66 = icmp eq i32 %.2.3, 1
  br i1 %66, label %67, label %83

67:                                               ; preds = %64
  %68 = zext nneg i32 %.232.3 to i64
  %69 = getelementptr inbounds [4 x %"union.NPat2::CDescendant"], ptr %9, i64 0, i64 %68
  %70 = tail call noundef zeroext i1 @_ZNK5NPat211CDescendant6IsNodeEv(ptr noundef nonnull align 4 dereferenceable(4) %69)
  br i1 %70, label %71, label %81

71:                                               ; preds = %67
  %72 = getelementptr inbounds i8, ptr %8, i64 4
  %73 = load i32, ptr %72, align 4, !tbaa !20
  %74 = add i32 %73, 2
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load i32, ptr %69, align 4, !tbaa !19
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds %"struct.NPat2::CNode", ptr %75, i64 %77, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !20
  %80 = add i32 %74, %79
  store i32 %80, ptr %78, align 4, !tbaa !20
  br label %81

81:                                               ; preds = %71, %67
  %82 = load i32, ptr %69, align 4, !tbaa !19
  store i32 %82, ptr %1, align 4, !tbaa !19
  br label %84

83:                                               ; preds = %64
  tail call void @_ZN5NPat211CDescendant9MakeEmptyEv(ptr noundef nonnull align 4 dereferenceable(4) %1)
  br label %84

84:                                               ; preds = %83, %81
  %85 = getelementptr inbounds i8, ptr %0, i64 120
  %86 = load i32, ptr %85, align 8, !tbaa !22
  store i32 %86, ptr %9, align 4, !tbaa !19
  store i32 %65, ptr %85, align 8, !tbaa !22
  %87 = getelementptr inbounds i8, ptr %0, i64 128
  %88 = load i32, ptr %87, align 8, !tbaa !23
  %89 = add i32 %88, -1
  store i32 %89, ptr %87, align 8, !tbaa !23
  br label %90

90:                                               ; preds = %62, %84
  ret void
}

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

!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, !16, i64 112}
!6 = !{!"_ZTSN5NPat29CPatriciaE", !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, !12, i64 128, !12, i64 132, !17, i64 136, !12, i64 140, !16, i64 144, !18, i64 152}
!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 = !{!13, !13, i64 0}
!20 = !{!21, !12, i64 4}
!21 = !{!"_ZTSN5NPat25CNodeE", !12, i64 0, !12, i64 4, !13, i64 8}
!22 = !{!6, !12, i64 120}
!23 = !{!6, !12, i64 128}


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