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

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

%"struct.tinyxml2::Entity" = type { ptr, i32, i8 }
%"class.tinyxml2::XMLPrinter" = type { %"class.tinyxml2::XMLVisitor", i8, %"class.tinyxml2::DynArray.7", i8, ptr, i32, i32, i8, i8, [64 x i8], [64 x i8], [6 x i8], %"class.tinyxml2::DynArray.8" }
%"class.tinyxml2::XMLVisitor" = type { ptr }
%"class.tinyxml2::DynArray.7" = type { ptr, [10 x ptr], i32, i32 }
%"class.tinyxml2::DynArray.8" = type <{ ptr, [20 x i8], i32, i32, [4 x i8] }>

@_ZN8tinyxml2L8entitiesE = external hidden constant [5 x %"struct.tinyxml2::Entity"], align 16

; 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 uwtable
declare dso_local void @_ZN8tinyxml210XMLPrinter5WriteEPKc(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef) #1 align 2

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

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %23 = load i8, ptr %6, align 1, !tbaa !9, !range !17, !noundef !18
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = getelementptr inbounds %"class.tinyxml2::XMLPrinter", ptr %17, i32 0, i32 10
  br label %29

27:                                               ; preds = %22
  %28 = getelementptr inbounds %"class.tinyxml2::XMLPrinter", ptr %17, i32 0, i32 9
  br label %29

29:                                               ; preds = %27, %25
  %30 = phi ptr [ %26, %25 ], [ %28, %27 ]
  %31 = getelementptr inbounds [64 x i8], ptr %30, i64 0, i64 0
  store ptr %31, ptr %8, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %144, %29
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load i8, ptr %33, align 1, !tbaa !19
  %35 = icmp ne i8 %34, 0
  br i1 %35, label %36, label %145

36:                                               ; preds = %32
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i8, ptr %40, align 1, !tbaa !19
  %42 = sext i8 %41 to i32
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %139

44:                                               ; preds = %39
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load i8, ptr %45, align 1, !tbaa !19
  %47 = sext i8 %46 to i32
  %48 = icmp slt i32 %47, 64
  br i1 %48, label %49, label %139

49:                                               ; preds = %44
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = load i8, ptr %51, align 1, !tbaa !19
  %53 = zext i8 %52 to i64
  %54 = getelementptr inbounds i8, ptr %50, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !9, !range !17, !noundef !18
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %138

57:                                               ; preds = %49
  br label %58

58:                                               ; preds = %74, %57
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = icmp ult ptr %59, %60
  br i1 %61, label %62, label %86

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = ptrtoint ptr %63 to i64
  %66 = ptrtoint ptr %64 to i64
  %67 = sub i64 %65, %66
  store i64 %67, ptr %9, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %68 = load i64, ptr %9, align 8, !tbaa !20
  %69 = icmp ult i64 2147483647, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %62
  br label %74

71:                                               ; preds = %62
  %72 = load i64, ptr %9, align 8, !tbaa !20
  %73 = trunc i64 %72 to i32
  br label %74

74:                                               ; preds = %71, %70
  %75 = phi i32 [ 2147483647, %70 ], [ %73, %71 ]
  store i32 %75, ptr %10, align 4, !tbaa !22
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !22
  %78 = sext i32 %77 to i64
  %79 = load ptr, ptr %17, align 8, !tbaa !23
  %80 = getelementptr inbounds ptr, ptr %79, i64 14
  %81 = load ptr, ptr %80, align 8
  call void %81(ptr noundef nonnull align 8 dereferenceable(312) %17, ptr noundef %76, i64 noundef %78)
  %82 = load i32, ptr %10, align 4, !tbaa !22
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = sext i32 %82 to i64
  %85 = getelementptr inbounds i8, ptr %83, i64 %84
  store ptr %85, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %58, !llvm.loop !25

86:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  store i8 0, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !22
  br label %87

87:                                               ; preds = %124, %86
  %88 = load i32, ptr %12, align 4, !tbaa !22
  %89 = icmp slt i32 %88, 5
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  store i32 8, ptr %13, align 4
  br label %127

91:                                               ; preds = %87
  %92 = load i32, ptr %12, align 4, !tbaa !22
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [5 x %"struct.tinyxml2::Entity"], ptr @_ZN8tinyxml2L8entitiesE, i64 0, i64 %93
  %95 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %94, i32 0, i32 2
  %96 = load i8, ptr %95, align 4, !tbaa !27
  %97 = sext i8 %96 to i32
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = load i8, ptr %98, align 1, !tbaa !19
  %100 = sext i8 %99 to i32
  %101 = icmp eq i32 %97, %100
  br i1 %101, label %102, label %123

102:                                              ; preds = %91
  %103 = load ptr, ptr %17, align 8, !tbaa !23
  %104 = getelementptr inbounds ptr, ptr %103, i64 15
  %105 = load ptr, ptr %104, align 8
  call void %105(ptr noundef nonnull align 8 dereferenceable(312) %17, i8 noundef signext 38)
  %106 = load i32, ptr %12, align 4, !tbaa !22
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [5 x %"struct.tinyxml2::Entity"], ptr @_ZN8tinyxml2L8entitiesE, i64 0, i64 %107
  %109 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 16, !tbaa !29
  %111 = load i32, ptr %12, align 4, !tbaa !22
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5 x %"struct.tinyxml2::Entity"], ptr @_ZN8tinyxml2L8entitiesE, i64 0, i64 %112
  %114 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 8, !tbaa !30
  %116 = sext i32 %115 to i64
  %117 = load ptr, ptr %17, align 8, !tbaa !23
  %118 = getelementptr inbounds ptr, ptr %117, i64 14
  %119 = load ptr, ptr %118, align 8
  call void %119(ptr noundef nonnull align 8 dereferenceable(312) %17, ptr noundef %110, i64 noundef %116)
  %120 = load ptr, ptr %17, align 8, !tbaa !23
  %121 = getelementptr inbounds ptr, ptr %120, i64 15
  %122 = load ptr, ptr %121, align 8
  call void %122(ptr noundef nonnull align 8 dereferenceable(312) %17, i8 noundef signext 59)
  store i8 1, ptr %11, align 1, !tbaa !9
  store i32 8, ptr %13, align 4
  br label %127

123:                                              ; preds = %91
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %12, align 4, !tbaa !22
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %12, align 4, !tbaa !22
  br label %87, !llvm.loop !31

127:                                              ; preds = %102, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %128

128:                                              ; preds = %127
  %129 = load i8, ptr %11, align 1, !tbaa !9, !range !17, !noundef !18
  %130 = trunc i8 %129 to i1
  br i1 %130, label %135, label %131

131:                                              ; preds = %128
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134, %128
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds i8, ptr %136, i32 1
  store ptr %137, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  br label %138

138:                                              ; preds = %135, %49
  br label %139

139:                                              ; preds = %138, %44, %39
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i32 1
  store ptr %141, ptr %7, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %139
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143
  br label %32, !llvm.loop !32

145:                                              ; preds = %32
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = icmp ult ptr %146, %147
  br i1 %148, label %149, label %169

149:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = ptrtoint ptr %150 to i64
  %153 = ptrtoint ptr %151 to i64
  %154 = sub i64 %152, %153
  store i64 %154, ptr %14, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %155 = load i64, ptr %14, align 8, !tbaa !20
  %156 = icmp ult i64 2147483647, %155
  br i1 %156, label %157, label %158

157:                                              ; preds = %149
  br label %161

158:                                              ; preds = %149
  %159 = load i64, ptr %14, align 8, !tbaa !20
  %160 = trunc i64 %159 to i32
  br label %161

161:                                              ; preds = %158, %157
  %162 = phi i32 [ 2147483647, %157 ], [ %160, %158 ]
  store i32 %162, ptr %15, align 4, !tbaa !22
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = load i32, ptr %15, align 4, !tbaa !22
  %165 = sext i32 %164 to i64
  %166 = load ptr, ptr %17, align 8, !tbaa !23
  %167 = getelementptr inbounds ptr, ptr %166, i64 14
  %168 = load ptr, ptr %167, align 8
  call void %168(ptr noundef nonnull align 8 dereferenceable(312) %17, ptr noundef %163, i64 noundef %165)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %169

169:                                              ; preds = %161, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %172

170:                                              ; preds = %3
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN8tinyxml210XMLPrinter5WriteEPKc(ptr noundef nonnull align 8 dereferenceable(312) %17, ptr noundef %171)
  br label %172

172:                                              ; preds = %170, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 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 = !{!"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, !10, i64 136}
!12 = !{!"_ZTSN8tinyxml210XMLPrinterE", !13, i64 0, !10, i64 8, !14, i64 16, !10, i64 112, !6, i64 120, !15, i64 128, !15, i64 132, !10, i64 136, !10, i64 137, !7, i64 138, !7, i64 202, !16, i64 272}
!13 = !{!"_ZTSN8tinyxml210XMLVisitorE"}
!14 = !{!"_ZTSN8tinyxml28DynArrayIPKcLi10EEE", !6, i64 0, !7, i64 8, !15, i64 88, !15, i64 92}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN8tinyxml28DynArrayIcLi20EEE", !6, i64 0, !7, i64 8, !15, i64 28, !15, i64 32}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!15, !15, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !7, i64 12}
!28 = !{!"_ZTSN8tinyxml26EntityE", !6, i64 0, !15, i64 8, !7, i64 12}
!29 = !{!28, !6, i64 0}
!30 = !{!28, !15, i64 8}
!31 = distinct !{!31, !26}
!32 = distinct !{!32, !26}


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

%"struct.tinyxml2::Entity" = type { ptr, i32, i8 }

@_ZN8tinyxml2L8entitiesE = external hidden local_unnamed_addr constant [5 x %"struct.tinyxml2::Entity"], align 16

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8tinyxml210XMLPrinter5WriteEPKc(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8tinyxml210XMLPrinter11PrintStringEPKcb(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef %1, i1 noundef zeroext %2) local_unnamed_addr #1 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 136
  %5 = load i8, ptr %4, align 8, !tbaa !5, !range !15, !noundef !16
  %6 = trunc nuw i8 %5 to i1
  br i1 %6, label %7, label %69

7:                                                ; preds = %3
  %.v = select i1 %2, i64 202, i64 138
  %8 = getelementptr inbounds i8, ptr %0, i64 %.v
  %9 = load i8, ptr %1, align 1, !tbaa !17
  %.not43 = icmp eq i8 %9, 0
  br i1 %.not43, label %._crit_edge.thread, label %.lr.ph46.preheader

.lr.ph46.preheader:                               ; preds = %7
  %10 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 12), align 4
  %11 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 28), align 4
  %12 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 44), align 4
  %13 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 60), align 4
  %14 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 76), align 4
  br label %.lr.ph46

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %57
  %15 = phi i8 [ %59, %57 ], [ %9, %.lr.ph46.preheader ]
  %.045 = phi ptr [ %.2, %57 ], [ %1, %.lr.ph46.preheader ]
  %.03544 = phi ptr [ %58, %57 ], [ %1, %.lr.ph46.preheader ]
  %or.cond = icmp ult i8 %15, 64
  br i1 %or.cond, label %16, label %57

16:                                               ; preds = %.lr.ph46
  %17 = zext nneg i8 %15 to i64
  %18 = getelementptr inbounds i8, ptr %8, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !18, !range !15, !noundef !16
  %20 = trunc nuw i8 %19 to i1
  br i1 %20, label %.preheader40, label %57

.preheader40:                                     ; preds = %16
  %21 = icmp ult ptr %.045, %.03544
  br i1 %21, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %.preheader40
  %22 = ptrtoint ptr %.03544 to i64
  br label %25

.preheader.loopexit:                              ; preds = %25
  %.pre = load i8, ptr %.03544, align 1, !tbaa !17
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader40
  %23 = phi i8 [ %15, %.preheader40 ], [ %.pre, %.preheader.loopexit ]
  %.1.lcssa = phi ptr [ %.045, %.preheader40 ], [ %32, %.preheader.loopexit ]
  %24 = icmp eq i8 %10, %23
  br i1 %24, label %42, label %34

25:                                               ; preds = %.lr.ph, %25
  %.141 = phi ptr [ %.045, %.lr.ph ], [ %32, %25 ]
  %26 = ptrtoint ptr %.141 to i64
  %27 = sub i64 %22, %26
  %28 = tail call i64 @llvm.umin.i64(i64 %27, i64 2147483647)
  %29 = load ptr, ptr %0, align 8, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %29, i64 112
  %31 = load ptr, ptr %30, align 8
  tail call void %31(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef %.141, i64 noundef %28)
  %32 = getelementptr inbounds i8, ptr %.141, i64 %28
  %33 = icmp ult ptr %32, %.03544
  br i1 %33, label %25, label %.preheader.loopexit, !llvm.loop !21

34:                                               ; preds = %.preheader
  %35 = icmp eq i8 %11, %23
  br i1 %35, label %42, label %36

36:                                               ; preds = %34
  %37 = icmp eq i8 %12, %23
  br i1 %37, label %42, label %38

38:                                               ; preds = %36
  %39 = icmp eq i8 %13, %23
  br i1 %39, label %42, label %40

40:                                               ; preds = %38
  %41 = icmp eq i8 %14, %23
  br i1 %41, label %42, label %.loopexit

42:                                               ; preds = %40, %38, %36, %34, %.preheader
  %.lcssa49 = phi ptr [ @_ZN8tinyxml2L8entitiesE, %.preheader ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 16), %34 ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 32), %36 ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 48), %38 ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 64), %40 ]
  %43 = load ptr, ptr %0, align 8, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %43, i64 120
  %45 = load ptr, ptr %44, align 8
  tail call void %45(ptr noundef nonnull align 8 dereferenceable(312) %0, i8 noundef signext 38)
  %46 = load ptr, ptr %.lcssa49, align 16, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %.lcssa49, i64 8
  %48 = load i32, ptr %47, align 8, !tbaa !25
  %49 = sext i32 %48 to i64
  %50 = load ptr, ptr %0, align 8, !tbaa !19
  %51 = getelementptr inbounds i8, ptr %50, i64 112
  %52 = load ptr, ptr %51, align 8
  tail call void %52(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef %46, i64 noundef %49)
  %53 = load ptr, ptr %0, align 8, !tbaa !19
  %54 = getelementptr inbounds i8, ptr %53, i64 120
  %55 = load ptr, ptr %54, align 8
  tail call void %55(ptr noundef nonnull align 8 dereferenceable(312) %0, i8 noundef signext 59)
  br label %.loopexit

.loopexit:                                        ; preds = %40, %42
  %56 = getelementptr inbounds i8, ptr %.1.lcssa, i64 1
  br label %57

57:                                               ; preds = %16, %.loopexit, %.lr.ph46
  %.2 = phi ptr [ %56, %.loopexit ], [ %.045, %16 ], [ %.045, %.lr.ph46 ]
  %58 = getelementptr inbounds i8, ptr %.03544, i64 1
  %59 = load i8, ptr %58, align 1, !tbaa !17
  %.not = icmp eq i8 %59, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph46, !llvm.loop !26

._crit_edge:                                      ; preds = %57
  %60 = icmp ult ptr %.2, %58
  br i1 %60, label %61, label %._crit_edge.thread

61:                                               ; preds = %._crit_edge
  %62 = ptrtoint ptr %58 to i64
  %63 = ptrtoint ptr %.2 to i64
  %64 = sub i64 %62, %63
  %65 = tail call i64 @llvm.umin.i64(i64 %64, i64 2147483647)
  %66 = load ptr, ptr %0, align 8, !tbaa !19
  %67 = getelementptr inbounds i8, ptr %66, i64 112
  %68 = load ptr, ptr %67, align 8
  tail call void %68(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef %.2, i64 noundef %65)
  br label %._crit_edge.thread

69:                                               ; preds = %3
  tail call void @_ZN8tinyxml210XMLPrinter5WriteEPKc(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef %1)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %7, %._crit_edge, %61, %69
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #2

attributes #0 = { inlinehint 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !8, i64 136}
!6 = !{!"_ZTSN8tinyxml210XMLPrinterE", !7, i64 0, !8, i64 8, !11, i64 16, !8, i64 112, !12, i64 120, !13, i64 128, !13, i64 132, !8, i64 136, !8, i64 137, !9, i64 138, !9, i64 202, !14, i64 272}
!7 = !{!"_ZTSN8tinyxml210XMLVisitorE"}
!8 = !{!"bool", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN8tinyxml28DynArrayIPKcLi10EEE", !12, i64 0, !9, i64 8, !13, i64 88, !13, i64 92}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"_ZTSN8tinyxml28DynArrayIcLi20EEE", !12, i64 0, !9, i64 8, !13, i64 28, !13, i64 32}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!9, !9, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !10, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !12, i64 0}
!24 = !{!"_ZTSN8tinyxml26EntityE", !12, i64 0, !13, i64 8, !9, i64 12}
!25 = !{!24, !13, i64 8}
!26 = distinct !{!26, !22}


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