; LLVM IR from JayXon/Leanify :: lib/pugixml/pugixml.ll (ZN4pugi8xml_node8traverseERNS_15xml_tree_walkerE)

; 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.pugi::xml_node" = type { ptr }
%"class.pugi::xml_tree_walker" = type <{ ptr, i32, [4 x i8] }>
%"struct.pugi::xml_node_struct" = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN4pugi8xml_node8traverseERNS_15xml_tree_walkerE = external hidden unnamed_addr constant [49 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4pugi8xml_node8traverseERNS_15xml_tree_walkerE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(12) %1) #2 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.pugi::xml_node", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.pugi::xml_node", align 8
  %10 = alloca %"class.pugi::xml_node", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %"class.pugi::xml_tree_walker", ptr %12, i32 0, i32 1
  store i32 -1, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %14 = getelementptr inbounds %"class.pugi::xml_node", ptr %11, i32 0, i32 0
  %15 = load ptr, ptr %14, align 8, !tbaa !12
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %15)
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %16, align 8, !tbaa !14
  %18 = getelementptr inbounds ptr, ptr %17, i64 2
  %19 = load ptr, ptr %18, align 8
  %20 = call noundef zeroext i1 %19(ptr noundef nonnull align 8 dereferenceable(12) %16, ptr noundef nonnull align 8 dereferenceable(8) %6)
  br i1 %20, label %22, label %21

21:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %141

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %23 = getelementptr inbounds %"class.pugi::xml_node", ptr %11, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %32

26:                                               ; preds = %22
  %27 = getelementptr inbounds %"class.pugi::xml_node", ptr %11, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %28, i32 0, i32 4
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %30, i64 0
  br label %33

32:                                               ; preds = %22
  br label %33

33:                                               ; preds = %32, %26
  %34 = phi ptr [ %31, %26 ], [ null, %32 ]
  store ptr %34, ptr %8, align 8, !tbaa !5
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %124

37:                                               ; preds = %33
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.pugi::xml_tree_walker", ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 8, !tbaa !9
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %39, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %121, %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %43)
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = getelementptr inbounds ptr, ptr %45, i64 3
  %47 = load ptr, ptr %46, align 8
  %48 = call noundef zeroext i1 %47(ptr noundef nonnull align 8 dereferenceable(12) %44, ptr noundef nonnull align 8 dereferenceable(8) %9)
  br i1 %48, label %50, label %49

49:                                               ; preds = %42
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %110

50:                                               ; preds = %42
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %51, i32 0, i32 4
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %63

55:                                               ; preds = %50
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.pugi::xml_tree_walker", ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %57, align 8, !tbaa !9
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %60, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  store ptr %62, ptr %8, align 8, !tbaa !5
  br label %109

63:                                               ; preds = %50
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %64, i32 0, i32 6
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %72

68:                                               ; preds = %63
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %69, i32 0, i32 6
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  store ptr %71, ptr %8, align 8, !tbaa !5
  br label %108

72:                                               ; preds = %63
  br label %73

73:                                               ; preds = %90, %72
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %74, i32 0, i32 6
  %76 = load ptr, ptr %75, align 8, !tbaa !19
  %77 = icmp ne ptr %76, null
  br i1 %77, label %88, label %78

78:                                               ; preds = %73
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %"class.pugi::xml_node", ptr %11, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !12
  %82 = icmp ne ptr %79, %81
  br i1 %82, label %83, label %88

83:                                               ; preds = %78
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %84, i32 0, i32 3
  %86 = load ptr, ptr %85, align 8, !tbaa !20
  %87 = icmp ne ptr %86, null
  br label %88

88:                                               ; preds = %83, %78, %73
  %89 = phi i1 [ false, %78 ], [ false, %73 ], [ %87, %83 ]
  br i1 %89, label %90, label %98

90:                                               ; preds = %88
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.pugi::xml_tree_walker", ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !9
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %92, align 8, !tbaa !9
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !20
  store ptr %97, ptr %8, align 8, !tbaa !5
  br label %73, !llvm.loop !21

98:                                               ; preds = %88
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.pugi::xml_node", ptr %11, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !12
  %102 = icmp ne ptr %99, %101
  br i1 %102, label %103, label %107

103:                                              ; preds = %98
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %104, i32 0, i32 6
  %106 = load ptr, ptr %105, align 8, !tbaa !19
  store ptr %106, ptr %8, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %103, %98
  br label %108

108:                                              ; preds = %107, %68
  br label %109

109:                                              ; preds = %108, %55
  store i32 0, ptr %7, align 4
  br label %110

110:                                              ; preds = %109, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %111 = load i32, ptr %7, align 4
  switch i32 %111, label %140 [
    i32 0, label %112
  ]

112:                                              ; preds = %110
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = icmp ne ptr %114, null
  br i1 %115, label %116, label %121

116:                                              ; preds = %113
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.pugi::xml_node", ptr %11, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !12
  %120 = icmp ne ptr %117, %119
  br label %121

121:                                              ; preds = %116, %113
  %122 = phi i1 [ false, %113 ], [ %120, %116 ]
  br i1 %122, label %42, label %123, !llvm.loop !23

123:                                              ; preds = %121
  br label %124

124:                                              ; preds = %123, %33
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %"class.pugi::xml_tree_walker", ptr %125, i32 0, i32 1
  %127 = load i32, ptr %126, align 8, !tbaa !9
  %128 = icmp eq i32 %127, -1
  br i1 %128, label %129, label %130

129:                                              ; preds = %124
  br label %132

130:                                              ; preds = %124
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 6521, ptr noundef @__PRETTY_FUNCTION__._ZN4pugi8xml_node8traverseERNS_15xml_tree_walkerE) #4
  unreachable

131:                                              ; No predecessors!
  br label %132

132:                                              ; preds = %131, %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %133 = getelementptr inbounds %"class.pugi::xml_node", ptr %11, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !12
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %134)
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = load ptr, ptr %135, align 8, !tbaa !14
  %137 = getelementptr inbounds ptr, ptr %136, i64 4
  %138 = load ptr, ptr %137, align 8
  %139 = call noundef zeroext i1 %138(ptr noundef nonnull align 8 dereferenceable(12) %135, ptr noundef nonnull align 8 dereferenceable(8) %10)
  store i1 %139, ptr %3, align 1
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %140

140:                                              ; preds = %132, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %141

141:                                              ; preds = %140, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %142 = load i1, ptr %3, align 1
  ret i1 %142
}

declare void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr, ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { nounwind }
attributes #4 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN4pugi15xml_tree_walkerE", !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTSN4pugi8xml_nodeE", !6, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = !{!17, !6, i64 32}
!17 = !{!"_ZTSN4pugi15xml_node_structE", !18, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!18 = !{!"long", !7, i64 0}
!19 = !{!17, !6, i64 48}
!20 = !{!17, !6, i64 24}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


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

%"class.pugi::xml_node" = type { ptr }

@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN4pugi8xml_node8traverseERNS_15xml_tree_walkerE = external hidden unnamed_addr constant [49 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4pugi8xml_node8traverseERNS_15xml_tree_walkerE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(12) %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %"class.pugi::xml_node", align 8
  %4 = alloca %"class.pugi::xml_node", align 8
  %5 = alloca %"class.pugi::xml_node", align 8
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 -1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %7 = load ptr, ptr %0, align 8, !tbaa !10
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %7)
  %8 = load ptr, ptr %1, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load ptr, ptr %9, align 8
  %11 = call noundef zeroext i1 %10(ptr noundef nonnull align 8 dereferenceable(12) %1, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %11, label %12, label %.loopexit

12:                                               ; preds = %2
  %13 = load ptr, ptr %0, align 8, !tbaa !10
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %.critedge2, label %14

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %13, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %.not34 = icmp eq ptr %16, null
  br i1 %.not34, label %.critedge2, label %17

17:                                               ; preds = %14
  %18 = load i32, ptr %6, align 8, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %6, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %47, %17
  %.0 = phi ptr [ %16, %17 ], [ %.347, %47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %.0)
  %21 = load ptr, ptr %1, align 8, !tbaa !13
  %22 = getelementptr inbounds i8, ptr %21, i64 24
  %23 = load ptr, ptr %22, align 8
  %24 = call noundef zeroext i1 %23(ptr noundef nonnull align 8 dereferenceable(12) %1, ptr noundef nonnull align 8 dereferenceable(8) %4)
  br i1 %24, label %25, label %.thread48

.thread48:                                        ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %.loopexit

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %.0, i64 32
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %.not35 = icmp eq ptr %27, null
  br i1 %.not35, label %31, label %28

28:                                               ; preds = %25
  %29 = load i32, ptr %6, align 8, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %6, align 8, !tbaa !5
  br label %.thread45

31:                                               ; preds = %25
  %32 = getelementptr inbounds i8, ptr %.0, i64 48
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %.not36 = icmp eq ptr %33, null
  br i1 %.not36, label %.preheader, label %.thread45

.preheader:                                       ; preds = %31
  %34 = load ptr, ptr %0, align 8
  %.not3851 = icmp eq ptr %.0, %34
  br i1 %.not3851, label %.critedge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %35 = getelementptr inbounds i8, ptr %.0, i64 24
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  %.not3981 = icmp eq ptr %36, null
  br i1 %.not3981, label %.critedge.thread, label %.lr.ph82

.lr.ph:                                           ; preds = %.lr.ph82
  %37 = getelementptr inbounds i8, ptr %39, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !19
  %.not39 = icmp eq ptr %38, null
  br i1 %.not39, label %.critedge.thread, label %.lr.ph82, !llvm.loop !20

.lr.ph82:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %39 = phi ptr [ %38, %.lr.ph ], [ %36, %.lr.ph.preheader ]
  %40 = load i32, ptr %6, align 8, !tbaa !5
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %39, i64 48
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %.not37 = icmp ne ptr %43, null
  %44 = load ptr, ptr %0, align 8
  %.not38 = icmp eq ptr %39, %44
  %cond.fr = freeze i1 %.not38
  %or.cond = or i1 %.not37, %cond.fr
  br i1 %or.cond, label %.critedge, label %.lr.ph, !llvm.loop !20

.critedge:                                        ; preds = %.lr.ph82
  %spec.select = select i1 %cond.fr, ptr %39, ptr %43
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %.lr.ph, %.lr.ph.preheader, %.critedge, %.preheader
  %45 = phi ptr [ %34, %.preheader ], [ %44, %.critedge ], [ %34, %.lr.ph.preheader ], [ %44, %.lr.ph ]
  %46 = phi ptr [ %.0, %.preheader ], [ %spec.select, %.critedge ], [ null, %.lr.ph.preheader ], [ null, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %47

.thread45:                                        ; preds = %28, %31
  %.3.ph = phi ptr [ %33, %31 ], [ %27, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %.pre = load ptr, ptr %0, align 8
  br label %47

47:                                               ; preds = %.critedge.thread, %.thread45
  %48 = phi ptr [ %.pre, %.thread45 ], [ %45, %.critedge.thread ]
  %.347 = phi ptr [ %.3.ph, %.thread45 ], [ %46, %.critedge.thread ]
  %.not41 = icmp eq ptr %.347, null
  %.not42 = icmp eq ptr %.347, %48
  %or.cond43 = select i1 %.not41, i1 true, i1 %.not42
  br i1 %or.cond43, label %.critedge2, label %20, !llvm.loop !22

.critedge2:                                       ; preds = %47, %12, %14
  %49 = phi ptr [ null, %12 ], [ %13, %14 ], [ %48, %47 ]
  %50 = load i32, ptr %6, align 8, !tbaa !5
  %51 = icmp eq i32 %50, -1
  br i1 %51, label %53, label %52

52:                                               ; preds = %.critedge2
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 6521, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4pugi8xml_node8traverseERNS_15xml_tree_walkerE) #4
  unreachable

53:                                               ; preds = %.critedge2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %49)
  %54 = load ptr, ptr %1, align 8, !tbaa !13
  %55 = getelementptr inbounds i8, ptr %54, i64 32
  %56 = load ptr, ptr %55, align 8
  %57 = call noundef zeroext i1 %56(ptr noundef nonnull align 8 dereferenceable(12) %1, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br label %.loopexit

.loopexit:                                        ; preds = %.thread48, %53, %2
  %.330 = phi i1 [ false, %2 ], [ %57, %53 ], [ false, %.thread48 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i1 %.330
}

declare void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { nounwind }
attributes #4 = { noreturn 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, !7, i64 8}
!6 = !{!"_ZTSN4pugi15xml_tree_walkerE", !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ZTSN4pugi8xml_nodeE", !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !9, i64 0}
!15 = !{!16, !12, i64 32}
!16 = !{!"_ZTSN4pugi15xml_node_structE", !17, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56}
!17 = !{!"long", !8, i64 0}
!18 = !{!16, !12, i64 48}
!19 = !{!16, !12, i64 24}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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