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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN8tinyxml27StrPair6GetStrEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [10 x i8], align 1
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  br label %14

14:                                               ; preds = %1
  br label %15

15:                                               ; preds = %14
  br label %16

16:                                               ; preds = %15
  br label %17

17:                                               ; preds = %16
  %18 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %19 = load i32, ptr %18, align 8, !tbaa !9
  %20 = and i32 %19, 256
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %227

22:                                               ; preds = %17
  %23 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  store i8 0, ptr %24, align 1, !tbaa !13
  %25 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = xor i32 %26, 256
  store i32 %27, ptr %25, align 8, !tbaa !9
  %28 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %216

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %32 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 1
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  store ptr %33, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %34 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  store ptr %35, ptr %4, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %213, %31
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !12
  %40 = icmp ult ptr %37, %39
  br i1 %40, label %41, label %214

41:                                               ; preds = %36
  %42 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !9
  %44 = and i32 %43, 2
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %67

46:                                               ; preds = %41
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = load i8, ptr %47, align 1, !tbaa !13
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %49, 13
  br i1 %50, label %51, label %67

51:                                               ; preds = %46
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 1
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 10
  br i1 %56, label %57, label %60

57:                                               ; preds = %51
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 2
  store ptr %59, ptr %3, align 8, !tbaa !5
  br label %63

60:                                               ; preds = %51
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i32 1
  store ptr %62, ptr %3, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %60, %57
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 10, ptr %64, align 1, !tbaa !13
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i32 1
  store ptr %66, ptr %4, align 8, !tbaa !5
  br label %213

67:                                               ; preds = %46, %41
  %68 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !9
  %70 = and i32 %69, 2
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %93

72:                                               ; preds = %67
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = load i8, ptr %73, align 1, !tbaa !13
  %75 = sext i8 %74 to i32
  %76 = icmp eq i32 %75, 10
  br i1 %76, label %77, label %93

77:                                               ; preds = %72
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 1
  %80 = load i8, ptr %79, align 1, !tbaa !13
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 13
  br i1 %82, label %83, label %86

83:                                               ; preds = %77
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds i8, ptr %84, i64 2
  store ptr %85, ptr %3, align 8, !tbaa !5
  br label %89

86:                                               ; preds = %77
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i32 1
  store ptr %88, ptr %3, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %86, %83
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 10, ptr %90, align 1, !tbaa !13
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i32 1
  store ptr %92, ptr %4, align 8, !tbaa !5
  br label %212

93:                                               ; preds = %72, %67
  %94 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %95 = load i32, ptr %94, align 8, !tbaa !9
  %96 = and i32 %95, 1
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %203

98:                                               ; preds = %93
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = load i8, ptr %99, align 1, !tbaa !13
  %101 = sext i8 %100 to i32
  %102 = icmp eq i32 %101, 38
  br i1 %102, label %103, label %203

103:                                              ; preds = %98
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 1
  %106 = load i8, ptr %105, align 1, !tbaa !13
  %107 = sext i8 %106 to i32
  %108 = icmp eq i32 %107, 35
  br i1 %108, label %109, label %140

109:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 10, ptr %5, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 10, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 1 %6, i8 0, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds [10 x i8], ptr %6, i64 0, i64 0
  %112 = call noundef ptr @_ZN8tinyxml27XMLUtil15GetCharacterRefEPKcPcPi(ptr noundef %110, ptr noundef %111, ptr noundef %7)
  store ptr %112, ptr %8, align 8, !tbaa !5
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %115, label %123

115:                                              ; preds = %109
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = load i8, ptr %116, align 1, !tbaa !13
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 %117, ptr %118, align 1, !tbaa !13
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds i8, ptr %119, i32 1
  store ptr %120, ptr %3, align 8, !tbaa !5
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i32 1
  store ptr %122, ptr %4, align 8, !tbaa !5
  br label %139

