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

; 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.TiXmlBase::Entity" = type { ptr, i32, i8 }

@_ZN9TiXmlBase6entityE = external global [5 x %"struct.TiXmlBase::Entity"], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9TiXmlBase12EncodeStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca [32 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %167, %2
  %9 = load i32, ptr %5, align 4, !tbaa !9
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  %12 = trunc i64 %11 to i32
  %13 = icmp slt i32 %9, %12
  br i1 %13, label %14, label %168

14:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %15, i64 noundef %17) #5
  %19 = load i8, ptr %18, align 1, !tbaa !11
  store i8 %19, ptr %6, align 1, !tbaa !11
  %20 = load i8, ptr %6, align 1, !tbaa !11
  %21 = zext i8 %20 to i32
  %22 = icmp eq i32 %21, 38
  br i1 %22, label %23, label %76

23:                                               ; preds = %14
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  %27 = trunc i64 %26 to i32
  %28 = sub nsw i32 %27, 2
  %29 = icmp slt i32 %24, %28
  br i1 %29, label %30, label %76

30:                                               ; preds = %23
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %31, i64 noundef %34) #5
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 35
  br i1 %38, label %39, label %76

39:                                               ; preds = %30
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = add nsw i32 %41, 2
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %40, i64 noundef %43) #5
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = sext i8 %45 to i32
  %47 = icmp eq i32 %46, 120
  br i1 %47, label %48, label %76

48:                                               ; preds = %39
  br label %49

49:                                               ; preds = %74, %48
  %50 = load i32, ptr %5, align 4, !tbaa !9
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %51) #5
  %53 = trunc i64 %52 to i32
  %54 = sub nsw i32 %53, 1
  %55 = icmp slt i32 %50, %54
  br i1 %55, label %56, label %75

56:                                               ; preds = %49
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %58) #5
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %63 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %57, ptr noundef %62, i64 noundef 1)
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %5, align 4, !tbaa !9
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %66, i64 noundef %68) #5
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 59
  br i1 %72, label %73, label %74

73:                                               ; preds = %56
  br label %75

74:                                               ; preds = %56
  br label %49, !llvm.loop !12

75:                                               ; preds = %73, %49
  br label %167

76:                                               ; preds = %39, %30, %23, %14
  %77 = load i8, ptr %6, align 1, !tbaa !11
  %78 = zext i8 %77 to i32
  %79 = icmp eq i32 %78, 38
  br i1 %79, label %80, label %88

80:                                               ; preds = %76
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load ptr, ptr @_ZN9TiXmlBase6entityE, align 16, !tbaa !14
  %83 = load i32, ptr getelementptr inbounds (%"struct.TiXmlBase::Entity", ptr @_ZN9TiXmlBase6entityE, i32 0, i32 1), align 8, !tbaa !16
  %84 = zext i32 %83 to i64
  %85 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %81, ptr noundef %82, i64 noundef %84)
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %5, align 4, !tbaa !9
  br label %166

88:                                               ; preds = %76
  %89 = load i8, ptr %6, align 1, !tbaa !11
  %90 = zext i8 %89 to i32
  %91 = icmp eq i32 %90, 60
  br i1 %91, label %92, label %100

92:                                               ; preds = %88
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = load ptr, ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 1), align 16, !tbaa !14
  %95 = load i32, ptr getelementptr inbounds (%"struct.TiXmlBase::Entity", ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 1), i32 0, i32 1), align 8, !tbaa !16
  %96 = zext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %93, ptr noundef %94, i64 noundef %96)
  %98 = load i32, ptr %5, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %5, align 4, !tbaa !9
  br label %165

100:                                              ; preds = %88
  %101 = load i8, ptr %6, align 1, !tbaa !11
  %102 = zext i8 %101 to i32
  %103 = icmp eq i32 %102, 62
  br i1 %103, label %104, label %112

104:                                              ; preds = %100
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = load ptr, ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 2), align 16, !tbaa !14
  %107 = load i32, ptr getelementptr inbounds (%"struct.TiXmlBase::Entity", ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 2), i32 0, i32 1), align 8, !tbaa !16
  %108 = zext i32 %107 to i64
  %109 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %105, ptr noundef %106, i64 noundef %108)
  %110 = load i32, ptr %5, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %5, align 4, !tbaa !9
  br label %164

112:                                              ; preds = %100
  %113 = load i8, ptr %6, align 1, !tbaa !11
  %114 = zext i8 %113 to i32
  %115 = icmp eq i32 %114, 34
  br i1 %115, label %116, label %124

116:                                              ; preds = %112
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = load ptr, ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 3), align 16, !tbaa !14
  %119 = load i32, ptr getelementptr inbounds (%"struct.TiXmlBase::Entity", ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 3), i32 0, i32 1), align 8, !tbaa !16
  %120 = zext i32 %119 to i64
  %121 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %117, ptr noundef %118, i64 noundef %120)
  %122 = load i32, ptr %5, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %5, align 4, !tbaa !9
  br label %163

124:                                              ; preds = %112
  %125 = load i8, ptr %6, align 1, !tbaa !11
  %126 = zext i8 %125 to i32
  %127 = icmp eq i32 %126, 39
  br i1 %127, label %128, label %136

128:                                              ; preds = %124
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = load ptr, ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 4), align 16, !tbaa !14
  %131 = load i32, ptr getelementptr inbounds (%"struct.TiXmlBase::Entity", ptr getelementptr inbounds ([5 x %"struct.TiXmlBase::Entity"], ptr @_ZN9TiXmlBase6entityE, i64 0, i64 4), i32 0, i32 1), align 8, !tbaa !16
  %132 = zext i32 %131 to i64
  %133 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %129, ptr noundef %130, i64 noundef %132)
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !9
  br label %162

136:                                              ; preds = %124
  %137 = load i8, ptr %6, align 1, !tbaa !11
  %138 = zext i8 %137 to i32
  %139 = icmp slt i32 %138, 32
  br i1 %139, label %140, label %155

140:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  %141 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %142 = load i8, ptr %6, align 1, !tbaa !11
  %143 = zext i8 %142 to i32
  %144 = and i32 %143, 255
  %145 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %141, i64 noundef 32, ptr noundef @.str, i32 noundef %144) #5
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %148 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %149 = call i64 @strlen(ptr noundef %148) #6
  %150 = trunc i64 %149 to i32
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %146, ptr noundef %147, i64 noundef %151)
  %153 = load i32, ptr %5, align 4, !tbaa !9
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  br label %161

155:                                              ; preds = %136
  %156 = load i8, ptr %6, align 1, !tbaa !11
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %157, i8 noundef signext %156)
  %159 = load i32, ptr %5, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %5, align 4, !tbaa !9
  br label %161

161:                                              ; preds = %155, %140
  br label %162

162:                                              ; preds = %161, %128
  br label %163

163:                                              ; preds = %162, %116
  br label %164

164:                                              ; preds = %163, %104
  br label %165

165:                                              ; preds = %164, %92
  br label %166

166:                                              ; preds = %165, %80
  br label %167

167:                                              ; preds = %166, %75
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %8, !llvm.loop !17

168:                                              ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #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) #0 align 2

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

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

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

; 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) #0 align 2

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #3 = { nounwind "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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSN9TiXmlBase6EntityE", !6, i64 0, !10, i64 8, !7, i64 12}
!16 = !{!15, !10, i64 8}
!17 = distinct !{!17, !13}


; 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.TiXmlBase::Entity" = type { ptr, i32, i8 }

@_ZN9TiXmlBase6entityE = external local_unnamed_addr global [5 x %"struct.TiXmlBase::Entity"], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9TiXmlBase12EncodeStringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) local_unnamed_addr #0 align 2 {
  %3 = alloca [32 x i8], align 16
  %4 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %5 = trunc i64 %4 to i32
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %.loopexit
  %.041 = phi i32 [ %.2, %.loopexit ], [ 0, %2 ]
  %7 = sext i32 %.041 to i64
  %8 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %7) #5
  %9 = load i8, ptr %8, align 1, !tbaa !5
  %10 = zext i8 %9 to i32
  switch i8 %9, label %67 [
    i8 38, label %11
    i8 60, label %43
    i8 62, label %49
    i8 34, label %55
    i8 39, label %61
  ]

11:                                               ; preds = %.lr.ph
  %12 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %13 = trunc i64 %12 to i32
  %14 = add nsw i32 %13, -2
  %15 = icmp slt i32 %.041, %14
  %16 = add nsw i32 %.041, 1
  br i1 %15, label %17, label %._crit_edge43

17:                                               ; preds = %11
  %18 = sext i32 %16 to i64
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %18) #5
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = icmp eq i8 %20, 35
  br i1 %21, label %22, label %._crit_edge43

22:                                               ; preds = %17
  %23 = add nsw i32 %.041, 2
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %24) #5
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = icmp eq i8 %26, 120
  br i1 %27, label %.preheader, label %._crit_edge43

.preheader:                                       ; preds = %22, %32
  %indvars.iv = phi i64 [ %indvars.iv.next, %32 ], [ %7, %22 ]
  %28 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %29 = shl i64 %28, 32
  %sext44 = add i64 %29, -4294967296
  %30 = ashr exact i64 %sext44, 32
  %31 = icmp slt i64 %indvars.iv, %30
  br i1 %31, label %32, label %.loopexit.loopexit

32:                                               ; preds = %.preheader
  %33 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %34 = getelementptr inbounds i8, ptr %33, i64 %indvars.iv
  %35 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %34, i64 noundef 1)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv.next) #5
  %37 = load i8, ptr %36, align 1, !tbaa !5
  %38 = icmp eq i8 %37, 59
  br i1 %38, label %.loopexit.loopexit, label %.preheader, !llvm.loop !8

._crit_edge43:                                    ; preds = %11, %17, %22
  %39 = load ptr, ptr @_ZN9TiXmlBase6entityE, align 16, !tbaa !10
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 8), align 8, !tbaa !14
  %41 = zext i32 %40 to i64
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %39, i64 noundef %41)
  br label %.loopexit

43:                                               ; preds = %.lr.ph
  %44 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 16), align 16, !tbaa !10
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 24), align 8, !tbaa !14
  %46 = zext i32 %45 to i64
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %44, i64 noundef %46)
  %48 = add nsw i32 %.041, 1
  br label %.loopexit

49:                                               ; preds = %.lr.ph
  %50 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 32), align 16, !tbaa !10
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 40), align 8, !tbaa !14
  %52 = zext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %50, i64 noundef %52)
  %54 = add nsw i32 %.041, 1
  br label %.loopexit

55:                                               ; preds = %.lr.ph
  %56 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 48), align 16, !tbaa !10
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 56), align 8, !tbaa !14
  %58 = zext i32 %57 to i64
  %59 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %56, i64 noundef %58)
  %60 = add nsw i32 %.041, 1
  br label %.loopexit

61:                                               ; preds = %.lr.ph
  %62 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 64), align 16, !tbaa !10
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN9TiXmlBase6entityE, i64 72), align 8, !tbaa !14
  %64 = zext i32 %63 to i64
  %65 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %62, i64 noundef %64)
  %66 = add nsw i32 %.041, 1
  br label %.loopexit

67:                                               ; preds = %.lr.ph
  %68 = icmp ult i8 %9, 32
  br i1 %68, label %69, label %75

69:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %70 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %3, i64 noundef 32, ptr noundef nonnull @.str, i32 noundef %10) #5
  %71 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #6
  %sext = shl i64 %71, 32
  %72 = ashr exact i64 %sext, 32
  %73 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %3, i64 noundef %72)
  %74 = add nsw i32 %.041, 1
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %.loopexit

75:                                               ; preds = %67
  %76 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %1, i8 noundef signext %9)
  %77 = add nsw i32 %.041, 1
  br label %.loopexit

.loopexit.loopexit:                               ; preds = %32, %.preheader
  %.2.ph.in = phi i64 [ %indvars.iv.next, %32 ], [ %indvars.iv, %.preheader ]
  %.2.ph = trunc i64 %.2.ph.in to i32
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %._crit_edge43, %49, %61, %75, %69, %55, %43
  %.2 = phi i32 [ %16, %._crit_edge43 ], [ %48, %43 ], [ %54, %49 ], [ %60, %55 ], [ %66, %61 ], [ %74, %69 ], [ %77, %75 ], [ %.2.ph, %.loopexit.loopexit ]
  %78 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %79 = trunc i64 %78 to i32
  %80 = icmp slt i32 %.2, %79
  br i1 %80, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.loopexit, %2
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 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 #0 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

; 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 #0 align 2

attributes #0 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #3 = { nofree nounwind "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 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ZTSN9TiXmlBase6EntityE", !12, i64 0, !13, i64 8, !6, i64 12}
!12 = !{!"any pointer", !6, i64 0}
!13 = !{!"int", !6, i64 0}
!14 = !{!11, !13, i64 8}
!15 = distinct !{!15, !9}


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