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

; 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::SymTMatrix" = type <{ %"class.SimTKIpopt::SymMatrix", ptr, ptr, i8, [7 x i8] }>
%"class.SimTKIpopt::SymMatrix" = type { %"class.SimTKIpopt::Matrix.base", ptr }
%"class.SimTKIpopt::Matrix.base" = type <{ %"class.SimTKIpopt::TaggedObject", %"class.SimTKIpopt::SmartPtr.5", 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.5" = type { ptr }

@_ZTIN10SimTKIpopt6VectorE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt11DenseVectorE = external constant 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt10SymTMatrix14MultVectorImplEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(97) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %2, double noundef %3, ptr noundef nonnull align 8 dereferenceable(205) %4) unnamed_addr #2 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store double %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8
  %22 = load double, ptr %9, align 8, !tbaa !9
  %23 = fcmp une double %22, 0.000000e+00
  br i1 %23, label %24, label %27

24:                                               ; preds = %5
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = load double, ptr %9, align 8, !tbaa !9
  call void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205) %25, double noundef %26)
  br label %29

27:                                               ; preds = %5
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN10SimTKIpopt6Vector3SetEd(ptr noundef nonnull align 8 dereferenceable(205) %28, double noundef 0.000000e+00)
  br label %29

29:                                               ; preds = %27, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %34, label %32

32:                                               ; preds = %29
  %33 = call ptr @__dynamic_cast(ptr %30, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %35

34:                                               ; preds = %29
  br label %35

35:                                               ; preds = %34, %32
  %36 = phi ptr [ %33, %32 ], [ null, %34 ]
  store ptr %36, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %41, label %39

39:                                               ; preds = %35
  %40 = call ptr @__dynamic_cast(ptr %37, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %42

41:                                               ; preds = %35
  br label %42

42:                                               ; preds = %41, %39
  %43 = phi ptr [ %40, %39 ], [ null, %41 ]
  store ptr %43, ptr %12, align 8, !tbaa !5
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %173

46:                                               ; preds = %42
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %173

49:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %50 = call noundef ptr @_ZNK10SimTKIpopt10SymTMatrix5IrowsEv(ptr noundef nonnull align 8 dereferenceable(97) %21)
  store ptr %50, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %51 = call noundef ptr @_ZNK10SimTKIpopt10SymTMatrix5JcolsEv(ptr noundef nonnull align 8 dereferenceable(97) %21)
  store ptr %51, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %52 = getelementptr inbounds %"class.SimTKIpopt::SymTMatrix", ptr %21, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  store ptr %53, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %54)
  store ptr %55, ptr %16, align 8, !tbaa !5
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %56)
  br i1 %57, label %58, label %108

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %59 = load double, ptr %7, align 8, !tbaa !9
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %60)
  %62 = fmul double %59, %61
  store double %62, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !25
  br label %63

63:                                               ; preds = %104, %58
  %64 = load i32, ptr %18, align 4, !tbaa !25
  %65 = call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %21)
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %107

68:                                               ; preds = %63
  %69 = load double, ptr %17, align 8, !tbaa !9
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = load double, ptr %70, align 8, !tbaa !9
  %72 = load ptr, ptr %16, align 8, !tbaa !5
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = load i32, ptr %73, align 4, !tbaa !25
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %72, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !9
  %79 = call double @llvm.fmuladd.f64(double %69, double %71, double %78)
  store double %79, ptr %77, align 8, !tbaa !9
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = load i32, ptr %80, align 4, !tbaa !25
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = load i32, ptr %82, align 4, !tbaa !25
  %84 = icmp ne i32 %81, %83
  br i1 %84, label %85, label %97

85:                                               ; preds = %68
  %86 = load double, ptr %17, align 8, !tbaa !9
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = load double, ptr %87, align 8, !tbaa !9
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = load i32, ptr %90, align 4, !tbaa !25
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %89, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !9
  %96 = call double @llvm.fmuladd.f64(double %86, double %88, double %95)
  store double %96, ptr %94, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %85, %68
  %98 = load ptr, ptr %15, align 8, !tbaa !5
  %99 = getelementptr inbounds double, ptr %98, i32 1
  store ptr %99, ptr %15, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = getelementptr inbounds i32, ptr %100, i32 1
  store ptr %101, ptr %13, align 8, !tbaa !5
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = getelementptr inbounds i32, ptr %102, i32 1
  store ptr %103, ptr %14, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %97
  %105 = load i32, ptr %18, align 4, !tbaa !25
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %18, align 4, !tbaa !25
  br label %63, !llvm.loop !26

107:                                              ; preds = %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %172

108:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %109)
  store ptr %110, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !25
  br label %111

111:                                              ; preds = %168, %108
  %112 = load i32, ptr %20, align 4, !tbaa !25
  %113 = call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %21)
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %171

116:                                              ; preds = %111
  %117 = load double, ptr %7, align 8, !tbaa !9
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = load double, ptr %118, align 8, !tbaa !9
  %120 = fmul double %117, %119
  %121 = load ptr, ptr %19, align 8, !tbaa !5
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = load i32, ptr %122, align 4, !tbaa !25
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %121, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !9
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = load i32, ptr %129, align 4, !tbaa !25
  %131 = sub nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds double, ptr %128, i64 %132
  %134 = load double, ptr %133, align 8, !tbaa !9
  %135 = call double @llvm.fmuladd.f64(double %120, double %127, double %134)
  store double %135, ptr %133, align 8, !tbaa !9
  %136 = load ptr, ptr %13, align 8, !tbaa !5
  %137 = load i32, ptr %136, align 4, !tbaa !25
  %138 = load ptr, ptr %14, align 8, !tbaa !5
  %139 = load i32, ptr %138, align 4, !tbaa !25
  %140 = icmp ne i32 %137, %139
  br i1 %140, label %141, label %161

141:                                              ; preds = %116
  %142 = load double, ptr %7, align 8, !tbaa !9
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = load double, ptr %143, align 8, !tbaa !9
  %145 = fmul double %142, %144
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = load i32, ptr %147, align 4, !tbaa !25
  %149 = sub nsw i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds double, ptr %146, i64 %150
  %152 = load double, ptr %151, align 8, !tbaa !9
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  %154 = load ptr, ptr %14, align 8, !tbaa !5
  %155 = load i32, ptr %154, align 4, !tbaa !25
  %156 = sub nsw i32 %155, 1
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds double, ptr %153, i64 %157
  %159 = load double, ptr %158, align 8, !tbaa !9
  %160 = call double @llvm.fmuladd.f64(double %145, double %152, double %159)
  store double %160, ptr %158, align 8, !tbaa !9
  br label %161

161:                                              ; preds = %141, %116
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = getelementptr inbounds double, ptr %162, i32 1
  store ptr %163, ptr %15, align 8, !tbaa !5
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = getelementptr inbounds i32, ptr %164, i32 1
  store ptr %165, ptr %13, align 8, !tbaa !5
  %166 = load ptr, ptr %14, align 8, !tbaa !5
  %167 = getelementptr inbounds i32, ptr %166, i32 1
  store ptr %167, ptr %14, align 8, !tbaa !5
  br label %168

168:                                              ; preds = %161
  %169 = load i32, ptr %20, align 4, !tbaa !25
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %20, align 4, !tbaa !25
  br label %111, !llvm.loop !28

171:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %172

172:                                              ; preds = %171, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %173

173:                                              ; preds = %172, %46, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  ret void
}

declare void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205), double noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt6Vector3SetEd(ptr noundef nonnull align 8 dereferenceable(205), double noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt10SymTMatrix5IrowsEv(ptr noundef nonnull align 8 dereferenceable(97)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt10SymTMatrix5JcolsEv(ptr noundef nonnull align 8 dereferenceable(97)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240)) #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240)) #7 align 2

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 = { 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 = { "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 willreturn memory(read) }
attributes #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 #8 = { 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 88}
!12 = !{!"_ZTSN10SimTKIpopt10SymTMatrixE", !13, i64 0, !6, i64 80, !6, i64 88, !24, i64 96}
!13 = !{!"_ZTSN10SimTKIpopt9SymMatrixE", !14, i64 0, !6, i64 72}
!14 = !{!"_ZTSN10SimTKIpopt6MatrixE", !15, i64 0, !23, i64 56, !17, i64 64, !24, i64 68}
!15 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !16, i64 0, !18, i64 16, !17, i64 48, !17, i64 52}
!16 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !17, i64 8}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt7SubjectE", !19, i64 8}
!19 = !{!"_ZTSSt6vectorIPN10SimTKIpopt8ObserverESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !6, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!17, !17, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


; 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 constant ptr

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt10SymTMatrix14MultVectorImplEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(97) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %2, double noundef %3, ptr noundef nonnull align 8 dereferenceable(205) %4) unnamed_addr #1 align 2 {
  %6 = fcmp une double %3, 0.000000e+00
  br i1 %6, label %7, label %8

7:                                                ; preds = %5
  tail call void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205) %4, double noundef %3)
  br label %9

8:                                                ; preds = %5
  tail call void @_ZN10SimTKIpopt6Vector3SetEd(ptr noundef nonnull align 8 dereferenceable(205) %4, double noundef 0.000000e+00)
  br label %9

9:                                                ; preds = %7, %8
  %10 = tail call ptr @__dynamic_cast(ptr nonnull %2, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #7
  %11 = tail call ptr @__dynamic_cast(ptr nonnull %4, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #7
  %12 = icmp ne ptr %10, null
  %13 = icmp ne ptr %11, null
  %or.cond = select i1 %12, i1 %13, i1 false
  br i1 %or.cond, label %14, label %.loopexit

14:                                               ; preds = %9
  %15 = tail call noundef ptr @_ZNK10SimTKIpopt10SymTMatrix5IrowsEv(ptr noundef nonnull align 8 dereferenceable(97) %0)
  %16 = tail call noundef ptr @_ZNK10SimTKIpopt10SymTMatrix5JcolsEv(ptr noundef nonnull align 8 dereferenceable(97) %0)
  %17 = getelementptr inbounds i8, ptr %0, i64 88
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %11)
  %20 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  %invariant.gep72 = getelementptr i8, ptr %19, i64 -8
  br i1 %20, label %21, label %44

21:                                               ; preds = %14
  %22 = tail call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  %23 = fmul double %22, %1
  %24 = tail call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %0)
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph80, label %.loopexit

.lr.ph80:                                         ; preds = %21, %37
  %.04879 = phi ptr [ %39, %37 ], [ %15, %21 ]
  %.04978 = phi i32 [ %41, %37 ], [ 0, %21 ]
  %.05077 = phi ptr [ %40, %37 ], [ %16, %21 ]
  %.05276 = phi ptr [ %38, %37 ], [ %18, %21 ]
  %26 = load double, ptr %.05276, align 8, !tbaa !22
  %27 = load i32, ptr %.04879, align 4, !tbaa !24
  %28 = sext i32 %27 to i64
  %gep73 = getelementptr double, ptr %invariant.gep72, i64 %28
  %29 = load double, ptr %gep73, align 8, !tbaa !22
  %30 = tail call double @llvm.fmuladd.f64(double %23, double %26, double %29)
  store double %30, ptr %gep73, align 8, !tbaa !22
  %31 = load i32, ptr %.05077, align 4, !tbaa !24
  %.not60 = icmp eq i32 %27, %31
  br i1 %.not60, label %37, label %32

32:                                               ; preds = %.lr.ph80
  %33 = load double, ptr %.05276, align 8, !tbaa !22
  %34 = sext i32 %31 to i64
  %gep75 = getelementptr double, ptr %invariant.gep72, i64 %34
  %35 = load double, ptr %gep75, align 8, !tbaa !22
  %36 = tail call double @llvm.fmuladd.f64(double %23, double %33, double %35)
  store double %36, ptr %gep75, align 8, !tbaa !22
  br label %37

37:                                               ; preds = %32, %.lr.ph80
  %38 = getelementptr inbounds i8, ptr %.05276, i64 8
  %39 = getelementptr inbounds i8, ptr %.04879, i64 4
  %40 = getelementptr inbounds i8, ptr %.05077, i64 4
  %41 = add nuw nsw i32 %.04978, 1
  %42 = tail call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %0)
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %.lr.ph80, label %.loopexit, !llvm.loop !25

44:                                               ; preds = %14
  %45 = tail call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  %invariant.gep = getelementptr i8, ptr %45, i64 -8
  %46 = tail call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %0)
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %44, %63
  %.071 = phi i32 [ %67, %63 ], [ 0, %44 ]
  %.170 = phi ptr [ %65, %63 ], [ %15, %44 ]
  %.15169 = phi ptr [ %66, %63 ], [ %16, %44 ]
  %.15368 = phi ptr [ %64, %63 ], [ %18, %44 ]
  %48 = load double, ptr %.15368, align 8, !tbaa !22
  %49 = fmul double %48, %1
  %50 = load i32, ptr %.15169, align 4, !tbaa !24
  %51 = sext i32 %50 to i64
  %gep = getelementptr double, ptr %invariant.gep, i64 %51
  %52 = load double, ptr %gep, align 8, !tbaa !22
  %53 = load i32, ptr %.170, align 4, !tbaa !24
  %54 = sext i32 %53 to i64
  %gep63 = getelementptr double, ptr %invariant.gep72, i64 %54
  %55 = load double, ptr %gep63, align 8, !tbaa !22
  %56 = tail call double @llvm.fmuladd.f64(double %49, double %52, double %55)
  store double %56, ptr %gep63, align 8, !tbaa !22
  %.not = icmp eq i32 %53, %50
  br i1 %.not, label %63, label %57

57:                                               ; preds = %.lr.ph
  %58 = load double, ptr %.15368, align 8, !tbaa !22
  %59 = fmul double %58, %1
  %gep65 = getelementptr double, ptr %invariant.gep, i64 %54
  %60 = load double, ptr %gep65, align 8, !tbaa !22
  %gep67 = getelementptr double, ptr %invariant.gep72, i64 %51
  %61 = load double, ptr %gep67, align 8, !tbaa !22
  %62 = tail call double @llvm.fmuladd.f64(double %59, double %60, double %61)
  store double %62, ptr %gep67, align 8, !tbaa !22
  br label %63

63:                                               ; preds = %57, %.lr.ph
  %64 = getelementptr inbounds i8, ptr %.15368, i64 8
  %65 = getelementptr inbounds i8, ptr %.170, i64 4
  %66 = getelementptr inbounds i8, ptr %.15169, i64 4
  %67 = add nuw nsw i32 %.071, 1
  %68 = tail call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %0)
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %.lr.ph, label %.loopexit, !llvm.loop !27

.loopexit:                                        ; preds = %63, %37, %44, %21, %9
  ret void
}

declare void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205), double noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240)) local_unnamed_addr #6 align 2

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 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 = { "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 nofree nounwind willreturn memory(read) }
attributes #4 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { 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, !19, i64 88}
!6 = !{!"_ZTSN10SimTKIpopt10SymTMatrixE", !7, i64 0, !19, i64 80, !19, i64 88, !21, i64 96}
!7 = !{!"_ZTSN10SimTKIpopt9SymMatrixE", !8, i64 0, !19, i64 72}
!8 = !{!"_ZTSN10SimTKIpopt6MatrixE", !9, i64 0, !20, i64 56, !11, i64 64, !21, i64 68}
!9 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !10, i64 0, !14, i64 16, !11, i64 48, !11, i64 52}
!10 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !11, i64 8}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!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", !12, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !19, i64 0}
!21 = !{!"bool", !12, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"double", !12, i64 0}
!24 = !{!11, !11, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


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