123:                                              ; preds = %109
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %130, ptr %3, align 8, !tbaa !5
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds [10 x i8], ptr %6, i64 0, i64 0
  %133 = load i32, ptr %7, align 4, !tbaa !15
  %134 = sext i32 %133 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %131, ptr align 1 %132, i64 %134, i1 false)
  %135 = load i32, ptr %7, align 4, !tbaa !15
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = sext i32 %135 to i64
  %138 = getelementptr inbounds i8, ptr %136, i64 %137
  store ptr %138, ptr %4, align 8, !tbaa !5
  br label %139

139:                                              ; preds = %129, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 10, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %202

140:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 0, ptr %9, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !15
  br label %141

141:                                              ; preds = %189, %140
  %142 = load i32, ptr %10, align 4, !tbaa !15
  %143 = icmp slt i32 %142, 5
  br i1 %143, label %145, label %144

144:                                              ; preds = %141
  store i32 12, ptr %11, align 4
  br label %192

145:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %146 = load i32, ptr %10, align 4, !tbaa !15
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [5 x %"struct.tinyxml2::Entity"], ptr @_ZN8tinyxml2L8entitiesE, i64 0, i64 %147
  store ptr %148, ptr %12, align 8, !tbaa !5
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %149, i64 1
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !18
  %154 = load ptr, ptr %12, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 8, !tbaa !20
  %157 = sext i32 %156 to i64
  %158 = call i32 @strncmp(ptr noundef %150, ptr noundef %153, i64 noundef %157) #7
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %185

160:                                              ; preds = %145
  %161 = load ptr, ptr %3, align 8, !tbaa !5
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %162, i32 0, i32 1
  %164 = load i32, ptr %163, align 8, !tbaa !20
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i8, ptr %161, i64 %165
  %167 = getelementptr inbounds i8, ptr %166, i64 1
  %168 = load i8, ptr %167, align 1, !tbaa !13
  %169 = sext i8 %168 to i32
  %170 = icmp eq i32 %169, 59
  br i1 %170, label %171, label %185

171:                                              ; preds = %160
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %172, i32 0, i32 2
  %174 = load i8, ptr %173, align 4, !tbaa !21
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 %174, ptr %175, align 1, !tbaa !13
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds i8, ptr %176, i32 1
  store ptr %177, ptr %4, align 8, !tbaa !5
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  %179 = getelementptr inbounds %"struct.tinyxml2::Entity", ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 8, !tbaa !20
  %181 = add nsw i32 %180, 2
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = sext i32 %181 to i64
  %184 = getelementptr inbounds i8, ptr %182, i64 %183
  store ptr %184, ptr %3, align 8, !tbaa !5
  store i8 1, ptr %9, align 1, !tbaa !16
  store i32 12, ptr %11, align 4
  br label %186

185:                                              ; preds = %160, %145
  store i32 0, ptr %11, align 4
  br label %186

186:                                              ; preds = %185, %171
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %187 = load i32, ptr %11, align 4
  switch i32 %187, label %192 [
    i32 0, label %188
  ]

188:                                              ; preds = %186
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %10, align 4, !tbaa !15
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %10, align 4, !tbaa !15
  br label %141, !llvm.loop !22

192:                                              ; preds = %186, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %193

193:                                              ; preds = %192
  %194 = load i8, ptr %9, align 1, !tbaa !16, !range !24, !noundef !25
  %195 = trunc i8 %194 to i1
  br i1 %195, label %201, label %196

196:                                              ; preds = %193
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = getelementptr inbounds i8, ptr %197, i32 1
  store ptr %198, ptr %3, align 8, !tbaa !5
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds i8, ptr %199, i32 1
  store ptr %200, ptr %4, align 8, !tbaa !5
  br label %201

201:                                              ; preds = %196, %193
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  br label %202

202:                                              ; preds = %201, %139
  br label %211

203:                                              ; preds = %98, %93
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = load i8, ptr %204, align 1, !tbaa !13
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 %205, ptr %206, align 1, !tbaa !13
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds i8, ptr %207, i32 1
  store ptr %208, ptr %3, align 8, !tbaa !5
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = getelementptr inbounds i8, ptr %209, i32 1
  store ptr %210, ptr %4, align 8, !tbaa !5
  br label %211

211:                                              ; preds = %203, %202
  br label %212

212:                                              ; preds = %211, %89
  br label %213

