; 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.25" = type { ptr }
%"class.SimTKIpopt::SmartPtr.27" = 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_8IpoptNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #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 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 @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt6Vector7MakeNewEv(ptr noundef nonnull align 8 dereferenceable(205)) #3 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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN10SimTKIpopt13RestoIpoptNLP1fERKNS_6VectorEd(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(205) %1, double noundef %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.SimTKIpopt::SmartPtr.25", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.SimTKIpopt::SmartPtr.27", align 8
  %13 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store double 0.000000e+00, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %19, label %17

17:                                               ; preds = %3
  %18 = call ptr @__dynamic_cast(ptr %15, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #5
  br label %20

19:                                               ; preds = %3
  br label %20

20:                                               ; preds = %19, %17
  %21 = phi ptr [ %18, %17 ], [ null, %19 ]
  store ptr %21, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %9, ptr noundef nonnull align 8 dereferenceable(265) %22, i32 noundef 0)
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = invoke noundef double @_ZNK10SimTKIpopt6Vector3SumEv(ptr noundef nonnull align 8 dereferenceable(205) %23)
          to label %25 unwind label %86

25:                                               ; preds = %20
  %26 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %27 unwind label %86

27:                                               ; preds = %25
  %28 = invoke noundef double @_ZNK10SimTKIpopt6Vector3SumEv(ptr noundef nonnull align 8 dereferenceable(205) %26)
          to label %29 unwind label %86

29:                                               ; preds = %27
  %30 = fsub double %24, %28
  store double %30, ptr %7, align 8, !tbaa !9
  %31 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %14, i32 0, i32 26
  %32 = load double, ptr %31, align 8, !tbaa !11
  %33 = load double, ptr %7, align 8, !tbaa !9
  %34 = fmul double %32, %33
  store double %34, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %35 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %36 unwind label %90

36:                                               ; preds = %29
  %37 = invoke noundef ptr @_ZNK10SimTKIpopt6Vector7MakeNewEv(ptr noundef nonnull align 8 dereferenceable(205) %35)
          to label %38 unwind label %90

38:                                               ; preds = %36
  invoke void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %37)
          to label %39 unwind label %90

39:                                               ; preds = %38
  %40 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %41 unwind label %94

41:                                               ; preds = %39
  %42 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %43 unwind label %94

43:                                               ; preds = %41
  invoke void @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %40, ptr noundef nonnull align 8 dereferenceable(205) %42)
          to label %44 unwind label %94

44:                                               ; preds = %43
  %45 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %46 unwind label %94

46:                                               ; preds = %44
  %47 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %14, i32 0, i32 31
  %48 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %47)
          to label %49 unwind label %94

49:                                               ; preds = %46
  invoke void @_ZN10SimTKIpopt6Vector4AxpyEdRKS0_(ptr noundef nonnull align 8 dereferenceable(205) %45, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %48)
          to label %50 unwind label %94

50:                                               ; preds = %49
  %51 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %52 unwind label %94

52:                                               ; preds = %50
  %53 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %14, i32 0, i32 29
  %54 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %53)
          to label %55 unwind label %94

55:                                               ; preds = %52
  invoke void @_ZN10SimTKIpopt6Vector19ElementWiseMultiplyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %51, ptr noundef nonnull align 8 dereferenceable(205) %54)
          to label %56 unwind label %94

56:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %57 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %58 unwind label %98

58:                                               ; preds = %56
  %59 = invoke noundef double @_ZNK10SimTKIpopt6Vector4Nrm2Ev(ptr noundef nonnull align 8 dereferenceable(205) %57)
          to label %60 unwind label %98

60:                                               ; preds = %58
  store double %59, ptr %13, align 8, !tbaa !9
  %61 = load double, ptr %6, align 8, !tbaa !9
  %62 = invoke noundef double @_ZNK10SimTKIpopt13RestoIpoptNLP3EtaEd(ptr noundef nonnull align 8 dereferenceable(312) %14, double noundef %61)
          to label %63 unwind label %98

63:                                               ; preds = %60
  %64 = fdiv double %62, 2.000000e+00
  %65 = load double, ptr %13, align 8, !tbaa !9
  %66 = fmul double %64, %65
  %67 = load double, ptr %13, align 8, !tbaa !9
  %68 = fmul double %66, %67
  store double %68, ptr %13, align 8, !tbaa !9
  %69 = load double, ptr %13, align 8, !tbaa !9
  %70 = load double, ptr %7, align 8, !tbaa !9
  %71 = fadd double %70, %69
  store double %71, ptr %7, align 8, !tbaa !9
  %72 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %14, i32 0, i32 32
  %73 = load i8, ptr %72, align 8, !tbaa !33, !range !34, !noundef !35
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %102

75:                                               ; preds = %63
  %76 = getelementptr inbounds %"class.SimTKIpopt::RestoIpoptNLP", ptr %14, i32 0, i32 1
  %77 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_8IpoptNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %76)
          to label %78 unwind label %98

78:                                               ; preds = %75
  %79 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %80 unwind label %98

80:                                               ; preds = %78
  %81 = load ptr, ptr %77, align 8, !tbaa !36
  %82 = getelementptr inbounds ptr, ptr %81, i64 5
  %83 = load ptr, ptr %82, align 8
  %84 = invoke noundef double %83(ptr noundef nonnull align 8 dereferenceable(24) %77, ptr noundef nonnull align 8 dereferenceable(205) %79)
          to label %85 unwind label %98

85:                                               ; preds = %80
  br label %102

