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

; 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::SmartPtr.43" = type { ptr }
%"class.SimTKIpopt::SmartPtr.54" = type { ptr }
%"class.SimTKIpopt::CompoundMatrix" = type <{ %"class.SimTKIpopt::Matrix.base", [3 x i8], %"class.std::vector.6", %"class.std::vector.11", ptr, i8, [7 x i8] }>
%"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 }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<SimTKIpopt::Matrix>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>, std::allocator<std::vector<SimTKIpopt::SmartPtr<const SimTKIpopt::Matrix>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

declare i32 @__gxx_personality_v0(...)

; 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 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10SimTKIpopt14CompoundMatrix13MatricesValidEv(ptr noundef nonnull align 8 dereferenceable(129)) #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.43") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.54") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt14CompoundMatrix19TransMultVectorImplEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(129) %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 personality ptr @__gxx_personality_v0 {
  %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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.SimTKIpopt::SmartPtr.43", align 8
  %16 = alloca %"class.SimTKIpopt::SmartPtr.43", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.SimTKIpopt::SmartPtr.54", align 8
  %21 = alloca %"class.SimTKIpopt::SmartPtr.54", align 8
  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
  %22 = load ptr, ptr %6, align 8
  %23 = getelementptr inbounds %"class.SimTKIpopt::CompoundMatrix", ptr %22, i32 0, i32 5
  %24 = load i8, ptr %23, align 8, !tbaa !11, !range !32, !noundef !33
  %25 = trunc i8 %24 to i1
  br i1 %25, label %30, label %26

26:                                               ; preds = %5
  %27 = call noundef zeroext i1 @_ZNK10SimTKIpopt14CompoundMatrix13MatricesValidEv(ptr noundef nonnull align 8 dereferenceable(129) %22)
  %28 = getelementptr inbounds %"class.SimTKIpopt::CompoundMatrix", ptr %22, i32 0, i32 5
  %29 = zext i1 %27 to i8
  store i8 %29, ptr %28, align 8, !tbaa !11
  br label %30

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

33:                                               ; preds = %30
  %34 = call ptr @__dynamic_cast(ptr %31, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #6
  br label %36

35:                                               ; preds = %30
  br label %36

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

40:                                               ; preds = %36
  %41 = call ptr @__dynamic_cast(ptr %38, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #6
  br label %43

42:                                               ; preds = %36
  br label %43

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

47:                                               ; preds = %43
  br label %49

48:                                               ; preds = %43
  br label %49

49:                                               ; preds = %48, %47
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %49
  br label %54

53:                                               ; preds = %49
  br label %54

54:                                               ; preds = %53, %52
  %55 = load double, ptr %9, align 8, !tbaa !9
  %56 = fcmp une double %55, 0.000000e+00
  br i1 %56, label %57, label %60

57:                                               ; preds = %54
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load double, ptr %9, align 8, !tbaa !9
  call void @_ZN10SimTKIpopt6Vector4ScalEd(ptr noundef nonnull align 8 dereferenceable(205) %58, double noundef %59)
  br label %62

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

62:                                               ; preds = %60, %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !34
  br label %63

63:                                               ; preds = %175, %62
  %64 = load i32, ptr %13, align 4, !tbaa !34
  %65 = call noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129) %22)
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %179

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15)
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %86

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !34
  invoke void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.43") align 8 %16, ptr noundef nonnull align 8 dereferenceable(265) %72, i32 noundef %73)
          to label %74 unwind label %77

74:                                               ; preds = %71
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %76 unwind label %81

76:                                               ; preds = %74
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %94

77:                                               ; preds = %71
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %17, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %18, align 4
  br label %85

81:                                               ; preds = %74
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %17, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %18, align 4
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  br label %85

85:                                               ; preds = %81, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %178

86:                                               ; preds = %68
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %87)
          to label %89 unwind label %90

89:                                               ; preds = %86
  br label %94

90:                                               ; preds = %86
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %17, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %18, align 4
  br label %178

94:                                               ; preds = %89, %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !34
  br label %95

95:                                               ; preds = %170, %94
  %96 = load i32, ptr %19, align 4, !tbaa !34
  %97 = invoke noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_RowsEv(ptr noundef nonnull align 8 dereferenceable(129) %22)
          to label %98 unwind label %101

98:                                               ; preds = %95
  %99 = icmp slt i32 %96, %97
  br i1 %99, label %105, label %100

100:                                              ; preds = %98
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %174

101:                                              ; preds = %119, %114, %105, %95
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %17, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %18, align 4
  br label %173

105:                                              ; preds = %98
  %106 = getelementptr inbounds %"class.SimTKIpopt::CompoundMatrix", ptr %22, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !35
  %108 = invoke noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %107)
          to label %109 unwind label %101

109:                                              ; preds = %105
  br i1 %108, label %110, label %114

110:                                              ; preds = %109
  %111 = load i32, ptr %13, align 4, !tbaa !34
  %112 = load i32, ptr %19, align 4, !tbaa !34
  %113 = icmp eq i32 %111, %112
  br i1 %113, label %125, label %114

114:                                              ; preds = %110, %109
  %115 = getelementptr inbounds %"class.SimTKIpopt::CompoundMatrix", ptr %22, i32 0, i32 4
  %116 = load ptr, ptr %115, align 8, !tbaa !35
  %117 = invoke noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %116)
          to label %118 unwind label %101

118:                                              ; preds = %114
  br i1 %117, label %169, label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %19, align 4, !tbaa !34
  %121 = load i32, ptr %13, align 4, !tbaa !34
  %122 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %22, i32 noundef %120, i32 noundef %121)
          to label %123 unwind label %101

123:                                              ; preds = %119
  %124 = icmp ne ptr %122, null
  br i1 %124, label %125, label %169

125:                                              ; preds = %123, %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  invoke void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %126 unwind label %135

126:                                              ; preds = %125
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %148

129:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = load i32, ptr %19, align 4, !tbaa !34
  invoke void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.54") align 8 %21, ptr noundef nonnull align 8 dereferenceable(265) %130, i32 noundef %131)
          to label %132 unwind label %139

132:                                              ; preds = %129
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %134 unwind label %143

134:                                              ; preds = %132
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %156

135:                                              ; preds = %125
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %17, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %18, align 4
  br label %168

139:                                              ; preds = %129
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %17, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %18, align 4
  br label %147

143:                                              ; preds = %132
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %17, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %18, align 4
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  br label %147

147:                                              ; preds = %143, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %167

148:                                              ; preds = %126
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef %149)
          to label %151 unwind label %152

151:                                              ; preds = %148
  br label %156

152:                                              ; preds = %165, %163, %160, %156, %148
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %17, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %18, align 4
  br label %167

156:                                              ; preds = %151, %134
  %157 = load i32, ptr %19, align 4, !tbaa !34
  %158 = load i32, ptr %13, align 4, !tbaa !34
  %159 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %22, i32 noundef %157, i32 noundef %158)
          to label %160 unwind label %152

160:                                              ; preds = %156
  %161 = load double, ptr %7, align 8, !tbaa !9
  %162 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %163 unwind label %152

163:                                              ; preds = %160
  %164 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %165 unwind label %152

165:                                              ; preds = %163
  invoke void @_ZNK10SimTKIpopt6Matrix15TransMultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69) %159, double noundef %161, ptr noundef nonnull align 8 dereferenceable(205) %162, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %164)
          to label %166 unwind label %152

166:                                              ; preds = %165
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %169

167:                                              ; preds = %152, %147
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  br label %168

168:                                              ; preds = %167, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %173

169:                                              ; preds = %166, %123, %118
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %19, align 4, !tbaa !34
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %19, align 4, !tbaa !34
  br label %95, !llvm.loop !36

173:                                              ; preds = %168, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %178

174:                                              ; preds = %100
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %13, align 4, !tbaa !34
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %13, align 4, !tbaa !34
  br label %63, !llvm.loop !38

178:                                              ; preds = %173, %90, %85
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %180

179:                                              ; preds = %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  ret void

180:                                              ; preds = %178
  %181 = load ptr, ptr %17, align 8
  %182 = load i32, ptr %18, align 4
  %183 = insertvalue { ptr, i32 } poison, ptr %181, 0
  %184 = insertvalue { ptr, i32 } %183, i32 %182, 1
  resume { ptr, i32 } %184
}