213:                                              ; preds = %212, %63
  br label %36, !llvm.loop !26

214:                                              ; preds = %36
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 0, ptr %215, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %216

216:                                              ; preds = %214, %22
  %217 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %218 = load i32, ptr %217, align 8, !tbaa !9
  %219 = and i32 %218, 4
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %222

221:                                              ; preds = %216
  call void @_ZN8tinyxml27StrPair18CollapseWhitespaceEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  br label %222

222:                                              ; preds = %221, %216
  %223 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  %224 = load i32, ptr %223, align 8, !tbaa !9
  %225 = and i32 %224, 512
  %226 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 0
  store i32 %225, ptr %226, align 8, !tbaa !9
  br label %227

227:                                              ; preds = %222, %17
  br label %228

228:                                              ; preds = %227
  br label %229

229:                                              ; preds = %228
  %230 = getelementptr inbounds %"class.tinyxml2::StrPair", ptr %13, i32 0, i32 1
  %231 = load ptr, ptr %230, align 8, !tbaa !14
  ret ptr %231
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8tinyxml27XMLUtil15GetCharacterRefEPKcPcPi(ptr noundef, ptr noundef, ptr noundef) #5 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN8tinyxml27StrPairE", !11, i64 0, !6, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = !{!7, !7, i64 0}
!14 = !{!10, !6, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"_ZTSN8tinyxml26EntityE", !6, i64 0, !11, i64 8, !7, i64 12}
!20 = !{!19, !11, i64 8}
!21 = !{!19, !7, i64 12}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !23}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; 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 nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN8tinyxml27StrPair6GetStrEv(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca [10 x i8], align 1
  %3 = alloca i32, align 4
  %4 = load i32, ptr %0, align 8, !tbaa !5
  %5 = and i32 %4, 256
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %110, label %6

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  store i8 0, ptr %8, align 1, !tbaa !12
  %9 = load i32, ptr %0, align 8, !tbaa !5
  %10 = xor i32 %9, 256
  store i32 %10, ptr %0, align 8, !tbaa !5
  %.not59 = icmp eq i32 %9, 256
  br i1 %.not59, label %.thread86, label %11

11:                                               ; preds = %6
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = load ptr, ptr %7, align 8, !tbaa !11
  %15 = icmp ult ptr %13, %14
  br i1 %15, label %.lr.ph.preheader, label %.loopexit88

.lr.ph.preheader:                                 ; preds = %11
  %16 = load ptr, ptr @_ZN8tinyxml2L8entitiesE, align 16
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 8), align 8
  %18 = sext i32 %17 to i64
  %19 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 16), align 16
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 24), align 8
  %21 = sext i32 %20 to i64
  %22 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 32), align 16
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 40), align 8
  %24 = sext i32 %23 to i64
  %25 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 48), align 16
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 56), align 8
  %27 = sext i32 %26 to i64
  %28 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 64), align 16
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 72), align 8
  %30 = sext i32 %29 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %103
  %.077 = phi ptr [ %.8, %103 ], [ %13, %.lr.ph.preheader ]
  %.05176 = phi ptr [ %.657, %103 ], [ %13, %.lr.ph.preheader ]
  %31 = load i32, ptr %0, align 8, !tbaa !5
  %32 = and i32 %31, 2
  %.not61 = icmp eq i32 %32, 0
  %.pre.pre = load i8, ptr %.077, align 1, !tbaa !12
  br i1 %.not61, label %.thread, label %33

33:                                               ; preds = %.lr.ph
  switch i8 %.pre.pre, label %.thread [
    i8 13, label %34
    i8 10, label %40
  ]

34:                                               ; preds = %33
  %35 = getelementptr inbounds i8, ptr %.077, i64 1
  %36 = load i8, ptr %35, align 1, !tbaa !12
  %37 = icmp eq i8 %36, 10
  %38 = getelementptr inbounds i8, ptr %.077, i64 2
  %.1 = select i1 %37, ptr %38, ptr %35
  store i8 10, ptr %.05176, align 1, !tbaa !12
  %39 = getelementptr inbounds i8, ptr %.05176, i64 1
  br label %103

