; LLVM IR from gem5/gem5 :: ext/mcpat/xmlParser.ll (ZN7XMLNode11parseStringEPKcS1_P10XMLResults)

; 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.XMLNode = type { ptr }
%struct.XML = type { ptr, ptr, i32, i32, i32, ptr, i32, ptr, i32, i32 }
%struct.XMLResults = type { i32, i32, i32 }

@_ZN7XMLNode12emptyXMLNodeE = external dso_local global %struct.XMLNode, align 8

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7XMLNode12getChildNodeEi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7XMLNode11parseStringEPKcS1_P10XMLResults(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 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 %struct.XMLNode, align 8
  %10 = alloca %struct.XML, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.XMLNode, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.XMLNode, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %31, label %20

20:                                               ; preds = %4
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %30

23:                                               ; preds = %20
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.XMLResults, ptr %24, i32 0, i32 0
  store i32 9, ptr %25, align 4, !tbaa !9
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.XMLResults, ptr %26, i32 0, i32 1
  store i32 0, ptr %27, align 4, !tbaa !13
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.XMLResults, ptr %28, i32 0, i32 2
  store i32 0, ptr %29, align 4, !tbaa !14
  br label %30

30:                                               ; preds = %23, %20
  call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  br label %179

31:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @_ZN7XMLNodeC1EPNS_14XMLNodeDataTagEPcc(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef null, ptr noundef null, i8 noundef signext 0)
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #4
  %32 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 0
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %33, ptr %32, align 8, !tbaa !15
  %34 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 1
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %35, ptr %34, align 8, !tbaa !17
  %36 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 2
  store i32 0, ptr %36, align 8, !tbaa !18
  %37 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 3
  store i32 0, ptr %37, align 4, !tbaa !19
  %38 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 4
  store i32 0, ptr %38, align 8, !tbaa !20
  %39 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 5
  store ptr null, ptr %39, align 8, !tbaa !21
  %40 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 6
  store i32 0, ptr %40, align 8, !tbaa !22
  %41 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 7
  store ptr null, ptr %41, align 8, !tbaa !23
  %42 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 8
  store i32 0, ptr %42, align 8, !tbaa !24
  %43 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 9
  store i32 1, ptr %43, align 4, !tbaa !25
  %44 = invoke noundef i32 @_ZN7XMLNode15ParseXMLElementEPv(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %10)
          to label %45 unwind label %52

45:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %46 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 4
  %47 = load i32, ptr %46, align 8, !tbaa !20
  store i32 %47, ptr %13, align 4, !tbaa !26
  %48 = invoke noundef i32 @_ZNK7XMLNode10nChildNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %49 unwind label %56

49:                                               ; preds = %45
  %50 = icmp ne i32 %48, 0
  br i1 %50, label %60, label %51

51:                                               ; preds = %49
  store i32 2, ptr %13, align 4, !tbaa !26
  br label %60

52:                                               ; preds = %31
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %11, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %12, align 4
  br label %178

56:                                               ; preds = %174, %166, %147, %64, %60, %45
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %11, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %12, align 4
  br label %177

60:                                               ; preds = %51, %49
  %61 = invoke noundef i32 @_ZNK7XMLNode10nChildNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %62 unwind label %56

62:                                               ; preds = %60
  %63 = icmp eq i32 %61, 1
  br i1 %63, label %64, label %81

64:                                               ; preds = %62
  %65 = invoke noundef i32 @_ZNK7XMLNode8nElementEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %66 unwind label %56

66:                                               ; preds = %64
  %67 = icmp eq i32 %65, 1
  br i1 %67, label %68, label %81

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  invoke void @_ZNK7XMLNode12getChildNodeEi(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %14, ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0)
          to label %69 unwind label %72

69:                                               ; preds = %68
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %71 unwind label %76

71:                                               ; preds = %69
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %81

72:                                               ; preds = %68
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %11, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %12, align 4
  br label %80

76:                                               ; preds = %69
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %11, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %12, align 4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  br label %80

80:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %177

81:                                               ; preds = %71, %66, %62
  %82 = load i32, ptr %13, align 4, !tbaa !26
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %90, label %84

84:                                               ; preds = %81
  %85 = load i32, ptr %13, align 4, !tbaa !26
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %90, label %87

87:                                               ; preds = %84
  %88 = load i32, ptr %13, align 4, !tbaa !26
  %89 = icmp eq i32 %88, 2
  br i1 %89, label %90, label %147

90:                                               ; preds = %87, %84, %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %91 = invoke noundef ptr @_ZNK7XMLNode7getNameEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %92 unwind label %126

92:                                               ; preds = %90
  store ptr %91, ptr %15, align 8, !tbaa !5
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %142

95:                                               ; preds = %92
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load i8, ptr %96, align 1, !tbaa !27
  %98 = icmp ne i8 %97, 0
  br i1 %98, label %99, label %142

99:                                               ; preds = %95
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = icmp ne ptr %100, null
  br i1 %101, label %102, label %108

102:                                              ; preds = %99
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = invoke noundef i32 @_ZL8xstricmpPKcS0_(ptr noundef %103, ptr noundef %104)
          to label %106 unwind label %126

106:                                              ; preds = %102
  %107 = icmp ne i32 %105, 0
  br i1 %107, label %108, label %142

108:                                              ; preds = %106, %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind writable sret(%struct.XMLNode) align 8 %16, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %109, ptr noundef null)
          to label %110 unwind label %130