declare void @_ZNK10SimTKIpopt6Matrix15TransMultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69), double noundef, ptr noundef nonnull align 8 dereferenceable(205), double noundef, ptr noundef nonnull align 8 dereferenceable(205)) #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 = { 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 = { nounwind willreturn memory(read) }
attributes #4 = { "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 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 }

!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, !23, i64 128}
!12 = !{!"_ZTSN10SimTKIpopt14CompoundMatrixE", !13, i64 0, !24, i64 72, !28, i64 96, !6, i64 120, !23, i64 128}
!13 = !{!"_ZTSN10SimTKIpopt6MatrixE", !14, i64 0, !22, i64 56, !16, i64 64, !23, i64 68}
!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_11MatrixSpaceEEE", !6, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSSt6vectorIS_IN10SimTKIpopt8SmartPtrINS0_6MatrixEEESaIS3_EESaIS5_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrINS1_6MatrixEEESaIS4_EESaIS6_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrINS1_6MatrixEEESaIS4_EESaIS6_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrINS1_6MatrixEEESaIS4_EESaIS6_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTSSt6vectorIS_IN10SimTKIpopt8SmartPtrIKNS0_6MatrixEEESaIS4_EESaIS6_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrIKNS1_6MatrixEEESaIS5_EESaIS7_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrIKNS1_6MatrixEEESaIS5_EESaIS7_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrIKNS1_6MatrixEEESaIS5_EESaIS7_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!16, !16, i64 0}
!35 = !{!12, !6, i64 120}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}


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

%"class.SimTKIpopt::SmartPtr.43" = type { ptr }
%"class.SimTKIpopt::SmartPtr.54" = type { ptr }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress 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 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10SimTKIpopt14CompoundMatrix13MatricesValidEv(ptr noundef nonnull align 8 dereferenceable(129)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.43") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.54") align 8, ptr noundef nonnull align 8 dereferenceable(265), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt14CompoundMatrix19TransMultVectorImplEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(129) %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 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.SimTKIpopt::SmartPtr.43", align 8
  %7 = alloca %"class.SimTKIpopt::SmartPtr.43", align 8
  %8 = alloca %"class.SimTKIpopt::SmartPtr.54", align 8
  %9 = alloca %"class.SimTKIpopt::SmartPtr.54", align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 128
  %11 = load i8, ptr %10, align 8, !tbaa !5, !range !29, !noundef !30
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %16, label %13

13:                                               ; preds = %5
  %14 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt14CompoundMatrix13MatricesValidEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
  %15 = zext i1 %14 to i8
  store i8 %15, ptr %10, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %5, %13
  %17 = tail call ptr @__dynamic_cast(ptr nonnull %2, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #6
  %.fr = freeze ptr %17
  %18 = tail call ptr @__dynamic_cast(ptr nonnull %4, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt14CompoundVectorE, i64 0) #6
  %19 = fcmp une double %3, 0.000000e+00
  br i1 %19, label %20, label %21

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

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

22:                                               ; preds = %21, %20
  %23 = tail call noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %22
  %.not = icmp eq ptr %18, null
  %25 = getelementptr inbounds i8, ptr %0, i64 120
  %.not40 = icmp eq ptr %.fr, null
  br i1 %.not40, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.split50.us.us
  %.03454.us = phi i32 [ %55, %.split50.us.us ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  br i1 %.not, label %30, label %26

26:                                               ; preds = %.lr.ph.split.us
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  invoke void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.43") align 8 %7, ptr noundef nonnull align 8 dereferenceable(265) %18, i32 noundef %.03454.us)
          to label %27 unwind label %.split56.us

27:                                               ; preds = %26
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %29 unwind label %.split59.us

29:                                               ; preds = %27
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %.split.us.us.preheader

30:                                               ; preds = %.lr.ph.split.us
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %4)
          to label %.split.us.us.preheader unwind label %.split62.us

.split.us.us.preheader:                           ; preds = %30, %29
  br label %.split.us.us

.split.us.us:                                     ; preds = %.split.us.us.preheader, %53
  %.0.us.us = phi i32 [ %54, %53 ], [ 0, %.split.us.us.preheader ]
  %32 = invoke noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_RowsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
          to label %33 unwind label %.split48.us.split.us

33:                                               ; preds = %.split.us.us
  %34 = icmp slt i32 %.0.us.us, %32
  br i1 %34, label %35, label %.split50.us.us

35:                                               ; preds = %33
  %36 = load ptr, ptr %25, align 8, !tbaa !31
  %37 = call noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %36)
  %38 = icmp eq i32 %.03454.us, %.0.us.us
  %or.cond.us.us = select i1 %37, i1 %38, i1 false
  br i1 %or.cond.us.us, label %45, label %39

39:                                               ; preds = %35
  %40 = load ptr, ptr %25, align 8, !tbaa !31
  %41 = call noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %40)
  br i1 %41, label %53, label %42

42:                                               ; preds = %39
  %43 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %0, i32 noundef %.0.us.us, i32 noundef %.03454.us)
          to label %44 unwind label %.split48.us.split.us

44:                                               ; preds = %42
  %.not39.us.us = icmp eq ptr %43, null
  br i1 %.not39.us.us, label %53, label %45

45:                                               ; preds = %44, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull %2)
          to label %47 unwind label %.split52.us.split.us

47:                                               ; preds = %45
  %48 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %0, i32 noundef %.0.us.us, i32 noundef %.03454.us)
          to label %49 unwind label %.split52.us.split.us

49:                                               ; preds = %47
  %50 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %51 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNK10SimTKIpopt6Matrix15TransMultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69) %48, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %50, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %51)
          to label %52 unwind label %.split52.us.split.us

52:                                               ; preds = %49
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %53

53:                                               ; preds = %52, %44, %39
  %54 = add nuw nsw i32 %.0.us.us, 1
  br label %.split.us.us, !llvm.loop !32

.split50.us.us:                                   ; preds = %33
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %55 = add nuw nsw i32 %.03454.us, 1
  %56 = call noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !34

.split56.us:                                      ; preds = %26
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %70

.split59.us:                                      ; preds = %27
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %69

.split62.us:                                      ; preds = %30
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %109

.split48.us.split.us:                             ; preds = %42, %.split.us.us
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %109

.split52.us.split.us:                             ; preds = %49, %47, %45
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %106

._crit_edge:                                      ; preds = %.split50, %.split50.us.us, %22
  ret void

.lr.ph.split:                                     ; preds = %.lr.ph, %.split50
  %.03454 = phi i32 [ %77, %.split50 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  br i1 %.not, label %71, label %63

63:                                               ; preds = %.lr.ph.split
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  invoke void @_ZN10SimTKIpopt14CompoundVector15GetCompNonConstEi(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.43") align 8 %7, ptr noundef nonnull align 8 dereferenceable(265) %18, i32 noundef %.03454)
          to label %64 unwind label %.split56

64:                                               ; preds = %63
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %66 unwind label %.split59

66:                                               ; preds = %64
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %.split.preheader

.split.preheader:                                 ; preds = %71, %66
  br label %.split

.split56:                                         ; preds = %63
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %70

.split59:                                         ; preds = %64
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %69

69:                                               ; preds = %.split59.us, %.split59
  %.us-phi60 = phi { ptr, i32 } [ %68, %.split59 ], [ %59, %.split59.us ]
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br label %70

70:                                               ; preds = %.split56, %.split56.us, %69
  %.pn = phi { ptr, i32 } [ %.us-phi60, %69 ], [ %67, %.split56 ], [ %58, %.split56.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %109

71:                                               ; preds = %.lr.ph.split
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %4)
          to label %.split.preheader unwind label %.split62

.split62:                                         ; preds = %71
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %109

.split:                                           ; preds = %.split.preheader, %107
  %.0 = phi i32 [ %108, %107 ], [ 0, %.split.preheader ]
  %74 = invoke noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_RowsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
          to label %75 unwind label %.split48

75:                                               ; preds = %.split
  %76 = icmp slt i32 %.0, %74
  br i1 %76, label %81, label %.split50

.split50:                                         ; preds = %75
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %77 = add nuw nsw i32 %.03454, 1
  %78 = call noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %.lr.ph.split, label %._crit_edge, !llvm.loop !34

.split48:                                         ; preds = %88, %.split
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %109

81:                                               ; preds = %75
  %82 = load ptr, ptr %25, align 8, !tbaa !31
  %83 = call noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %82)
  %84 = icmp eq i32 %.03454, %.0
  %or.cond = select i1 %83, i1 %84, i1 false
  br i1 %or.cond, label %91, label %85

85:                                               ; preds = %81
  %86 = load ptr, ptr %25, align 8, !tbaa !31
  %87 = call noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %86)
  br i1 %87, label %107, label %88

88:                                               ; preds = %85
  %89 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %0, i32 noundef %.0, i32 noundef %.03454)
          to label %90 unwind label %.split48

90:                                               ; preds = %88
  %.not39 = icmp eq ptr %89, null
  br i1 %.not39, label %107, label %91

91:                                               ; preds = %81, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  invoke void @_ZNK10SimTKIpopt14CompoundVector7GetCompEi(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.54") align 8 %9, ptr noundef nonnull align 8 dereferenceable(265) %.fr, i32 noundef %.0)
          to label %92 unwind label %96

92:                                               ; preds = %91
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %94 unwind label %98

94:                                               ; preds = %92
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %95 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %0, i32 noundef %.0, i32 noundef %.03454)
          to label %102 unwind label %.split52

96:                                               ; preds = %91
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %100

98:                                               ; preds = %92
  %99 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br label %100

100:                                              ; preds = %98, %96
  %.pn41 = phi { ptr, i32 } [ %99, %98 ], [ %97, %96 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %106

.split52:                                         ; preds = %102, %94
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %106

102:                                              ; preds = %94
  %103 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %104 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNK10SimTKIpopt6Matrix15TransMultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69) %95, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %103, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %104)
          to label %105 unwind label %.split52

105:                                              ; preds = %102
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %107

106:                                              ; preds = %.split52, %.split52.us.split.us, %100
  %.pn43 = phi { ptr, i32 } [ %.pn41, %100 ], [ %101, %.split52 ], [ %62, %.split52.us.split.us ]
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %109

107:                                              ; preds = %85, %90, %105
  %108 = add nuw nsw i32 %.0, 1
  br label %.split, !llvm.loop !32

109:                                              ; preds = %.split48, %.split48.us.split.us, %.split62, %.split62.us, %106, %70
  %.pn43.pn.pn = phi { ptr, i32 } [ %.pn, %70 ], [ %.pn43, %106 ], [ %73, %.split62 ], [ %60, %.split62.us ], [ %80, %.split48 ], [ %61, %.split48.us.split.us ]
  call void @_ZN10SimTKIpopt8SmartPtrINS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  resume { ptr, i32 } %.pn43.pn.pn
}

declare void @_ZNK10SimTKIpopt6Matrix15TransMultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69), double noundef, ptr noundef nonnull align 8 dereferenceable(205), double noundef, ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #4

attributes #0 = { mustprogress 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 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #4 = { "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 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 }

!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, !20, i64 128}
!6 = !{!"_ZTSN10SimTKIpopt14CompoundMatrixE", !7, i64 0, !21, i64 72, !25, i64 96, !18, i64 120, !20, i64 128}
!7 = !{!"_ZTSN10SimTKIpopt6MatrixE", !8, i64 0, !19, i64 56, !10, i64 64, !20, i64 68}
!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_11MatrixSpaceEEE", !18, i64 0}
!20 = !{!"bool", !11, i64 0}
!21 = !{!"_ZTSSt6vectorIS_IN10SimTKIpopt8SmartPtrINS0_6MatrixEEESaIS3_EESaIS5_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrINS1_6MatrixEEESaIS4_EESaIS6_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrINS1_6MatrixEEESaIS4_EESaIS6_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrINS1_6MatrixEEESaIS4_EESaIS6_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!25 = !{!"_ZTSSt6vectorIS_IN10SimTKIpopt8SmartPtrIKNS0_6MatrixEEESaIS4_EESaIS6_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrIKNS1_6MatrixEEESaIS5_EESaIS7_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrIKNS1_6MatrixEEESaIS5_EESaIS7_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN10SimTKIpopt8SmartPtrIKNS1_6MatrixEEESaIS5_EESaIS7_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!6, !18, i64 120}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


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