40:                                               ; preds = %33
  %41 = getelementptr inbounds i8, ptr %.077, i64 1
  %42 = load i8, ptr %41, align 1, !tbaa !12
  %43 = icmp eq i8 %42, 13
  %44 = getelementptr inbounds i8, ptr %.077, i64 2
  %.2 = select i1 %43, ptr %44, ptr %41
  store i8 10, ptr %.05176, align 1, !tbaa !12
  %45 = getelementptr inbounds i8, ptr %.05176, i64 1
  br label %103

.thread:                                          ; preds = %33, %.lr.ph
  %46 = and i32 %31, 1
  %.not63 = icmp ne i32 %46, 0
  %47 = icmp eq i8 %.pre.pre, 38
  %or.cond = select i1 %.not63, i1 %47, i1 false
  br i1 %or.cond, label %48, label %100

48:                                               ; preds = %.thread
  %49 = getelementptr i8, ptr %.077, i64 1
  %50 = load i8, ptr %49, align 1, !tbaa !12
  %51 = icmp eq i8 %50, 35
  br i1 %51, label %54, label %.preheader

.preheader:                                       ; preds = %48
  %52 = call i32 @strncmp(ptr noundef nonnull %49, ptr noundef %16, i64 noundef %18) #6
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %66, label %76

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %2, i8 0, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !14
  %55 = call noundef ptr @_ZN8tinyxml27XMLUtil15GetCharacterRefEPKcPcPi(ptr noundef nonnull %.077, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %59

57:                                               ; preds = %54
  %58 = load i8, ptr %.077, align 1, !tbaa !12
  store i8 %58, ptr %.05176, align 1, !tbaa !12
  br label %64

59:                                               ; preds = %54
  %60 = load i32, ptr %3, align 4, !tbaa !14
  %61 = sext i32 %60 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.05176, ptr nonnull align 1 %2, i64 %61, i1 false)
  %62 = load i32, ptr %3, align 4, !tbaa !14
  %63 = sext i32 %62 to i64
  br label %64

64:                                               ; preds = %59, %57
  %.sink = phi i64 [ %63, %59 ], [ 1, %57 ]
  %.3 = phi ptr [ %55, %59 ], [ %49, %57 ]
  %65 = getelementptr inbounds i8, ptr %.05176, i64 %.sink
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %2) #7
  br label %103

66:                                               ; preds = %.preheader
  %gep = getelementptr i8, ptr %49, i64 %18
  %67 = load i8, ptr %gep, align 1, !tbaa !12
  %68 = icmp eq i8 %67, 59
  br i1 %68, label %69, label %76

69:                                               ; preds = %97, %91, %85, %79, %66
  %.lcssa79 = phi ptr [ @_ZN8tinyxml2L8entitiesE, %66 ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 16), %79 ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 32), %85 ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 48), %91 ], [ getelementptr inbounds (i8, ptr @_ZN8tinyxml2L8entitiesE, i64 64), %97 ]
  %.lcssa = phi i32 [ %17, %66 ], [ %20, %79 ], [ %23, %85 ], [ %26, %91 ], [ %29, %97 ]
  %70 = getelementptr inbounds i8, ptr %.lcssa79, i64 12
  %71 = load i8, ptr %70, align 4, !tbaa !15
  store i8 %71, ptr %.05176, align 1, !tbaa !12
  %72 = getelementptr inbounds i8, ptr %.05176, i64 1
  %73 = add nsw i32 %.lcssa, 2
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %.077, i64 %74
  br label %.loopexit

76:                                               ; preds = %66, %.preheader
  %77 = call i32 @strncmp(ptr noundef nonnull %49, ptr noundef %19, i64 noundef %21) #6
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %82

79:                                               ; preds = %76
  %gep.1 = getelementptr i8, ptr %49, i64 %21
  %80 = load i8, ptr %gep.1, align 1, !tbaa !12
  %81 = icmp eq i8 %80, 59
  br i1 %81, label %69, label %82

