; LLVM IR from simbody/simbody :: SimTKmath/Optimizers/src/IpOpt/IpVector.ll (ZN10SimTKIpopt6Vector4ScalEd)

; 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::Vector" = type <{ %"class.SimTKIpopt::TaggedObject", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::CachedResults", i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, i32, [4 x i8], double, i32, i8, [3 x i8] }>
%"class.SimTKIpopt::TaggedObject" = type { %"class.SimTKIpopt::ReferencedObject.base", %"class.SimTKIpopt::Subject", i32, i32 }
%"class.SimTKIpopt::ReferencedObject.base" = type <{ ptr, i32 }>
%"class.SimTKIpopt::Subject" = type { ptr, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl" }
%"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl" = type { %"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.SimTKIpopt::SmartPtr" = type { ptr }
%"class.SimTKIpopt::CachedResults" = type { ptr, i32, ptr }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205) %0, double noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  %7 = load double, ptr %4, align 8, !tbaa !9
  %8 = fcmp une double %7, 1.000000e+00
  br i1 %8, label %9, label %137

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %10 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  store i32 %10, ptr %5, align 4, !tbaa !11
  %11 = load double, ptr %4, align 8, !tbaa !9
  %12 = load ptr, ptr %6, align 8, !tbaa !13
  %13 = getelementptr inbounds ptr, ptr %12, i64 3
  %14 = load ptr, ptr %13, align 8
  call void %14(ptr noundef nonnull align 8 dereferenceable(205) %6, double noundef %11)
  call void @_ZN10SimTKIpopt12TaggedObject13ObjectChangedEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %15 = load i32, ptr %5, align 4, !tbaa !11
  %16 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 3
  %17 = load i32, ptr %16, align 8, !tbaa !15
  %18 = icmp eq i32 %15, %17
  br i1 %18, label %19, label %27

19:                                               ; preds = %9
  %20 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %21 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 3
  store i32 %20, ptr %21, align 8, !tbaa !15
  %22 = load double, ptr %4, align 8, !tbaa !9
  %23 = call double @llvm.fabs.f64(double %22)
  %24 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 5
  %25 = load double, ptr %24, align 8, !tbaa !27
  %26 = fmul double %25, %23
  store double %26, ptr %24, align 8, !tbaa !27
  br label %27

27:                                               ; preds = %19, %9
  %28 = load i32, ptr %5, align 4, !tbaa !11
  %29 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 6
  %30 = load i32, ptr %29, align 8, !tbaa !28
  %31 = icmp eq i32 %28, %30
  br i1 %31, label %32, label %40

32:                                               ; preds = %27
  %33 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %34 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 6
  store i32 %33, ptr %34, align 8, !tbaa !28
  %35 = load double, ptr %4, align 8, !tbaa !9
  %36 = call double @llvm.fabs.f64(double %35)
  %37 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 8
  %38 = load double, ptr %37, align 8, !tbaa !29
  %39 = fmul double %38, %36
  store double %39, ptr %37, align 8, !tbaa !29
  br label %40

40:                                               ; preds = %32, %27
  %41 = load i32, ptr %5, align 4, !tbaa !11
  %42 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 9
  %43 = load i32, ptr %42, align 8, !tbaa !30
  %44 = icmp eq i32 %41, %43
  br i1 %44, label %45, label %53

45:                                               ; preds = %40
  %46 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %47 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 9
  store i32 %46, ptr %47, align 8, !tbaa !30
  %48 = load double, ptr %4, align 8, !tbaa !9
  %49 = call double @llvm.fabs.f64(double %48)
  %50 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 11
  %51 = load double, ptr %50, align 8, !tbaa !31
  %52 = fmul double %51, %49
  store double %52, ptr %50, align 8, !tbaa !31
  br label %53

53:                                               ; preds = %45, %40
  %54 = load i32, ptr %5, align 4, !tbaa !11
  %55 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 12
  %56 = load i32, ptr %55, align 8, !tbaa !32
  %57 = icmp eq i32 %54, %56
  br i1 %57, label %58, label %81

58:                                               ; preds = %53
  %59 = load double, ptr %4, align 8, !tbaa !9
  %60 = fcmp oge double %59, 0.000000e+00
  br i1 %60, label %61, label %68

61:                                               ; preds = %58
  %62 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %63 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 12
  store i32 %62, ptr %63, align 8, !tbaa !32
  %64 = load double, ptr %4, align 8, !tbaa !9
  %65 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 14
  %66 = load double, ptr %65, align 8, !tbaa !33
  %67 = fmul double %66, %64
  store double %67, ptr %65, align 8, !tbaa !33
  br label %80

68:                                               ; preds = %58
  %69 = load double, ptr %4, align 8, !tbaa !9
  %70 = fcmp olt double %69, 0.000000e+00
  br i1 %70, label %71, label %79

71:                                               ; preds = %68
  %72 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %73 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 15
  store i32 %72, ptr %73, align 8, !tbaa !34
  %74 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 14
  %75 = load double, ptr %74, align 8, !tbaa !33
  %76 = load double, ptr %4, align 8, !tbaa !9
  %77 = fmul double %75, %76
  %78 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 17
  store double %77, ptr %78, align 8, !tbaa !35
  br label %79

79:                                               ; preds = %71, %68
  br label %80

80:                                               ; preds = %79, %61
  br label %81

81:                                               ; preds = %80, %53
  %82 = load i32, ptr %5, align 4, !tbaa !11
  %83 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 15
  %84 = load i32, ptr %83, align 8, !tbaa !34
  %85 = icmp eq i32 %82, %84
  br i1 %85, label %86, label %109

86:                                               ; preds = %81
  %87 = load double, ptr %4, align 8, !tbaa !9
  %88 = fcmp oge double %87, 0.000000e+00
  br i1 %88, label %89, label %96

89:                                               ; preds = %86
  %90 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %91 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 15
  store i32 %90, ptr %91, align 8, !tbaa !34
  %92 = load double, ptr %4, align 8, !tbaa !9
  %93 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 17
  %94 = load double, ptr %93, align 8, !tbaa !35
  %95 = fmul double %94, %92
  store double %95, ptr %93, align 8, !tbaa !35
  br label %108

96:                                               ; preds = %86
  %97 = load double, ptr %4, align 8, !tbaa !9
  %98 = fcmp olt double %97, 0.000000e+00
  br i1 %98, label %99, label %107

99:                                               ; preds = %96
  %100 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %101 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 12
  store i32 %100, ptr %101, align 8, !tbaa !32
  %102 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 17
  %103 = load double, ptr %102, align 8, !tbaa !35
  %104 = load double, ptr %4, align 8, !tbaa !9
  %105 = fmul double %103, %104
  %106 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 14
  store double %105, ptr %106, align 8, !tbaa !33
  br label %107

107:                                              ; preds = %99, %96
  br label %108

108:                                              ; preds = %107, %89
  br label %109

109:                                              ; preds = %108, %81
  %110 = load i32, ptr %5, align 4, !tbaa !11
  %111 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 18
  %112 = load i32, ptr %111, align 8, !tbaa !36
  %113 = icmp eq i32 %110, %112
  br i1 %113, label %114, label %121

114:                                              ; preds = %109
  %115 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %116 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 18
  store i32 %115, ptr %116, align 8, !tbaa !36
  %117 = load double, ptr %4, align 8, !tbaa !9
  %118 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 20
  %119 = load double, ptr %118, align 8, !tbaa !37
  %120 = fmul double %119, %117
  store double %120, ptr %118, align 8, !tbaa !37
  br label %121

121:                                              ; preds = %114, %109
  %122 = load i32, ptr %5, align 4, !tbaa !11
  %123 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 21
  %124 = load i32, ptr %123, align 8, !tbaa !38
  %125 = icmp eq i32 %122, %124
  br i1 %125, label %126, label %136

126:                                              ; preds = %121
  %127 = call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  %128 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 21
  store i32 %127, ptr %128, align 8, !tbaa !38
  %129 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %6)
  %130 = sitofp i32 %129 to double
  %131 = load double, ptr %4, align 8, !tbaa !9
  %132 = call double @log(double noundef %131) #6
  %133 = getelementptr inbounds %"class.SimTKIpopt::Vector", ptr %6, i32 0, i32 23
  %134 = load double, ptr %133, align 8, !tbaa !39
  %135 = call double @llvm.fmuladd.f64(double %130, double %132, double %134)
  store double %135, ptr %133, align 8, !tbaa !39
  br label %136