110:                                              ; preds = %108
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %112 unwind label %134

112:                                              ; preds = %110
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %113 = invoke noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %114 unwind label %126

114:                                              ; preds = %112
  %115 = icmp ne i8 %113, 0
  br i1 %115, label %116, label %141

116:                                              ; preds = %114
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %139

119:                                              ; preds = %116
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.XMLResults, ptr %120, i32 0, i32 0
  store i32 11, ptr %121, align 4, !tbaa !9
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.XMLResults, ptr %122, i32 0, i32 1
  store i32 0, ptr %123, align 4, !tbaa !13
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.XMLResults, ptr %124, i32 0, i32 2
  store i32 0, ptr %125, align 4, !tbaa !14
  br label %139

126:                                              ; preds = %139, %112, %102, %90
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %11, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %12, align 4
  br label %146

130:                                              ; preds = %108
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %11, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %12, align 4
  br label %138

134:                                              ; preds = %110
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %11, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %12, align 4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  br label %138

138:                                              ; preds = %134, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %146

139:                                              ; preds = %119, %116
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
          to label %140 unwind label %126

140:                                              ; preds = %139
  store i32 1, ptr %17, align 4
  br label %143

141:                                              ; preds = %114
  br label %142

142:                                              ; preds = %141, %106, %95, %92
  store i32 0, ptr %17, align 4
  br label %143

143:                                              ; preds = %142, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  %144 = load i32, ptr %17, align 4
  switch i32 %144, label %176 [
    i32 0, label %145
  ]

145:                                              ; preds = %143
  br label %150

146:                                              ; preds = %138, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %177

147:                                              ; preds = %87
  %148 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
          to label %149 unwind label %56

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149, %145
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %174

153:                                              ; preds = %150
  %154 = load i32, ptr %13, align 4, !tbaa !26
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.XMLResults, ptr %155, i32 0, i32 0
  store i32 %154, ptr %156, align 4, !tbaa !9
  %157 = load i32, ptr %13, align 4, !tbaa !26
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %173

159:                                              ; preds = %153
  %160 = load i32, ptr %13, align 4, !tbaa !26
  %161 = icmp eq i32 %160, 1
  br i1 %161, label %162, label %166

162:                                              ; preds = %159
  %163 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 3
  %164 = load i32, ptr %163, align 4, !tbaa !19
  %165 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 2
  store i32 %164, ptr %165, align 8, !tbaa !18
  br label %166

166:                                              ; preds = %162, %159
  %167 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !15
  %169 = getelementptr inbounds %struct.XML, ptr %10, i32 0, i32 2
  %170 = load i32, ptr %169, align 8, !tbaa !18
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZL20CountLinesAndColumnsPKciP10XMLResults(ptr noundef %168, i32 noundef %170, ptr noundef %171)
          to label %172 unwind label %56

172:                                              ; preds = %166
  br label %173

173:                                              ; preds = %172, %153
  br label %174

174:                                              ; preds = %173, %150
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %175 unwind label %56

175:                                              ; preds = %174
  store i32 1, ptr %17, align 4
  br label %176

