; LLVM IR from simbody/simbody :: SimTKcommon/src/Xml.ll (ZN5SimTK3Xml7Element8updValueEv)

; 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.SimTK::Xml::node_iterator" = type <{ %"class.SimTK::Xml::Node", i32, [4 x i8] }>
%"class.SimTK::Xml::Node" = type { ptr }

@.str.10 = external hidden unnamed_addr constant [73 x i8], align 1
@_ZTIN5SimTK9Exception10ErrorCheckE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.34 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [37 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5SimTK3Xml7Element13getElementTagEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare ptr @__cxa_allocate_exception(i64)

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

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5SimTK3Xml7Element14isValueElementEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5SimTK3Xml7Element10node_beginENS0_8NodeTypeE(ptr dead_on_unwind noalias writable sret(%"class.SimTK::Xml::node_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5SimTK3Xml7Element8node_endEv(ptr dead_on_unwind noalias writable sret(%"class.SimTK::Xml::node_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN5SimTK3Xml7Element8updValueEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.SimTK::Xml::node_iterator", align 8
  %7 = alloca %"class.SimTK::Xml::node_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  br label %11

11:                                               ; preds = %1
  %12 = call noundef zeroext i1 @_ZNK5SimTK3Xml7Element14isValueElementEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  br i1 %12, label %23, label %13

13:                                               ; preds = %11
  %14 = call ptr @__cxa_allocate_exception(i64 112) #6
  %15 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5SimTK3Xml7Element13getElementTagEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %16 unwind label %19

16:                                               ; preds = %13
  %17 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  invoke void (ptr, ptr, i32, ptr, ptr, ptr, ...) @_ZN5SimTK9Exception10ErrorCheckC2EPKciS3_S3_S3_z(ptr noundef nonnull align 8 dereferenceable(112) %14, ptr noundef @.str.10, i32 noundef 732, ptr noundef @.str.54, ptr noundef @.str.55, ptr noundef @.str.56, ptr noundef %17)
          to label %18 unwind label %19

18:                                               ; preds = %16
  call void @__cxa_throw(ptr %14, ptr @_ZTIN5SimTK9Exception10ErrorCheckE, ptr @_ZN5SimTK9Exception4BaseD2Ev) #7
  unreachable

19:                                               ; preds = %16, %13
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %4, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %5, align 4
  call void @__cxa_free_exception(ptr %14) #6
  br label %72

23:                                               ; preds = %11
  br label %24

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  call void @_ZN5SimTK3Xml7Element10node_beginENS0_8NodeTypeE(ptr dead_on_unwind writable sret(%"class.SimTK::Xml::node_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  invoke void @_ZNK5SimTK3Xml7Element8node_endEv(ptr dead_on_unwind writable sret(%"class.SimTK::Xml::node_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %25 unwind label %35

25:                                               ; preds = %24
  %26 = invoke noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 8 dereferenceable(12) %7)
          to label %27 unwind label %39

27:                                               ; preds = %25
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br i1 %26, label %28, label %48

28:                                               ; preds = %27
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK3Xml13node_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
          to label %30 unwind label %44

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK3Xml4Text5getAsERNS0_4NodeE(ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %32 unwind label %44

32:                                               ; preds = %30
  %33 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN5SimTK3Xml4Text7updTextEv(ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %34 unwind label %44

34:                                               ; preds = %32
  store ptr %33, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %69

35:                                               ; preds = %24
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %4, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %5, align 4
  br label %43

39:                                               ; preds = %25
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %4, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %5, align 4
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %7) #6
  br label %43

43:                                               ; preds = %39, %35
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %71

44:                                               ; preds = %32, %30, %28
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %4, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %5, align 4
  br label %71

48:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %49 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 112) #8
          to label %50 unwind label %60

50:                                               ; preds = %48
  invoke void @_ZN5SimTK9TiXmlTextC2EPKc(ptr noundef nonnull align 8 dereferenceable(105) %49, ptr noundef @.str.34)
          to label %51 unwind label %64

51:                                               ; preds = %50
  store ptr %49, ptr %9, align 8, !tbaa !5
  %52 = invoke noundef nonnull align 8 dereferenceable(216) ptr @_ZN5SimTK3Xml7Element12updTiElementEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %53 unwind label %60

53:                                               ; preds = %51
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = invoke noundef ptr @_ZN5SimTK9TiXmlNode12LinkEndChildEPS0_(ptr noundef nonnull align 8 dereferenceable(104) %52, ptr noundef %54)
          to label %56 unwind label %60

56:                                               ; preds = %53
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN5SimTK9TiXmlNode11UpdValueStrEv(ptr noundef nonnull align 8 dereferenceable(104) %57)
          to label %59 unwind label %60

59:                                               ; preds = %56
  store ptr %58, ptr %2, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %69

60:                                               ; preds = %56, %53, %51, %48
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %4, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %5, align 4
  br label %68

64:                                               ; preds = %50
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %4, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %49, i64 noundef 112) #9
  br label %68

68:                                               ; preds = %64, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %71

69:                                               ; preds = %59, %34
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  %70 = load ptr, ptr %2, align 8
  ret ptr %70

71:                                               ; preds = %68, %44, %43
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  br label %72

72:                                               ; preds = %71, %19
  %73 = load ptr, ptr %4, align 8
  %74 = load i32, ptr %5, align 4
  %75 = insertvalue { ptr, i32 } poison, ptr %73, 0
  %76 = insertvalue { ptr, i32 } %75, i32 %74, 1
  resume { ptr, i32 } %76
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN5SimTK3Xml4Text7updTextEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5SimTK9TiXmlTextC2EPKc(ptr noundef nonnull align 8 dereferenceable(105), ptr noundef) unnamed_addr #4 align 2

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

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


; 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.SimTK::Xml::node_iterator" = type <{ %"class.SimTK::Xml::Node", i32, [4 x i8] }>
%"class.SimTK::Xml::Node" = type { ptr }

@.str.10 = external hidden unnamed_addr constant [73 x i8], align 1
@_ZTIN5SimTK9Exception10ErrorCheckE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.34 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [37 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5SimTK3Xml7Element14isValueElementEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5SimTK3Xml7Element10node_beginENS0_8NodeTypeE(ptr dead_on_unwind noalias writable sret(%"class.SimTK::Xml::node_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK5SimTK3Xml7Element8node_endEv(ptr dead_on_unwind noalias writable sret(%"class.SimTK::Xml::node_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN5SimTK3Xml7Element8updValueEv(ptr noundef nonnull align 8 dereferenceable(8) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.SimTK::Xml::node_iterator", align 8
  %3 = alloca %"class.SimTK::Xml::node_iterator", align 8
  %4 = tail call noundef zeroext i1 @_ZNK5SimTK3Xml7Element14isValueElementEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  br i1 %4, label %13, label %5

5:                                                ; preds = %1
  %6 = tail call ptr @__cxa_allocate_exception(i64 112) #6
  %7 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK5SimTK3Xml7Element13getElementTagEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %8 unwind label %11

8:                                                ; preds = %5
  %9 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  invoke void (ptr, ptr, i32, ptr, ptr, ptr, ...) @_ZN5SimTK9Exception10ErrorCheckC2EPKciS3_S3_S3_z(ptr noundef nonnull align 8 dereferenceable(112) %6, ptr noundef nonnull @.str.10, i32 noundef 732, ptr noundef nonnull @.str.54, ptr noundef nonnull @.str.55, ptr noundef nonnull @.str.56, ptr noundef %9)
          to label %10 unwind label %11

10:                                               ; preds = %8
  tail call void @__cxa_throw(ptr nonnull %6, ptr nonnull @_ZTIN5SimTK9Exception10ErrorCheckE, ptr nonnull @_ZN5SimTK9Exception4BaseD2Ev) #7
  unreachable

11:                                               ; preds = %8, %5
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %6) #6
  br label %43

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  call void @_ZN5SimTK3Xml7Element10node_beginENS0_8NodeTypeE(ptr dead_on_unwind nonnull writable sret(%"class.SimTK::Xml::node_iterator") align 8 %2, ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #6
  invoke void @_ZNK5SimTK3Xml7Element8node_endEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTK::Xml::node_iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %14 unwind label %22

14:                                               ; preds = %13
  %15 = invoke noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratorneERKS1_(ptr noundef nonnull align 8 dereferenceable(12) %2, ptr noundef nonnull align 8 dereferenceable(12) %3)
          to label %16 unwind label %24

16:                                               ; preds = %14
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br i1 %15, label %17, label %29

17:                                               ; preds = %16
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK3Xml13node_iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %2)
  %19 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5SimTK3Xml4Text5getAsERNS0_4NodeE(ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %20 unwind label %27

20:                                               ; preds = %17
  %21 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN5SimTK3Xml4Text7updTextEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %41 unwind label %27

22:                                               ; preds = %13
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %26

24:                                               ; preds = %14
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %3) #6
  br label %26

26:                                               ; preds = %24, %22
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #6
  br label %42

27:                                               ; preds = %20, %17
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %42

29:                                               ; preds = %16
  %30 = invoke noalias noundef nonnull dereferenceable(112) ptr @_Znwm(i64 noundef 112) #8
          to label %31 unwind label %37

31:                                               ; preds = %29
  invoke void @_ZN5SimTK9TiXmlTextC2EPKc(ptr noundef nonnull align 8 dereferenceable(105) %30, ptr noundef nonnull @.str.34)
          to label %32 unwind label %39

32:                                               ; preds = %31
  %33 = call noundef nonnull align 8 dereferenceable(216) ptr @_ZN5SimTK3Xml7Element12updTiElementEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %34 = invoke noundef ptr @_ZN5SimTK9TiXmlNode12LinkEndChildEPS0_(ptr noundef nonnull align 8 dereferenceable(104) %33, ptr noundef nonnull %30)
          to label %35 unwind label %37

35:                                               ; preds = %32
  %36 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN5SimTK9TiXmlNode11UpdValueStrEv(ptr noundef nonnull align 8 dereferenceable(104) %30)
  br label %41

37:                                               ; preds = %32, %29
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %42

39:                                               ; preds = %31
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %30, i64 noundef 112) #9
  br label %42

41:                                               ; preds = %20, %35
  %.0 = phi ptr [ %36, %35 ], [ %21, %20 ]
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  ret ptr %.0

42:                                               ; preds = %37, %39, %27, %26
  %.pn13 = phi { ptr, i32 } [ %28, %27 ], [ %.pn, %26 ], [ %38, %37 ], [ %40, %39 ]
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  br label %43

43:                                               ; preds = %42, %11
  %.pn13.pn = phi { ptr, i32 } [ %.pn13, %42 ], [ %12, %11 ]
  resume { ptr, i32 } %.pn13.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5SimTK9TiXmlTextC2EPKc(ptr noundef nonnull align 8 dereferenceable(105), ptr noundef) unnamed_addr #4 align 2

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

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


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