; LLVM IR from simbody/simbody :: SimTKmath/Optimizers/src/IpOpt (IpRestoIpoptNLP)

; 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.SimTKIpopt::SmartPtr.27" = type { ptr }
%"class.SimTKIpopt::SmartPtr.25" = type { ptr }
%"class.SimTKIpopt::RestoIpoptNLP" = type { %"class.SimTKIpopt::IpoptNLP", %"class.SimTKIpopt::SmartPtr.17", %"class.SimTKIpopt::SmartPtr.18", %"class.SimTKIpopt::SmartPtr.19", %"class.SimTKIpopt::SmartPtr.20", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.20", %"class.SimTKIpopt::SmartPtr.21", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.21", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr.21", %"class.SimTKIpopt::SmartPtr.21", %"class.SimTKIpopt::SmartPtr.22", %"class.SimTKIpopt::SmartPtr.23", %"class.SimTKIpopt::SmartPtr.24", %"class.SimTKIpopt::SmartPtr.25", %"class.SimTKIpopt::SmartPtr.24", %"class.SimTKIpopt::SmartPtr.25", %"class.SimTKIpopt::SmartPtr.26", %"class.SimTKIpopt::SmartPtr.25", %"class.SimTKIpopt::SmartPtr.26", double, double, double, %"class.SimTKIpopt::SmartPtr.27", %"class.SimTKIpopt::SmartPtr.28", %"class.SimTKIpopt::SmartPtr.27", i8, i32, i8, i32, i32, i32, i32, i32, i32, i32 }
%"class.SimTKIpopt::IpoptNLP" = type { %"class.SimTKIpopt::ReferencedObject.base", %"class.SimTKIpopt::SmartPtr.16" }
%"class.SimTKIpopt::ReferencedObject.base" = type <{ ptr, i32 }>
%"class.SimTKIpopt::SmartPtr.16" = type { ptr }
%"class.SimTKIpopt::SmartPtr.17" = type { ptr }
%"class.SimTKIpopt::SmartPtr.18" = type { ptr }
%"class.SimTKIpopt::SmartPtr.19" = type { ptr }
%"class.SimTKIpopt::SmartPtr.20" = type { ptr }
%"class.SimTKIpopt::SmartPtr" = type { ptr }
%"class.SimTKIpopt::SmartPtr.5" = type { ptr }
%"class.SimTKIpopt::SmartPtr.21" = type { ptr }
%"class.SimTKIpopt::SmartPtr.22" = type { ptr }
%"class.SimTKIpopt::SmartPtr.23" = type { ptr }
%"class.SimTKIpopt::SmartPtr.24" = type { ptr }
%"class.SimTKIpopt::SmartPtr.26" = type { ptr }
%"class.SimTKIpopt::SmartPtr.28" = type { ptr }

@_ZTIN10SimTKIpopt6VectorE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt14CompoundVectorE = external constant ptr

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.27") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector3SetEd(ptr noundef nonnull align 8 dereferenceable(205), double noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) #4 align 2

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

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

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

declare void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205), double noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector4AxpyEdRKS0_(ptr noundef nonnull align 8 dereferenceable(205), double noundef, ptr noundef nonnull align 8 dereferenceable(205)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector19ElementWiseMultiplyERKS0_(ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt13RestoIpoptNLP6grad_fERKNS_6VectorEd(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %0, ptr noundef nonnull align 8 dereferenceable(312) %1, ptr noundef nonnull align 8 dereferenceable(205) %2, double noundef %3) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.SimTKIpopt::SmartPtr.27", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.SimTKIpopt::SmartPtr.25", align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.SimTKIpopt::SmartPtr.27", align 8
  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 double %3, ptr %8, align 8, !tbaa !9
  %16 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNK10SimTKIpopt6Vector7MakeNewEv(ptr noundef nonnull align 8 dereferenceable(205) %17)
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %18)
  %19 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %20 unwind label %28

20:                                               ; preds = %4
  %21 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %16, i32 0, i32 26
  %22 = load double, ptr %21, align 8, !tbaa !11
  invoke void @_ZN10SimTKIpopt6Vector3SetEd(ptr noundef nonnull align 8 dereferenceable(205) %19, double noundef %22)
          to label %23 unwind label %28

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %32, label %26

26:                                               ; preds = %23
  %27 = call ptr @__dynamic_cast(ptr %24, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #6
  br label %33

28:                                               ; preds = %20, %4
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %10, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %11, align 4
  br label %90

32:                                               ; preds = %23
  br label %33

33:                                               ; preds = %32, %26
  %34 = phi ptr [ %27, %26 ], [ null, %32 ]
  store ptr %34, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %13, ptr noundef nonnull align 8 dereferenceable(265) %35, i32 noundef 0)
          to label %36 unwind label %42

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %37 = invoke noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %38 unwind label %46

38:                                               ; preds = %36
  %39 = icmp eq ptr %37, null
  br i1 %39, label %50, label %40

40:                                               ; preds = %38
  %41 = call ptr @__dynamic_cast(ptr %37, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #6
  br label %51

42:                                               ; preds = %33
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  br label %89

46:                                               ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  br label %88

50:                                               ; preds = %38
  br label %51

51:                                               ; preds = %50, %40
  %52 = phi ptr [ %41, %40 ], [ null, %50 ]
  store ptr %52, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.27") align 8 %15, ptr noundef nonnull align 8 dereferenceable(265) %53, i32 noundef 0)
          to label %54 unwind label %79

54:                                               ; preds = %51
  %55 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %56 unwind label %83

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %58 unwind label %83

58:                                               ; preds = %56
  invoke void @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %55, ptr noundef nonnull align 8 dereferenceable(205) %57)
          to label %59 unwind label %83

59:                                               ; preds = %58
  %60 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %61 unwind label %83

61:                                               ; preds = %59
  %62 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %16, i32 0, i32 31
  %63 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %62)
          to label %64 unwind label %83

64:                                               ; preds = %61
  invoke void @_ZN10SimTKIpopt6Vector4AxpyEdRKS0_(ptr noundef nonnull align 8 dereferenceable(205) %60, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %63)
          to label %65 unwind label %83

65:                                               ; preds = %64
  %66 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %67 unwind label %83

67:                                               ; preds = %65
  %68 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %16, i32 0, i32 29
  %69 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %68)
          to label %70 unwind label %83

70:                                               ; preds = %67
  invoke void @_ZN10SimTKIpopt6Vector19ElementWiseMultiplyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %66, ptr noundef nonnull align 8 dereferenceable(205) %69)
          to label %71 unwind label %83

71:                                               ; preds = %70
  %72 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %73 unwind label %83

73:                                               ; preds = %71
  %74 = load double, ptr %8, align 8, !tbaa !9
  %75 = invoke noundef double @_ZNK10SimTKIpopt13RestoIpoptNLP3EtaEd(ptr noundef nonnull align 8 dereferenceable(312) %16, double noundef %74)
          to label %76 unwind label %83

76:                                               ; preds = %73
  invoke void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205) %72, double noundef %75)
          to label %77 unwind label %83

77:                                               ; preds = %76
  invoke void @_ZN10SimTKIpopt8ConstPtrINS_6VectorEEENS_8SmartPtrIKT_EERKNS2_IS3_EE(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %78 unwind label %83

78:                                               ; preds = %77
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret void

79:                                               ; preds = %51
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %10, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %11, align 4
  br label %87

83:                                               ; preds = %77, %76, %73, %71, %70, %67, %65, %64, %61, %59, %58, %56, %54
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %10, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %11, align 4
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %87

87:                                               ; preds = %83, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %88

88:                                               ; preds = %87, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br label %89

89:                                               ; preds = %88, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %90

90:                                               ; preds = %89, %28
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %10, align 8
  %93 = load i32, ptr %11, align 4
  %94 = insertvalue { ptr, i32 } poison, ptr %92, 0
  %95 = insertvalue { ptr, i32 } %94, i32 %93, 1
  resume { ptr, i32 } %95
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt8ConstPtrINS_6VectorEEENS_8SmartPtrIKT_EERKNS2_IS3_EE(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 224}
!12 = !{!"_ZTSN10SimTKIpopt13RestoIpoptNLPE", !13, i64 0, !17, i64 24, !18, i64 32, !19, i64 40, !20, i64 48, !21, i64 56, !21, i64 64, !20, i64 72, !22, i64 80, !21, i64 88, !22, i64 96, !21, i64 104, !23, i64 112, !21, i64 120, !23, i64 128, !22, i64 136, !22, i64 144, !24, i64 152, !25, i64 160, !26, i64 168, !27, i64 176, !26, i64 184, !27, i64 192, !28, i64 200, !27, i64 208, !28, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !29, i64 248, !30, i64 256, !29, i64 264, !31, i64 272, !32, i64 276, !31, i64 280, !15, i64 284, !15, i64 288, !15, i64 292, !15, i64 296, !15, i64 300, !15, i64 304, !15, i64 308}
!13 = !{!"_ZTSN10SimTKIpopt8IpoptNLPE", !14, i64 0, !16, i64 16}
!14 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !15, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_16NLPScalingObjectEEE", !6, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !6, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !6, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !6, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_19CompoundVectorSpaceEEE", !6, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !6, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_19CompoundMatrixSpaceEEE", !6, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !6, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_22CompoundSymMatrixSpaceEEE", !6, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_14CompoundVectorEEE", !6, i64 0}
!26 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_14CompoundMatrixEEE", !6, i64 0}
!27 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_6VectorEEE", !6, i64 0}
!28 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_6MatrixEEE", !6, i64 0}
!29 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_6VectorEEE", !6, i64 0}
!30 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_10DiagMatrixEEE", !6, i64 0}
!31 = !{!"bool", !7, i64 0}
!32 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !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"

%"class.SimTKIpopt::SmartPtr.27" = type { ptr }
%"class.SimTKIpopt::SmartPtr.25" = type { ptr }

@_ZTIN10SimTKIpopt6VectorE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt14CompoundVectorE = external constant ptr

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.27") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector3SetEd(ptr noundef nonnull align 8 dereferenceable(205), double noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #4 align 2

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

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

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

declare void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205), double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector4AxpyEdRKS0_(ptr noundef nonnull align 8 dereferenceable(205), double noundef, ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector19ElementWiseMultiplyERKS0_(ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt13RestoIpoptNLP6grad_fERKNS_6VectorEd(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %0, ptr noundef nonnull align 8 dereferenceable(312) %1, ptr noundef nonnull align 8 dereferenceable(205) %2, double noundef %3) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.SimTKIpopt::SmartPtr.27", align 8
  %6 = alloca %"class.SimTKIpopt::SmartPtr.25", align 8
  %7 = alloca %"class.SimTKIpopt::SmartPtr.27", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %8 = tail call noundef ptr @_ZNK10SimTKIpopt6Vector7MakeNewEv(ptr noundef nonnull align 8 dereferenceable(205) %2)
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %8)
  %9 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %10 = getelementptr inbounds i8, ptr %1, i64 224
  %11 = load double, ptr %10, align 8, !tbaa !5
  invoke void @_ZN10SimTKIpopt6Vector3SetEd(ptr noundef nonnull align 8 dereferenceable(205) %9, double noundef %11)
          to label %14 unwind label %12

12:                                               ; preds = %4
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %44

14:                                               ; preds = %4
  %15 = call ptr @__dynamic_cast(ptr nonnull %2, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  invoke void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %6, ptr noundef nonnull align 8 dereferenceable(265) %15, i32 noundef 0)
          to label %16 unwind label %20

16:                                               ; preds = %14
  %17 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %18 = icmp ne ptr %17, null
  call void @llvm.assume(i1 %18)
  %19 = call ptr @__dynamic_cast(ptr nonnull %17, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  invoke void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.27") align 8 %7, ptr noundef nonnull align 8 dereferenceable(265) %19, i32 noundef 0)
          to label %22 unwind label %38

20:                                               ; preds = %14
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %43

22:                                               ; preds = %16
  %23 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %24 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %23, ptr noundef nonnull align 8 dereferenceable(205) %24)
          to label %25 unwind label %40

25:                                               ; preds = %22
  %26 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %27 = getelementptr inbounds i8, ptr %1, i64 264
  %28 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %27)
  invoke void @_ZN10SimTKIpopt6Vector4AxpyEdRKS0_(ptr noundef nonnull align 8 dereferenceable(205) %26, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %28)
          to label %29 unwind label %40

29:                                               ; preds = %25
  %30 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %31 = getelementptr inbounds i8, ptr %1, i64 248
  %32 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %31)
  invoke void @_ZN10SimTKIpopt6Vector19ElementWiseMultiplyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %30, ptr noundef nonnull align 8 dereferenceable(205) %32)
          to label %33 unwind label %40

33:                                               ; preds = %29
  %34 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %35 = call noundef double @_ZNK10SimTKIpopt13RestoIpoptNLP3EtaEd(ptr noundef nonnull align 8 dereferenceable(312) %1, double noundef %3)
  invoke void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205) %34, double noundef %35)
          to label %36 unwind label %40

36:                                               ; preds = %33
  invoke void @_ZN10SimTKIpopt8ConstPtrINS_6VectorEEENS_8SmartPtrIKT_EERKNS2_IS3_EE(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %37 unwind label %40

37:                                               ; preds = %36
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret void

38:                                               ; preds = %16
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %36, %33, %29, %25, %22
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br label %43

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

44:                                               ; preds = %43, %12
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %43 ], [ %13, %12 ]
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt8ConstPtrINS_6VectorEEENS_8SmartPtrIKT_EERKNS2_IS3_EE(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(read) }
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 = { inlinehint 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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
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, !26, i64 224}
!6 = !{!"_ZTSN10SimTKIpopt13RestoIpoptNLPE", !7, i64 0, !14, i64 24, !15, i64 32, !16, i64 40, !17, i64 48, !18, i64 56, !18, i64 64, !17, i64 72, !19, i64 80, !18, i64 88, !19, i64 96, !18, i64 104, !20, i64 112, !18, i64 120, !20, i64 128, !19, i64 136, !19, i64 144, !21, i64 152, !22, i64 160, !23, i64 168, !24, i64 176, !23, i64 184, !24, i64 192, !25, i64 200, !24, i64 208, !25, i64 216, !26, i64 224, !26, i64 232, !26, i64 240, !27, i64 248, !28, i64 256, !27, i64 264, !29, i64 272, !30, i64 276, !29, i64 280, !9, i64 284, !9, i64 288, !9, i64 292, !9, i64 296, !9, i64 300, !9, i64 304, !9, i64 308}
!7 = !{!"_ZTSN10SimTKIpopt8IpoptNLPE", !8, i64 0, !12, i64 16}
!8 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !9, i64 8}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_16NLPScalingObjectEEE", !13, i64 0}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !13, i64 0}
!15 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !13, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !13, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_19CompoundVectorSpaceEEE", !13, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !13, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_19CompoundMatrixSpaceEEE", !13, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !13, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_22CompoundSymMatrixSpaceEEE", !13, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_14CompoundVectorEEE", !13, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_14CompoundMatrixEEE", !13, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_6VectorEEE", !13, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_6MatrixEEE", !13, i64 0}
!26 = !{!"double", !10, i64 0}
!27 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_6VectorEEE", !13, i64 0}
!28 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_10DiagMatrixEEE", !13, i64 0}
!29 = !{!"bool", !10, i64 0}
!30 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !10, i64 0}


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