; 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
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [98 x i8], align 1
@__PRETTY_FUNCTION__._ZN10SimTKIpopt11DenseVector18ElementWiseMaxImplERKNS_6VectorE = external hidden unnamed_addr constant [73 x i8], align 1

; 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 @_ZN10SimTKIpopt11DenseVector18ElementWiseMaxImplERKNS_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) #6
  %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) #6
  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 %22

21:                                               ; preds = %17
  br label %24

22:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 291, ptr noundef @__PRETTY_FUNCTION__._ZN10SimTKIpopt11DenseVector18ElementWiseMaxImplERKNS_6VectorE) #7
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %134

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

34:                                               ; preds = %27
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %35, i32 0, i32 4
  %37 = load i8, ptr %36, align 1, !tbaa !24, !range !25, !noundef !26
  %38 = trunc i8 %37 to i1
  br i1 %38, label %39, label %47

39:                                               ; preds = %34
  %40 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 5
  %41 = load double, ptr %40, align 8, !tbaa !27
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %42, i32 0, i32 5
  %44 = load double, ptr %43, align 8, !tbaa !27
  %45 = call noundef double @_ZN10SimTKIpopt3MaxEdd(double noundef %41, double noundef %44)
  %46 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 5
  store double %45, ptr %46, align 8, !tbaa !27
  br label %72

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

50:                                               ; preds = %68, %47
  %51 = load i32, ptr %8, align 4, !tbaa !28
  %52 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %11)
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %71

55:                                               ; preds = %50
  %56 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 5
  %57 = load double, ptr %56, align 8, !tbaa !27
  %58 = load ptr, ptr %6, 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
  %62 = load double, ptr %61, align 8, !tbaa !29
  %63 = call noundef double @_ZN10SimTKIpopt3MaxEdd(double noundef %57, double noundef %62)
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !28
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds double, ptr %64, i64 %66
  store double %63, ptr %67, align 8, !tbaa !29
  br label %68

68:                                               ; preds = %55
  %69 = load i32, ptr %8, align 4, !tbaa !28
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %8, align 4, !tbaa !28
  br label %50, !llvm.loop !30

71:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %72

72:                                               ; preds = %71, %39
  br label %133

73:                                               ; preds = %27
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %74, i32 0, i32 4
  %76 = load i8, ptr %75, align 1, !tbaa !24, !range !25, !noundef !26
  %77 = trunc i8 %76 to i1
  br i1 %77, label %78, label %104

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

79:                                               ; preds = %100, %78
  %80 = load i32, ptr %9, align 4, !tbaa !28
  %81 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %11)
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %103

84:                                               ; preds = %79
  %85 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = load i32, ptr %9, align 4, !tbaa !28
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !29
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %91, i32 0, i32 5
  %93 = load double, ptr %92, align 8, !tbaa !27
  %94 = call noundef double @_ZN10SimTKIpopt3MaxEdd(double noundef %90, double noundef %93)
  %95 = getelementptr inbounds %"class.SimTKIpopt::DenseVector", ptr %11, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !28
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds double, ptr %96, i64 %98
  store double %94, ptr %99, align 8, !tbaa !29
  br label %100

100:                                              ; preds = %84
  %101 = load i32, ptr %9, align 4, !tbaa !28
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %9, align 4, !tbaa !28
  br label %79, !llvm.loop !32

103:                                              ; preds = %83
  br label %132

104:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !28
  br label %105

105:                                              ; preds = %128, %104
  %106 = load i32, ptr %10, align 4, !tbaa !28
  %107 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %11)
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %131

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

128:                                              ; preds = %110
  %129 = load i32, ptr %10, align 4, !tbaa !28
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %10, align 4, !tbaa !28
  br label %105, !llvm.loop !33

131:                                              ; preds = %109
  br label %132

132:                                              ; preds = %131, %103
  br label %133

133:                                              ; preds = %132, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %134

134:                                              ; preds = %133, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

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 = { noreturn 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [98 x i8], align 1
@__PRETTY_FUNCTION__._ZN10SimTKIpopt11DenseVector18ElementWiseMaxImplERKNS_6VectorE = external hidden unnamed_addr constant [73 x i8], align 1

; 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 @_ZN10SimTKIpopt11DenseVector18ElementWiseMaxImplERKNS_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) #5
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 291, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN10SimTKIpopt11DenseVector18ElementWiseMaxImplERKNS_6VectorE) #6
  unreachable

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

14:                                               ; preds = %5
  br i1 %13, label %15, label %21

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

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

.lr.ph34:                                         ; preds = %21
  %25 = getelementptr inbounds i8, ptr %0, i64 232
  br label %26

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

35:                                               ; preds = %5
  %36 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %0)
  %37 = icmp sgt i32 %36, 0
  br i1 %13, label %.preheader, label %.preheader28

.preheader28:                                     ; preds = %35
  br i1 %37, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader28
  %38 = getelementptr inbounds i8, ptr %0, i64 216
  br label %52

.preheader:                                       ; preds = %35
  br i1 %37, label %.lr.ph32, label %.loopexit

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

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

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

.loopexit:                                        ; preds = %52, %41, %26, %.preheader28, %.preheader, %21, %15
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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 = { noreturn 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 #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 }
attributes #6 = { noreturn 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