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

; 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: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; 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
declare dso_local noundef ptr @_ZNK7XMLNode12getAttributeEPKcPi(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK7XMLNode25getChildNodeWithAttributeEPKcS1_S1_Pi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.XMLNode, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %struct.XMLNode, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %7, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %27

24:                                               ; preds = %6
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %26, ptr %13, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %24, %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @_ZN7XMLNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  br label %28

28:                                               ; preds = %96, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %29 = load ptr, ptr %9, 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) %21, ptr noundef %29, ptr noundef %13)
          to label %30 unwind label %58

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %32 unwind label %62

32:                                               ; preds = %30
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %33 = invoke noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %34 unwind label %67

34:                                               ; preds = %32
  %35 = icmp ne i8 %33, 0
  br i1 %35, label %93, label %36

36:                                               ; preds = %34
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %78

39:                                               ; preds = %36
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %74, %39
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = invoke noundef ptr @_ZNK7XMLNode12getAttributeEPKcPi(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %41, ptr noundef %14)
          to label %43 unwind label %67

43:                                               ; preds = %40
  store ptr %42, ptr %16, align 8, !tbaa !5
  %44 = load ptr, ptr %16, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %73

46:                                               ; preds = %43
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = invoke noundef i32 @_ZL8xstricmpPKcS0_(ptr noundef %47, ptr noundef %48)
          to label %50 unwind label %67

50:                                               ; preds = %46
  %51 = icmp eq i32 %49, 0
  br i1 %51, label %52, label %73

52:                                               ; preds = %50
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %71

55:                                               ; preds = %52
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %56, ptr %57, align 4, !tbaa !9
  br label %71

58:                                               ; preds = %28
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %18, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %19, align 4
  br label %66

62:                                               ; preds = %30
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %18, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %19, align 4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  br label %66

66:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %102

67:                                               ; preds = %99, %94, %89, %78, %71, %46, %40, %32
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %18, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %19, align 4
  br label %102

71:                                               ; preds = %55, %52
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %72 unwind label %67

72:                                               ; preds = %71
  store i32 1, ptr %20, align 4
  br label %101

73:                                               ; preds = %50, %43
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %40, label %77, !llvm.loop !11

77:                                               ; preds = %74
  br label %92

78:                                               ; preds = %36
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = invoke noundef signext i8 @_ZNK7XMLNode14isAttributeSetEPKc(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %79)
          to label %81 unwind label %67

81:                                               ; preds = %78
  %82 = icmp ne i8 %80, 0
  br i1 %82, label %83, label %91

83:                                               ; preds = %81
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %89

86:                                               ; preds = %83
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %87, ptr %88, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %86, %83
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %90 unwind label %67

90:                                               ; preds = %89
  store i32 1, ptr %20, align 4
  br label %101

91:                                               ; preds = %81
  br label %92

92:                                               ; preds = %91, %77
  br label %93

93:                                               ; preds = %92, %34
  br label %94

94:                                               ; preds = %93
  %95 = invoke noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %96 unwind label %67

96:                                               ; preds = %94
  %97 = icmp ne i8 %95, 0
  %98 = xor i1 %97, true
  br i1 %98, label %28, label %99, !llvm.loop !13

99:                                               ; preds = %96
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
          to label %100 unwind label %67

100:                                              ; preds = %99
  store i32 1, ptr %20, align 4
  br label %101

101:                                              ; preds = %100, %90, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret void

102:                                              ; preds = %67, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %18, align 8
  %105 = load i32, ptr %19, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZNK7XMLNode14isAttributeSetEPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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: 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: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL8xstricmpPKcS0_(ptr noundef, ptr noundef) local_unnamed_addr #3

; 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
declare dso_local noundef ptr @_ZNK7XMLNode12getAttributeEPKcPi(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 @_ZNK7XMLNode25getChildNodeWithAttributeEPKcS1_S1_Pi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.XMLNode, align 8
  %10 = alloca %struct.XMLNode, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %13, label %11

11:                                               ; preds = %6
  %12 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %12, ptr %7, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %11, %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @_ZN7XMLNodeC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %.not24 = icmp eq ptr %4, null
  br i1 %.not24, label %.split.us, label %.split

.split.us:                                        ; preds = %13, %.critedge.us
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef nonnull %7)
          to label %14 unwind label %.split34.us

