; 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.TiXmlAttribute = type { %class.TiXmlBase, ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", ptr, ptr }
%class.TiXmlBase = type { ptr, %struct.TiXmlCursor, ptr }
%struct.TiXmlCursor = type { i32, i32 }
%"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] }
%class.TiXmlDeclaration = type { %class.TiXmlNode, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%class.TiXmlNode = type { %class.TiXmlBase, ptr, i32, ptr, ptr, %"class.std::__cxx11::basic_string", ptr, ptr }

@.str.11 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [11 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: mustprogress nounwind uwtable
declare dso_local void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, i32 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext) #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20)) #1 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 i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN16TiXmlDeclaration5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %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 ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %class.TiXmlAttribute, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %class.TiXmlAttribute, align 8
  %16 = alloca %class.TiXmlAttribute, 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
  %17 = load ptr, ptr %6, align 8
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %18, i32 noundef %19)
  store ptr %20, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %21 = call noundef ptr @_ZN9TiXmlNode11GetDocumentEv(ptr noundef nonnull align 8 dereferenceable(104) %17)
  store ptr %21, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %32

24:                                               ; preds = %4
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = load i8, ptr %25, align 1, !tbaa !11
  %27 = icmp ne i8 %26, 0
  br i1 %27, label %28, label %32

28:                                               ; preds = %24
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %29, ptr noundef @.str.19, i1 noundef zeroext true, i32 noundef %30)
  br i1 %31, label %39, label %32

32:                                               ; preds = %28, %24, %4
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %38

35:                                               ; preds = %32
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %36, i32 noundef 11, ptr noundef null, ptr noundef null, i32 noundef %37)
  br label %38

38:                                               ; preds = %35, %32
  store ptr null, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %164

39:                                               ; preds = %28
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %49

42:                                               ; preds = %39
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20) %43, ptr noundef %44, i32 noundef %45)
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20) %46)
  %48 = getelementptr inbounds %class.TiXmlBase, ptr %17, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %48, ptr align 4 %47, i64 8, i1 false), !tbaa.struct !12
  br label %49

49:                                               ; preds = %42, %39
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 5
  store ptr %51, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %class.TiXmlDeclaration, ptr %17, i32 0, i32 1
  %53 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %52, ptr noundef @.str.11)
  %54 = getelementptr inbounds %class.TiXmlDeclaration, ptr %17, i32 0, i32 2
  %55 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %54, ptr noundef @.str.11)
  %56 = getelementptr inbounds %class.TiXmlDeclaration, ptr %17, i32 0, i32 3
  %57 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %56, ptr noundef @.str.11)
  br label %58

58:                                               ; preds = %162, %49
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %65

61:                                               ; preds = %58
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load i8, ptr %62, align 1, !tbaa !11
  %64 = icmp ne i8 %63, 0
  br label %65

65:                                               ; preds = %61, %58
  %66 = phi i1 [ false, %58 ], [ %64, %61 ]
  br i1 %66, label %67, label %163

67:                                               ; preds = %65
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = sext i8 %69 to i32
  %71 = icmp eq i32 %70, 62
  br i1 %71, label %72, label %76

72:                                               ; preds = %67
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i32 1
  store ptr %74, ptr %7, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %75, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %164

76:                                               ; preds = %67
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %77, i32 noundef %78)
  store ptr %79, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %80, ptr noundef @.str.32, i1 noundef zeroext true, i32 noundef %81)
  br i1 %82, label %83, label %98

83:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 112, ptr %12) #5
  call void @_ZN14TiXmlAttributeC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %12)
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = invoke noundef ptr @_ZN14TiXmlAttribute5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(112) %12, ptr noundef %84, ptr noundef %85, i32 noundef %86)
          to label %88 unwind label %94

88:                                               ; preds = %83
  store ptr %87, ptr %7, align 8, !tbaa !5
  %89 = invoke noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112) %12)
          to label %90 unwind label %94

