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

; 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.54 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [25 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 uwtable
declare dso_local noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratoreqERKS1_(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 @_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 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(104) ptr @_ZN5SimTK3Xml4Node9updTiNodeEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5SimTK9TiXmlNode8SetValueERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(32)) #4 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 nounwind uwtable
declare dso_local noundef ptr @_ZN5SimTK3Xml13node_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(12)) #3 align 2

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

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

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

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

17:                                               ; preds = %15
  call void @__cxa_throw(ptr %13, ptr @_ZTIN5SimTK9Exception10ErrorCheckE, ptr @_ZN5SimTK9Exception4BaseD2Ev) #7
  unreachable

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

22:                                               ; preds = %10
  br label %23

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

24:                                               ; preds = %23
  %25 = invoke noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratoreqERKS1_(ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(12) %8)
          to label %26 unwind label %40

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

27:                                               ; preds = %26
  %28 = invoke noundef nonnull align 8 dereferenceable(104) ptr @_ZN5SimTK3Xml4Node9updTiNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %29 unwind label %45

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

31:                                               ; preds = %29
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN5SimTK9TiXmlTextC2ERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(105) %30, ptr noundef nonnull align 8 dereferenceable(32) %32)
          to label %33 unwind label %49

33:                                               ; preds = %31
  %34 = invoke noundef ptr @_ZN5SimTK9TiXmlNode12LinkEndChildEPS0_(ptr noundef nonnull align 8 dereferenceable(104) %28, ptr noundef %30)
          to label %35 unwind label %45

35:                                               ; preds = %33
  br label %60

36:                                               ; preds = %23
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %5, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %6, align 4
  br label %44

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

44:                                               ; preds = %40, %36
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  br label %61

45:                                               ; preds = %57, %55, %53, %33, %29, %27
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %5, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %6, align 4
  br label %61

49:                                               ; preds = %31
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %5, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %30, i64 noundef 112) #9
  br label %61

53:                                               ; preds = %26
  %54 = invoke noundef ptr @_ZN5SimTK3Xml13node_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(12) %7)
          to label %55 unwind label %45

55:                                               ; preds = %53
  %56 = invoke noundef nonnull align 8 dereferenceable(104) ptr @_ZN5SimTK3Xml4Node9updTiNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %57 unwind label %45

57:                                               ; preds = %55
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN5SimTK9TiXmlNode8SetValueERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(104) %56, ptr noundef nonnull align 8 dereferenceable(32) %58)
          to label %59 unwind label %45

59:                                               ; preds = %57
  br label %60

60:                                               ; preds = %59, %35
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  ret void

61:                                               ; preds = %49, %45, %44
  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 label %62

62:                                               ; preds = %61, %18
  %63 = load ptr, ptr %5, align 8
  %64 = load i32, ptr %6, align 4
  %65 = insertvalue { ptr, i32 } poison, ptr %63, 0
  %66 = insertvalue { ptr, i32 } %65, i32 %64, 1
  resume { ptr, i32 } %66
}

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.54 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [25 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 uwtable
declare dso_local noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratoreqERKS1_(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 @_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 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(104) ptr @_ZN5SimTK3Xml4Node9updTiNodeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5SimTK9TiXmlNode8SetValueERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 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 nounwind uwtable
declare dso_local noundef ptr @_ZN5SimTK3Xml13node_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #3 align 2

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

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

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

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

12:                                               ; preds = %9, %6
  %13 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %7) #6
  br label %38

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

15:                                               ; preds = %14
  %16 = invoke noundef zeroext i1 @_ZNK5SimTK3Xml13node_iteratoreqERKS1_(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 8 dereferenceable(12) %4)
          to label %17 unwind label %26

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

18:                                               ; preds = %17
  %19 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZN5SimTK3Xml4Node9updTiNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %20 = invoke noalias noundef nonnull dereferenceable(112) ptr @_Znwm(i64 noundef 112) #8
          to label %21 unwind label %29

21:                                               ; preds = %18
  invoke void @_ZN5SimTK9TiXmlTextC2ERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(105) %20, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %22 unwind label %31

22:                                               ; preds = %21
  %23 = invoke noundef ptr @_ZN5SimTK9TiXmlNode12LinkEndChildEPS0_(ptr noundef nonnull align 8 dereferenceable(104) %19, ptr noundef nonnull %20)
          to label %36 unwind label %29

24:                                               ; preds = %14
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %28

26:                                               ; preds = %15
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5SimTK3Xml13node_iteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %4) #6
  br label %28

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

29:                                               ; preds = %33, %22, %18
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %37

31:                                               ; preds = %21
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %20, i64 noundef 112) #9
  br label %37

33:                                               ; preds = %17
  %34 = call noundef ptr @_ZN5SimTK3Xml13node_iteratorptEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  %35 = call noundef nonnull align 8 dereferenceable(104) ptr @_ZN5SimTK3Xml4Node9updTiNodeEv(ptr noundef nonnull align 8 dereferenceable(8) %34)
  invoke void @_ZN5SimTK9TiXmlNode8SetValueERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(104) %35, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %36 unwind label %29

36:                                               ; preds = %33, %22
  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
  ret void

37:                                               ; preds = %31, %29, %28
  %.pn8 = phi { ptr, i32 } [ %30, %29 ], [ %32, %31 ], [ %.pn, %28 ]
  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 label %38

38:                                               ; preds = %37, %12
  %.pn8.pn = phi { ptr, i32 } [ %.pn8, %37 ], [ %13, %12 ]
  resume { ptr, i32 } %.pn8.pn
}

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