136:                                              ; preds = %126, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %137

137:                                              ; preds = %136, %2
  ret void
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

; Function Attrs: nounwind
declare double @log(double noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !12, i64 88}
!16 = !{!"_ZTSN10SimTKIpopt6VectorE", !17, i64 0, !24, i64 56, !25, i64 64, !12, i64 88, !10, i64 96, !12, i64 104, !10, i64 112, !12, i64 120, !10, i64 128, !12, i64 136, !10, i64 144, !12, i64 152, !10, i64 160, !12, i64 168, !10, i64 176, !12, i64 184, !10, i64 192, !12, i64 200, !26, i64 204}
!17 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !18, i64 0, !19, i64 16, !12, i64 48, !12, i64 52}
!18 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !12, i64 8}
!19 = !{!"_ZTSN10SimTKIpopt7SubjectE", !20, i64 8}
!20 = !{!"_ZTSSt6vectorIPN10SimTKIpopt8ObserverESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !6, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt13CachedResultsIdEE", !12, i64 8, !6, i64 16}
!26 = !{!"bool", !7, i64 0}
!27 = !{!16, !10, i64 96}
!28 = !{!16, !12, i64 104}
!29 = !{!16, !10, i64 112}
!30 = !{!16, !12, i64 120}
!31 = !{!16, !10, i64 128}
!32 = !{!16, !12, i64 136}
!33 = !{!16, !10, i64 144}
!34 = !{!16, !12, i64 152}
!35 = !{!16, !10, i64 160}
!36 = !{!16, !12, i64 168}
!37 = !{!16, !10, i64 176}
!38 = !{!16, !12, i64 184}
!39 = !{!16, !10, i64 192}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205) %0, double noundef %1) local_unnamed_addr #0 align 2 {
  %3 = fcmp une double %1, 1.000000e+00
  br i1 %3, label %4, label %98

4:                                                ; preds = %2
  %5 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 24
  %8 = load ptr, ptr %7, align 8
  tail call void %8(ptr noundef nonnull align 8 dereferenceable(205) %0, double noundef %1)
  tail call void @_ZN10SimTKIpopt12TaggedObject13ObjectChangedEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %9 = getelementptr inbounds i8, ptr %0, i64 88
  %10 = load i32, ptr %9, align 8, !tbaa !8
  %11 = icmp eq i32 %5, %10
  br i1 %11, label %12, label %18

12:                                               ; preds = %4
  %13 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %13, ptr %9, align 8, !tbaa !8
  %14 = tail call double @llvm.fabs.f64(double %1)
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  %16 = load double, ptr %15, align 8, !tbaa !24
  %17 = fmul double %14, %16
  store double %17, ptr %15, align 8, !tbaa !24
  br label %18

18:                                               ; preds = %12, %4
  %19 = getelementptr inbounds i8, ptr %0, i64 104
  %20 = load i32, ptr %19, align 8, !tbaa !25
  %21 = icmp eq i32 %5, %20
  br i1 %21, label %22, label %28

22:                                               ; preds = %18
  %23 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %23, ptr %19, align 8, !tbaa !25
  %24 = tail call double @llvm.fabs.f64(double %1)
  %25 = getelementptr inbounds i8, ptr %0, i64 112
  %26 = load double, ptr %25, align 8, !tbaa !26
  %27 = fmul double %24, %26
  store double %27, ptr %25, align 8, !tbaa !26
  br label %28

28:                                               ; preds = %22, %18
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  %30 = load i32, ptr %29, align 8, !tbaa !27
  %31 = icmp eq i32 %5, %30
  br i1 %31, label %32, label %38

32:                                               ; preds = %28
  %33 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %33, ptr %29, align 8, !tbaa !27
  %34 = tail call double @llvm.fabs.f64(double %1)
  %35 = getelementptr inbounds i8, ptr %0, i64 128
  %36 = load double, ptr %35, align 8, !tbaa !28
  %37 = fmul double %34, %36
  store double %37, ptr %35, align 8, !tbaa !28
  br label %38

38:                                               ; preds = %32, %28
  %39 = getelementptr inbounds i8, ptr %0, i64 136
  %40 = load i32, ptr %39, align 8, !tbaa !29
  %41 = icmp eq i32 %5, %40
  br i1 %41, label %42, label %58

42:                                               ; preds = %38
  %43 = fcmp ult double %1, 0.000000e+00
  br i1 %43, label %49, label %44

44:                                               ; preds = %42
  %45 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %45, ptr %39, align 8, !tbaa !29
  %46 = getelementptr inbounds i8, ptr %0, i64 144
  %47 = load double, ptr %46, align 8, !tbaa !30
  %48 = fmul double %47, %1
  store double %48, ptr %46, align 8, !tbaa !30
  br label %58

49:                                               ; preds = %42
  %50 = fcmp olt double %1, 0.000000e+00
  br i1 %50, label %51, label %58

51:                                               ; preds = %49
  %52 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %53 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 %52, ptr %53, align 8, !tbaa !31
  %54 = getelementptr inbounds i8, ptr %0, i64 144
  %55 = load double, ptr %54, align 8, !tbaa !30
  %56 = fmul double %55, %1
  %57 = getelementptr inbounds i8, ptr %0, i64 160
  store double %56, ptr %57, align 8, !tbaa !32
  br label %58

58:                                               ; preds = %44, %51, %49, %38
  %59 = getelementptr inbounds i8, ptr %0, i64 152
  %60 = load i32, ptr %59, align 8, !tbaa !31
  %61 = icmp eq i32 %5, %60
  br i1 %61, label %62, label %77

62:                                               ; preds = %58
  %63 = fcmp ult double %1, 0.000000e+00
  br i1 %63, label %69, label %64

64:                                               ; preds = %62
  %65 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %65, ptr %59, align 8, !tbaa !31
  %66 = getelementptr inbounds i8, ptr %0, i64 160
  %67 = load double, ptr %66, align 8, !tbaa !32
  %68 = fmul double %67, %1
  store double %68, ptr %66, align 8, !tbaa !32
  br label %77

69:                                               ; preds = %62
  %70 = fcmp olt double %1, 0.000000e+00
  br i1 %70, label %71, label %77

71:                                               ; preds = %69
  %72 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %72, ptr %39, align 8, !tbaa !29
  %73 = getelementptr inbounds i8, ptr %0, i64 160
  %74 = load double, ptr %73, align 8, !tbaa !32
  %75 = fmul double %74, %1
  %76 = getelementptr inbounds i8, ptr %0, i64 144
  store double %75, ptr %76, align 8, !tbaa !30
  br label %77

77:                                               ; preds = %64, %71, %69, %58
  %78 = getelementptr inbounds i8, ptr %0, i64 168
  %79 = load i32, ptr %78, align 8, !tbaa !33
  %80 = icmp eq i32 %5, %79
  br i1 %80, label %81, label %86

81:                                               ; preds = %77
  %82 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %82, ptr %78, align 8, !tbaa !33
  %83 = getelementptr inbounds i8, ptr %0, i64 176
  %84 = load double, ptr %83, align 8, !tbaa !34
  %85 = fmul double %84, %1
  store double %85, ptr %83, align 8, !tbaa !34
  br label %86

86:                                               ; preds = %81, %77
  %87 = getelementptr inbounds i8, ptr %0, i64 184
  %88 = load i32, ptr %87, align 8, !tbaa !35
  %89 = icmp eq i32 %5, %88
  br i1 %89, label %90, label %98

90:                                               ; preds = %86
  %91 = tail call noundef i32 @_ZNK10SimTKIpopt12TaggedObject6GetTagEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  store i32 %91, ptr %87, align 8, !tbaa !35
  %92 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %93 = sitofp i32 %92 to double
  %94 = tail call double @log(double noundef %1) #5
  %95 = getelementptr inbounds i8, ptr %0, i64 192
  %96 = load double, ptr %95, align 8, !tbaa !36
  %97 = tail call double @llvm.fmuladd.f64(double %93, double %94, double %96)
  store double %97, ptr %95, align 8, !tbaa !36
  br label %98

98:                                               ; preds = %86, %90, %2
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt12TaggedObject13ObjectChangedEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !12, i64 88}
!9 = !{!"_ZTSN10SimTKIpopt6VectorE", !10, i64 0, !20, i64 56, !21, i64 64, !12, i64 88, !22, i64 96, !12, i64 104, !22, i64 112, !12, i64 120, !22, i64 128, !12, i64 136, !22, i64 144, !12, i64 152, !22, i64 160, !12, i64 168, !22, i64 176, !12, i64 184, !22, i64 192, !12, i64 200, !23, i64 204}
!10 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !11, i64 0, !14, i64 16, !12, i64 48, !12, i64 52}
!11 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !12, i64 8}
!12 = !{!"int", !13, i64 0}
!13 = !{!"omnipotent char", !7, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt7SubjectE", !15, i64 8}
!15 = !{!"_ZTSSt6vectorIPN10SimTKIpopt8ObserverESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !13, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !19, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt13CachedResultsIdEE", !12, i64 8, !19, i64 16}
!22 = !{!"double", !13, i64 0}
!23 = !{!"bool", !13, i64 0}
!24 = !{!9, !22, i64 96}
!25 = !{!9, !12, i64 104}
!26 = !{!9, !22, i64 112}
!27 = !{!9, !12, i64 120}
!28 = !{!9, !22, i64 128}
!29 = !{!9, !12, i64 136}
!30 = !{!9, !22, i64 144}
!31 = !{!9, !12, i64 152}
!32 = !{!9, !22, i64 160}
!33 = !{!9, !12, i64 168}
!34 = !{!9, !22, i64 176}
!35 = !{!9, !12, i64 184}
!36 = !{!9, !22, i64 192}


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