; LLVM IR from thuhcsi/Crystal.TTVS :: TinyXML/tinyxmlparser.ll (ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding)

; 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.TiXmlParsingData = type <{ %struct.TiXmlCursor, ptr, i32, [4 x i8] }>
%struct.TiXmlCursor = type { i32, i32 }
%class.TiXmlBase = type { ptr, %struct.TiXmlCursor, ptr }
%class.TiXmlNode = type { %class.TiXmlBase, ptr, i32, ptr, ptr, %class.TiXmlString, ptr, ptr }
%class.TiXmlString = type { ptr, i64, i64 }

@.str.6 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__._ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding = external hidden unnamed_addr constant [90 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [5 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef, i32 noundef) #2 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
define dso_local noundef ptr @_ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(140) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 {
  %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 %class.TiXmlParsingData, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = 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
  %16 = load ptr, ptr %6, align 8
  call void @_ZN13TiXmlDocument10ClearErrorEv(ptr noundef nonnull align 8 dereferenceable(140) %16)
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %23

19:                                               ; preds = %4
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %24, label %23

23:                                               ; preds = %19, %4
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(140) %16, i32 noundef 13, ptr noundef null, ptr noundef null, i32 noundef 0)
  store ptr null, ptr %5, align 8
  br label %180

24:                                               ; preds = %19
  %25 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  call void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8) %25)
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %41

28:                                               ; preds = %24
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.TiXmlParsingData, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds %struct.TiXmlCursor, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !12
  %33 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  %34 = getelementptr inbounds %struct.TiXmlCursor, ptr %33, i32 0, i32 0
  store i32 %32, ptr %34, align 8, !tbaa !16
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.TiXmlParsingData, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %struct.TiXmlCursor, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !18
  %39 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  %40 = getelementptr inbounds %struct.TiXmlCursor, ptr %39, i32 0, i32 1
  store i32 %38, ptr %40, align 4, !tbaa !19
  br label %46

41:                                               ; preds = %24
  %42 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  %43 = getelementptr inbounds %struct.TiXmlCursor, ptr %42, i32 0, i32 0
  store i32 0, ptr %43, align 8, !tbaa !16
  %44 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  %45 = getelementptr inbounds %struct.TiXmlCursor, ptr %44, i32 0, i32 1
  store i32 0, ptr %45, align 4, !tbaa !19
  br label %46

46:                                               ; preds = %41, %28
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = call noundef i32 @_ZNK13TiXmlDocument7TabSizeEv(ptr noundef nonnull align 8 dereferenceable(140) %16)
  %49 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  %50 = getelementptr inbounds %struct.TiXmlCursor, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !16
  %52 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  %53 = getelementptr inbounds %struct.TiXmlCursor, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 4, !tbaa !19
  call void @_ZN16TiXmlParsingDataC2EPKciii(ptr noundef nonnull align 8 dereferenceable(20) %10, ptr noundef %47, i32 noundef %48, i32 noundef %51, i32 noundef %54)
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20) %10)
  %56 = getelementptr inbounds %class.TiXmlBase, ptr %16, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %56, ptr align 4 %55, i64 8, i1 false), !tbaa.struct !20
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %95

59:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %60, ptr %11, align 8, !tbaa !5
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 0
  %63 = load i8, ptr %62, align 1, !tbaa !11
  %64 = icmp ne i8 %63, 0
  br i1 %64, label %65, label %94

65:                                               ; preds = %59
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 0
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = zext i8 %68 to i32
  %70 = icmp eq i32 %69, 239
  br i1 %70, label %71, label %94

71:                                               ; preds = %65
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 1
  %74 = load i8, ptr %73, align 1, !tbaa !11
  %75 = icmp ne i8 %74, 0
  br i1 %75, label %76, label %94

76:                                               ; preds = %71
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 1
  %79 = load i8, ptr %78, align 1, !tbaa !11
  %80 = zext i8 %79 to i32
  %81 = icmp eq i32 %80, 187
  br i1 %81, label %82, label %94

82:                                               ; preds = %76
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 2
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = icmp ne i8 %85, 0
  br i1 %86, label %87, label %94

87:                                               ; preds = %82
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 2
  %90 = load i8, ptr %89, align 1, !tbaa !11
  %91 = zext i8 %90 to i32
  %92 = icmp eq i32 %91, 191
  br i1 %92, label %93, label %94

93:                                               ; preds = %87
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %93, %87, %82, %76, %71, %65, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %95

95:                                               ; preds = %94, %46
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %96, i32 noundef %97)
  store ptr %98, ptr %7, align 8, !tbaa !5
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %102, label %101

101:                                              ; preds = %95
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(140) %16, i32 noundef 13, ptr noundef null, ptr noundef null, i32 noundef 0)
  store ptr null, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %179

102:                                              ; preds = %95
  br label %103

103:                                              ; preds = %170, %102
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %110

106:                                              ; preds = %103
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = load i8, ptr %107, align 1, !tbaa !11
  %109 = icmp ne i8 %108, 0
  br label %110

110:                                              ; preds = %106, %103
  %111 = phi i1 [ false, %103 ], [ %109, %106 ]
  br i1 %111, label %112, label %171

112:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = call noundef ptr @_ZN9TiXmlNode8IdentifyEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(96) %16, ptr noundef %113, i32 noundef %114)
  store ptr %115, ptr %13, align 8, !tbaa !5
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %128

118:                                              ; preds = %112
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !9
  %122 = load ptr, ptr %119, align 8, !tbaa !22
  %123 = getelementptr inbounds ptr, ptr %122, i64 3
  %124 = load ptr, ptr %123, align 8
  %125 = call noundef ptr %124(ptr noundef nonnull align 8 dereferenceable(24) %119, ptr noundef %120, ptr noundef %10, i32 noundef %121)
  store ptr %125, ptr %7, align 8, !tbaa !5
  %126 = load ptr, ptr %13, align 8, !tbaa !5
  %127 = call noundef ptr @_ZN9TiXmlNode12LinkEndChildEPS_(ptr noundef nonnull align 8 dereferenceable(96) %16, ptr noundef %126)
  br label %129

128:                                              ; preds = %112
  store i32 3, ptr %12, align 4
  br label %168

129:                                              ; preds = %118
  %130 = load i32, ptr %9, align 4, !tbaa !9
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %164

132:                                              ; preds = %129
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = call noundef ptr @_ZN9TiXmlNode13ToDeclarationEv(ptr noundef nonnull align 8 dereferenceable(96) %133)
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %164

136:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = call noundef ptr @_ZN9TiXmlNode13ToDeclarationEv(ptr noundef nonnull align 8 dereferenceable(96) %137)
  store ptr %138, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = call noundef ptr @_ZNK16TiXmlDeclaration8EncodingEv(ptr noundef nonnull align 8 dereferenceable(168) %139)
  store ptr %140, ptr %15, align 8, !tbaa !5
  %141 = load ptr, ptr %15, align 8, !tbaa !5
  %142 = icmp ne ptr %141, null
  br i1 %142, label %143, label %144

143:                                              ; preds = %136
  br label %146

144:                                              ; preds = %136
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.6, i32 noundef 749, ptr noundef @__PRETTY_FUNCTION__._ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding) #7
  unreachable

145:                                              ; No predecessors!
  br label %146

146:                                              ; preds = %145, %143
  %147 = load ptr, ptr %15, align 8, !tbaa !5
  %148 = load i8, ptr %147, align 1, !tbaa !11
  %149 = sext i8 %148 to i32
  %150 = icmp eq i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %146
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %163

152:                                              ; preds = %146
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %153, ptr noundef @.str.16, i1 noundef zeroext true, i32 noundef 0)
  br i1 %154, label %155, label %156

155:                                              ; preds = %152
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %162

156:                                              ; preds = %152
  %157 = load ptr, ptr %15, align 8, !tbaa !5
  %158 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %157, ptr noundef @.str.17, i1 noundef zeroext true, i32 noundef 0)
  br i1 %158, label %159, label %160

159:                                              ; preds = %156
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %161

160:                                              ; preds = %156
  store i32 2, ptr %9, align 4, !tbaa !9
  br label %161

161:                                              ; preds = %160, %159
  br label %162

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

163:                                              ; preds = %162, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %164

164:                                              ; preds = %163, %132, %129
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = load i32, ptr %9, align 4, !tbaa !9
  %167 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %165, i32 noundef %166)
  store ptr %167, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %12, align 4
  br label %168

168:                                              ; preds = %164, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %169 = load i32, ptr %12, align 4
  switch i32 %169, label %182 [
    i32 0, label %170
    i32 3, label %171
  ]

170:                                              ; preds = %168
  br label %103, !llvm.loop !24

171:                                              ; preds = %168, %110
  %172 = getelementptr inbounds %class.TiXmlNode, ptr %16, i32 0, i32 3
  %173 = load ptr, ptr %172, align 8, !tbaa !26
  %174 = icmp ne ptr %173, null
  br i1 %174, label %177, label %175

175:                                              ; preds = %171
  %176 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(140) %16, i32 noundef 13, ptr noundef null, ptr noundef null, i32 noundef %176)
  store ptr null, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %179

177:                                              ; preds = %171
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %178, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %179

179:                                              ; preds = %177, %175, %101
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %180

180:                                              ; preds = %179, %23
  %181 = load ptr, ptr %5, align 8
  ret ptr %181

182:                                              ; preds = %168
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13TiXmlDocument10ClearErrorEv(ptr noundef nonnull align 8 dereferenceable(140)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK13TiXmlDocument7TabSizeEv(ptr noundef nonnull align 8 dereferenceable(140)) #3 align 2

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

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

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

declare noundef ptr @_ZN9TiXmlNode12LinkEndChildEPS_(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9TiXmlNode13ToDeclarationEv(ptr noundef nonnull align 8 dereferenceable(96)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!7, !7, i64 0}
!12 = !{!13, !15, i64 0}
!13 = !{!"_ZTS16TiXmlParsingData", !14, i64 0, !6, i64 8, !15, i64 16}
!14 = !{!"_ZTS11TiXmlCursor", !15, i64 0, !15, i64 4}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !15, i64 8}
!17 = !{!"_ZTS9TiXmlBase", !14, i64 8, !6, i64 16}
!18 = !{!13, !15, i64 4}
!19 = !{!17, !15, i64 12}
!20 = !{i64 0, i64 4, !21, i64 4, i64 4, !21}
!21 = !{!15, !15, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !6, i64 40}
!27 = !{!"_ZTS9TiXmlNode", !17, i64 0, !6, i64 24, !28, i64 32, !6, i64 40, !6, i64 48, !29, i64 56, !6, i64 80, !6, i64 88}
!28 = !{!"_ZTSN9TiXmlNode8NodeTypeE", !7, i64 0}
!29 = !{!"_ZTS11TiXmlString", !6, i64 0, !30, i64 8, !30, i64 16}
!30 = !{!"long", !7, 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.TiXmlParsingData = type <{ %struct.TiXmlCursor, ptr, i32, [4 x i8] }>
%struct.TiXmlCursor = type { i32, i32 }

@.str.6 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__._ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding = external hidden unnamed_addr constant [90 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [5 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef, i32 noundef) local_unnamed_addr #2 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
define dso_local noundef ptr @_ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(140) %0, ptr noundef %1, ptr noundef readonly %2, i32 noundef %3) unnamed_addr #2 align 2 {
  %5 = alloca %class.TiXmlParsingData, align 8
  tail call void @_ZN13TiXmlDocument10ClearErrorEv(ptr noundef nonnull align 8 dereferenceable(140) %0)
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %8, label %6

6:                                                ; preds = %4
  %7 = load i8, ptr %1, align 1, !tbaa !5
  %.not56 = icmp eq i8 %7, 0
  br i1 %.not56, label %8, label %9

8:                                                ; preds = %6, %4
  tail call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(140) %0, i32 noundef 13, ptr noundef null, ptr noundef null, i32 noundef 0)
  br label %60

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %.not57 = icmp eq ptr %2, null
  br i1 %.not57, label %13, label %11

11:                                               ; preds = %9
  %12 = load <2 x i32>, ptr %2, align 8, !tbaa !8
  br label %13

13:                                               ; preds = %9, %11
  %14 = phi <2 x i32> [ %12, %11 ], [ zeroinitializer, %9 ]
  %15 = getelementptr inbounds i8, ptr %0, i64 12
  store <2 x i32> %14, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %16 = tail call noundef i32 @_ZNK13TiXmlDocument7TabSizeEv(ptr noundef nonnull align 8 dereferenceable(140) %0)
  %17 = load i32, ptr %10, align 8, !tbaa !10
  %18 = load i32, ptr %15, align 4, !tbaa !14
  call void @_ZN16TiXmlParsingDataC2EPKciii(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull %1, i32 noundef %16, i32 noundef %17, i32 noundef %18)
  %19 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20) %5)
  %20 = load i64, ptr %19, align 4
  store i64 %20, ptr %10, align 8
  %21 = icmp eq i32 %3, 0
  br i1 %21, label %22, label %30

22:                                               ; preds = %13
  %23 = load i8, ptr %1, align 1, !tbaa !5
  %cond = icmp eq i8 %23, -17
  br i1 %cond, label %24, label %30

24:                                               ; preds = %22
  %25 = getelementptr inbounds i8, ptr %1, i64 1
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %cond68 = icmp eq i8 %26, -69
  br i1 %cond68, label %27, label %30

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %1, i64 2
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %cond69 = icmp eq i8 %29, -65
  %spec.select = zext i1 %cond69 to i32
  br label %30

30:                                               ; preds = %27, %24, %22, %13
  %.143 = phi i32 [ %3, %13 ], [ 0, %22 ], [ 0, %24 ], [ %spec.select, %27 ]
  %31 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef nonnull %1, i32 noundef %.143)
  %.not61 = icmp eq ptr %31, null
  br i1 %.not61, label %.sink.split, label %.preheader

.preheader:                                       ; preds = %30, %55
  %.04077 = phi ptr [ %56, %55 ], [ %31, %30 ]
  %.24476 = phi i32 [ %.4, %55 ], [ %.143, %30 ]
  %32 = load i8, ptr %.04077, align 1, !tbaa !5
  %.not63 = icmp eq i8 %32, 0
  br i1 %.not63, label %.critedge, label %33