86:                                               ; preds = %27, %25, %20
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %10, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %11, align 4
  br label %106

90:                                               ; preds = %38, %36, %29
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %10, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %11, align 4
  br label %105

94:                                               ; preds = %55, %52, %50, %49, %46, %44, %43, %41, %39
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %10, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %11, align 4
  br label %104

98:                                               ; preds = %80, %78, %75, %60, %58, %56
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %10, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %104

102:                                              ; preds = %85, %63
  %103 = load double, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret double %103

104:                                              ; preds = %98, %94
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br label %105

105:                                              ; preds = %104, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %106

106:                                              ; preds = %105, %86
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %10, align 8
  %109 = load i32, ptr %11, align 4
  %110 = insertvalue { ptr, i32 } poison, ptr %108, 0
  %111 = insertvalue { ptr, i32 } %110, i32 %109, 1
  resume { ptr, i32 } %111
}

; 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) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 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)) #3 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)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK10SimTKIpopt6Vector4Nrm2Ev(ptr noundef nonnull align 8 dereferenceable(205)) #3 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

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 = { 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 #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 = { 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}
!33 = !{!12, !31, i64 272}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !8, 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.25" = type { ptr }
%"class.SimTKIpopt::SmartPtr.27" = 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_8IpoptNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_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 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 @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt6Vector7MakeNewEv(ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #3 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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN10SimTKIpopt13RestoIpoptNLP1fERKNS_6VectorEd(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(205) %1, double noundef %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.SimTKIpopt::SmartPtr.25", align 8
  %5 = alloca %"class.SimTKIpopt::SmartPtr.27", align 8
  %6 = tail call ptr @__dynamic_cast(ptr nonnull %1, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.25") align 8 %4, ptr noundef nonnull align 8 dereferenceable(265) %6, i32 noundef 0)
  %7 = invoke noundef double @_ZNK10SimTKIpopt6Vector3SumEv(ptr noundef nonnull align 8 dereferenceable(205) %1)
          to label %8 unwind label %43

8:                                                ; preds = %3
  %9 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %10 = invoke noundef double @_ZNK10SimTKIpopt6Vector3SumEv(ptr noundef nonnull align 8 dereferenceable(205) %9)
          to label %11 unwind label %43

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 224
  %13 = load double, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %14 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %15 = invoke noundef ptr @_ZNK10SimTKIpopt6Vector7MakeNewEv(ptr noundef nonnull align 8 dereferenceable(205) %14)
          to label %16 unwind label %45

16:                                               ; preds = %11
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %15)
  %17 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %18 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  invoke void @_ZN10SimTKIpopt6Vector4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %17, ptr noundef nonnull align 8 dereferenceable(205) %18)
          to label %19 unwind label %47

19:                                               ; preds = %16
  %20 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %21 = getelementptr inbounds i8, ptr %0, i64 264
  %22 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  invoke void @_ZN10SimTKIpopt6Vector4AxpyEdRKS0_(ptr noundef nonnull align 8 dereferenceable(205) %20, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %22)
          to label %23 unwind label %47

23:                                               ; preds = %19
  %24 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %25 = getelementptr inbounds i8, ptr %0, i64 248
  %26 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25)
  invoke void @_ZN10SimTKIpopt6Vector19ElementWiseMultiplyERKS0_(ptr noundef nonnull align 8 dereferenceable(205) %24, ptr noundef nonnull align 8 dereferenceable(205) %26)
          to label %27 unwind label %47

27:                                               ; preds = %23
  %28 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %29 = invoke noundef double @_ZNK10SimTKIpopt6Vector4Nrm2Ev(ptr noundef nonnull align 8 dereferenceable(205) %28)
          to label %30 unwind label %49

30:                                               ; preds = %27
  %31 = call noundef double @_ZNK10SimTKIpopt13RestoIpoptNLP3EtaEd(ptr noundef nonnull align 8 dereferenceable(312) %0, double noundef %2)
  %32 = getelementptr inbounds i8, ptr %0, i64 272
  %33 = load i8, ptr %32, align 8, !tbaa !31, !range !32, !noundef !33
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %35, label %51

35:                                               ; preds = %30
  %36 = getelementptr inbounds i8, ptr %0, i64 24
  %37 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_8IpoptNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %36)
  %38 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %39 = load ptr, ptr %37, align 8, !tbaa !34
  %40 = getelementptr inbounds i8, ptr %39, i64 40
  %41 = load ptr, ptr %40, align 8
  %42 = invoke noundef double %41(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(205) %38)
          to label %51 unwind label %49

43:                                               ; preds = %8, %3
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %60

45:                                               ; preds = %11
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %59

47:                                               ; preds = %23, %19, %16
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %58

49:                                               ; preds = %35, %27
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %58

51:                                               ; preds = %35, %30
  %52 = fsub double %7, %10
  %53 = fmul double %52, %13
  %54 = fmul double %31, 5.000000e-01
  %55 = fmul double %29, %54
  %56 = fmul double %29, %55
  %57 = fadd double %53, %56
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret double %57

58:                                               ; preds = %49, %47
  %.pn = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br label %59

59:                                               ; preds = %58, %45
  %.pn.pn = phi { ptr, i32 } [ %.pn, %58 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %60

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

; 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 #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 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 #3 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 #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK10SimTKIpopt6Vector4Nrm2Ev(ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #3 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

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 = { 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 #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 = { 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}
!31 = !{!6, !29, i64 272}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!35, !35, i64 0}
!35 = !{!"vtable pointer", !11, i64 0}


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