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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.TiXmlParsingData = type <{ %struct.TiXmlCursor, ptr, i32, [4 x i8] }>
%struct.TiXmlCursor = type { i32, i32 }
%class.TiXmlBase = type { ptr, %struct.TiXmlCursor, ptr }
%class.TiXmlDocument = type <{ %class.TiXmlNode, i8, [3 x i8], i32, %"class.std::__cxx11::basic_string", i32, %struct.TiXmlCursor, i8, [3 x i8] }>
%class.TiXmlNode = type { %class.TiXmlBase, ptr, i32, ptr, ptr, %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str.6 = external hidden unnamed_addr constant [89 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
declare dso_local void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157), i32 noundef, ptr noundef, ptr noundef, i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %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(157) %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(157) %16, i32 noundef 12, ptr noundef null, ptr noundef null, i32 noundef 0)
  store ptr null, ptr %5, align 8
  br label %187

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(157) %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 @_ZNK16TiXmlParsingData6CursorEv(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 %96

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 %95

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 %95

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 %95

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 %95

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 %95

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 %95

93:                                               ; preds = %87
  store i32 1, ptr %9, align 4, !tbaa !9
  %94 = getelementptr inbounds %class.TiXmlDocument, ptr %16, i32 0, i32 7
  store i8 1, ptr %94, align 4, !tbaa !22
  br label %95

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

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

102:                                              ; preds = %96
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %16, i32 noundef 12, 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 %186

103:                                              ; preds = %96
  br label %104

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

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

111:                                              ; preds = %107, %104
  %112 = phi i1 [ false, %104 ], [ %110, %107 ]
  br i1 %112, label %113, label %178

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

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

129:                                              ; preds = %113
  store i32 3, ptr %12, align 4
  br label %175

130:                                              ; preds = %119
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %171

133:                                              ; preds = %130
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = load ptr, ptr %134, align 8, !tbaa !30
  %136 = getelementptr inbounds ptr, ptr %135, i64 15
  %137 = load ptr, ptr %136, align 8
  %138 = call noundef ptr %137(ptr noundef nonnull align 8 dereferenceable(104) %134)
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %171

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = load ptr, ptr %141, align 8, !tbaa !30
  %143 = getelementptr inbounds ptr, ptr %142, i64 15
  %144 = load ptr, ptr %143, align 8
  %145 = call noundef ptr %144(ptr noundef nonnull align 8 dereferenceable(104) %141)
  store ptr %145, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %146 = load ptr, ptr %14, align 8, !tbaa !5
  %147 = call noundef ptr @_ZNK16TiXmlDeclaration8EncodingEv(ptr noundef nonnull align 8 dereferenceable(200) %146)
  store ptr %147, ptr %15, align 8, !tbaa !5
  %148 = load ptr, ptr %15, align 8, !tbaa !5
  %149 = icmp ne ptr %148, null
  br i1 %149, label %150, label %151

150:                                              ; preds = %140
  br label %153

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

152:                                              ; No predecessors!
  br label %153

153:                                              ; preds = %152, %150
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = load i8, ptr %154, align 1, !tbaa !11
  %156 = sext i8 %155 to i32
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %159

158:                                              ; preds = %153
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %170

159:                                              ; preds = %153
  %160 = load ptr, ptr %15, align 8, !tbaa !5
  %161 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %160, ptr noundef @.str.16, i1 noundef zeroext true, i32 noundef 0)
  br i1 %161, label %162, label %163

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

163:                                              ; preds = %159
  %164 = load ptr, ptr %15, align 8, !tbaa !5
  %165 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %164, ptr noundef @.str.17, i1 noundef zeroext true, i32 noundef 0)
  br i1 %165, label %166, label %167

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

167:                                              ; preds = %163
  store i32 2, ptr %9, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %167, %166
  br label %169

169:                                              ; preds = %168, %162
  br label %170

170:                                              ; preds = %169, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %171

171:                                              ; preds = %170, %133, %130
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = load i32, ptr %9, align 4, !tbaa !9
  %174 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %172, i32 noundef %173)
  store ptr %174, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %12, align 4
  br label %175

175:                                              ; preds = %171, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %176 = load i32, ptr %12, align 4
  switch i32 %176, label %189 [
    i32 0, label %177
    i32 3, label %178
  ]

177:                                              ; preds = %175
  br label %104, !llvm.loop !32

178:                                              ; preds = %175, %111
  %179 = getelementptr inbounds %class.TiXmlNode, ptr %16, i32 0, i32 3
  %180 = load ptr, ptr %179, align 8, !tbaa !34
  %181 = icmp ne ptr %180, null
  br i1 %181, label %184, label %182

182:                                              ; preds = %178
  %183 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %16, i32 noundef 12, ptr noundef null, ptr noundef null, i32 noundef %183)
  store ptr null, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %186

184:                                              ; preds = %178
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %185, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %186

186:                                              ; preds = %184, %182, %102
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %187

187:                                              ; preds = %186, %23
  %188 = load ptr, ptr %5, align 8
  ret ptr %188

189:                                              ; preds = %175
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13TiXmlDocument10ClearErrorEv(ptr noundef nonnull align 8 dereferenceable(157)) #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(157)) #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 @_ZNK16TiXmlParsingData6CursorEv(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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK16TiXmlDeclaration8EncodingEv(ptr noundef nonnull align 8 dereferenceable(200)) #3 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, !29, i64 156}
!23 = !{!"_ZTS13TiXmlDocument", !24, i64 0, !29, i64 104, !15, i64 108, !26, i64 112, !15, i64 144, !14, i64 148, !29, i64 156}
!24 = !{!"_ZTS9TiXmlNode", !17, i64 0, !6, i64 24, !25, i64 32, !6, i64 40, !6, i64 48, !26, i64 56, !6, i64 88, !6, i64 96}
!25 = !{!"_ZTSN9TiXmlNode8NodeTypeE", !7, i64 0}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !27, i64 0, !28, i64 8, !7, i64 16}
!27 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!28 = !{!"long", !7, i64 0}
!29 = !{!"bool", !7, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !8, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!24, !6, i64 40}


; 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 [89 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
declare dso_local void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157), i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN13TiXmlDocument5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %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(157) %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(157) %0, i32 noundef 12, ptr noundef null, ptr noundef null, i32 noundef 0)
  br label %68

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(157) %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 @_ZNK16TiXmlParsingData6CursorEv(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 %32

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

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 %32

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
  br i1 %cond69, label %30, label %32

30:                                               ; preds = %27
  %31 = getelementptr inbounds i8, ptr %0, i64 156
  store i8 1, ptr %31, align 4, !tbaa !15
  br label %32

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

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

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

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

44:                                               ; preds = %37
  %45 = load ptr, ptr %36, align 8, !tbaa !23
  %46 = getelementptr inbounds i8, ptr %45, i64 120
  %47 = load ptr, ptr %46, align 8
  %48 = call noundef ptr %47(ptr noundef nonnull align 8 dereferenceable(104) %36)
  %.not65 = icmp eq ptr %48, null
  br i1 %.not65, label %63, label %49

49:                                               ; preds = %44
  %50 = load ptr, ptr %36, align 8, !tbaa !23
  %51 = getelementptr inbounds i8, ptr %50, i64 120
  %52 = load ptr, ptr %51, align 8
  %53 = call noundef ptr %52(ptr noundef nonnull align 8 dereferenceable(104) %36)
  %54 = call noundef ptr @_ZNK16TiXmlDeclaration8EncodingEv(ptr noundef nonnull align 8 dereferenceable(200) %53)
  %.not66 = icmp eq ptr %54, null
  br i1 %.not66, label %55, label %56

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

56:                                               ; preds = %49
  %57 = load i8, ptr %54, align 1, !tbaa !5
  %58 = icmp eq i8 %57, 0
  br i1 %58, label %63, label %59

59:                                               ; preds = %56
  %60 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %54, ptr noundef nonnull @.str.16, i1 noundef zeroext true, i32 noundef 0)
  br i1 %60, label %63, label %61

61:                                               ; preds = %59
  %62 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %54, ptr noundef nonnull @.str.17, i1 noundef zeroext true, i32 noundef 0)
  %. = select i1 %62, i32 1, i32 2
  br label %63

63:                                               ; preds = %37, %44, %61, %59, %56
  %.4 = phi i32 [ 0, %44 ], [ %.24476, %37 ], [ 1, %56 ], [ 1, %59 ], [ %., %61 ]
  %64 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %41, i32 noundef %.4)
  %.not62 = icmp eq ptr %64, null
  br i1 %.not62, label %.critedge, label %.preheader

.critedge:                                        ; preds = %35, %63, %.preheader
  %.244.lcssa = phi i32 [ %.24476, %35 ], [ %.4, %63 ], [ %.24476, %.preheader ]
  %.040.lcssa = phi ptr [ %.04077, %35 ], [ null, %63 ], [ %.04077, %.preheader ]
  %65 = getelementptr inbounds i8, ptr %0, i64 40
  %66 = load ptr, ptr %65, align 8, !tbaa !25
  %.not67 = icmp eq ptr %66, null
  br i1 %.not67, label %.sink.split, label %67

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

67:                                               ; 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 %68

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13TiXmlDocument10ClearErrorEv(ptr noundef nonnull align 8 dereferenceable(157)) 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(157)) 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 @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK16TiXmlDeclaration8EncodingEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #3 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, !22, i64 156}
!16 = !{!"_ZTS13TiXmlDocument", !17, i64 0, !22, i64 104, !9, i64 108, !19, i64 112, !9, i64 144, !12, i64 148, !22, i64 156}
!17 = !{!"_ZTS9TiXmlNode", !11, i64 0, !13, i64 24, !18, i64 32, !13, i64 40, !13, i64 48, !19, i64 56, !13, i64 88, !13, i64 96}
!18 = !{!"_ZTSN9TiXmlNode8NodeTypeE", !6, i64 0}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !6, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!21 = !{!"long", !6, i64 0}
!22 = !{!"bool", !6, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !7, i64 0}
!25 = !{!17, !13, i64 40}


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