14:                                               ; preds = %.split.us
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %16 unwind label %.split36.us

16:                                               ; preds = %14
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  %17 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %.not23.us = icmp eq i8 %17, 0
  br i1 %.not23.us, label %18, label %.critedge.us

18:                                               ; preds = %16
  %19 = invoke noundef signext i8 @_ZNK7XMLNode14isAttributeSetEPKc(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %3)
          to label %20 unwind label %.loopexit.split-lp.loopexit.split.us

20:                                               ; preds = %18
  %.not25.us = icmp eq i8 %19, 0
  br i1 %.not25.us, label %.critedge.us, label %.split40.us

.critedge.us:                                     ; preds = %20, %16
  %21 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %.not27.us = icmp eq i8 %21, 0
  br i1 %.not27.us, label %.split.us, label %.split42.us.invoke, !llvm.loop !9

.split34.us:                                      ; preds = %.split.us
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %39

.split36.us:                                      ; preds = %14
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %38

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

.split:                                           ; preds = %13, %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef nonnull %7)
          to label %24 unwind label %.split34

24:                                               ; preds = %.split
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %26 unwind label %.split36

26:                                               ; preds = %24
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  %27 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %.not23 = icmp eq i8 %27, 0
  br i1 %.not23, label %28, label %.critedge

28:                                               ; preds = %26
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %32, %28
  %30 = invoke noundef ptr @_ZNK7XMLNode12getAttributeEPKcPi(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %3, ptr noundef nonnull %8)
          to label %31 unwind label %.loopexit

31:                                               ; preds = %29
  %.not26 = icmp eq ptr %30, null
  br i1 %.not26, label %.critedge, label %32

32:                                               ; preds = %31
  %33 = call noundef i32 @_ZL8xstricmpPKcS0_(ptr noundef nonnull %4, ptr noundef nonnull %30)
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %29, !llvm.loop !11

35:                                               ; preds = %32
  br i1 %.not, label %.split42.us.invoke, label %.split42.us.invoke.sink.split

.split34:                                         ; preds = %.split
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

.split36:                                         ; preds = %24
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %38

38:                                               ; preds = %.split36.us, %.split36
  %.us-phi37 = phi { ptr, i32 } [ %37, %.split36 ], [ %23, %.split36.us ]
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br label %39

39:                                               ; preds = %.split34, %.split34.us, %38
  %.pn = phi { ptr, i32 } [ %.us-phi37, %38 ], [ %36, %.split34 ], [ %22, %.split34.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %.loopexit.split-lp

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

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

.split40.us:                                      ; preds = %20
  br i1 %.not, label %.split42.us.invoke, label %.split42.us.invoke.sink.split

.critedge:                                        ; preds = %31, %26
  %40 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %.not27 = icmp eq i8 %40, 0
  br i1 %.not27, label %.split, label %.split42.us.invoke, !llvm.loop !9

.split42.us.invoke.sink.split:                    ; preds = %.split40.us, %35
  %.sink = load i32, ptr %7, align 4, !tbaa !5
  store i32 %.sink, ptr %5, align 4, !tbaa !5
  br label %.split42.us.invoke

.split42.us.invoke:                               ; preds = %.critedge, %.critedge.us, %.split42.us.invoke.sink.split, %.split40.us, %35
  %41 = phi ptr [ %9, %35 ], [ %9, %.split40.us ], [ %9, %.split42.us.invoke.sink.split ], [ @_ZN7XMLNode12emptyXMLNodeE, %.critedge.us ], [ @_ZN7XMLNode12emptyXMLNodeE, %.critedge ]
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %41)
          to label %42 unwind label %.loopexit.split-lp.loopexit.split-lp

42:                                               ; preds = %.split42.us.invoke
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  ret void

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit.split.us, %39
  %.pn28 = phi { ptr, i32 } [ %.pn, %39 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit30.us, %.loopexit.split-lp.loopexit.split.us ], [ %lpad.loopexit.split-lp31, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  resume { ptr, i32 } %.pn28
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef signext i8 @_ZNK7XMLNode14isAttributeSetEPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass