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

@.str.11 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZN9TiXmlBase18condenseWhiteSpaceE = external global 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext) #3 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: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; 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
define dso_local noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2, ptr noundef %3, i1 noundef zeroext %4, i32 noundef %5) #2 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [4 x i8], align 1
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca [4 x i8], align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %9, align 1, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  %19 = zext i1 %4 to i8
  store i8 %19, ptr %11, align 1, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !11
  %20 = load ptr, ptr %8, align 8, !tbaa !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)
  %22 = load i8, ptr %9, align 1, !tbaa !9, !range !13, !noundef !14
  %23 = trunc i8 %22 to i1
  br i1 %23, label %24, label %27

24:                                               ; preds = %6
  %25 = load i8, ptr @_ZN9TiXmlBase18condenseWhiteSpaceE, align 1, !tbaa !9, !range !13, !noundef !14
  %26 = trunc i8 %25 to i1
  br i1 %26, label %56, label %27

27:                                               ; preds = %24, %6
  br label %28

28:                                               ; preds = %45, %27
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %43

31:                                               ; preds = %28
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load i8, ptr %32, align 1, !tbaa !15
  %34 = icmp ne i8 %33, 0
  br i1 %34, label %35, label %43

35:                                               ; preds = %31
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load i8, ptr %11, align 1, !tbaa !9, !range !13, !noundef !14
  %39 = trunc i8 %38 to i1
  %40 = load i32, ptr %12, align 4, !tbaa !11
  %41 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %36, ptr noundef %37, i1 noundef zeroext %39, i32 noundef %40)
  %42 = xor i1 %41, true
  br label %43

43:                                               ; preds = %35, %31, %28
  %44 = phi i1 [ false, %31 ], [ false, %28 ], [ %42, %35 ]
  br i1 %44, label %45, label %55

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.memset.p0.i64(ptr align 1 %14, i8 0, i64 4, i1 false)
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds [4 x i8], ptr %14, i64 0, i64 0
  %48 = load i32, ptr %12, align 4, !tbaa !11
  %49 = call noundef ptr @_ZN9TiXmlBase7GetCharEPKcPcPi13TiXmlEncoding(ptr noundef %46, ptr noundef %47, ptr noundef %13, i32 noundef %48)
  store ptr %49, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds [4 x i8], ptr %14, i64 0, i64 0
  %52 = load i32, ptr %13, align 4, !tbaa !16
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %50, ptr noundef %51, i64 noundef %53)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %28, !llvm.loop !18

55:                                               ; preds = %43
  br label %125

56:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  store i8 0, ptr %15, align 1, !tbaa !9
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !11
  %59 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %57, i32 noundef %58)
  store ptr %59, ptr %7, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %123, %56
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %75

63:                                               ; preds = %60
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load i8, ptr %64, align 1, !tbaa !15
  %66 = icmp ne i8 %65, 0
  br i1 %66, label %67, label %75

67:                                               ; preds = %63
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = load i8, ptr %11, align 1, !tbaa !9, !range !13, !noundef !14
  %71 = trunc i8 %70 to i1
  %72 = load i32, ptr %12, align 4, !tbaa !11
  %73 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %68, ptr noundef %69, i1 noundef zeroext %71, i32 noundef %72)
  %74 = xor i1 %73, true
  br label %75

75:                                               ; preds = %67, %63, %60
  %76 = phi i1 [ false, %63 ], [ false, %60 ], [ %74, %67 ]
  br i1 %76, label %77, label %124

77:                                               ; preds = %75
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = load i8, ptr %78, align 1, !tbaa !15
  %80 = sext i8 %79 to i32
  %81 = icmp eq i32 %80, 13
  br i1 %81, label %87, label %82

82:                                               ; preds = %77
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = load i8, ptr %83, align 1, !tbaa !15
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 10
  br i1 %86, label %87, label %90

87:                                               ; preds = %82, %77
  store i8 1, ptr %15, align 1, !tbaa !9
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i32 1
  store ptr %89, ptr %7, align 8, !tbaa !5
  br label %123

90:                                               ; preds = %82
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load i8, ptr %91, align 1, !tbaa !15
  %93 = call noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext %92)
  br i1 %93, label %94, label %97

94:                                               ; preds = %90
  store i8 1, ptr %15, align 1, !tbaa !9
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i32 1
  store ptr %96, ptr %7, align 8, !tbaa !5
  br label %122

97:                                               ; preds = %90
  %98 = load i8, ptr %15, align 1, !tbaa !9, !range !13, !noundef !14
  %99 = trunc i8 %98 to i1
  br i1 %99, label %100, label %103

100:                                              ; preds = %97
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %101, i8 noundef signext 32)
  store i8 0, ptr %15, align 1, !tbaa !9
  br label %103

103:                                              ; preds = %100, %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.memset.p0.i64(ptr align 1 %17, i8 0, i64 4, i1 false)
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds [4 x i8], ptr %17, i64 0, i64 0
  %106 = load i32, ptr %12, align 4, !tbaa !11
  %107 = call noundef ptr @_ZN9TiXmlBase7GetCharEPKcPcPi13TiXmlEncoding(ptr noundef %104, ptr noundef %105, ptr noundef %16, i32 noundef %106)
  store ptr %107, ptr %7, align 8, !tbaa !5
  %108 = load i32, ptr %16, align 4, !tbaa !16
  %109 = icmp eq i32 %108, 1
  br i1 %109, label %110, label %115

110:                                              ; preds = %103
  %111 = getelementptr inbounds [4 x i8], ptr %17, i64 0, i64 0
  %112 = load i8, ptr %111, align 1, !tbaa !15
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %113, i8 noundef signext %112)
  br label %121

115:                                              ; preds = %103
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = getelementptr inbounds [4 x i8], ptr %17, i64 0, i64 0
  %118 = load i32, ptr %16, align 4, !tbaa !16
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %116, ptr noundef %117, i64 noundef %119)
  br label %121

121:                                              ; preds = %115, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %122

122:                                              ; preds = %121, %94
  br label %123

123:                                              ; preds = %122, %87
  br label %60, !llvm.loop !20

124:                                              ; preds = %75
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  br label %125

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

128:                                              ; preds = %125
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load i8, ptr %129, align 1, !tbaa !15
  %131 = icmp ne i8 %130, 0
  br i1 %131, label %132, label %137

132:                                              ; preds = %128
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = call i64 @strlen(ptr noundef %133) #6
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds i8, ptr %135, i64 %134
  store ptr %136, ptr %7, align 8, !tbaa !5
  br label %137

137:                                              ; preds = %132, %128, %125
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %146

140:                                              ; preds = %137
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = load i8, ptr %141, align 1, !tbaa !15
  %143 = icmp ne i8 %142, 0
  br i1 %143, label %144, label %146

144:                                              ; preds = %140
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  br label %147

146:                                              ; preds = %140, %137
  br label %147

147:                                              ; preds = %146, %144
  %148 = phi ptr [ %145, %144 ], [ null, %146 ]
  ret ptr %148
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9TiXmlBase7GetCharEPKcPcPi13TiXmlEncoding(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(read) "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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS13TiXmlEncoding", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.11 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZN9TiXmlBase18condenseWhiteSpaceE = external local_unnamed_addr global 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 uwtable
declare dso_local noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext) local_unnamed_addr #2 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 #1 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 #1 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9TiXmlBase8ReadTextEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbS1_b13TiXmlEncoding(ptr noundef %0, ptr noundef nonnull %1, i1 noundef zeroext %2, ptr noundef %3, i1 noundef zeroext %4, i32 noundef %5) local_unnamed_addr #1 align 2 {
  %7 = alloca i32, align 4
  %8 = alloca [4 x i8], align 4
  %9 = alloca i32, align 4
  %10 = alloca [4 x i8], align 4
  %11 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.11)
  br i1 %2, label %12, label %15

12:                                               ; preds = %6
  %13 = load i8, ptr @_ZN9TiXmlBase18condenseWhiteSpaceE, align 1, !tbaa !5, !range !9, !noundef !10
  %14 = trunc nuw i8 %13 to i1
  br i1 %14, label %24, label %15

15:                                               ; preds = %12, %6
  %.not72 = icmp eq ptr %0, null
  br i1 %.not72, label %.critedge.thread57, label %.lr.ph

.lr.ph:                                           ; preds = %15, %19
  %.03873 = phi ptr [ %20, %19 ], [ %0, %15 ]
  %16 = load i8, ptr %.03873, align 1, !tbaa !11
  %.not43 = icmp eq i8 %16, 0
  br i1 %.not43, label %.critedge.thread57, label %17

17:                                               ; preds = %.lr.ph
  %18 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %.03873, ptr noundef %3, i1 noundef zeroext %4, i32 noundef %5)
  br i1 %18, label %.loopexit, label %19

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 0, ptr %8, align 4
  %20 = call noundef ptr @_ZN9TiXmlBase7GetCharEPKcPcPi13TiXmlEncoding(ptr noundef nonnull %.03873, ptr noundef nonnull %8, ptr noundef nonnull %7, i32 noundef %5)
  %21 = load i32, ptr %7, align 4, !tbaa !12
  %22 = sext i32 %21 to i64
  %23 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %8, i64 noundef %22)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %.not = icmp eq ptr %20, null
  br i1 %.not, label %.critedge.thread57, label %.lr.ph, !llvm.loop !14

24:                                               ; preds = %12
  %25 = tail call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %0, i32 noundef %5)
  %.not4474 = icmp eq ptr %25, null
  br i1 %.not4474, label %.critedge.thread57, label %.lr.ph77

.lr.ph77:                                         ; preds = %24, %51
  %.076 = phi i1 [ %.2, %51 ], [ false, %24 ]
  %.13975 = phi ptr [ %.240, %51 ], [ %25, %24 ]
  %26 = load i8, ptr %.13975, align 1, !tbaa !11
  %.not45 = icmp eq i8 %26, 0
  br i1 %.not45, label %.critedge.thread57, label %27

27:                                               ; preds = %.lr.ph77
  %28 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %.13975, ptr noundef %3, i1 noundef zeroext %4, i32 noundef %5)
  br i1 %28, label %.loopexit, label %29

29:                                               ; preds = %27
  %30 = load i8, ptr %.13975, align 1, !tbaa !11
  switch i8 %30, label %33 [
    i8 13, label %31
    i8 10, label %31
  ]

31:                                               ; preds = %29, %29
  %32 = getelementptr inbounds i8, ptr %.13975, i64 1
  br label %51

33:                                               ; preds = %29
  %34 = call noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext %30)
  br i1 %34, label %35, label %37

35:                                               ; preds = %33
  %36 = getelementptr inbounds i8, ptr %.13975, i64 1
  br label %51

37:                                               ; preds = %33
  br i1 %.076, label %38, label %40

38:                                               ; preds = %37
  %39 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %1, i8 noundef signext 32)
  br label %40

40:                                               ; preds = %38, %37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  store i32 0, ptr %10, align 4
  %41 = call noundef ptr @_ZN9TiXmlBase7GetCharEPKcPcPi13TiXmlEncoding(ptr noundef nonnull %.13975, ptr noundef nonnull %10, ptr noundef nonnull %9, i32 noundef %5)
  %42 = load i32, ptr %9, align 4, !tbaa !12
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %47

44:                                               ; preds = %40
  %45 = load i8, ptr %10, align 4, !tbaa !11
  %46 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %1, i8 noundef signext %45)
  br label %50

47:                                               ; preds = %40
  %48 = sext i32 %42 to i64
  %49 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %10, i64 noundef %48)
  br label %50

50:                                               ; preds = %47, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  br label %51

51:                                               ; preds = %35, %50, %31
  %.240 = phi ptr [ %32, %31 ], [ %36, %35 ], [ %41, %50 ]
  %.2 = phi i1 [ true, %31 ], [ true, %35 ], [ false, %50 ]
  %.not44 = icmp eq ptr %.240, null
  br i1 %.not44, label %.critedge.thread57, label %.lr.ph77, !llvm.loop !16

.loopexit:                                        ; preds = %17, %27
  %.3.ph.ph = phi ptr [ %.13975, %27 ], [ %.03873, %17 ]
  %.pr = load i8, ptr %.3.ph.ph, align 1, !tbaa !11
  %.not47 = icmp eq i8 %.pr, 0
  br i1 %.not47, label %.critedge.thread57, label %.critedge

.critedge:                                        ; preds = %.loopexit
  %52 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #5
  %53 = getelementptr inbounds i8, ptr %.3.ph.ph, i64 %52
  %.pre = load i8, ptr %53, align 1, !tbaa !11
  %54 = icmp eq i8 %.pre, 0
  %55 = select i1 %54, ptr null, ptr %53
  br label %.critedge.thread57

.critedge.thread57:                               ; preds = %19, %.lr.ph, %51, %.lr.ph77, %.loopexit, %.critedge, %15, %24
  %56 = phi ptr [ null, %24 ], [ null, %15 ], [ %55, %.critedge ], [ null, %.loopexit ], [ null, %.lr.ph77 ], [ null, %51 ], [ null, %.lr.ph ], [ null, %19 ]
  ret ptr %56
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9TiXmlBase7GetCharEPKcPcPi13TiXmlEncoding(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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