82:                                               ; preds = %79, %76
  %83 = call i32 @strncmp(ptr noundef nonnull %49, ptr noundef %22, i64 noundef %24) #6
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %82
  %gep.2 = getelementptr i8, ptr %49, i64 %24
  %86 = load i8, ptr %gep.2, align 1, !tbaa !12
  %87 = icmp eq i8 %86, 59
  br i1 %87, label %69, label %88

88:                                               ; preds = %85, %82
  %89 = call i32 @strncmp(ptr noundef nonnull %49, ptr noundef %25, i64 noundef %27) #6
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %94

91:                                               ; preds = %88
  %gep.3 = getelementptr i8, ptr %49, i64 %27
  %92 = load i8, ptr %gep.3, align 1, !tbaa !12
  %93 = icmp eq i8 %92, 59
  br i1 %93, label %69, label %94

94:                                               ; preds = %91, %88
  %95 = call i32 @strncmp(ptr noundef nonnull %49, ptr noundef %28, i64 noundef %30) #6
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %.loopexit

97:                                               ; preds = %94
  %gep.4 = getelementptr i8, ptr %49, i64 %30
  %98 = load i8, ptr %gep.4, align 1, !tbaa !12
  %99 = icmp eq i8 %98, 59
  br i1 %99, label %69, label %.loopexit

.loopexit:                                        ; preds = %94, %97, %69
  %.556.idx = phi i64 [ 0, %69 ], [ 1, %97 ], [ 1, %94 ]
  %.455 = phi ptr [ %72, %69 ], [ %.05176, %97 ], [ %.05176, %94 ]
  %.6 = phi ptr [ %75, %69 ], [ %.077, %97 ], [ %.077, %94 ]
  %.556 = getelementptr inbounds i8, ptr %.455, i64 %.556.idx
  %.7 = getelementptr inbounds i8, ptr %.6, i64 %.556.idx
  br label %103

100:                                              ; preds = %.thread
  store i8 %.pre.pre, ptr %.05176, align 1, !tbaa !12
  %101 = getelementptr inbounds i8, ptr %.077, i64 1
  %102 = getelementptr inbounds i8, ptr %.05176, i64 1
  br label %103

103:                                              ; preds = %40, %64, %.loopexit, %100, %34
  %.657 = phi ptr [ %39, %34 ], [ %45, %40 ], [ %65, %64 ], [ %.556, %.loopexit ], [ %102, %100 ]
  %.8 = phi ptr [ %.1, %34 ], [ %.2, %40 ], [ %.3, %64 ], [ %.7, %.loopexit ], [ %101, %100 ]
  %104 = load ptr, ptr %7, align 8, !tbaa !11
  %105 = icmp ult ptr %.8, %104
  br i1 %105, label %.lr.ph, label %.loopexit88, !llvm.loop !17

.loopexit88:                                      ; preds = %103, %11
  %.051.lcssa = phi ptr [ %13, %11 ], [ %.657, %103 ]
  store i8 0, ptr %.051.lcssa, align 1, !tbaa !12
  %.pre84 = load i32, ptr %0, align 8, !tbaa !5
  %106 = and i32 %.pre84, 4
  %.not60 = icmp eq i32 %106, 0
  br i1 %.not60, label %.thread86, label %107

107:                                              ; preds = %.loopexit88
  call void @_ZN8tinyxml27StrPair18CollapseWhitespaceEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %.pre85 = load i32, ptr %0, align 8, !tbaa !5
  br label %.thread86

.thread86:                                        ; preds = %6, %107, %.loopexit88
  %108 = phi i32 [ %.pre85, %107 ], [ %.pre84, %.loopexit88 ], [ 0, %6 ]
  %109 = and i32 %108, 512
  store i32 %109, ptr %0, align 8, !tbaa !5
  br label %110

110:                                              ; preds = %.thread86, %1
  %111 = getelementptr inbounds i8, ptr %0, i64 8
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  ret ptr %112
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8tinyxml27XMLUtil15GetCharacterRefEPKcPcPi(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"_ZTSN8tinyxml27StrPairE", !7, i64 0, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = !{!8, !8, i64 0}
!13 = !{!6, !10, i64 8}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !8, i64 12}
!16 = !{!"_ZTSN8tinyxml26EntityE", !10, i64 0, !7, i64 8, !8, i64 12}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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