33:                                               ; preds = %.preheader
  %34 = call noundef ptr @_ZN9TiXmlNode8IdentifyEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %.04077, i32 noundef %.24476)
  %.not64 = icmp eq ptr %34, null
  br i1 %.not64, label %.critedge, label %35

35:                                               ; preds = %33
  %36 = load ptr, ptr %34, align 8, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load ptr, ptr %37, align 8
  %39 = call noundef ptr %38(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull %.04077, ptr noundef nonnull %5, i32 noundef %.24476)
  %40 = call noundef ptr @_ZN9TiXmlNode12LinkEndChildEPS_(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %34)
  %41 = icmp eq i32 %.24476, 0
  br i1 %41, label %42, label %55

42:                                               ; preds = %35
  %43 = call noundef ptr @_ZN9TiXmlNode13ToDeclarationEv(ptr noundef nonnull align 8 dereferenceable(96) %34)
  %.not65 = icmp eq ptr %43, null
  br i1 %.not65, label %55, label %44

44:                                               ; preds = %42
  %45 = call noundef ptr @_ZN9TiXmlNode13ToDeclarationEv(ptr noundef nonnull align 8 dereferenceable(96) %34)
  %46 = call noundef ptr @_ZNK16TiXmlDeclaration8EncodingEv(ptr noundef nonnull align 8 dereferenceable(168) %45)
  %.not66 = icmp eq ptr %46, null
  br i1 %.not66, label %47, label %48

47:                                               ; preds = %44
  call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.6, i32 noundef 749, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding) #6
  unreachable

48:                                               ; preds = %44
  %49 = load i8, ptr %46, align 1, !tbaa !5
  %50 = icmp eq i8 %49, 0
  br i1 %50, label %55, label %51

51:                                               ; preds = %48
  %52 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %46, ptr noundef nonnull @.str.16, i1 noundef zeroext true, i32 noundef 0)
  br i1 %52, label %55, label %53

53:                                               ; preds = %51
  %54 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %46, ptr noundef nonnull @.str.17, i1 noundef zeroext true, i32 noundef 0)
  %. = select i1 %54, i32 1, i32 2
  br label %55

55:                                               ; preds = %35, %42, %53, %51, %48
  %.4 = phi i32 [ 0, %42 ], [ %.24476, %35 ], [ 1, %48 ], [ 1, %51 ], [ %., %53 ]
  %56 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %39, i32 noundef %.4)
  %.not62 = icmp eq ptr %56, null
  br i1 %.not62, label %.critedge, label %.preheader

.critedge:                                        ; preds = %33, %55, %.preheader
  %.244.lcssa = phi i32 [ %.24476, %33 ], [ %.4, %55 ], [ %.24476, %.preheader ]
  %.040.lcssa = phi ptr [ %.04077, %33 ], [ null, %55 ], [ %.04077, %.preheader ]
  %57 = getelementptr inbounds i8, ptr %0, i64 40
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %.not67 = icmp eq ptr %58, null
  br i1 %.not67, label %.sink.split, label %59

.sink.split:                                      ; preds = %.critedge, %30
  %.244.lcssa.sink = phi i32 [ 0, %30 ], [ %.244.lcssa, %.critedge ]
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(140) %0, i32 noundef 13, ptr noundef null, ptr noundef null, i32 noundef %.244.lcssa.sink)
  br label %59

59:                                               ; preds = %.sink.split, %.critedge
  %.0 = phi ptr [ %.040.lcssa, %.critedge ], [ null, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %60

60:                                               ; preds = %59, %8
  %.1 = phi ptr [ %.0, %59 ], [ null, %8 ]
  ret ptr %.1
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11TiXmlCursor5ClearEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK13TiXmlDocument7TabSizeEv(ptr noundef nonnull align 8 dereferenceable(140)) local_unnamed_addr #3 align 2

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

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

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

declare noundef ptr @_ZN9TiXmlNode12LinkEndChildEPS_(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9TiXmlNode13ToDeclarationEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { noreturn 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !9, i64 8}
!11 = !{!"_ZTS9TiXmlBase", !12, i64 8, !13, i64 16}
!12 = !{!"_ZTS11TiXmlCursor", !9, i64 0, !9, i64 4}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{!11, !9, i64 12}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !7, i64 0}
!17 = !{!18, !13, i64 40}
!18 = !{!"_ZTS9TiXmlNode", !11, i64 0, !13, i64 24, !19, i64 32, !13, i64 40, !13, i64 48, !20, i64 56, !13, i64 80, !13, i64 88}
!19 = !{!"_ZTSN9TiXmlNode8NodeTypeE", !6, i64 0}
!20 = !{!"_ZTS11TiXmlString", !13, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"long", !6, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass