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

; 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 }
%"struct.pugi::xml_node_struct" = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

; 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 noundef ptr @_ZNK4pugi8xml_nodecvPFvPPPS0_EEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

; 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

; Function Attrs: mustprogress uwtable
define dso_local ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %1, i8 noundef signext %2) #2 align 2 {
  %4 = alloca %"class.pugi::xml_node", align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca %"class.pugi::xml_node", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.pugi::xml_node", align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.pugi::xml_node", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i8 %2, ptr %7, align 1, !tbaa !9
  %17 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 0
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = sext i8 %20 to i32
  %22 = load i8, ptr %7, align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = icmp eq i32 %21, %23
  br i1 %24, label %25, label %28

25:                                               ; preds = %3
  %26 = call ptr @_ZNK4pugi8xml_node4rootEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
  %27 = getelementptr inbounds %"class.pugi::xml_node", ptr %8, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  br label %29

28:                                               ; preds = %3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %17, i64 8, i1 false), !tbaa.struct !10
  br label %29

29:                                               ; preds = %28, %25
  %30 = getelementptr inbounds %"class.pugi::xml_node", ptr %8, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @_ZN4pugi8xml_nodeC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  store i32 1, ptr %9, align 4
  br label %166

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %35, ptr %10, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %43, %34
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = sext i8 %38 to i32
  %40 = load i8, ptr %7, align 1, !tbaa !9
  %41 = sext i8 %40 to i32
  %42 = icmp eq i32 %39, %41
  br i1 %42, label %43, label %46

43:                                               ; preds = %36
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i32 1
  store ptr %45, ptr %10, align 8, !tbaa !5
  br label %36, !llvm.loop !13

46:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %47, ptr %11, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %61, %46
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = load i8, ptr %49, align 1, !tbaa !9
  %51 = icmp ne i8 %50, 0
  br i1 %51, label %52, label %59

52:                                               ; preds = %48
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = load i8, ptr %7, align 1, !tbaa !9
  %57 = sext i8 %56 to i32
  %58 = icmp ne i32 %55, %57
  br label %59

59:                                               ; preds = %52, %48
  %60 = phi i1 [ false, %48 ], [ %58, %52 ]
  br i1 %60, label %61, label %64

61:                                               ; preds = %59
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i32 1
  store ptr %63, ptr %11, align 8, !tbaa !5
  br label %48, !llvm.loop !15

64:                                               ; preds = %59
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = icmp eq ptr %65, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %8, i64 8, i1 false), !tbaa.struct !10
  store i32 1, ptr %9, align 4
  br label %165

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %70, ptr %12, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %78, %69
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %74 = sext i8 %73 to i32
  %75 = load i8, ptr %7, align 1, !tbaa !9
  %76 = sext i8 %75 to i32
  %77 = icmp eq i32 %74, %76
  br i1 %77, label %78, label %81

78:                                               ; preds = %71
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i32 1
  store ptr %80, ptr %12, align 8, !tbaa !5
  br label %71, !llvm.loop !16

81:                                               ; preds = %71
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = load i8, ptr %82, align 1, !tbaa !9
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 46
  br i1 %85, label %86, label %96

86:                                               ; preds = %81
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 1
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = icmp eq ptr %88, %89
  br i1 %90, label %91, label %96

91:                                               ; preds = %86
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = load i8, ptr %7, align 1, !tbaa !9
  %94 = call ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef %92, i8 noundef signext %93)
  %95 = getelementptr inbounds %"class.pugi::xml_node", ptr %4, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  store i32 1, ptr %9, align 4
  br label %164

96:                                               ; preds = %86, %81
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load i8, ptr %97, align 1, !tbaa !9
  %99 = sext i8 %98 to i32
  %100 = icmp eq i32 %99, 46
  br i1 %100, label %101, label %119

101:                                              ; preds = %96
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i64 1
  %104 = load i8, ptr %103, align 1, !tbaa !9
  %105 = sext i8 %104 to i32
  %106 = icmp eq i32 %105, 46
  br i1 %106, label %107, label %119

107:                                              ; preds = %101
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 2
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = icmp eq ptr %109, %110
  br i1 %111, label %112, label %119

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %113 = call ptr @_ZNK4pugi8xml_node6parentEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %114 = getelementptr inbounds %"class.pugi::xml_node", ptr %13, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = load i8, ptr %7, align 1, !tbaa !9
  %117 = call ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %115, i8 noundef signext %116)
  %118 = getelementptr inbounds %"class.pugi::xml_node", ptr %4, i32 0, i32 0
  store ptr %117, ptr %118, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  store i32 1, ptr %9, align 4
  br label %164

119:                                              ; preds = %107, %101, %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %120 = getelementptr inbounds %"class.pugi::xml_node", ptr %8, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !11
  %122 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %121, i32 0, i32 4
  %123 = load ptr, ptr %122, align 8, !tbaa !17
  store ptr %123, ptr %14, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %157, %119
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %128, label %127

127:                                              ; preds = %124
  store i32 8, ptr %9, align 4
  br label %161

128:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !20
  store ptr %131, ptr %15, align 8, !tbaa !5
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %153

134:                                              ; preds = %128
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = ptrtoint ptr %137 to i64
  %140 = ptrtoint ptr %138 to i64
  %141 = sub i64 %139, %140
  %142 = call noundef zeroext i1 @_ZN4pugi4impl12_GLOBAL__N_113strequalrangeEPKcS3_m(ptr noundef %135, ptr noundef %136, i64 noundef %141)
  br i1 %142, label %143, label %153

143:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %144)
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  %146 = load i8, ptr %7, align 1, !tbaa !9
  %147 = call ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %145, i8 noundef signext %146)
  %148 = getelementptr inbounds %"class.pugi::xml_node", ptr %4, i32 0, i32 0
  store ptr %147, ptr %148, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %149 = call noundef ptr @_ZNK4pugi8xml_nodecvPFvPPPS0_EEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %152

151:                                              ; preds = %143
  store i32 1, ptr %9, align 4
  br label %154

152:                                              ; preds = %143
  br label %153

153:                                              ; preds = %152, %134, %128
  store i32 0, ptr %9, align 4
  br label %154

154:                                              ; preds = %153, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  %155 = load i32, ptr %9, align 4
  switch i32 %155, label %161 [
    i32 0, label %156
  ]

156:                                              ; preds = %154
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.pugi::xml_node_struct", ptr %158, i32 0, i32 6
  %160 = load ptr, ptr %159, align 8, !tbaa !21
  store ptr %160, ptr %14, align 8, !tbaa !5
  br label %124, !llvm.loop !22

161:                                              ; preds = %154, %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %162 = load i32, ptr %9, align 4
  switch i32 %162, label %164 [
    i32 8, label %163
  ]

163:                                              ; preds = %161
  call void @_ZN4pugi8xml_nodeC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  store i32 1, ptr %9, align 4
  br label %164

164:                                              ; preds = %163, %161, %112, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %165

165:                                              ; preds = %164, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %166

166:                                              ; preds = %165, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %167 = getelementptr inbounds %"class.pugi::xml_node", ptr %4, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8
  ret ptr %168
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN4pugi4impl12_GLOBAL__N_113strequalrangeEPKcS3_m(ptr noundef, ptr noundef, i64 noundef) #1

declare void @_ZN4pugi8xml_nodeC1Ev(ptr)

declare void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(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 = { 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 = !{!7, !7, i64 0}
!10 = !{i64 0, i64 8, !5}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN4pugi8xml_nodeE", !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!18, !6, i64 32}
!18 = !{!"_ZTSN4pugi15xml_node_structE", !19, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!19 = !{!"long", !7, i64 0}
!20 = !{!18, !6, i64 8}
!21 = !{!18, !6, i64 48}
!22 = distinct !{!22, !14}


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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %1, i8 noundef signext %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.pugi::xml_node", align 8
  %5 = alloca %"class.pugi::xml_node", align 8
  %6 = alloca %"class.pugi::xml_node", align 8
  %7 = alloca %"class.pugi::xml_node", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %8 = load i8, ptr %1, align 1, !tbaa !5
  %9 = icmp eq i8 %8, %2
  br i1 %9, label %10, label %13

10:                                               ; preds = %3
  %11 = tail call ptr @_ZNK4pugi8xml_node4rootEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %12 = ptrtoint ptr %11 to i64
  br label %15

13:                                               ; preds = %3
  %14 = load i64, ptr %0, align 8, !tbaa !8
  br label %15

15:                                               ; preds = %13, %10
  %storemerge = phi i64 [ %14, %13 ], [ %12, %10 ]
  store i64 %storemerge, ptr %5, align 8
  %.not = icmp eq i64 %storemerge, 0
  %16 = inttoptr i64 %storemerge to ptr
  br i1 %.not, label %17, label %.preheader61

17:                                               ; preds = %15
  call void @_ZN4pugi8xml_nodeC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  br label %.loopexit

.preheader61:                                     ; preds = %15, %.preheader61
  %.045 = phi ptr [ %20, %.preheader61 ], [ %1, %15 ]
  %18 = load i8, ptr %.045, align 1, !tbaa !5
  %19 = icmp eq i8 %18, %2
  %20 = getelementptr inbounds i8, ptr %.045, i64 1
  br i1 %19, label %.preheader61, label %.preheader60, !llvm.loop !10

.preheader60:                                     ; preds = %.preheader61, %.preheader60
  %.044.idx = phi i64 [ %.044.add, %.preheader60 ], [ 0, %.preheader61 ]
  %.044.ptr = getelementptr inbounds i8, ptr %.045, i64 %.044.idx
  %21 = load i8, ptr %.044.ptr, align 1, !tbaa !5
  %.not49 = icmp eq i8 %21, 0
  %.not50 = icmp eq i8 %21, %2
  %or.cond = or i1 %.not49, %.not50
  %.044.add = add nuw nsw i64 %.044.idx, 1
  br i1 %or.cond, label %.critedge, label %.preheader60, !llvm.loop !12

.critedge:                                        ; preds = %.preheader60
  %22 = icmp eq i64 %.044.idx, 0
  br i1 %22, label %23, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.critedge
  %.044.ptr.le = getelementptr inbounds i8, ptr %.045, i64 %.044.idx
  br label %.preheader

23:                                               ; preds = %.critedge
  store i64 %storemerge, ptr %4, align 8, !tbaa !8
  br label %.loopexit

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.043 = phi ptr [ %26, %.preheader ], [ %.044.ptr.le, %.preheader.preheader ]
  %24 = load i8, ptr %.043, align 1, !tbaa !5
  %25 = icmp eq i8 %24, %2
  %26 = getelementptr inbounds i8, ptr %.043, i64 1
  br i1 %25, label %.preheader, label %27, !llvm.loop !13

27:                                               ; preds = %.preheader
  %28 = icmp eq i8 %18, 46
  %29 = icmp eq i64 %.044.idx, 1
  %or.cond54 = and i1 %28, %29
  br i1 %or.cond54, label %30, label %32

30:                                               ; preds = %27
  %31 = call ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %.043, i8 noundef signext %2)
  store ptr %31, ptr %4, align 8
  br label %.loopexit

32:                                               ; preds = %27
  br i1 %28, label %33, label %40

33:                                               ; preds = %32
  %34 = load i8, ptr %20, align 1, !tbaa !5
  %35 = icmp eq i8 %34, 46
  %36 = icmp eq i64 %.044.idx, 2
  %or.cond55 = and i1 %36, %35
  br i1 %or.cond55, label %37, label %40

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %38 = call ptr @_ZNK4pugi8xml_node6parentEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  store ptr %38, ptr %6, align 8
  %39 = call ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %.043, i8 noundef signext %2)
  store ptr %39, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  br label %.loopexit

40:                                               ; preds = %33, %32
  %41 = getelementptr inbounds i8, ptr %16, i64 32
  %.04263 = load ptr, ptr %41, align 8, !tbaa !8
  %.not5164 = icmp eq ptr %.04263, null
  br i1 %.not5164, label %.critedge59, label %.lr.ph

.lr.ph:                                           ; preds = %40, %.critedge57
  %.04265 = phi ptr [ %.042, %.critedge57 ], [ %.04263, %40 ]
  %42 = getelementptr inbounds i8, ptr %.04265, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !14
  %.not52 = icmp eq ptr %43, null
  br i1 %.not52, label %.critedge57, label %44

44:                                               ; preds = %.lr.ph
  %45 = call noundef zeroext i1 @_ZN4pugi4impl12_GLOBAL__N_113strequalrangeEPKcS3_m(ptr noundef nonnull %43, ptr noundef nonnull %.045, i64 noundef %.044.idx)
  br i1 %45, label %46, label %.critedge57

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @_ZN4pugi8xml_nodeC1EPNS_15xml_node_structE(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %.04265)
  %47 = call ptr @_ZNK4pugi8xml_node21first_element_by_pathEPKcc(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %.043, i8 noundef signext %2)
  store ptr %47, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  %48 = call noundef ptr @_ZNK4pugi8xml_nodecvPFvPPPS0_EEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %.not53 = icmp eq ptr %48, null
  br i1 %.not53, label %.critedge57, label %.loopexit

.critedge57:                                      ; preds = %46, %44, %.lr.ph
  %49 = getelementptr inbounds i8, ptr %.04265, i64 48
  %.042 = load ptr, ptr %49, align 8, !tbaa !8
  %.not51 = icmp eq ptr %.042, null
  br i1 %.not51, label %.critedge59, label %.lr.ph, !llvm.loop !17

.critedge59:                                      ; preds = %.critedge57, %40
  call void @_ZN4pugi8xml_nodeC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  br label %.loopexit

.loopexit:                                        ; preds = %46, %23, %.critedge59, %37, %30, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  %50 = load ptr, ptr %4, align 8
  ret ptr %50
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN4pugi4impl12_GLOBAL__N_113strequalrangeEPKcS3_m(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @_ZN4pugi8xml_nodeC1Ev(ptr) local_unnamed_addr

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 = { 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 = { 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 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = !{!15, !9, i64 8}
!15 = !{!"_ZTSN4pugi15xml_node_structE", !16, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !9, i64 48, !9, i64 56}
!16 = !{!"long", !6, i64 0}
!17 = distinct !{!17, !11}


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