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

; 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::DenseVector" = type { %"class.SimTKIpopt::Vector.base", ptr, ptr, i8, i8, double }
%"class.SimTKIpopt::Vector.base" = 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 }>
%"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 }

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

; 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10SimTKIpopt3MinEdd(double noundef, double noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK10SimTKIpopt11DenseVector15FracToBoundImplERKNS_6VectorEd(ptr noundef nonnull align 8 dereferenceable(240) %0, ptr noundef nonnull align 8 dereferenceable(205) %1, double noundef %2) unnamed_addr #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  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
  %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 @_ZTIN10SimTKIpopt11DenseVectorE, 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 %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store double 1.000000e+00, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %22 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %14, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  store ptr %23, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %24, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  store ptr %26, ptr %10, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %14, i32 0, i32 4
  %28 = load i8, ptr %27, align 1, !tbaa !25, !range !26, !noundef !27
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %86

30:                                               ; preds = %20
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %31, i32 0, i32 4
  %33 = load i8, ptr %32, align 1, !tbaa !25, !range !26, !noundef !27
  %34 = trunc i8 %33 to i1
  br i1 %34, label %35, label %53

35:                                               ; preds = %30
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %36, i32 0, i32 5
  %38 = load double, ptr %37, align 8, !tbaa !28
  %39 = fcmp olt double %38, 0.000000e+00
  br i1 %39, label %40, label %52

40:                                               ; preds = %35
  %41 = load double, ptr %8, align 8, !tbaa !9
  %42 = load double, ptr %6, align 8, !tbaa !9
  %43 = fneg double %42
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %44, i32 0, i32 5
  %46 = load double, ptr %45, align 8, !tbaa !28
  %47 = fdiv double %43, %46
  %48 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %14, i32 0, i32 5
  %49 = load double, ptr %48, align 8, !tbaa !28
  %50 = fmul double %47, %49
  %51 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %41, double noundef %50)
  store double %51, ptr %8, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %40, %35
  br label %85

53:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !29
  br label %54

54:                                               ; preds = %81, %53
  %55 = load i32, ptr %11, align 4, !tbaa !29
  %56 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %14)
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %84

59:                                               ; preds = %54
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load i32, ptr %11, align 4, !tbaa !29
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !9
  %65 = fcmp olt double %64, 0.000000e+00
  br i1 %65, label %66, label %80

66:                                               ; preds = %59
  %67 = load double, ptr %8, align 8, !tbaa !9
  %68 = load double, ptr %6, align 8, !tbaa !9
  %69 = fneg double %68
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !29
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds double, ptr %70, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !9
  %75 = fdiv double %69, %74
  %76 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %14, i32 0, i32 5
  %77 = load double, ptr %76, align 8, !tbaa !28
  %78 = fmul double %75, %77
  %79 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %67, double noundef %78)
  store double %79, ptr %8, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %66, %59
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %11, align 4, !tbaa !29
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %11, align 4, !tbaa !29
  br label %54, !llvm.loop !30

84:                                               ; preds = %58
  br label %85

85:                                               ; preds = %84, %52
  br label %158

86:                                               ; preds = %20
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %87, i32 0, i32 4
  %89 = load i8, ptr %88, align 1, !tbaa !25, !range !26, !noundef !27
  %90 = trunc i8 %89 to i1
  br i1 %90, label %91, label %122

91:                                               ; preds = %86
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %92, i32 0, i32 5
  %94 = load double, ptr %93, align 8, !tbaa !28
  %95 = fcmp olt double %94, 0.000000e+00
  br i1 %95, label %96, label %121

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !29
  br label %97

97:                                               ; preds = %117, %96
  %98 = load i32, ptr %12, align 4, !tbaa !29
  %99 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %14)
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %120

102:                                              ; preds = %97
  %103 = load double, ptr %8, align 8, !tbaa !9
  %104 = load double, ptr %6, align 8, !tbaa !9
  %105 = fneg double %104
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %106, i32 0, i32 5
  %108 = load double, ptr %107, align 8, !tbaa !28
  %109 = fdiv double %105, %108
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load i32, ptr %12, align 4, !tbaa !29
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %110, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !9
  %115 = fmul double %109, %114
  %116 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %103, double noundef %115)
  store double %116, ptr %8, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %102
  %118 = load i32, ptr %12, align 4, !tbaa !29
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %12, align 4, !tbaa !29
  br label %97, !llvm.loop !32

120:                                              ; preds = %101
  br label %121

121:                                              ; preds = %120, %91
  br label %157

122:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !29
  br label %123

123:                                              ; preds = %153, %122
  %124 = load i32, ptr %13, align 4, !tbaa !29
  %125 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %14)
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %156

128:                                              ; preds = %123
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = load i32, ptr %13, align 4, !tbaa !29
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = fcmp olt double %133, 0.000000e+00
  br i1 %134, label %135, label %152

135:                                              ; preds = %128
  %136 = load double, ptr %8, align 8, !tbaa !9
  %137 = load double, ptr %6, align 8, !tbaa !9
  %138 = fneg double %137
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = load i32, ptr %13, align 4, !tbaa !29
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds double, ptr %139, i64 %141
  %143 = load double, ptr %142, align 8, !tbaa !9
  %144 = fdiv double %138, %143
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = load i32, ptr %13, align 4, !tbaa !29
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds double, ptr %145, i64 %147
  %149 = load double, ptr %148, align 8, !tbaa !9
  %150 = fmul double %144, %149
  %151 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %136, double noundef %150)
  store double %151, ptr %8, align 8, !tbaa !9
  br label %152

152:                                              ; preds = %135, %128
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %13, align 4, !tbaa !29
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %13, align 4, !tbaa !29
  br label %123, !llvm.loop !33

156:                                              ; preds = %127
  br label %157

157:                                              ; preds = %156, %121
  br label %158

158:                                              ; preds = %157, %85
  %159 = load double, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #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 %159
}

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


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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10SimTKIpopt3MinEdd(double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK10SimTKIpopt11DenseVector15FracToBoundImplERKNS_6VectorEd(ptr noundef nonnull align 8 dereferenceable(240) %0, ptr noundef nonnull readonly align 8 dereferenceable(205) %1, double noundef %2) unnamed_addr #3 align 2 {
  %4 = tail call ptr @__dynamic_cast(ptr nonnull %1, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #4
  %5 = getelementptr inbounds i8, ptr %0, i64 216
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %4, i64 216
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 225
  %10 = load i8, ptr %9, align 1, !tbaa !23, !range !24, !noundef !25
  %11 = trunc nuw i8 %10 to i1
  %12 = getelementptr inbounds i8, ptr %4, i64 225
  %13 = load i8, ptr %12, align 1, !tbaa !23, !range !24, !noundef !25
  %14 = trunc nuw i8 %13 to i1
  br i1 %11, label %15, label %44

15:                                               ; preds = %3
  br i1 %14, label %20, label %.preheader

.preheader:                                       ; preds = %15
  %16 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph53, label %.loopexit

.lr.ph53:                                         ; preds = %.preheader
  %18 = fneg double %2
  %19 = getelementptr inbounds i8, ptr %0, i64 232
  br label %31

20:                                               ; preds = %15
  %21 = getelementptr inbounds i8, ptr %4, i64 232
  %22 = load double, ptr %21, align 8, !tbaa !26
  %23 = fcmp olt double %22, 0.000000e+00
  br i1 %23, label %24, label %.loopexit

24:                                               ; preds = %20
  %25 = fneg double %2
  %26 = fdiv double %25, %22
  %27 = getelementptr inbounds i8, ptr %0, i64 232
  %28 = load double, ptr %27, align 8, !tbaa !26
  %29 = fmul double %26, %28
  %30 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef 1.000000e+00, double noundef %29)
  br label %.loopexit

31:                                               ; preds = %.lr.ph53, %40
  %indvars.iv61 = phi i64 [ 0, %.lr.ph53 ], [ %indvars.iv.next62, %40 ]
  %.03751 = phi double [ 1.000000e+00, %.lr.ph53 ], [ %.1, %40 ]
  %32 = getelementptr inbounds double, ptr %8, i64 %indvars.iv61
  %33 = load double, ptr %32, align 8, !tbaa !27
  %34 = fcmp olt double %33, 0.000000e+00
  br i1 %34, label %35, label %40

35:                                               ; preds = %31
  %36 = fdiv double %18, %33
  %37 = load double, ptr %19, align 8, !tbaa !26
  %38 = fmul double %36, %37
  %39 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %.03751, double noundef %38)
  br label %40

40:                                               ; preds = %31, %35
  %.1 = phi double [ %39, %35 ], [ %.03751, %31 ]
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %41 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next62, %42
  br i1 %43, label %31, label %.loopexit, !llvm.loop !28

44:                                               ; preds = %3
  br i1 %14, label %48, label %.preheader43

.preheader43:                                     ; preds = %44
  %45 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader43
  %47 = fneg double %2
  br label %65

48:                                               ; preds = %44
  %49 = getelementptr inbounds i8, ptr %4, i64 232
  %50 = load double, ptr %49, align 8, !tbaa !26
  %51 = fcmp olt double %50, 0.000000e+00
  br i1 %51, label %.preheader41, label %.loopexit

.preheader41:                                     ; preds = %48
  %52 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph49, label %.loopexit

.lr.ph49:                                         ; preds = %.preheader41
  %54 = fneg double %2
  br label %55

55:                                               ; preds = %.lr.ph49, %55
  %indvars.iv58 = phi i64 [ 0, %.lr.ph49 ], [ %indvars.iv.next59, %55 ]
  %.247 = phi double [ 1.000000e+00, %.lr.ph49 ], [ %61, %55 ]
  %56 = load double, ptr %49, align 8, !tbaa !26
  %57 = fdiv double %54, %56
  %58 = getelementptr inbounds double, ptr %6, i64 %indvars.iv58
  %59 = load double, ptr %58, align 8, !tbaa !27
  %60 = fmul double %57, %59
  %61 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %.247, double noundef %60)
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %62 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next59, %63
  br i1 %64, label %55, label %.loopexit, !llvm.loop !30

65:                                               ; preds = %.lr.ph, %75
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %75 ]
  %.345 = phi double [ 1.000000e+00, %.lr.ph ], [ %.4, %75 ]
  %66 = getelementptr inbounds double, ptr %8, i64 %indvars.iv
  %67 = load double, ptr %66, align 8, !tbaa !27
  %68 = fcmp olt double %67, 0.000000e+00
  br i1 %68, label %69, label %75

69:                                               ; preds = %65
  %70 = fdiv double %47, %67
  %71 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  %72 = load double, ptr %71, align 8, !tbaa !27
  %73 = fmul double %70, %72
  %74 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %.345, double noundef %73)
  br label %75

75:                                               ; preds = %65, %69
  %.4 = phi double [ %74, %69 ], [ %.345, %65 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %76 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next, %77
  br i1 %78, label %65, label %.loopexit, !llvm.loop !31

.loopexit:                                        ; preds = %75, %55, %40, %.preheader43, %.preheader41, %.preheader, %48, %24, %20
  %.5 = phi double [ %30, %24 ], [ 1.000000e+00, %20 ], [ 1.000000e+00, %48 ], [ 1.000000e+00, %.preheader ], [ 1.000000e+00, %.preheader41 ], [ 1.000000e+00, %.preheader43 ], [ %.1, %40 ], [ %61, %55 ], [ %.4, %75 ]
  ret double %.5
}

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #2 = { inlinehint 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 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 = { 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, !18, i64 216}
!6 = !{!"_ZTSN10SimTKIpopt11DenseVectorE", !7, i64 0, !18, i64 208, !18, i64 216, !22, i64 224, !22, i64 225, !21, i64 232}
!7 = !{!"_ZTSN10SimTKIpopt6VectorE", !8, i64 0, !19, i64 56, !20, i64 64, !10, i64 88, !21, i64 96, !10, i64 104, !21, i64 112, !10, i64 120, !21, i64 128, !10, i64 136, !21, i64 144, !10, i64 152, !21, i64 160, !10, i64 168, !21, i64 176, !10, i64 184, !21, i64 192, !10, i64 200, !22, i64 204}
!8 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !9, i64 0, !13, i64 16, !10, i64 48, !10, i64 52}
!9 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !10, i64 8}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN10SimTKIpopt7SubjectE", !14, i64 8}
!14 = !{!"_ZTSSt6vectorIPN10SimTKIpopt8ObserverESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !11, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !18, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt13CachedResultsIdEE", !10, i64 8, !18, i64 16}
!21 = !{!"double", !11, i64 0}
!22 = !{!"bool", !11, i64 0}
!23 = !{!6, !22, i64 225}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!6, !21, i64 232}
!27 = !{!21, !21, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass