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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt11DenseVector18ElementWiseMinImplERKNS_6VectorE(ptr noundef nonnull align 8 dereferenceable(240) %0, ptr noundef nonnull align 8 dereferenceable(205) %1) unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %16, label %14

14:                                               ; preds = %2
  %15 = call ptr @__dynamic_cast(ptr %12, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #5
  br label %17

16:                                               ; preds = %2
  br label %17

17:                                               ; preds = %16, %14
  %18 = phi ptr [ %15, %14 ], [ null, %16 ]
  store ptr %18, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %128

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 4
  %26 = load i8, ptr %25, align 1, !tbaa !24, !range !25, !noundef !26
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %67

28:                                               ; preds = %21
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %29, i32 0, i32 4
  %31 = load i8, ptr %30, align 1, !tbaa !24, !range !25, !noundef !26
  %32 = trunc i8 %31 to i1
  br i1 %32, label %33, label %41

33:                                               ; preds = %28
  %34 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 5
  %35 = load double, ptr %34, align 8, !tbaa !27
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %36, i32 0, i32 5
  %38 = load double, ptr %37, align 8, !tbaa !27
  %39 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %35, double noundef %38)
  %40 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 5
  store double %39, ptr %40, align 8, !tbaa !27
  br label %66

41:                                               ; preds = %28
  %42 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 4
  store i8 0, ptr %42, align 1, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %43 = call noundef ptr @_ZN10SimTKIpopt11DenseVector16values_allocatedEv(ptr noundef nonnull align 8 dereferenceable(240) %11)
  store ptr %43, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !28
  br label %44

44:                                               ; preds = %62, %41
  %45 = load i32, ptr %8, align 4, !tbaa !28
  %46 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %11)
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %65

49:                                               ; preds = %44
  %50 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 5
  %51 = load double, ptr %50, align 8, !tbaa !27
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load i32, ptr %8, align 4, !tbaa !28
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %52, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !29
  %57 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %51, double noundef %56)
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !28
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  store double %57, ptr %61, align 8, !tbaa !29
  br label %62

62:                                               ; preds = %49
  %63 = load i32, ptr %8, align 4, !tbaa !28
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !28
  br label %44, !llvm.loop !30

65:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %66

66:                                               ; preds = %65, %33
  br label %127

67:                                               ; preds = %21
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %68, i32 0, i32 4
  %70 = load i8, ptr %69, align 1, !tbaa !24, !range !25, !noundef !26
  %71 = trunc i8 %70 to i1
  br i1 %71, label %72, label %98

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !28
  br label %73

73:                                               ; preds = %94, %72
  %74 = load i32, ptr %9, align 4, !tbaa !28
  %75 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %11)
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

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

78:                                               ; preds = %73
  %79 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = load i32, ptr %9, align 4, !tbaa !28
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %80, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !29
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %85, i32 0, i32 5
  %87 = load double, ptr %86, align 8, !tbaa !27
  %88 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %84, double noundef %87)
  %89 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 2
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  %91 = load i32, ptr %9, align 4, !tbaa !28
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %90, i64 %92
  store double %88, ptr %93, align 8, !tbaa !29
  br label %94

94:                                               ; preds = %78
  %95 = load i32, ptr %9, align 4, !tbaa !28
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %9, align 4, !tbaa !28
  br label %73, !llvm.loop !32

97:                                               ; preds = %77
  br label %126

98:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !28
  br label %99

99:                                               ; preds = %122, %98
  %100 = load i32, ptr %10, align 4, !tbaa !28
  %101 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %11)
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %125

104:                                              ; preds = %99
  %105 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 2
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = load i32, ptr %10, align 4, !tbaa !28
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds double, ptr %106, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !29
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !28
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds double, ptr %111, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !29
  %116 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %110, double noundef %115)
  %117 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = load i32, ptr %10, align 4, !tbaa !28
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %118, i64 %120
  store double %116, ptr %121, align 8, !tbaa !29
  br label %122

122:                                              ; preds = %104
  %123 = load i32, ptr %10, align 4, !tbaa !28
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %10, align 4, !tbaa !28
  br label %99, !llvm.loop !33

125:                                              ; preds = %103
  br label %126

126:                                              ; preds = %125, %97
  br label %127

127:                                              ; preds = %126, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %128

128:                                              ; preds = %127, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

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 = { 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 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 #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, !6, i64 216}
!10 = !{!"_ZTSN10SimTKIpopt11DenseVectorE", !11, i64 0, !6, i64 208, !6, i64 216, !23, i64 224, !23, i64 225, !22, i64 232}
!11 = !{!"_ZTSN10SimTKIpopt6VectorE", !12, i64 0, !20, i64 56, !21, i64 64, !14, i64 88, !22, i64 96, !14, i64 104, !22, i64 112, !14, i64 120, !22, i64 128, !14, i64 136, !22, i64 144, !14, i64 152, !22, i64 160, !14, i64 168, !22, i64 176, !14, i64 184, !22, i64 192, !14, i64 200, !23, i64 204}
!12 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !13, i64 0, !15, i64 16, !14, i64 48, !14, i64 52}
!13 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !14, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN10SimTKIpopt7SubjectE", !16, i64 8}
!16 = !{!"_ZTSSt6vectorIPN10SimTKIpopt8ObserverESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !6, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt13CachedResultsIdEE", !14, i64 8, !6, i64 16}
!22 = !{!"double", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!10, !23, i64 225}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!10, !22, i64 232}
!28 = !{!14, !14, i64 0}
!29 = !{!22, !22, 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: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN10SimTKIpopt11DenseVector16values_allocatedEv(ptr noundef nonnull align 8 dereferenceable(240)) 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: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt11DenseVector18ElementWiseMinImplERKNS_6VectorE(ptr noundef nonnull align 8 dereferenceable(240) %0, ptr noundef nonnull readonly align 8 dereferenceable(205) %1) unnamed_addr #2 align 2 {
  %3 = tail call ptr @__dynamic_cast(ptr nonnull %1, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #4
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %.loopexit, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %3, i64 216
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 225
  %8 = load i8, ptr %7, align 1, !tbaa !23, !range !24, !noundef !25
  %9 = trunc nuw i8 %8 to i1
  %10 = getelementptr inbounds i8, ptr %3, i64 225
  %11 = load i8, ptr %10, align 1, !tbaa !23, !range !24, !noundef !25
  %12 = trunc nuw i8 %11 to i1
  br i1 %9, label %13, label %34

13:                                               ; preds = %4
  br i1 %12, label %14, label %20

14:                                               ; preds = %13
  %15 = getelementptr inbounds i8, ptr %0, i64 232
  %16 = load double, ptr %15, align 8, !tbaa !26
  %17 = getelementptr inbounds i8, ptr %3, i64 232
  %18 = load double, ptr %17, align 8, !tbaa !26
  %19 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %16, double noundef %18)
  store double %19, ptr %15, align 8, !tbaa !26
  br label %.loopexit

20:                                               ; preds = %13
  store i8 0, ptr %7, align 1, !tbaa !23
  %21 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector16values_allocatedEv(ptr noundef nonnull align 8 dereferenceable(240) %0)
  %22 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph33, label %.loopexit

.lr.ph33:                                         ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 232
  br label %25

25:                                               ; preds = %.lr.ph33, %25
  %indvars.iv40 = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next41, %25 ]
  %26 = load double, ptr %24, align 8, !tbaa !26
  %27 = getelementptr inbounds double, ptr %6, i64 %indvars.iv40
  %28 = load double, ptr %27, align 8, !tbaa !27
  %29 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %26, double noundef %28)
  %30 = getelementptr inbounds double, ptr %21, i64 %indvars.iv40
  store double %29, ptr %30, align 8, !tbaa !27
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %31 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next41, %32
  br i1 %33, label %25, label %.loopexit, !llvm.loop !28

34:                                               ; preds = %4
  %35 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %36 = icmp sgt i32 %35, 0
  br i1 %12, label %.preheader, label %.preheader27

.preheader27:                                     ; preds = %34
  br i1 %36, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader27
  %37 = getelementptr inbounds i8, ptr %0, i64 216
  br label %51

.preheader:                                       ; preds = %34
  br i1 %36, label %.lr.ph31, label %.loopexit

.lr.ph31:                                         ; preds = %.preheader
  %38 = getelementptr inbounds i8, ptr %0, i64 216
  %39 = getelementptr inbounds i8, ptr %3, i64 232
  br label %40

40:                                               ; preds = %.lr.ph31, %40
  %indvars.iv37 = phi i64 [ 0, %.lr.ph31 ], [ %indvars.iv.next38, %40 ]
  %41 = load ptr, ptr %38, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %41, i64 %indvars.iv37
  %43 = load double, ptr %42, align 8, !tbaa !27
  %44 = load double, ptr %39, align 8, !tbaa !26
  %45 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %43, double noundef %44)
  %46 = load ptr, ptr %38, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %46, i64 %indvars.iv37
  store double %45, ptr %47, align 8, !tbaa !27
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %48 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next38, %49
  br i1 %50, label %40, label %.loopexit, !llvm.loop !30

51:                                               ; preds = %.lr.ph, %51
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %51 ]
  %52 = load ptr, ptr %37, align 8, !tbaa !5
  %53 = getelementptr inbounds double, ptr %52, i64 %indvars.iv
  %54 = load double, ptr %53, align 8, !tbaa !27
  %55 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  %56 = load double, ptr %55, align 8, !tbaa !27
  %57 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %54, double noundef %56)
  %58 = load ptr, ptr %37, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %58, i64 %indvars.iv
  store double %57, ptr %59, align 8, !tbaa !27
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next, %61
  br i1 %62, label %51, label %.loopexit, !llvm.loop !31

.loopexit:                                        ; preds = %51, %40, %25, %.preheader27, %.preheader, %20, %14, %2
  ret void
}

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

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 = { 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 = { 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 = { 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,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass