; LLVM IR from gem5/gem5 :: ext/mcpat/xmlParser.ll (ZN7XMLNode26getChildNodeByPathNonConstEPccc)

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

%struct.XMLNode = type { ptr }

@_ZN7XMLNode12emptyXMLNodeE = external dso_local global %struct.XMLNode, align 8

; 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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL7xstrstrPKcS0_(ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7XMLNode26getChildNodeByPathNonConstEPccc(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, i8 noundef signext %3, i8 noundef signext %4) #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca %struct.XMLNode, align 8
  %12 = alloca %struct.XMLNode, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca [2 x i8], align 1
  %17 = alloca %struct.XMLNode, align 8
  %18 = alloca %struct.XMLNode, align 8
  %19 = alloca i32, align 4
  %20 = alloca %struct.XMLNode, align 8
  %21 = alloca %struct.XMLNode, align 8
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i8 %3, ptr %9, align 1, !tbaa !9
  store i8 %4, ptr %10, align 1, !tbaa !9
  %22 = load ptr, ptr %7, align 8
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %29

25:                                               ; preds = %5
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = icmp ne i8 %27, 0
  br i1 %28, label %30, label %29

29:                                               ; preds = %25, %5
  call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %22)
  br label %140

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @_ZN7XMLNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %31 unwind label %59

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #4
  %32 = load i8, ptr %10, align 1, !tbaa !9
  %33 = getelementptr inbounds [2 x i8], ptr %16, i64 0, i64 0
  store i8 %32, ptr %33, align 1, !tbaa !9
  %34 = getelementptr inbounds [2 x i8], ptr %16, i64 0, i64 1
  store i8 0, ptr %34, align 1, !tbaa !9
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds [2 x i8], ptr %16, i64 0, i64 0
  %37 = invoke noundef ptr @_ZL7xstrstrPKcS0_(ptr noundef %35, ptr noundef %36)
          to label %38 unwind label %63

38:                                               ; preds = %31
  store ptr %37, ptr %15, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %100, %38
  %40 = load ptr, ptr %15, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %101

42:                                               ; preds = %39
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  store i8 0, ptr %43, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %17, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %44, ptr noundef null)
          to label %45 unwind label %67

45:                                               ; preds = %42
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %47 unwind label %71

47:                                               ; preds = %45
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %48 = invoke noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %49 unwind label %63

49:                                               ; preds = %47
  %50 = icmp ne i8 %48, 0
  br i1 %50, label %51, label %90

51:                                               ; preds = %49
  %52 = load i8, ptr %9, align 1, !tbaa !9
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %54, label %85

54:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN7XMLNode8addChildEPKcci(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %18, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %55, i8 noundef signext 0, i32 noundef -1)
          to label %56 unwind label %76

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %58 unwind label %80

58:                                               ; preds = %56
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %89

59:                                               ; preds = %30
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %13, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %14, align 4
  br label %139

63:                                               ; preds = %135, %105, %94, %90, %85, %47, %31
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %13, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %14, align 4
  br label %138

67:                                               ; preds = %42
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %13, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %14, align 4
  br label %75

71:                                               ; preds = %45
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %13, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %14, align 4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  br label %75

75:                                               ; preds = %71, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %138

76:                                               ; preds = %54
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %13, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %14, align 4
  br label %84

80:                                               ; preds = %56
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %13, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %14, align 4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #4
  br label %84

84:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %138

85:                                               ; preds = %51
  %86 = load i8, ptr %10, align 1, !tbaa !9
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  store i8 %86, ptr %87, align 1, !tbaa !9
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
          to label %88 unwind label %63

88:                                               ; preds = %85
  store i32 1, ptr %19, align 4
  br label %137

89:                                               ; preds = %58
  br label %90

90:                                               ; preds = %89, %49
  %91 = load i8, ptr %10, align 1, !tbaa !9
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  store i8 %91, ptr %92, align 1, !tbaa !9
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %94 unwind label %63

94:                                               ; preds = %90
  %95 = load ptr, ptr %15, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 1
  store ptr %96, ptr %8, align 8, !tbaa !5
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds [2 x i8], ptr %16, i64 0, i64 0
  %99 = invoke noundef ptr @_ZL7xstrstrPKcS0_(ptr noundef %97, ptr noundef %98)
          to label %100 unwind label %63

100:                                              ; preds = %94
  store ptr %99, ptr %15, align 8, !tbaa !5
  br label %39, !llvm.loop !10

101:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %20, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %102, ptr noundef null)
          to label %103 unwind label %117

103:                                              ; preds = %101
  %104 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %105 unwind label %121

105:                                              ; preds = %103
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  %106 = invoke noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %107 unwind label %63

107:                                              ; preds = %105
  %108 = icmp ne i8 %106, 0
  br i1 %108, label %109, label %135

109:                                              ; preds = %107
  %110 = load i8, ptr %9, align 1, !tbaa !9
  %111 = icmp ne i8 %110, 0
  br i1 %111, label %112, label %135

112:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN7XMLNode8addChildEPKcci(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %21, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %113, i8 noundef signext 0, i32 noundef -1)
          to label %114 unwind label %126

114:                                              ; preds = %112
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %116 unwind label %130

116:                                              ; preds = %114
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %135

117:                                              ; preds = %101
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %13, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %14, align 4
  br label %125

121:                                              ; preds = %103
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %13, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %14, align 4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  br label %125

125:                                              ; preds = %121, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %138

126:                                              ; preds = %112
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %13, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %14, align 4
  br label %134

130:                                              ; preds = %114
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %13, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %14, align 4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  br label %134

134:                                              ; preds = %130, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %138

135:                                              ; preds = %116, %109, %107
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %136 unwind label %63

136:                                              ; preds = %135
  store i32 1, ptr %19, align 4
  br label %137

137:                                              ; preds = %136, %88
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %140

138:                                              ; preds = %134, %125, %84, %75, %63
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  br label %139

139:                                              ; preds = %138, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %141

140:                                              ; preds = %137, %29
  ret void

141:                                              ; preds = %139
  %142 = load ptr, ptr %13, align 8
  %143 = load i32, ptr %14, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7XMLNode8addChildEPKcci(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i8 noundef signext, i32 noundef) #2 align 2

declare void @_ZN7XMLNodeD1Ev(ptr)

declare void @_ZN7XMLNodeC1ERKS_(ptr, ptr)

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; 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.XMLNode = type { ptr }

@_ZN7XMLNode12emptyXMLNodeE = external dso_local global %struct.XMLNode, align 8

; 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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL7xstrstrPKcS0_(ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7XMLNode26getChildNodeByPathNonConstEPccc(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, i8 noundef signext %3, i8 noundef signext %4) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %struct.XMLNode, align 8
  %7 = alloca %struct.XMLNode, align 8
  %8 = alloca [2 x i8], align 1
  %9 = alloca %struct.XMLNode, align 8
  %10 = alloca %struct.XMLNode, align 8
  %11 = alloca %struct.XMLNode, align 8
  %12 = alloca %struct.XMLNode, align 8
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %15, label %13

13:                                               ; preds = %5
  %14 = load i8, ptr %2, align 1, !tbaa !5
  %.not30 = icmp eq i8 %14, 0
  br i1 %.not30, label %15, label %16

15:                                               ; preds = %13, %5
  tail call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1)
  br label %78

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @_ZN7XMLNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %17 unwind label %39

17:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %8) #4
  store i8 %4, ptr %8, align 1, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %8, i64 1
  store i8 0, ptr %18, align 1, !tbaa !5
  %19 = call noundef ptr @_ZL7xstrstrPKcS0_(ptr noundef nonnull %2, ptr noundef nonnull %8)
  %.not3156 = icmp eq ptr %19, null
  br i1 %.not3156, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %17
  %.not38 = icmp eq i8 %3, 0
  br i1 %.not38, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %26
  %.058.us = phi ptr [ %28, %26 ], [ %19, %.lr.ph ]
  %.02857.us = phi ptr [ %27, %26 ], [ %2, %.lr.ph ]
  store i8 0, ptr %.058.us, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %.02857.us, ptr noundef null)
          to label %20 unwind label %.split.us

20:                                               ; preds = %.lr.ph.split.us
  %21 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %22 unwind label %.split60.us

22:                                               ; preds = %20
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %23 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %.not37.us = icmp eq i8 %23, 0
  store i8 %4, ptr %.058.us, align 1, !tbaa !5
  br i1 %.not37.us, label %24, label %.split63.us.invoke

24:                                               ; preds = %22
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %26 unwind label %.loopexit.split.us

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %.058.us, i64 1
  %28 = call noundef ptr @_ZL7xstrstrPKcS0_(ptr noundef nonnull %27, ptr noundef nonnull %8)
  %.not31.us = icmp eq ptr %28, null
  br i1 %.not31.us, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !8

.split.us:                                        ; preds = %.lr.ph.split.us
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %44

.split60.us:                                      ; preds = %20
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %43

.loopexit.split.us:                               ; preds = %24
  %lpad.loopexit.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.lr.ph.split:                                     ; preds = %.lr.ph, %53
  %.058 = phi ptr [ %55, %53 ], [ %19, %.lr.ph ]
  %.02857 = phi ptr [ %54, %53 ], [ %2, %.lr.ph ]
  store i8 0, ptr %.058, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %.02857, ptr noundef null)
          to label %31 unwind label %.split

31:                                               ; preds = %.lr.ph.split
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %33 unwind label %.split60

33:                                               ; preds = %31
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %34 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %.not37 = icmp eq i8 %34, 0
  br i1 %.not37, label %51, label %35

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  invoke void @_ZN7XMLNode8addChildEPKcci(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %.02857, i8 noundef signext 0, i32 noundef -1)
          to label %36 unwind label %45

36:                                               ; preds = %35
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %38 unwind label %47

38:                                               ; preds = %36
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %51

39:                                               ; preds = %16
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %77

.loopexit.split:                                  ; preds = %51
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.split-lp:                               ; preds = %.split63.us.invoke
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.split:                                           ; preds = %.lr.ph.split
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

.split60:                                         ; preds = %31
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %43

43:                                               ; preds = %.split60.us, %.split60
  %.us-phi61 = phi { ptr, i32 } [ %42, %.split60 ], [ %30, %.split60.us ]
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br label %44

44:                                               ; preds = %.split, %.split.us, %43
  %.pn35 = phi { ptr, i32 } [ %.us-phi61, %43 ], [ %41, %.split ], [ %29, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br label %.loopexit

45:                                               ; preds = %35
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %36
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br label %49

49:                                               ; preds = %47, %45
  %.pn39 = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %.loopexit

.split63.us.invoke:                               ; preds = %22, %58, %65
  %50 = phi ptr [ %6, %65 ], [ %6, %58 ], [ @_ZN7XMLNode12emptyXMLNodeE, %22 ]
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %50)
          to label %76 unwind label %.loopexit.split-lp

51:                                               ; preds = %38, %33
  store i8 %4, ptr %.058, align 1, !tbaa !5
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %53 unwind label %.loopexit.split

53:                                               ; preds = %51
  %54 = getelementptr inbounds i8, ptr %.058, i64 1
  %55 = call noundef ptr @_ZL7xstrstrPKcS0_(ptr noundef nonnull %54, ptr noundef nonnull %8)
  %.not31 = icmp eq ptr %55, null
  br i1 %.not31, label %._crit_edge, label %.lr.ph.split, !llvm.loop !8

._crit_edge:                                      ; preds = %53, %26, %17
  %.028.lcssa = phi ptr [ %2, %17 ], [ %27, %26 ], [ %54, %53 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %.028.lcssa, ptr noundef null)
          to label %56 unwind label %66

56:                                               ; preds = %._crit_edge
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %58 unwind label %68

58:                                               ; preds = %56
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  %59 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %60 = icmp ne i8 %59, 0
  %61 = icmp ne i8 %3, 0
  %or.cond = and i1 %61, %60
  br i1 %or.cond, label %62, label %.split63.us.invoke

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  invoke void @_ZN7XMLNode8addChildEPKcci(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %.028.lcssa, i8 noundef signext 0, i32 noundef -1)
          to label %63 unwind label %71

63:                                               ; preds = %62
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %65 unwind label %73

65:                                               ; preds = %63
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br label %.split63.us.invoke

66:                                               ; preds = %._crit_edge
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %70

68:                                               ; preds = %56
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br label %70

70:                                               ; preds = %68, %66
  %.pn = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %.loopexit

71:                                               ; preds = %62
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %75

73:                                               ; preds = %63
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  br label %75

75:                                               ; preds = %73, %71
  %.pn33 = phi { ptr, i32 } [ %74, %73 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  br label %.loopexit

76:                                               ; preds = %.split63.us.invoke
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %78

.loopexit:                                        ; preds = %.loopexit.split-lp, %.loopexit.split.us, %.loopexit.split, %75, %70, %49, %44
  %.pn41 = phi { ptr, i32 } [ %.pn39, %49 ], [ %.pn35, %44 ], [ %.pn33, %75 ], [ %.pn, %70 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit, %.loopexit.split ], [ %lpad.loopexit.us, %.loopexit.split.us ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br label %77

77:                                               ; preds = %.loopexit, %39
  %.pn41.pn = phi { ptr, i32 } [ %.pn41, %.loopexit ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn41.pn

78:                                               ; preds = %76, %15
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7XMLNode8addChildEPKcci(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i8 noundef signext, i32 noundef) local_unnamed_addr #2 align 2

declare void @_ZN7XMLNodeD1Ev(ptr) local_unnamed_addr

declare void @_ZN7XMLNodeC1ERKS_(ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


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