; 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
define dso_local void @_ZNK10SimTKIpopt14CompoundMatrix14MultVectorImplEdRKNS_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 %11, 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 %12, 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 = %180, %62
  %64 = load i32, ptr %13, align 4, !tbaa !34
  %65 = call noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_RowsEv(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 %184

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 %183

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 %183

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 = %175, %94
  %96 = load i32, ptr %19, align 4, !tbaa !34
  %97 = invoke noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(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 %179

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 %178

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 %174, label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %13, align 4, !tbaa !34
  %121 = load i32, ptr %19, 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 %174

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 %161

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 %173

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 %172

148:                                              ; preds = %126
  %149 = invoke noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129) %22)
          to label %150 unwind label %156

150:                                              ; preds = %148
  %151 = icmp eq i32 %149, 1
  br i1 %151, label %152, label %160

152:                                              ; preds = %150
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef %153)
          to label %155 unwind label %156

155:                                              ; preds = %152
  br label %160

156:                                              ; preds = %170, %168, %165, %161, %152, %148
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %17, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %18, align 4
  br label %172

160:                                              ; preds = %155, %150
  br label %161

161:                                              ; preds = %160, %134
  %162 = load i32, ptr %13, align 4, !tbaa !34
  %163 = load i32, ptr %19, align 4, !tbaa !34
  %164 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %22, i32 noundef %162, i32 noundef %163)
          to label %165 unwind label %156

165:                                              ; preds = %161
  %166 = load double, ptr %7, align 8, !tbaa !9
  %167 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %168 unwind label %156

168:                                              ; preds = %165
  %169 = invoke noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %170 unwind label %156

170:                                              ; preds = %168
  invoke void @_ZNK10SimTKIpopt6Matrix10MultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69) %164, double noundef %166, ptr noundef nonnull align 8 dereferenceable(205) %167, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %169)
          to label %171 unwind label %156

171:                                              ; preds = %170
  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 %174

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

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

174:                                              ; preds = %171, %123, %118
  br label %175

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

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

179:                                              ; 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 %180

180:                                              ; preds = %179
  %181 = load i32, ptr %13, align 4, !tbaa !34
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %13, align 4, !tbaa !34
  br label %63, !llvm.loop !38

183:                                              ; preds = %178, %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 %185

184:                                              ; 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

185:                                              ; preds = %183
  %186 = load ptr, ptr %17, align 8
  %187 = load i32, ptr %18, align 4
  %188 = insertvalue { ptr, i32 } poison, ptr %186, 0
  %189 = insertvalue { ptr, i32 } %188, i32 %187, 1
  resume { ptr, i32 } %189
}

; 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

declare void @_ZNK10SimTKIpopt6Matrix10MultVectorEdRKNS_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

; 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

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
define dso_local void @_ZNK10SimTKIpopt14CompoundMatrix14MultVectorImplEdRKNS_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_RowsEv(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 [ %59, %.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, %57
  %.0.us.us = phi i32 [ %58, %57 ], [ 0, %.split.us.us.preheader ]
  %32 = invoke noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(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 %57, label %42

42:                                               ; preds = %39
  %43 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %0, i32 noundef %.03454.us, i32 noundef %.0.us.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 %57, 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 i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
          to label %47 unwind label %.split52.us.split.us

47:                                               ; preds = %45
  %48 = icmp eq i32 %46, 1
  br i1 %48, label %49, label %51

49:                                               ; preds = %47
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull %2)
          to label %51 unwind label %.split52.us.split.us

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

53:                                               ; preds = %51
  %54 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %55 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNK10SimTKIpopt6Matrix10MultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69) %52, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %54, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %55)
          to label %56 unwind label %.split52.us.split.us

56:                                               ; preds = %53
  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 %57

57:                                               ; preds = %56, %44, %39
  %58 = 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
  %59 = add nuw nsw i32 %.03454.us, 1
  %60 = call noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_RowsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !34

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

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

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

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

.split52.us.split.us:                             ; preds = %53, %51, %49, %45
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %110

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

.lr.ph.split:                                     ; preds = %.lr.ph, %.split50
  %.03454 = phi i32 [ %81, %.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 %75, label %67

67:                                               ; 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 %68 unwind label %.split56

68:                                               ; preds = %67
  %69 = 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 %70 unwind label %.split59

70:                                               ; preds = %68
  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 = %75, %70
  br label %.split

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

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

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

74:                                               ; preds = %.split56, %.split56.us, %73
  %.pn = phi { ptr, i32 } [ %.us-phi60, %73 ], [ %71, %.split56 ], [ %62, %.split56.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %113

75:                                               ; preds = %.lr.ph.split
  %76 = 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 = %75
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %113

.split:                                           ; preds = %.split.preheader, %111
  %.0 = phi i32 [ %112, %111 ], [ 0, %.split.preheader ]
  %78 = invoke noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_ColsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
          to label %79 unwind label %.split48

79:                                               ; preds = %.split
  %80 = icmp slt i32 %.0, %78
  br i1 %80, label %85, label %.split50

.split50:                                         ; preds = %79
  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
  %81 = add nuw nsw i32 %.03454, 1
  %82 = call noundef i32 @_ZNK10SimTKIpopt14CompoundMatrix11NComps_RowsEv(ptr noundef nonnull align 8 dereferenceable(129) %0)
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %.lr.ph.split, label %._crit_edge, !llvm.loop !34

.split48:                                         ; preds = %92, %.split
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %113

85:                                               ; preds = %79
  %86 = load ptr, ptr %25, align 8, !tbaa !31
  %87 = call noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %86)
  %88 = icmp eq i32 %.03454, %.0
  %or.cond = select i1 %87, i1 %88, i1 false
  br i1 %or.cond, label %95, label %89

89:                                               ; preds = %85
  %90 = load ptr, ptr %25, align 8, !tbaa !31
  %91 = call noundef zeroext i1 @_ZNK10SimTKIpopt19CompoundMatrixSpace8DiagonalEv(ptr noundef nonnull align 8 dereferenceable(129) %90)
  br i1 %91, label %111, label %92

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

94:                                               ; preds = %92
  %.not39 = icmp eq ptr %93, null
  br i1 %.not39, label %111, label %95

95:                                               ; preds = %85, %94
  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 %96 unwind label %100

96:                                               ; preds = %95
  %97 = 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 %98 unwind label %102

98:                                               ; preds = %96
  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
  %99 = invoke noundef ptr @_ZNK10SimTKIpopt14CompoundMatrix9ConstCompEii(ptr noundef nonnull align 8 dereferenceable(129) %0, i32 noundef %.03454, i32 noundef %.0)
          to label %106 unwind label %.split52

100:                                              ; preds = %95
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %96
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br label %104

104:                                              ; preds = %102, %100
  %.pn41 = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %110

.split52:                                         ; preds = %106, %98
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %110

106:                                              ; preds = %98
  %107 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %108 = call noundef nonnull align 8 dereferenceable(205) ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNK10SimTKIpopt6Matrix10MultVectorEdRKNS_6VectorEdRS1_(ptr noundef nonnull align 8 dereferenceable(69) %99, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %107, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(205) %108)
          to label %109 unwind label %.split52

109:                                              ; preds = %106
  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 %111

110:                                              ; preds = %.split52, %.split52.us.split.us, %104
  %.pn43 = phi { ptr, i32 } [ %.pn41, %104 ], [ %105, %.split52 ], [ %66, %.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 %113

111:                                              ; preds = %89, %94, %109
  %112 = add nuw nsw i32 %.0, 1
  br label %.split, !llvm.loop !32

113:                                              ; preds = %.split48, %.split48.us.split.us, %.split62, %.split62.us, %110, %74
  %.pn43.pn.pn = phi { ptr, i32 } [ %.pn, %74 ], [ %.pn43, %110 ], [ %77, %.split62 ], [ %64, %.split62.us ], [ %84, %.split48 ], [ %65, %.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
}

; 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

declare void @_ZNK10SimTKIpopt6Matrix10MultVectorEdRKNS_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

; 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

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