176:                                              ; preds = %175, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %179

177:                                              ; preds = %146, %80, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %178

178:                                              ; preds = %177, %52
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %180

179:                                              ; preds = %176, %30
  ret void

180:                                              ; preds = %178
  %181 = load ptr, ptr %11, align 8
  %182 = load i32, ptr %12, align 4
  %183 = insertvalue { ptr, i32 } poison, ptr %181, 0
  %184 = insertvalue { ptr, i32 } %183, i32 %182, 1
  resume { ptr, i32 } %184
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL8xstricmpPKcS0_(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL20CountLinesAndColumnsPKciP10XMLResults(ptr noundef, i32 noundef, ptr noundef) #2

declare void @_ZN7XMLNodeC1EPNS_14XMLNodeDataTagEPcc(ptr, ptr, ptr, i8)

declare void @_ZN7XMLNodeD1Ev(ptr)

declare void @_ZN7XMLNodeC1ERKS_(ptr, ptr)

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


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

%struct.XMLNode = type { ptr }
%struct.XML = type { ptr, ptr, i32, i32, i32, ptr, i32, ptr, i32, i32 }

@_ZN7XMLNode12emptyXMLNodeE = external dso_local global %struct.XMLNode, align 8

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7XMLNode12getChildNodeEi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7XMLNode11parseStringEPKcS1_P10XMLResults(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.XMLNode, align 8
  %6 = alloca %struct.XML, align 8
  %7 = alloca %struct.XMLNode, align 8
  %8 = alloca %struct.XMLNode, align 8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %9, label %14

9:                                                ; preds = %4
  %.not44 = icmp eq ptr %3, null
  br i1 %.not44, label %13, label %10

10:                                               ; preds = %9
  store i32 9, ptr %3, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 0, ptr %11, align 4, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 0, ptr %12, align 4, !tbaa !12
  br label %13

13:                                               ; preds = %10, %9
  tail call void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
  br label %82

14:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @_ZN7XMLNodeC1EPNS_14XMLNodeDataTagEPcc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef null, ptr noundef null, i8 noundef signext 0)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #4
  store ptr %1, ptr %6, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %1, ptr %15, align 8, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %6, i64 16
  store i32 0, ptr %16, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %6, i64 20
  store i32 0, ptr %17, align 4, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %6, i64 24
  store i32 0, ptr %18, align 8, !tbaa !19
  %19 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr null, ptr %19, align 8, !tbaa !20
  %20 = getelementptr inbounds i8, ptr %6, i64 40
  store i32 0, ptr %20, align 8, !tbaa !21
  %21 = getelementptr inbounds i8, ptr %6, i64 48
  store ptr null, ptr %21, align 8, !tbaa !22
  %22 = getelementptr inbounds i8, ptr %6, i64 56
  store i32 0, ptr %22, align 8, !tbaa !23
  %23 = getelementptr inbounds i8, ptr %6, i64 60
  store i32 1, ptr %23, align 4, !tbaa !24
  %24 = invoke noundef i32 @_ZN7XMLNode15ParseXMLElementEPv(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %6)
          to label %25 unwind label %30

25:                                               ; preds = %14
  %26 = load i32, ptr %18, align 8, !tbaa !19
  %27 = call noundef i32 @_ZNK7XMLNode10nChildNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %.not45 = icmp eq i32 %27, 0
  %spec.select = select i1 %.not45, i32 2, i32 %26
  %28 = call noundef i32 @_ZNK7XMLNode10nChildNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %34, label %46

30:                                               ; preds = %14
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %81

32:                                               ; preds = %80, %71
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %81

34:                                               ; preds = %25
  %35 = call noundef i32 @_ZNK7XMLNode8nElementEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %46

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  invoke void @_ZNK7XMLNode12getChildNodeEi(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0)
          to label %38 unwind label %41

38:                                               ; preds = %37
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %40 unwind label %43

40:                                               ; preds = %38
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %46

41:                                               ; preds = %37
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %45

43:                                               ; preds = %38
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br label %45

45:                                               ; preds = %43, %41
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %81

46:                                               ; preds = %40, %34, %25
  %or.cond3 = icmp ult i32 %spec.select, 3
  br i1 %or.cond3, label %47, label %71

47:                                               ; preds = %46
  %48 = call noundef ptr @_ZNK7XMLNode7getNameEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %.not47 = icmp eq ptr %2, null
  br i1 %.not47, label %73, label %49

49:                                               ; preds = %47
  %50 = load i8, ptr %2, align 1, !tbaa !25
  %.not48 = icmp eq i8 %50, 0
  br i1 %.not48, label %73, label %51

51:                                               ; preds = %49
  %.not49 = icmp eq ptr %48, null
  br i1 %.not49, label %54, label %52

52:                                               ; preds = %51
  %53 = call noundef i32 @_ZL8xstricmpPKcS0_(ptr noundef nonnull %48, ptr noundef nonnull %2)
  %.not50 = icmp eq i32 %53, 0
  br i1 %.not50, label %73, label %54

54:                                               ; preds = %52, %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  invoke void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind nonnull writable sret(%struct.XMLNode) align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %2, ptr noundef null)
          to label %55 unwind label %65

55:                                               ; preds = %54
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %57 unwind label %67

57:                                               ; preds = %55
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  %58 = call noundef signext i8 @_ZNK7XMLNode7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %.not53 = icmp eq i8 %58, 0
  br i1 %.not53, label %73, label %59

59:                                               ; preds = %57
  %.not54 = icmp eq ptr %3, null
  br i1 %.not54, label %70, label %60

60:                                               ; preds = %59
  store i32 11, ptr %3, align 4, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 0, ptr %61, align 4, !tbaa !11
  %62 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 0, ptr %62, align 4, !tbaa !12
  br label %70

63:                                               ; preds = %70
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %81

65:                                               ; preds = %54
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %69

67:                                               ; preds = %55
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br label %69

69:                                               ; preds = %67, %65
  %.pn51 = phi { ptr, i32 } [ %68, %67 ], [ %66, %65 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %81

70:                                               ; preds = %60, %59
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
          to label %.critedge unwind label %63

71:                                               ; preds = %46
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7XMLNodeaSERKS_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) @_ZN7XMLNode12emptyXMLNodeE)
          to label %73 unwind label %32

73:                                               ; preds = %57, %52, %49, %47, %71
  %.not57 = icmp eq ptr %3, null
  br i1 %.not57, label %80, label %74

74:                                               ; preds = %73
  store i32 %spec.select, ptr %3, align 4, !tbaa !5
  switch i32 %spec.select, label %._crit_edge [
    i32 0, label %80
    i32 1, label %75
  ]

._crit_edge:                                      ; preds = %74
  %.pre = load i32, ptr %16, align 8, !tbaa !17
  br label %77

75:                                               ; preds = %74
  %76 = load i32, ptr %17, align 4, !tbaa !18
  store i32 %76, ptr %16, align 8, !tbaa !17
  br label %77

77:                                               ; preds = %._crit_edge, %75
  %78 = phi i32 [ %.pre, %._crit_edge ], [ %76, %75 ]
  %79 = load ptr, ptr %6, align 8, !tbaa !13
  call void @_ZL20CountLinesAndColumnsPKciP10XMLResults(ptr noundef %79, i32 noundef %78, ptr noundef nonnull %3)
  br label %80

80:                                               ; preds = %74, %77, %73
  invoke void @_ZN7XMLNodeC1ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %.critedge unwind label %32

.critedge:                                        ; preds = %70, %80
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %82

81:                                               ; preds = %32, %45, %69, %63, %30
  %.pn59.pn = phi { ptr, i32 } [ %31, %30 ], [ %33, %32 ], [ %.pn, %45 ], [ %64, %63 ], [ %.pn51, %69 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #4
  call void @_ZN7XMLNodeD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn59.pn

82:                                               ; preds = %.critedge, %13
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL8xstricmpPKcS0_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7XMLNode12getChildNodeEPKcPi(ptr dead_on_unwind noalias writable sret(%struct.XMLNode) align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL20CountLinesAndColumnsPKciP10XMLResults(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN7XMLNodeC1EPNS_14XMLNodeDataTagEPcc(ptr, ptr, ptr, i8) local_unnamed_addr

declare void @_ZN7XMLNodeD1Ev(ptr) local_unnamed_addr

declare void @_ZN7XMLNodeC1ERKS_(ptr, ptr) local_unnamed_addr

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass