; LLVM IR from HiroIshida/tinyfk :: urdf_parser/tinyxml (tinyxmlparser)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%class.TiXmlNode = type { %class.TiXmlBase, ptr, i32, ptr, ptr, %"class.std::__cxx11::basic_string", ptr, ptr }
%class.TiXmlBase = type { ptr, %struct.TiXmlCursor, ptr }
%struct.TiXmlCursor = type { i32, i32 }
%class.TiXmlText = type <{ %class.TiXmlNode, i8, [7 x i8] }>

@.str.11 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [2 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: mustprogress nounwind uwtable
declare dso_local void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef, ptr noundef, i1 noundef zeroext, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef, i1 noundef zeroext, i32 noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20)) #1 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9TiXmlText5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(105) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %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 ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  %19 = load ptr, ptr %6, align 8
  %20 = getelementptr inbounds %class.TiXmlNode, ptr %19, i32 0, i32 5
  %21 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef @.str.11)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %22 = call noundef ptr @_ZN9TiXmlNode11GetDocumentEv(ptr noundef nonnull align 8 dereferenceable(104) %19)
  store ptr %22, ptr %10, align 8, !tbaa !5
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %32

25:                                               ; preds = %4
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20) %26, ptr noundef %27, i32 noundef %28)
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20) %29)
  %31 = getelementptr inbounds %class.TiXmlBase, ptr %19, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 4 %30, i64 8, i1 false), !tbaa.struct !11
  br label %32

32:                                               ; preds = %25, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr @.str.22, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store ptr @.str.30, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.TiXmlText, ptr %19, i32 0, i32 1
  %34 = load i8, ptr %33, align 8, !tbaa !14, !range !24, !noundef !25
  %35 = trunc i8 %34 to i1
  br i1 %35, label %40, label %36

36:                                               ; preds = %32
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %37, ptr noundef @.str.22, i1 noundef zeroext false, i32 noundef %38)
  br i1 %39, label %40, label %88

40:                                               ; preds = %36, %32
  %41 = getelementptr inbounds %class.TiXmlText, ptr %19, i32 0, i32 1
  store i8 1, ptr %41, align 8, !tbaa !14
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %42, ptr noundef @.str.22, i1 noundef zeroext false, i32 noundef %43)
  br i1 %44, label %54, label %45

45:                                               ; preds = %40
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %49, i32 noundef 14, ptr noundef %50, ptr noundef %51, i32 noundef %52)
  br label %53

53:                                               ; preds = %48, %45
  store ptr null, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %107

54:                                               ; preds = %40
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 9
  store ptr %56, ptr %7, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %71, %54
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %69

60:                                               ; preds = %57
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load i8, ptr %61, align 1, !tbaa !26
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %64, label %69

64:                                               ; preds = %60
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %65, ptr noundef @.str.30, i1 noundef zeroext false, i32 noundef %66)
  %68 = xor i1 %67, true
  br label %69

69:                                               ; preds = %64, %60, %57
  %70 = phi i1 [ false, %60 ], [ false, %57 ], [ %68, %64 ]
  br i1 %70, label %71, label %78

71:                                               ; preds = %69
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = load i8, ptr %72, align 1, !tbaa !26
  %74 = getelementptr inbounds %class.TiXmlNode, ptr %19, i32 0, i32 5
  %75 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %74, i8 noundef signext %73)
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i32 1
  store ptr %77, ptr %7, align 8, !tbaa !5
  br label %57, !llvm.loop !27

78:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = invoke noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef %79, ptr noundef %14, i1 noundef zeroext false, ptr noundef @.str.30, i1 noundef zeroext false, i32 noundef %80)
          to label %82 unwind label %84

82:                                               ; preds = %78
  store ptr %81, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %83, ptr %5, align 8
  store i32 1, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  br label %107

84:                                               ; preds = %78
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %15, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %109

88:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #4
  store i8 1, ptr %17, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store ptr @.str.31, ptr %18, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.TiXmlNode, ptr %19, i32 0, i32 5
  %91 = load i8, ptr %17, align 1, !tbaa !29, !range !24, !noundef !25
  %92 = trunc i8 %91 to i1
  %93 = load ptr, ptr %18, align 8, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = call noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef %89, ptr noundef %90, i1 noundef zeroext %92, ptr noundef %93, i1 noundef zeroext false, i32 noundef %94)
  store ptr %95, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %105

98:                                               ; preds = %88
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = load i8, ptr %99, align 1, !tbaa !26
  %101 = icmp ne i8 %100, 0
  br i1 %101, label %102, label %105

102:                                              ; preds = %98
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 -1
  store ptr %104, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %106

105:                                              ; preds = %98, %88
  store ptr null, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %106

106:                                              ; preds = %105, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  br label %107

107:                                              ; preds = %106, %82, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %108 = load ptr, ptr %5, align 8
  ret ptr %108

109:                                              ; preds = %84
  %110 = load ptr, ptr %15, align 8
  %111 = load i32, ptr %16, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

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 = !{!10, !10, i64 0}
!10 = !{!"_ZTS13TiXmlEncoding", !7, i64 0}
!11 = !{i64 0, i64 4, !12, i64 4, i64 4, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !23, i64 104}
!15 = !{!"_ZTS9TiXmlText", !16, i64 0, !23, i64 104}
!16 = !{!"_ZTS9TiXmlNode", !17, i64 0, !6, i64 24, !19, i64 32, !6, i64 40, !6, i64 48, !20, i64 56, !6, i64 88, !6, i64 96}
!17 = !{!"_ZTS9TiXmlBase", !18, i64 8, !6, i64 16}
!18 = !{!"_ZTS11TiXmlCursor", !13, i64 0, !13, i64 4}
!19 = !{!"_ZTSN9TiXmlNode8NodeTypeE", !7, i64 0}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !22, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!23, !23, i64 0}


; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str.11 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [2 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: mustprogress nounwind uwtable
declare dso_local void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef, ptr noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef, ptr noundef, i1 noundef zeroext, ptr noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9TiXmlText5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(105) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  %7 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.11)
  %8 = tail call noundef ptr @_ZN9TiXmlNode11GetDocumentEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %13, label %9

9:                                                ; preds = %4
  tail call void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20) %2, ptr noundef %1, i32 noundef %3)
  %10 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20) %2)
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i64, ptr %10, align 4
  store i64 %12, ptr %11, align 8
  br label %13

13:                                               ; preds = %9, %4
  %14 = getelementptr inbounds i8, ptr %0, i64 104
  %15 = load i8, ptr %14, align 8, !tbaa !5, !range !19, !noundef !20
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %19, label %17

17:                                               ; preds = %13
  %18 = tail call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %1, ptr noundef nonnull @.str.22, i1 noundef zeroext false, i32 noundef %3)
  br i1 %18, label %19, label %36

19:                                               ; preds = %17, %13
  store i8 1, ptr %14, align 8, !tbaa !5
  %20 = tail call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %1, ptr noundef nonnull @.str.22, i1 noundef zeroext false, i32 noundef %3)
  br i1 %20, label %23, label %21

21:                                               ; preds = %19
  %.not40 = icmp eq ptr %8, null
  br i1 %.not40, label %41, label %22

22:                                               ; preds = %21
  tail call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %8, i32 noundef 14, ptr noundef %1, ptr noundef %2, i32 noundef %3)
  br label %41

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %1, i64 9
  %25 = load i8, ptr %24, align 1, !tbaa !21
  %.not4142 = icmp eq i8 %25, 0
  br i1 %.not4142, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %23, %27
  %.03443 = phi ptr [ %30, %27 ], [ %24, %23 ]
  %26 = tail call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %.03443, ptr noundef nonnull @.str.30, i1 noundef zeroext false, i32 noundef %3)
  br i1 %26, label %.critedge, label %27

27:                                               ; preds = %.lr.ph
  %28 = load i8, ptr %.03443, align 1, !tbaa !21
  %29 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %6, i8 noundef signext %28)
  %30 = getelementptr inbounds i8, ptr %.03443, i64 1
  %31 = load i8, ptr %30, align 1, !tbaa !21
  %.not41 = icmp eq i8 %31, 0
  br i1 %.not41, label %.critedge, label %.lr.ph, !llvm.loop !22

.critedge:                                        ; preds = %.lr.ph, %27, %23
  %.034.lcssa = phi ptr [ %24, %23 ], [ %30, %27 ], [ %.03443, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  %32 = invoke noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef nonnull %.034.lcssa, ptr noundef nonnull %5, i1 noundef zeroext false, ptr noundef nonnull @.str.30, i1 noundef zeroext false, i32 noundef %3)
          to label %33 unwind label %34

33:                                               ; preds = %.critedge
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  br label %41

34:                                               ; preds = %.critedge
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  resume { ptr, i32 } %35

36:                                               ; preds = %17
  %37 = tail call noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef %1, ptr noundef nonnull %6, i1 noundef zeroext true, ptr noundef nonnull @.str.31, i1 noundef zeroext false, i32 noundef %3)
  %.not38 = icmp eq ptr %37, null
  br i1 %.not38, label %41, label %38

38:                                               ; preds = %36
  %39 = load i8, ptr %37, align 1, !tbaa !21
  %.not39 = icmp eq i8 %39, 0
  %40 = getelementptr inbounds i8, ptr %37, i64 -1
  %spec.select = select i1 %.not39, ptr null, ptr %40
  br label %41

41:                                               ; preds = %38, %36, %21, %22, %33
  %.1 = phi ptr [ %32, %33 ], [ null, %22 ], [ null, %21 ], [ null, %36 ], [ %spec.select, %38 ]
  ret ptr %.1
}

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, !18, i64 104}
!6 = !{!"_ZTS9TiXmlText", !7, i64 0, !18, i64 104}
!7 = !{!"_ZTS9TiXmlNode", !8, i64 0, !13, i64 24, !14, i64 32, !13, i64 40, !13, i64 48, !15, i64 56, !13, i64 88, !13, i64 96}
!8 = !{!"_ZTS9TiXmlBase", !9, i64 8, !13, i64 16}
!9 = !{!"_ZTS11TiXmlCursor", !10, i64 0, !10, i64 4}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"any pointer", !11, i64 0}
!14 = !{!"_ZTSN9TiXmlNode8NodeTypeE", !11, i64 0}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !11, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!17 = !{!"long", !11, i64 0}
!18 = !{!"bool", !11, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!11, !11, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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