; LLVM IR from Xiangyu-Hu/SPHinXsys :: src/shared/tools/tinyxml2.ll (ZN8tinyxml210XMLElement15ParseAttributesEPcPi)

; 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.tinyxml2::XMLNode" = type { ptr, ptr, ptr, %"class.tinyxml2::StrPair", i32, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.tinyxml2::StrPair" = type { i32, ptr, ptr }
%"class.tinyxml2::XMLDocument" = type { %"class.tinyxml2::XMLNode", i8, i8, i32, i32, %"class.tinyxml2::StrPair", i32, ptr, i32, i32, %"class.tinyxml2::DynArray", %"class.tinyxml2::MemPoolT", %"class.tinyxml2::MemPoolT.1", %"class.tinyxml2::MemPoolT.3", %"class.tinyxml2::MemPoolT.5" }
%"class.tinyxml2::DynArray" = type { ptr, [10 x ptr], i32, i32 }
%"class.tinyxml2::MemPoolT" = type { %"class.tinyxml2::MemPool", %"class.tinyxml2::DynArray.0", ptr, i32, i32, i32, i32 }
%"class.tinyxml2::MemPool" = type { ptr }
%"class.tinyxml2::DynArray.0" = type { ptr, [10 x ptr], i32, i32 }
%"class.tinyxml2::MemPoolT.1" = type { %"class.tinyxml2::MemPool", %"class.tinyxml2::DynArray.2", ptr, i32, i32, i32, i32 }
%"class.tinyxml2::DynArray.2" = type { ptr, [10 x ptr], i32, i32 }
%"class.tinyxml2::MemPoolT.3" = type { %"class.tinyxml2::MemPool", %"class.tinyxml2::DynArray.4", ptr, i32, i32, i32, i32 }
%"class.tinyxml2::DynArray.4" = type { ptr, [10 x ptr], i32, i32 }
%"class.tinyxml2::MemPoolT.5" = type { %"class.tinyxml2::MemPool", %"class.tinyxml2::DynArray.6", ptr, i32, i32, i32, i32 }
%"class.tinyxml2::DynArray.6" = type { ptr, [10 x ptr], i32, i32 }
%"class.tinyxml2::XMLAttribute" = type { ptr, %"class.tinyxml2::StrPair", %"class.tinyxml2::StrPair", i32, ptr, ptr }
%"class.tinyxml2::XMLElement" = type { %"class.tinyxml2::XMLNode", i32, ptr }

@.str.23 = external hidden unnamed_addr constant [19 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8tinyxml27XMLUtil15IsNameStartCharEh(i8 noundef zeroext) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8tinyxml27XMLUtil14SkipWhiteSpaceEPcPi(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776), i32 noundef, i32 noundef, ptr noundef, ...) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8tinyxml211XMLDocument15ProcessEntitiesEv(ptr noundef nonnull align 8 dereferenceable(776)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8tinyxml210XMLElement15DeleteAttributeEPNS_12XMLAttributeE(ptr noundef) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN8tinyxml210XMLElement15ParseAttributesEPcPi(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef %1, ptr noundef %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %116, %3
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %117

16:                                               ; preds = %13
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = call noundef ptr @_ZN8tinyxml27XMLUtil14SkipWhiteSpaceEPcPi(ptr noundef %17, ptr noundef %18)
  store ptr %19, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = load i8, ptr %20, align 1, !tbaa !9
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %29, label %23

23:                                               ; preds = %16
  %24 = getelementptr inbounds %"class.tinyxml2::XMLNode", ptr %12, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !10
  %26 = getelementptr inbounds %"class.tinyxml2::XMLNode", ptr %12, i32 0, i32 4
  %27 = load i32, ptr %26, align 8, !tbaa !14
  %28 = call noundef ptr @_ZNK8tinyxml210XMLElement4NameEv(ptr noundef nonnull align 8 dereferenceable(120) %12)
  call void (ptr, i32, i32, ptr, ...) @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776) %25, i32 noundef 6, i32 noundef %27, ptr noundef @.str.23, ptr noundef %28)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