90:                                               ; preds = %88
  %91 = getelementptr inbounds %class.TiXmlDeclaration, ptr %17, i32 0, i32 1
  %92 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %91, ptr noundef %89)
          to label %93 unwind label %94

93:                                               ; preds = %90
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %12) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %12) #5
  br label %162

94:                                               ; preds = %90, %88, %83
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %13, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %14, align 4
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %12) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %12) #5
  br label %166

98:                                               ; preds = %76
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = load i32, ptr %9, align 4, !tbaa !9
  %101 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %99, ptr noundef @.str.33, i1 noundef zeroext true, i32 noundef %100)
  br i1 %101, label %102, label %117

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 112, ptr %15) #5
  call void @_ZN14TiXmlAttributeC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %15)
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = invoke noundef ptr @_ZN14TiXmlAttribute5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(112) %15, ptr noundef %103, ptr noundef %104, i32 noundef %105)
          to label %107 unwind label %113

107:                                              ; preds = %102
  store ptr %106, ptr %7, align 8, !tbaa !5
  %108 = invoke noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112) %15)
          to label %109 unwind label %113

109:                                              ; preds = %107
  %110 = getelementptr inbounds %class.TiXmlDeclaration, ptr %17, i32 0, i32 2
  %111 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %110, ptr noundef %108)
          to label %112 unwind label %113

112:                                              ; preds = %109
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %15) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %15) #5
  br label %161

113:                                              ; preds = %109, %107, %102
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %13, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %14, align 4
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %15) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %15) #5
  br label %166

117:                                              ; preds = %98
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %118, ptr noundef @.str.34, i1 noundef zeroext true, i32 noundef %119)
  br i1 %120, label %121, label %136

121:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 112, ptr %16) #5
  call void @_ZN14TiXmlAttributeC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %16)
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = invoke noundef ptr @_ZN14TiXmlAttribute5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(112) %16, ptr noundef %122, ptr noundef %123, i32 noundef %124)
          to label %126 unwind label %132

126:                                              ; preds = %121
  store ptr %125, ptr %7, align 8, !tbaa !5
  %127 = invoke noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112) %16)
          to label %128 unwind label %132

128:                                              ; preds = %126
  %129 = getelementptr inbounds %class.TiXmlDeclaration, ptr %17, i32 0, i32 3
  %130 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %129, ptr noundef %127)
          to label %131 unwind label %132

131:                                              ; preds = %128
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %16) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %16) #5
  br label %160

132:                                              ; preds = %128, %126, %121
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %13, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %14, align 4
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %16) #5
  call void @llvm.lifetime.end.p0(i64 112, ptr %16) #5
  br label %166

136:                                              ; preds = %117
  br label %137

137:                                              ; preds = %156, %136
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %154

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

144:                                              ; preds = %140
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = load i8, ptr %145, align 1, !tbaa !11
  %147 = sext i8 %146 to i32
  %148 = icmp ne i32 %147, 62
  br i1 %148, label %149, label %154

149:                                              ; preds = %144
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = load i8, ptr %150, align 1, !tbaa !11
  %152 = call noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext %151)
  %153 = xor i1 %152, true
  br label %154

154:                                              ; preds = %149, %144, %140, %137
  %155 = phi i1 [ false, %144 ], [ false, %140 ], [ false, %137 ], [ %153, %149 ]
  br i1 %155, label %156, label %159

156:                                              ; preds = %154
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds i8, ptr %157, i32 1
  store ptr %158, ptr %7, align 8, !tbaa !5
  br label %137, !llvm.loop !15

159:                                              ; preds = %154
  br label %160

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

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

162:                                              ; preds = %161, %93
  br label %58, !llvm.loop !17

163:                                              ; preds = %65
  store ptr null, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %164

164:                                              ; preds = %163, %72, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %165 = load ptr, ptr %5, align 8
  ret ptr %165

166:                                              ; preds = %132, %113, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %13, align 8
  %169 = load i32, ptr %14, align 4
  %170 = insertvalue { ptr, i32 } poison, ptr %168, 0
  %171 = insertvalue { ptr, i32 } %170, i32 %169, 1
  resume { ptr, i32 } %171
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #3 align 2

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


; 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.TiXmlAttribute = type { %class.TiXmlBase, ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", ptr, ptr }
%class.TiXmlBase = type { ptr, %struct.TiXmlCursor, ptr }
%struct.TiXmlCursor = type { i32, i32 }
%"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.11 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [11 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: mustprogress nounwind uwtable
declare dso_local void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN16TiXmlDeclaration5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.TiXmlAttribute, align 8
  %6 = alloca %class.TiXmlAttribute, align 8
  %7 = alloca %class.TiXmlAttribute, align 8
  %8 = tail call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef %1, i32 noundef %3)
  %9 = tail call noundef ptr @_ZN9TiXmlNode11GetDocumentEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %14, label %10

10:                                               ; preds = %4
  %11 = load i8, ptr %8, align 1, !tbaa !5
  %.not55 = icmp eq i8 %11, 0
  br i1 %.not55, label %14, label %12

12:                                               ; preds = %10
  %13 = tail call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef nonnull %8, ptr noundef nonnull @.str.19, i1 noundef zeroext true, i32 noundef %3)
  br i1 %13, label %16, label %14

14:                                               ; preds = %12, %10, %4
  %.not56 = icmp eq ptr %9, null
  br i1 %.not56, label %.critedge, label %15

15:                                               ; preds = %14
  tail call void @_ZN13TiXmlDocument8SetErrorEiPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(157) %9, i32 noundef 11, ptr noundef null, ptr noundef null, i32 noundef %3)
  br label %.critedge

16:                                               ; preds = %12
  %.not57 = icmp eq ptr %2, null
  br i1 %.not57, label %21, label %17

17:                                               ; preds = %16
  tail call void @_ZN16TiXmlParsingData5StampEPKc13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(20) %2, ptr noundef nonnull %8, i32 noundef %3)
  %18 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK16TiXmlParsingData6CursorEv(ptr noundef nonnull align 8 dereferenceable(20) %2)
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = load i64, ptr %18, align 4
  store i64 %20, ptr %19, align 8
  br label %21

21:                                               ; preds = %17, %16
  %22 = getelementptr inbounds i8, ptr %8, i64 5
  %23 = getelementptr inbounds i8, ptr %0, i64 104
  %24 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull @.str.11)
  %25 = getelementptr inbounds i8, ptr %0, i64 136
  %26 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull @.str.11)
  %27 = getelementptr inbounds i8, ptr %0, i64 168
  %28 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef nonnull @.str.11)
  br label %29

29:                                               ; preds = %21, %.critedge2
  %.04976 = phi ptr [ %22, %21 ], [ %.2, %.critedge2 ]
  %30 = load i8, ptr %.04976, align 1, !tbaa !5
  switch i8 %30, label %33 [
    i8 0, label %.critedge
    i8 62, label %31
  ]

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

33:                                               ; preds = %29
  %34 = call noundef ptr @_ZN9TiXmlBase14SkipWhiteSpaceEPKc13TiXmlEncoding(ptr noundef nonnull %.04976, i32 noundef %3)
  %35 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %34, ptr noundef nonnull @.str.32, i1 noundef zeroext true, i32 noundef %3)
  br i1 %35, label %36, label %44

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %5) #4
  call void @_ZN14TiXmlAttributeC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %5)
  %37 = invoke noundef ptr @_ZN14TiXmlAttribute5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(112) %5, ptr noundef %34, ptr noundef %2, i32 noundef %3)
          to label %38 unwind label %42

38:                                               ; preds = %36
  %39 = call noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112) %5)
  %40 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef %39)
          to label %41 unwind label %42

41:                                               ; preds = %38
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %5) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %5) #4
  br label %.critedge2

42:                                               ; preds = %38, %36
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %5) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %5) #4
  br label %69

44:                                               ; preds = %33
  %45 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %34, ptr noundef nonnull @.str.33, i1 noundef zeroext true, i32 noundef %3)
  br i1 %45, label %46, label %54

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %6) #4
  call void @_ZN14TiXmlAttributeC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %6)
  %47 = invoke noundef ptr @_ZN14TiXmlAttribute5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(112) %6, ptr noundef %34, ptr noundef %2, i32 noundef %3)
          to label %48 unwind label %52

48:                                               ; preds = %46
  %49 = call noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112) %6)
  %50 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef %49)
          to label %51 unwind label %52

51:                                               ; preds = %48
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %6) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %6) #4
  br label %.critedge2

52:                                               ; preds = %48, %46
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %6) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %6) #4
  br label %69

54:                                               ; preds = %44
  %55 = call noundef zeroext i1 @_ZN9TiXmlBase11StringEqualEPKcS1_b13TiXmlEncoding(ptr noundef %34, ptr noundef nonnull @.str.34, i1 noundef zeroext true, i32 noundef %3)
  br i1 %55, label %56, label %.preheader

.preheader:                                       ; preds = %54
  %.not6068 = icmp eq ptr %34, null
  br i1 %.not6068, label %.critedge, label %.lr.ph

56:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %7) #4
  call void @_ZN14TiXmlAttributeC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %7)
  %57 = invoke noundef ptr @_ZN14TiXmlAttribute5ParseEPKcP16TiXmlParsingData13TiXmlEncoding(ptr noundef nonnull align 8 dereferenceable(112) %7, ptr noundef %34, ptr noundef %2, i32 noundef %3)
          to label %58 unwind label %62

58:                                               ; preds = %56
  %59 = call noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112) %7)
  %60 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef %59)
          to label %61 unwind label %62

61:                                               ; preds = %58
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %7) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %7) #4
  br label %.critedge2

62:                                               ; preds = %58, %56
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %7) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %7) #4
  br label %69

.lr.ph:                                           ; preds = %.preheader, %67
  %.169 = phi ptr [ %68, %67 ], [ %34, %.preheader ]
  %64 = load i8, ptr %.169, align 1, !tbaa !5
  switch i8 %64, label %65 [
    i8 0, label %.critedge2
    i8 62, label %.critedge2
  ]

65:                                               ; preds = %.lr.ph
  %66 = call noundef zeroext i1 @_ZN9TiXmlBase12IsWhiteSpaceEc(i8 noundef signext %64)
  br i1 %66, label %.critedge2, label %67

67:                                               ; preds = %65
  %68 = getelementptr inbounds i8, ptr %.169, i64 1
  br label %.lr.ph, !llvm.loop !8

.critedge2:                                       ; preds = %65, %.lr.ph, %.lr.ph, %51, %61, %41
  %.2 = phi ptr [ %37, %41 ], [ %47, %51 ], [ %57, %61 ], [ %.169, %.lr.ph ], [ %.169, %.lr.ph ], [ %.169, %65 ]
  %.not58 = icmp eq ptr %.2, null
  br i1 %.not58, label %.critedge, label %29, !llvm.loop !10

.critedge:                                        ; preds = %.preheader, %.critedge2, %29, %14, %15, %31
  %.048 = phi ptr [ %32, %31 ], [ null, %15 ], [ null, %14 ], [ null, %29 ], [ null, %.critedge2 ], [ null, %.preheader ]
  ret ptr %.048

69:                                               ; preds = %62, %52, %42
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %53, %52 ], [ %63, %62 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14TiXmlAttribute5ValueEv(ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN14TiXmlAttributeD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #3 align 2

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

!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 = distinct !{!10, !9}


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