29:                                               ; preds = %16
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = call noundef zeroext i1 @_ZN8tinyxml27XMLUtil15IsNameStartCharEh(i8 noundef zeroext %31)
  br i1 %32, label %33, label %88

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %34 = call noundef ptr @_ZN8tinyxml210XMLElement15CreateAttributeEv(ptr noundef nonnull align 8 dereferenceable(120) %12)
  store ptr %34, ptr %10, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %33
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = getelementptr inbounds %"class.tinyxml2::XMLNode", ptr %12, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !10
  %40 = getelementptr inbounds %"class.tinyxml2::XMLDocument", ptr %39, i32 0, i32 8
  %41 = load i32, ptr %40, align 8, !tbaa !15
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.tinyxml2::XMLAttribute", ptr %42, i32 0, i32 3
  store i32 %41, ptr %43, align 8, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.tinyxml2::XMLAttribute", ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !30
  store i32 %46, ptr %11, align 4, !tbaa !32
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.tinyxml2::XMLNode", ptr %12, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !10
  %51 = call noundef zeroext i1 @_ZNK8tinyxml211XMLDocument15ProcessEntitiesEv(ptr noundef nonnull align 8 dereferenceable(776) %50)
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = call noundef ptr @_ZN8tinyxml212XMLAttribute9ParseDeepEPcbPi(ptr noundef nonnull align 8 dereferenceable(80) %47, ptr noundef %48, i1 noundef zeroext %51, ptr noundef %52)
  store ptr %53, ptr %6, align 8, !tbaa !5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %61

56:                                               ; preds = %37
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = call noundef ptr @_ZNK8tinyxml212XMLAttribute4NameEv(ptr noundef nonnull align 8 dereferenceable(80) %57)
  %59 = call noundef ptr @_ZNK8tinyxml210XMLElement9AttributeEPKcS2_(ptr noundef nonnull align 8 dereferenceable(120) %12, ptr noundef %58, ptr noundef null)
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %67

61:                                               ; preds = %56, %37
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN8tinyxml210XMLElement15DeleteAttributeEPNS_12XMLAttributeE(ptr noundef %62)
  %63 = getelementptr inbounds %"class.tinyxml2::XMLNode", ptr %12, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !10
  %65 = load i32, ptr %11, align 4, !tbaa !32
  %66 = call noundef ptr @_ZNK8tinyxml210XMLElement4NameEv(ptr noundef nonnull align 8 dereferenceable(120) %12)
  call void (ptr, i32, i32, ptr, ...) @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776) %64, i32 noundef 7, i32 noundef %65, ptr noundef @.str.23, ptr noundef %66)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %85

67:                                               ; preds = %56
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %77

70:                                               ; preds = %67
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %"class.tinyxml2::XMLAttribute", ptr %75, i32 0, i32 4
  store ptr %74, ptr %76, align 8, !tbaa !33
  br label %83

77:                                               ; preds = %67
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.tinyxml2::XMLElement", ptr %12, i32 0, i32 2
  store ptr %81, ptr %82, align 8, !tbaa !34
  br label %83

83:                                               ; preds = %80, %73
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %84, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %9, align 4
  br label %85

85:                                               ; preds = %83, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %86 = load i32, ptr %9, align 4
  switch i32 %86, label %119 [
    i32 0, label %87
  ]

87:                                               ; preds = %85
  br label %116

88:                                               ; preds = %29
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %91 = sext i8 %90 to i32
  %92 = icmp eq i32 %91, 62
  br i1 %92, label %93, label %96

93:                                               ; preds = %88
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i32 1
  store ptr %95, ptr %6, align 8, !tbaa !5
  br label %117

96:                                               ; preds = %88
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load i8, ptr %97, align 1, !tbaa !9
  %99 = sext i8 %98 to i32
  %100 = icmp eq i32 %99, 47
  br i1 %100, label %101, label %111

101:                                              ; preds = %96
  %102 = load ptr, ptr %6, 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, 62
  br i1 %106, label %107, label %111

107:                                              ; preds = %101
  %108 = getelementptr inbounds %"class.tinyxml2::XMLElement", ptr %12, i32 0, i32 1
  store i32 1, ptr %108, align 8, !tbaa !37
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i64 2
  store ptr %110, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

111:                                              ; preds = %101, %96
  %112 = getelementptr inbounds %"class.tinyxml2::XMLNode", ptr %12, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !10
  %114 = getelementptr inbounds %"class.tinyxml2::XMLNode", ptr %12, i32 0, i32 4
  %115 = load i32, ptr %114, align 8, !tbaa !14
  call void (ptr, i32, i32, ptr, ...) @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776) %113, i32 noundef 6, i32 noundef %115, ptr noundef null)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

116:                                              ; preds = %87
  br label %13, !llvm.loop !38

117:                                              ; preds = %93, %13
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %118, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %119

119:                                              ; preds = %117, %111, %107, %85, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %120 = load ptr, ptr %4, align 8
  ret ptr %120
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!11, !6, i64 8}
!11 = !{!"_ZTSN8tinyxml27XMLNodeE", !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!12 = !{!"_ZTSN8tinyxml27StrPairE", !13, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!11, !13, i64 48}
!15 = !{!16, !13, i64 160}
!16 = !{!"_ZTSN8tinyxml211XMLDocumentE", !11, i64 0, !17, i64 104, !17, i64 105, !18, i64 108, !19, i64 112, !12, i64 120, !13, i64 144, !6, i64 152, !13, i64 160, !13, i64 164, !20, i64 168, !21, i64 264, !24, i64 392, !26, i64 520, !28, i64 648}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTSN8tinyxml28XMLErrorE", !7, i64 0}
!19 = !{!"_ZTSN8tinyxml210WhitespaceE", !7, i64 0}
!20 = !{!"_ZTSN8tinyxml28DynArrayIPNS_7XMLNodeELi10EEE", !6, i64 0, !7, i64 8, !13, i64 88, !13, i64 92}
!21 = !{!"_ZTSN8tinyxml28MemPoolTILi120EEE", !22, i64 0, !23, i64 8, !6, i64 104, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124}
!22 = !{!"_ZTSN8tinyxml27MemPoolE"}
!23 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi120EE5BlockELi10EEE", !6, i64 0, !7, i64 8, !13, i64 88, !13, i64 92}
!24 = !{!"_ZTSN8tinyxml28MemPoolTILi80EEE", !22, i64 0, !25, i64 8, !6, i64 104, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124}
!25 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi80EE5BlockELi10EEE", !6, i64 0, !7, i64 8, !13, i64 88, !13, i64 92}
!26 = !{!"_ZTSN8tinyxml28MemPoolTILi112EEE", !22, i64 0, !27, i64 8, !6, i64 104, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124}
!27 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi112EE5BlockELi10EEE", !6, i64 0, !7, i64 8, !13, i64 88, !13, i64 92}
!28 = !{!"_ZTSN8tinyxml28MemPoolTILi104EEE", !22, i64 0, !29, i64 8, !6, i64 104, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124}
!29 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi104EE5BlockELi10EEE", !6, i64 0, !7, i64 8, !13, i64 88, !13, i64 92}
!30 = !{!31, !13, i64 56}
!31 = !{!"_ZTSN8tinyxml212XMLAttributeE", !12, i64 8, !12, i64 32, !13, i64 56, !6, i64 64, !6, i64 72}
!32 = !{!13, !13, i64 0}
!33 = !{!31, !6, i64 64}
!34 = !{!35, !6, i64 112}
!35 = !{!"_ZTSN8tinyxml210XMLElementE", !11, i64 0, !36, i64 104, !6, i64 112}
!36 = !{!"_ZTSN8tinyxml210XMLElement18ElementClosingTypeE", !7, i64 0}
!37 = !{!35, !36, i64 104}
!38 = distinct !{!38, !39}
!39 = !{!"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"

@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8tinyxml27XMLUtil15IsNameStartCharEh(i8 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8tinyxml27XMLUtil14SkipWhiteSpaceEPcPi(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776), i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8tinyxml211XMLDocument15ProcessEntitiesEv(ptr noundef nonnull align 8 dereferenceable(776)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8tinyxml212XMLAttribute9ParseDeepEPcbPi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i1 noundef zeroext, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8tinyxml210XMLElement15DeleteAttributeEPNS_12XMLAttributeE(ptr noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN8tinyxml210XMLElement15ParseAttributesEPcPi(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 align 2 {
  %.not45 = icmp eq ptr %1, null
  br i1 %.not45, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = getelementptr inbounds i8, ptr %0, i64 112
  %6 = tail call noundef ptr @_ZN8tinyxml27XMLUtil14SkipWhiteSpaceEPcPi(ptr noundef nonnull %1, ptr noundef %2)
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %.not3463 = icmp eq i8 %7, 0
  br i1 %.not3463, label %._crit_edge, label %.lr.ph65

._crit_edge:                                      ; preds = %28, %.lr.ph
  %8 = load ptr, ptr %4, align 8, !tbaa !8
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load i32, ptr %9, align 8, !tbaa !13
  %11 = tail call noundef ptr @_ZNK8tinyxml210XMLElement4NameEv(ptr noundef nonnull align 8 dereferenceable(120) %0)
  tail call void (ptr, i32, i32, ptr, ...) @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776) %8, i32 noundef 6, i32 noundef %10, ptr noundef nonnull @.str.23, ptr noundef %11)
  br label %.loopexit

.lr.ph65:                                         ; preds = %.lr.ph, %28
  %12 = phi i8 [ %31, %28 ], [ %7, %.lr.ph ]
  %13 = phi ptr [ %30, %28 ], [ %6, %.lr.ph ]
  %.0304664 = phi ptr [ %16, %28 ], [ null, %.lr.ph ]
  %14 = tail call noundef zeroext i1 @_ZN8tinyxml27XMLUtil15IsNameStartCharEh(i8 noundef zeroext %12)
  br i1 %14, label %15, label %32

15:                                               ; preds = %.lr.ph65
  %16 = tail call noundef ptr @_ZN8tinyxml210XMLElement15CreateAttributeEv(ptr noundef nonnull align 8 dereferenceable(120) %0)
  %17 = load ptr, ptr %4, align 8, !tbaa !8
  %18 = getelementptr inbounds i8, ptr %17, i64 160
  %19 = load i32, ptr %18, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %16, i64 56
  store i32 %19, ptr %20, align 8, !tbaa !29
  %21 = tail call noundef zeroext i1 @_ZNK8tinyxml211XMLDocument15ProcessEntitiesEv(ptr noundef nonnull align 8 dereferenceable(776) %17)
  %22 = tail call noundef ptr @_ZN8tinyxml212XMLAttribute9ParseDeepEPcbPi(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull %13, i1 noundef zeroext %21, ptr noundef %2)
  %.not35 = icmp eq ptr %22, null
  br i1 %.not35, label %.thread, label %23

23:                                               ; preds = %15
  %24 = tail call noundef ptr @_ZNK8tinyxml212XMLAttribute4NameEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  %25 = tail call noundef ptr @_ZNK8tinyxml210XMLElement9AttributeEPKcS2_(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef %24, ptr noundef null)
  %.not36 = icmp eq ptr %25, null
  br i1 %.not36, label %28, label %.thread

.thread:                                          ; preds = %15, %23
  tail call void @_ZN8tinyxml210XMLElement15DeleteAttributeEPNS_12XMLAttributeE(ptr noundef nonnull %16)
  %26 = load ptr, ptr %4, align 8, !tbaa !8
  %27 = tail call noundef ptr @_ZNK8tinyxml210XMLElement4NameEv(ptr noundef nonnull align 8 dereferenceable(120) %0)
  tail call void (ptr, i32, i32, ptr, ...) @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776) %26, i32 noundef 7, i32 noundef %19, ptr noundef nonnull @.str.23, ptr noundef %27)
  br label %.loopexit

28:                                               ; preds = %23
  %.not37 = icmp eq ptr %.0304664, null
  %29 = getelementptr inbounds i8, ptr %.0304664, i64 64
  %.sink = select i1 %.not37, ptr %5, ptr %29
  store ptr %16, ptr %.sink, align 8, !tbaa !31
  %30 = tail call noundef ptr @_ZN8tinyxml27XMLUtil14SkipWhiteSpaceEPcPi(ptr noundef nonnull %22, ptr noundef %2)
  %31 = load i8, ptr %30, align 1, !tbaa !5
  %.not34 = icmp eq i8 %31, 0
  br i1 %.not34, label %._crit_edge, label %.lr.ph65

32:                                               ; preds = %.lr.ph65
  %33 = load i8, ptr %13, align 1, !tbaa !5
  switch i8 %33, label %43 [
    i8 62, label %34
    i8 47, label %36
  ]

34:                                               ; preds = %32
  %35 = getelementptr inbounds i8, ptr %13, i64 1
  br label %.loopexit

36:                                               ; preds = %32
  %37 = getelementptr inbounds i8, ptr %13, i64 1
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = icmp eq i8 %38, 62
  br i1 %39, label %40, label %43

40:                                               ; preds = %36
  %41 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 1, ptr %41, align 8, !tbaa !32
  %42 = getelementptr inbounds i8, ptr %13, i64 2
  br label %.loopexit

43:                                               ; preds = %32, %36
  %44 = load ptr, ptr %4, align 8, !tbaa !8
  %45 = getelementptr inbounds i8, ptr %0, i64 48
  %46 = load i32, ptr %45, align 8, !tbaa !13
  tail call void (ptr, i32, i32, ptr, ...) @_ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz(ptr noundef nonnull align 8 dereferenceable(776) %44, i32 noundef 6, i32 noundef %46, ptr noundef null)
  br label %.loopexit

.loopexit:                                        ; preds = %3, %.thread, %34, %43, %40, %._crit_edge
  %.2 = phi ptr [ %42, %40 ], [ null, %43 ], [ null, %._crit_edge ], [ %35, %34 ], [ null, %.thread ], [ null, %3 ]
  ret ptr %.2
}

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTSN8tinyxml27XMLNodeE", !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"_ZTSN8tinyxml27StrPairE", !12, i64 0, !10, i64 8, !10, i64 16}
!12 = !{!"int", !6, i64 0}
!13 = !{!9, !12, i64 48}
!14 = !{!15, !12, i64 160}
!15 = !{!"_ZTSN8tinyxml211XMLDocumentE", !9, i64 0, !16, i64 104, !16, i64 105, !17, i64 108, !18, i64 112, !11, i64 120, !12, i64 144, !10, i64 152, !12, i64 160, !12, i64 164, !19, i64 168, !20, i64 264, !23, i64 392, !25, i64 520, !27, i64 648}
!16 = !{!"bool", !6, i64 0}
!17 = !{!"_ZTSN8tinyxml28XMLErrorE", !6, i64 0}
!18 = !{!"_ZTSN8tinyxml210WhitespaceE", !6, i64 0}
!19 = !{!"_ZTSN8tinyxml28DynArrayIPNS_7XMLNodeELi10EEE", !10, i64 0, !6, i64 8, !12, i64 88, !12, i64 92}
!20 = !{!"_ZTSN8tinyxml28MemPoolTILi120EEE", !21, i64 0, !22, i64 8, !10, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124}
!21 = !{!"_ZTSN8tinyxml27MemPoolE"}
!22 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi120EE5BlockELi10EEE", !10, i64 0, !6, i64 8, !12, i64 88, !12, i64 92}
!23 = !{!"_ZTSN8tinyxml28MemPoolTILi80EEE", !21, i64 0, !24, i64 8, !10, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124}
!24 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi80EE5BlockELi10EEE", !10, i64 0, !6, i64 8, !12, i64 88, !12, i64 92}
!25 = !{!"_ZTSN8tinyxml28MemPoolTILi112EEE", !21, i64 0, !26, i64 8, !10, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124}
!26 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi112EE5BlockELi10EEE", !10, i64 0, !6, i64 8, !12, i64 88, !12, i64 92}
!27 = !{!"_ZTSN8tinyxml28MemPoolTILi104EEE", !21, i64 0, !28, i64 8, !10, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124}
!28 = !{!"_ZTSN8tinyxml28DynArrayIPNS_8MemPoolTILi104EE5BlockELi10EEE", !10, i64 0, !6, i64 8, !12, i64 88, !12, i64 92}
!29 = !{!30, !12, i64 56}
!30 = !{!"_ZTSN8tinyxml212XMLAttributeE", !11, i64 8, !11, i64 32, !12, i64 56, !10, i64 64, !10, i64 72}
!31 = !{!10, !10, i64 0}
!32 = !{!33, !34, i64 104}
!33 = !{!"_ZTSN8tinyxml210XMLElementE", !9, i64 0, !34, i64 104, !10, i64 112}
!34 = !{!"_ZTSN8tinyxml210XMLElement18ElementClosingTypeE", !6, i64 0}


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