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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt15ExpansionMatrix18SinvBlrmZMTdBrImplEdRKNS_6VectorES3_S3_S3_RS1_(ptr noundef nonnull align 8 dereferenceable(80) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %2, ptr noundef nonnull align 8 dereferenceable(205) %3, ptr noundef nonnull align 8 dereferenceable(205) %4, ptr noundef nonnull align 8 dereferenceable(205) %5, ptr noundef nonnull align 8 dereferenceable(205) %6) unnamed_addr #6 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca double, align 8
  %35 = alloca i32, align 4
  %36 = alloca ptr, align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store double %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %45, label %43

43:                                               ; preds = %7
  %44 = call ptr @__dynamic_cast(ptr %41, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %46

45:                                               ; preds = %7
  br label %46

46:                                               ; preds = %45, %43
  %47 = phi ptr [ %44, %43 ], [ null, %45 ]
  store ptr %47, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = icmp eq ptr %48, null
  br i1 %49, label %52, label %50

50:                                               ; preds = %46
  %51 = call ptr @__dynamic_cast(ptr %48, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %53

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52, %50
  %54 = phi ptr [ %51, %50 ], [ null, %52 ]
  store ptr %54, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = icmp eq ptr %55, null
  br i1 %56, label %59, label %57

57:                                               ; preds = %53
  %58 = call ptr @__dynamic_cast(ptr %55, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %60

59:                                               ; preds = %53
  br label %60

60:                                               ; preds = %59, %57
  %61 = phi ptr [ %58, %57 ], [ null, %59 ]
  store ptr %61, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = icmp eq ptr %62, null
  br i1 %63, label %66, label %64

64:                                               ; preds = %60
  %65 = call ptr @__dynamic_cast(ptr %62, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %67

66:                                               ; preds = %60
  br label %67

67:                                               ; preds = %66, %64
  %68 = phi ptr [ %65, %64 ], [ null, %66 ]
  store ptr %68, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = icmp eq ptr %69, null
  br i1 %70, label %73, label %71

71:                                               ; preds = %67
  %72 = call ptr @__dynamic_cast(ptr %69, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %74

73:                                               ; preds = %67
  br label %74

74:                                               ; preds = %73, %71
  %75 = phi ptr [ %72, %71 ], [ null, %73 ]
  store ptr %75, ptr %19, align 8, !tbaa !5
  %76 = load ptr, ptr %15, align 8, !tbaa !5
  %77 = call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %76)
  br i1 %77, label %81, label %78

78:                                               ; preds = %74
  %79 = load ptr, ptr %18, align 8, !tbaa !5
  %80 = call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %79)
  br i1 %80, label %81, label %88

81:                                               ; preds = %78, %74
  %82 = load double, ptr %9, align 8, !tbaa !9
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZNK10SimTKIpopt6Matrix18SinvBlrmZMTdBrImplEdRKNS_6VectorES3_S3_S3_RS1_(ptr noundef nonnull align 8 dereferenceable(69) %40, double noundef %82, ptr noundef nonnull align 8 dereferenceable(205) %83, ptr noundef nonnull align 8 dereferenceable(205) %84, ptr noundef nonnull align 8 dereferenceable(205) %85, ptr noundef nonnull align 8 dereferenceable(205) %86, ptr noundef nonnull align 8 dereferenceable(205) %87)
  store i32 1, ptr %20, align 4
  br label %475

88:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %89 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %40)
  store ptr %89, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %90 = load ptr, ptr %15, align 8, !tbaa !5
  %91 = call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %90)
  store ptr %91, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %92 = load ptr, ptr %18, align 8, !tbaa !5
  %93 = call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %92)
  store ptr %93, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %94 = load ptr, ptr %19, align 8, !tbaa !5
  %95 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %94)
  store ptr %95, ptr %24, align 8, !tbaa !5
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %96)
  br i1 %97, label %98, label %291

98:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %99 = load ptr, ptr %16, align 8, !tbaa !5
  %100 = call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %99)
  store double %100, ptr %25, align 8, !tbaa !9
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  %102 = call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %101)
  br i1 %102, label %103, label %166

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %104 = load double, ptr %9, align 8, !tbaa !9
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %105)
  %107 = fmul double %104, %106
  store double %107, ptr %26, align 8, !tbaa !9
  %108 = load double, ptr %26, align 8, !tbaa !9
  %109 = fcmp oeq double %108, 0.000000e+00
  br i1 %109, label %110, label %132

110:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !11
  br label %111

111:                                              ; preds = %128, %110
  %112 = load i32, ptr %27, align 4, !tbaa !11
  %113 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 2, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %131

116:                                              ; preds = %111
  %117 = load double, ptr %25, align 8, !tbaa !9
  %118 = load ptr, ptr %22, align 8, !tbaa !5
  %119 = load i32, ptr %27, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %118, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !9
  %123 = fdiv double %117, %122
  %124 = load ptr, ptr %24, align 8, !tbaa !5
  %125 = load i32, ptr %27, align 4, !tbaa !11
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds double, ptr %124, i64 %126
  store double %123, ptr %127, align 8, !tbaa !9
  br label %128

128:                                              ; preds = %116
  %129 = load i32, ptr %27, align 4, !tbaa !11
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %27, align 4, !tbaa !11
  br label %111, !llvm.loop !13

131:                                              ; preds = %115
  br label %165

132:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %133

133:                                              ; preds = %161, %132
  %134 = load i32, ptr %28, align 4, !tbaa !11
  %135 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %164

138:                                              ; preds = %133
  %139 = load double, ptr %25, align 8, !tbaa !9
  %140 = load double, ptr %26, align 8, !tbaa !9
  %141 = load ptr, ptr %23, align 8, !tbaa !5
  %142 = load ptr, ptr %21, align 8, !tbaa !5
  %143 = load i32, ptr %28, align 4, !tbaa !11
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !11
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds double, ptr %141, i64 %147
  %149 = load double, ptr %148, align 8, !tbaa !9
  %150 = call double @llvm.fmuladd.f64(double %140, double %149, double %139)
  %151 = load ptr, ptr %22, align 8, !tbaa !5
  %152 = load i32, ptr %28, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds double, ptr %151, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !9
  %156 = fdiv double %150, %155
  %157 = load ptr, ptr %24, align 8, !tbaa !5
  %158 = load i32, ptr %28, align 4, !tbaa !11
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds double, ptr %157, i64 %159
  store double %156, ptr %160, align 8, !tbaa !9
  br label %161

161:                                              ; preds = %138
  %162 = load i32, ptr %28, align 4, !tbaa !11
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %28, align 4, !tbaa !11
  br label %133, !llvm.loop !15

164:                                              ; preds = %137
  br label %165

165:                                              ; preds = %164, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %290

166:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %167 = load ptr, ptr %17, align 8, !tbaa !5
  %168 = call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %167)
  store ptr %168, ptr %29, align 8, !tbaa !5
  %169 = load double, ptr %9, align 8, !tbaa !9
  %170 = fcmp oeq double %169, 1.000000e+00
  br i1 %170, label %171, label %208

171:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 0, ptr %30, align 4, !tbaa !11
  br label %172

172:                                              ; preds = %204, %171
  %173 = load i32, ptr %30, align 4, !tbaa !11
  %174 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %175 = icmp slt i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %207

177:                                              ; preds = %172
  %178 = load double, ptr %25, align 8, !tbaa !9
  %179 = load ptr, ptr %29, align 8, !tbaa !5
  %180 = load i32, ptr %30, align 4, !tbaa !11
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds double, ptr %179, i64 %181
  %183 = load double, ptr %182, align 8, !tbaa !9
  %184 = load ptr, ptr %23, align 8, !tbaa !5
  %185 = load ptr, ptr %21, align 8, !tbaa !5
  %186 = load i32, ptr %30, align 4, !tbaa !11
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds i32, ptr %185, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !11
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %184, i64 %190
  %192 = load double, ptr %191, align 8, !tbaa !9
  %193 = call double @llvm.fmuladd.f64(double %183, double %192, double %178)
  %194 = load ptr, ptr %22, align 8, !tbaa !5
  %195 = load i32, ptr %30, align 4, !tbaa !11
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds double, ptr %194, i64 %196
  %198 = load double, ptr %197, align 8, !tbaa !9
  %199 = fdiv double %193, %198
  %200 = load ptr, ptr %24, align 8, !tbaa !5
  %201 = load i32, ptr %30, align 4, !tbaa !11
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds double, ptr %200, i64 %202
  store double %199, ptr %203, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %177
  %205 = load i32, ptr %30, align 4, !tbaa !11
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %30, align 4, !tbaa !11
  br label %172, !llvm.loop !16

207:                                              ; preds = %176
  br label %289

208:                                              ; preds = %166
  %209 = load double, ptr %9, align 8, !tbaa !9
  %210 = fcmp oeq double %209, -1.000000e+00
  br i1 %210, label %211, label %249

211:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  store i32 0, ptr %31, align 4, !tbaa !11
  br label %212

212:                                              ; preds = %245, %211
  %213 = load i32, ptr %31, align 4, !tbaa !11
  %214 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %215 = icmp slt i32 %213, %214
  br i1 %215, label %217, label %216

216:                                              ; preds = %212
  store i32 11, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %248

217:                                              ; preds = %212
  %218 = load double, ptr %25, align 8, !tbaa !9
  %219 = load ptr, ptr %29, align 8, !tbaa !5
  %220 = load i32, ptr %31, align 4, !tbaa !11
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds double, ptr %219, i64 %221
  %223 = load double, ptr %222, align 8, !tbaa !9
  %224 = load ptr, ptr %23, align 8, !tbaa !5
  %225 = load ptr, ptr %21, align 8, !tbaa !5
  %226 = load i32, ptr %31, align 4, !tbaa !11
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds i32, ptr %225, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !11
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds double, ptr %224, i64 %230
  %232 = load double, ptr %231, align 8, !tbaa !9
  %233 = fneg double %223
  %234 = call double @llvm.fmuladd.f64(double %233, double %232, double %218)
  %235 = load ptr, ptr %22, align 8, !tbaa !5
  %236 = load i32, ptr %31, align 4, !tbaa !11
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds double, ptr %235, i64 %237
  %239 = load double, ptr %238, align 8, !tbaa !9
  %240 = fdiv double %234, %239
  %241 = load ptr, ptr %24, align 8, !tbaa !5
  %242 = load i32, ptr %31, align 4, !tbaa !11
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds double, ptr %241, i64 %243
  store double %240, ptr %244, align 8, !tbaa !9
  br label %245

245:                                              ; preds = %217
  %246 = load i32, ptr %31, align 4, !tbaa !11
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %31, align 4, !tbaa !11
  br label %212, !llvm.loop !17

248:                                              ; preds = %216
  br label %288

249:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  store i32 0, ptr %32, align 4, !tbaa !11
  br label %250

250:                                              ; preds = %284, %249
  %251 = load i32, ptr %32, align 4, !tbaa !11
  %252 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %253 = icmp slt i32 %251, %252
  br i1 %253, label %255, label %254

254:                                              ; preds = %250
  store i32 14, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %287

255:                                              ; preds = %250
  %256 = load double, ptr %25, align 8, !tbaa !9
  %257 = load double, ptr %9, align 8, !tbaa !9
  %258 = load ptr, ptr %29, align 8, !tbaa !5
  %259 = load i32, ptr %32, align 4, !tbaa !11
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds double, ptr %258, i64 %260
  %262 = load double, ptr %261, align 8, !tbaa !9
  %263 = fmul double %257, %262
  %264 = load ptr, ptr %23, align 8, !tbaa !5
  %265 = load ptr, ptr %21, align 8, !tbaa !5
  %266 = load i32, ptr %32, align 4, !tbaa !11
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds i32, ptr %265, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !11
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds double, ptr %264, i64 %270
  %272 = load double, ptr %271, align 8, !tbaa !9
  %273 = call double @llvm.fmuladd.f64(double %263, double %272, double %256)
  %274 = load ptr, ptr %22, align 8, !tbaa !5
  %275 = load i32, ptr %32, align 4, !tbaa !11
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds double, ptr %274, i64 %276
  %278 = load double, ptr %277, align 8, !tbaa !9
  %279 = fdiv double %273, %278
  %280 = load ptr, ptr %24, align 8, !tbaa !5
  %281 = load i32, ptr %32, align 4, !tbaa !11
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds double, ptr %280, i64 %282
  store double %279, ptr %283, align 8, !tbaa !9
  br label %284

284:                                              ; preds = %255
  %285 = load i32, ptr %32, align 4, !tbaa !11
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %32, align 4, !tbaa !11
  br label %250, !llvm.loop !18

287:                                              ; preds = %254
  br label %288

288:                                              ; preds = %287, %248
  br label %289

289:                                              ; preds = %288, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  br label %290

290:                                              ; preds = %289, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %474

291:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %292 = load ptr, ptr %16, align 8, !tbaa !5
  %293 = call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %292)
  store ptr %293, ptr %33, align 8, !tbaa !5
  %294 = load ptr, ptr %17, align 8, !tbaa !5
  %295 = call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %294)
  br i1 %295, label %296, label %337

296:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %297 = load double, ptr %9, align 8, !tbaa !9
  %298 = load ptr, ptr %17, align 8, !tbaa !5
  %299 = call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %298)
  %300 = fmul double %297, %299
  store double %300, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  store i32 0, ptr %35, align 4, !tbaa !11
  br label %301

301:                                              ; preds = %333, %296
  %302 = load i32, ptr %35, align 4, !tbaa !11
  %303 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %304 = icmp slt i32 %302, %303
  br i1 %304, label %306, label %305

305:                                              ; preds = %301
  store i32 17, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %336

306:                                              ; preds = %301
  %307 = load ptr, ptr %33, align 8, !tbaa !5
  %308 = load i32, ptr %35, align 4, !tbaa !11
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds double, ptr %307, i64 %309
  %311 = load double, ptr %310, align 8, !tbaa !9
  %312 = load double, ptr %34, align 8, !tbaa !9
  %313 = load ptr, ptr %23, align 8, !tbaa !5
  %314 = load ptr, ptr %21, align 8, !tbaa !5
  %315 = load i32, ptr %35, align 4, !tbaa !11
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds i32, ptr %314, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !11
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds double, ptr %313, i64 %319
  %321 = load double, ptr %320, align 8, !tbaa !9
  %322 = call double @llvm.fmuladd.f64(double %312, double %321, double %311)
  %323 = load ptr, ptr %22, align 8, !tbaa !5
  %324 = load i32, ptr %35, align 4, !tbaa !11
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds double, ptr %323, i64 %325
  %327 = load double, ptr %326, align 8, !tbaa !9
  %328 = fdiv double %322, %327
  %329 = load ptr, ptr %24, align 8, !tbaa !5
  %330 = load i32, ptr %35, align 4, !tbaa !11
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds double, ptr %329, i64 %331
  store double %328, ptr %332, align 8, !tbaa !9
  br label %333

333:                                              ; preds = %306
  %334 = load i32, ptr %35, align 4, !tbaa !11
  %335 = add nsw i32 %334, 1
  store i32 %335, ptr %35, align 4, !tbaa !11
  br label %301, !llvm.loop !19

336:                                              ; preds = %305
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  br label %473

337:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %338 = load ptr, ptr %17, align 8, !tbaa !5
  %339 = call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %338)
  store ptr %339, ptr %36, align 8, !tbaa !5
  %340 = load double, ptr %9, align 8, !tbaa !9
  %341 = fcmp oeq double %340, 1.000000e+00
  br i1 %341, label %342, label %383

342:                                              ; preds = %337
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  store i32 0, ptr %37, align 4, !tbaa !11
  br label %343

343:                                              ; preds = %379, %342
  %344 = load i32, ptr %37, align 4, !tbaa !11
  %345 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %346 = icmp slt i32 %344, %345
  br i1 %346, label %348, label %347

347:                                              ; preds = %343
  store i32 20, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %382

348:                                              ; preds = %343
  %349 = load ptr, ptr %33, align 8, !tbaa !5
  %350 = load i32, ptr %37, align 4, !tbaa !11
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds double, ptr %349, i64 %351
  %353 = load double, ptr %352, align 8, !tbaa !9
  %354 = load ptr, ptr %36, align 8, !tbaa !5
  %355 = load i32, ptr %37, align 4, !tbaa !11
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds double, ptr %354, i64 %356
  %358 = load double, ptr %357, align 8, !tbaa !9
  %359 = load ptr, ptr %23, align 8, !tbaa !5
  %360 = load ptr, ptr %21, align 8, !tbaa !5
  %361 = load i32, ptr %37, align 4, !tbaa !11
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds i32, ptr %360, i64 %362
  %364 = load i32, ptr %363, align 4, !tbaa !11
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds double, ptr %359, i64 %365
  %367 = load double, ptr %366, align 8, !tbaa !9
  %368 = call double @llvm.fmuladd.f64(double %358, double %367, double %353)
  %369 = load ptr, ptr %22, align 8, !tbaa !5
  %370 = load i32, ptr %37, align 4, !tbaa !11
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds double, ptr %369, i64 %371
  %373 = load double, ptr %372, align 8, !tbaa !9
  %374 = fdiv double %368, %373
  %375 = load ptr, ptr %24, align 8, !tbaa !5
  %376 = load i32, ptr %37, align 4, !tbaa !11
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds double, ptr %375, i64 %377
  store double %374, ptr %378, align 8, !tbaa !9
  br label %379

379:                                              ; preds = %348
  %380 = load i32, ptr %37, align 4, !tbaa !11
  %381 = add nsw i32 %380, 1
  store i32 %381, ptr %37, align 4, !tbaa !11
  br label %343, !llvm.loop !20

382:                                              ; preds = %347
  br label %472

383:                                              ; preds = %337
  %384 = load double, ptr %9, align 8, !tbaa !9
  %385 = fcmp oeq double %384, -1.000000e+00
  br i1 %385, label %386, label %428

386:                                              ; preds = %383
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  store i32 0, ptr %38, align 4, !tbaa !11
  br label %387

387:                                              ; preds = %424, %386
  %388 = load i32, ptr %38, align 4, !tbaa !11
  %389 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %390 = icmp slt i32 %388, %389
  br i1 %390, label %392, label %391

391:                                              ; preds = %387
  store i32 23, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %427

392:                                              ; preds = %387
  %393 = load ptr, ptr %33, align 8, !tbaa !5
  %394 = load i32, ptr %38, align 4, !tbaa !11
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds double, ptr %393, i64 %395
  %397 = load double, ptr %396, align 8, !tbaa !9
  %398 = load ptr, ptr %36, align 8, !tbaa !5
  %399 = load i32, ptr %38, align 4, !tbaa !11
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds double, ptr %398, i64 %400
  %402 = load double, ptr %401, align 8, !tbaa !9
  %403 = load ptr, ptr %23, align 8, !tbaa !5
  %404 = load ptr, ptr %21, align 8, !tbaa !5
  %405 = load i32, ptr %38, align 4, !tbaa !11
  %406 = sext i32 %405 to i64
  %407 = getelementptr inbounds i32, ptr %404, i64 %406
  %408 = load i32, ptr %407, align 4, !tbaa !11
  %409 = sext i32 %408 to i64
  %410 = getelementptr inbounds double, ptr %403, i64 %409
  %411 = load double, ptr %410, align 8, !tbaa !9
  %412 = fneg double %402
  %413 = call double @llvm.fmuladd.f64(double %412, double %411, double %397)
  %414 = load ptr, ptr %22, align 8, !tbaa !5
  %415 = load i32, ptr %38, align 4, !tbaa !11
  %416 = sext i32 %415 to i64
  %417 = getelementptr inbounds double, ptr %414, i64 %416
  %418 = load double, ptr %417, align 8, !tbaa !9
  %419 = fdiv double %413, %418
  %420 = load ptr, ptr %24, align 8, !tbaa !5
  %421 = load i32, ptr %38, align 4, !tbaa !11
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds double, ptr %420, i64 %422
  store double %419, ptr %423, align 8, !tbaa !9
  br label %424

424:                                              ; preds = %392
  %425 = load i32, ptr %38, align 4, !tbaa !11
  %426 = add nsw i32 %425, 1
  store i32 %426, ptr %38, align 4, !tbaa !11
  br label %387, !llvm.loop !21

427:                                              ; preds = %391
  br label %471

428:                                              ; preds = %383
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  store i32 0, ptr %39, align 4, !tbaa !11
  br label %429

429:                                              ; preds = %467, %428
  %430 = load i32, ptr %39, align 4, !tbaa !11
  %431 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  %432 = icmp slt i32 %430, %431
  br i1 %432, label %434, label %433

433:                                              ; preds = %429
  store i32 26, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %470

434:                                              ; preds = %429
  %435 = load ptr, ptr %33, align 8, !tbaa !5
  %436 = load i32, ptr %39, align 4, !tbaa !11
  %437 = sext i32 %436 to i64
  %438 = getelementptr inbounds double, ptr %435, i64 %437
  %439 = load double, ptr %438, align 8, !tbaa !9
  %440 = load double, ptr %9, align 8, !tbaa !9
  %441 = load ptr, ptr %36, align 8, !tbaa !5
  %442 = load i32, ptr %39, align 4, !tbaa !11
  %443 = sext i32 %442 to i64
  %444 = getelementptr inbounds double, ptr %441, i64 %443
  %445 = load double, ptr %444, align 8, !tbaa !9
  %446 = fmul double %440, %445
  %447 = load ptr, ptr %23, align 8, !tbaa !5
  %448 = load ptr, ptr %21, align 8, !tbaa !5
  %449 = load i32, ptr %39, align 4, !tbaa !11
  %450 = sext i32 %449 to i64
  %451 = getelementptr inbounds i32, ptr %448, i64 %450
  %452 = load i32, ptr %451, align 4, !tbaa !11
  %453 = sext i32 %452 to i64
  %454 = getelementptr inbounds double, ptr %447, i64 %453
  %455 = load double, ptr %454, align 8, !tbaa !9
  %456 = call double @llvm.fmuladd.f64(double %446, double %455, double %439)
  %457 = load ptr, ptr %22, align 8, !tbaa !5
  %458 = load i32, ptr %39, align 4, !tbaa !11
  %459 = sext i32 %458 to i64
  %460 = getelementptr inbounds double, ptr %457, i64 %459
  %461 = load double, ptr %460, align 8, !tbaa !9
  %462 = fdiv double %456, %461
  %463 = load ptr, ptr %24, align 8, !tbaa !5
  %464 = load i32, ptr %39, align 4, !tbaa !11
  %465 = sext i32 %464 to i64
  %466 = getelementptr inbounds double, ptr %463, i64 %465
  store double %462, ptr %466, align 8, !tbaa !9
  br label %467

467:                                              ; preds = %434
  %468 = load i32, ptr %39, align 4, !tbaa !11
  %469 = add nsw i32 %468, 1
  store i32 %469, ptr %39, align 4, !tbaa !11
  br label %429, !llvm.loop !22

470:                                              ; preds = %433
  br label %471

471:                                              ; preds = %470, %427
  br label %472

472:                                              ; preds = %471, %382
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  br label %473

473:                                              ; preds = %472, %336
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %474

474:                                              ; preds = %473, %290
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  store i32 0, ptr %20, align 4
  br label %475

475:                                              ; preds = %474, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  %476 = load i32, ptr %20, align 4
  switch i32 %476, label %478 [
    i32 0, label %477
    i32 1, label %477
  ]

477:                                              ; preds = %475, %475
  ret void

478:                                              ; preds = %475
  unreachable
}

declare void @_ZNK10SimTKIpopt6Matrix18SinvBlrmZMTdBrImplEdRKNS_6VectorES3_S3_S3_RS1_(ptr noundef nonnull align 8 dereferenceable(69), double noundef, ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) unnamed_addr #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(read) }
attributes #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt15ExpansionMatrix18SinvBlrmZMTdBrImplEdRKNS_6VectorES3_S3_S3_RS1_(ptr noundef nonnull align 8 dereferenceable(80) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %2, ptr noundef nonnull align 8 dereferenceable(205) %3, ptr noundef nonnull align 8 dereferenceable(205) %4, ptr noundef nonnull align 8 dereferenceable(205) %5, ptr noundef nonnull align 8 dereferenceable(205) %6) unnamed_addr #5 align 2 {
  %8 = tail call ptr @__dynamic_cast(ptr nonnull %2, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #7
  %9 = tail call ptr @__dynamic_cast(ptr nonnull %3, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #7
  %10 = tail call ptr @__dynamic_cast(ptr nonnull %4, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #7
  %11 = tail call ptr @__dynamic_cast(ptr nonnull %5, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #7
  %12 = tail call ptr @__dynamic_cast(ptr nonnull %6, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #7
  %13 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %8)
  br i1 %13, label %16, label %14

14:                                               ; preds = %7
  %15 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %11)
  br i1 %15, label %16, label %17

16:                                               ; preds = %14, %7
  tail call void @_ZNK10SimTKIpopt6Matrix18SinvBlrmZMTdBrImplEdRKNS_6VectorES3_S3_S3_RS1_(ptr noundef nonnull align 8 dereferenceable(69) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(205) %2, ptr noundef nonnull align 8 dereferenceable(205) %3, ptr noundef nonnull align 8 dereferenceable(205) %4, ptr noundef nonnull align 8 dereferenceable(205) %5, ptr noundef nonnull align 8 dereferenceable(205) %6)
  br label %.loopexit

17:                                               ; preds = %14
  %18 = tail call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %19 = tail call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %8)
  %20 = tail call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %11)
  %21 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %12)
  %22 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %9)
  br i1 %22, label %23, label %108

23:                                               ; preds = %17
  %24 = tail call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %9)
  %25 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  br i1 %25, label %26, label %52

26:                                               ; preds = %23
  %27 = tail call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  %28 = fmul double %27, %1
  %29 = fcmp oeq double %28, 0.000000e+00
  %30 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %31 = icmp sgt i32 %30, 0
  br i1 %29, label %.preheader, label %.preheader149

.preheader149:                                    ; preds = %26
  br i1 %31, label %.lr.ph178, label %.loopexit

.preheader:                                       ; preds = %26
  br i1 %31, label %.lr.ph180, label %.loopexit

.lr.ph180:                                        ; preds = %.preheader, %.lr.ph180
  %indvars.iv211 = phi i64 [ %indvars.iv.next212, %.lr.ph180 ], [ 0, %.preheader ]
  %32 = getelementptr inbounds double, ptr %19, i64 %indvars.iv211
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = fdiv double %24, %33
  %35 = getelementptr inbounds double, ptr %21, i64 %indvars.iv211
  store double %34, ptr %35, align 8, !tbaa !5
  %indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
  %36 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next212, %37
  br i1 %38, label %.lr.ph180, label %.loopexit, !llvm.loop !9

.lr.ph178:                                        ; preds = %.preheader149, %.lr.ph178
  %indvars.iv208 = phi i64 [ %indvars.iv.next209, %.lr.ph178 ], [ 0, %.preheader149 ]
  %39 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv208
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %20, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !5
  %44 = tail call double @llvm.fmuladd.f64(double %28, double %43, double %24)
  %45 = getelementptr inbounds double, ptr %19, i64 %indvars.iv208
  %46 = load double, ptr %45, align 8, !tbaa !5
  %47 = fdiv double %44, %46
  %48 = getelementptr inbounds double, ptr %21, i64 %indvars.iv208
  store double %47, ptr %48, align 8, !tbaa !5
  %indvars.iv.next209 = add nuw nsw i64 %indvars.iv208, 1
  %49 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next209, %50
  br i1 %51, label %.lr.ph178, label %.loopexit, !llvm.loop !13

52:                                               ; preds = %23
  %53 = tail call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  %54 = fcmp oeq double %1, 1.000000e+00
  br i1 %54, label %.preheader151, label %72

.preheader151:                                    ; preds = %52
  %55 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph176, label %.loopexit

.lr.ph176:                                        ; preds = %.preheader151, %.lr.ph176
  %indvars.iv205 = phi i64 [ %indvars.iv.next206, %.lr.ph176 ], [ 0, %.preheader151 ]
  %57 = getelementptr inbounds double, ptr %53, i64 %indvars.iv205
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv205
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %20, i64 %61
  %63 = load double, ptr %62, align 8, !tbaa !5
  %64 = tail call double @llvm.fmuladd.f64(double %58, double %63, double %24)
  %65 = getelementptr inbounds double, ptr %19, i64 %indvars.iv205
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = fdiv double %64, %66
  %68 = getelementptr inbounds double, ptr %21, i64 %indvars.iv205
  store double %67, ptr %68, align 8, !tbaa !5
  %indvars.iv.next206 = add nuw nsw i64 %indvars.iv205, 1
  %69 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next206, %70
  br i1 %71, label %.lr.ph176, label %.loopexit, !llvm.loop !14

72:                                               ; preds = %52
  %73 = fcmp oeq double %1, -1.000000e+00
  %74 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %75 = icmp sgt i32 %74, 0
  br i1 %73, label %.preheader153, label %.preheader155

.preheader155:                                    ; preds = %72
  br i1 %75, label %.lr.ph172, label %.loopexit

.preheader153:                                    ; preds = %72
  br i1 %75, label %.lr.ph174, label %.loopexit

.lr.ph174:                                        ; preds = %.preheader153, %.lr.ph174
  %indvars.iv202 = phi i64 [ %indvars.iv.next203, %.lr.ph174 ], [ 0, %.preheader153 ]
  %76 = getelementptr inbounds double, ptr %53, i64 %indvars.iv202
  %77 = load double, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv202
  %79 = load i32, ptr %78, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %20, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !5
  %83 = fneg double %77
  %84 = tail call double @llvm.fmuladd.f64(double %83, double %82, double %24)
  %85 = getelementptr inbounds double, ptr %19, i64 %indvars.iv202
  %86 = load double, ptr %85, align 8, !tbaa !5
  %87 = fdiv double %84, %86
  %88 = getelementptr inbounds double, ptr %21, i64 %indvars.iv202
  store double %87, ptr %88, align 8, !tbaa !5
  %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1
  %89 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %indvars.iv.next203, %90
  br i1 %91, label %.lr.ph174, label %.loopexit, !llvm.loop !15

.lr.ph172:                                        ; preds = %.preheader155, %.lr.ph172
  %indvars.iv199 = phi i64 [ %indvars.iv.next200, %.lr.ph172 ], [ 0, %.preheader155 ]
  %92 = getelementptr inbounds double, ptr %53, i64 %indvars.iv199
  %93 = load double, ptr %92, align 8, !tbaa !5
  %94 = fmul double %93, %1
  %95 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv199
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %20, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !5
  %100 = tail call double @llvm.fmuladd.f64(double %94, double %99, double %24)
  %101 = getelementptr inbounds double, ptr %19, i64 %indvars.iv199
  %102 = load double, ptr %101, align 8, !tbaa !5
  %103 = fdiv double %100, %102
  %104 = getelementptr inbounds double, ptr %21, i64 %indvars.iv199
  store double %103, ptr %104, align 8, !tbaa !5
  %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
  %105 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %106 = sext i32 %105 to i64
  %107 = icmp slt i64 %indvars.iv.next200, %106
  br i1 %107, label %.lr.ph172, label %.loopexit, !llvm.loop !16

108:                                              ; preds = %17
  %109 = tail call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %9)
  %110 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt11DenseVector13IsHomogeneousEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  br i1 %110, label %111, label %131

111:                                              ; preds = %108
  %112 = tail call noundef double @_ZNK10SimTKIpopt11DenseVector6ScalarEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  %113 = fmul double %112, %1
  %114 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %115 = icmp sgt i32 %114, 0
  br i1 %115, label %.lr.ph170, label %.loopexit

.lr.ph170:                                        ; preds = %111, %.lr.ph170
  %indvars.iv196 = phi i64 [ %indvars.iv.next197, %.lr.ph170 ], [ 0, %111 ]
  %116 = getelementptr inbounds double, ptr %109, i64 %indvars.iv196
  %117 = load double, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv196
  %119 = load i32, ptr %118, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %20, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !5
  %123 = tail call double @llvm.fmuladd.f64(double %113, double %122, double %117)
  %124 = getelementptr inbounds double, ptr %19, i64 %indvars.iv196
  %125 = load double, ptr %124, align 8, !tbaa !5
  %126 = fdiv double %123, %125
  %127 = getelementptr inbounds double, ptr %21, i64 %indvars.iv196
  store double %126, ptr %127, align 8, !tbaa !5
  %indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1
  %128 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %129 = sext i32 %128 to i64
  %130 = icmp slt i64 %indvars.iv.next197, %129
  br i1 %130, label %.lr.ph170, label %.loopexit, !llvm.loop !17

131:                                              ; preds = %108
  %132 = tail call noundef ptr @_ZNK10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %10)
  %133 = fcmp oeq double %1, 1.000000e+00
  br i1 %133, label %.preheader158, label %153

.preheader158:                                    ; preds = %131
  %134 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %135 = icmp sgt i32 %134, 0
  br i1 %135, label %.lr.ph168, label %.loopexit

.lr.ph168:                                        ; preds = %.preheader158, %.lr.ph168
  %indvars.iv193 = phi i64 [ %indvars.iv.next194, %.lr.ph168 ], [ 0, %.preheader158 ]
  %136 = getelementptr inbounds double, ptr %109, i64 %indvars.iv193
  %137 = load double, ptr %136, align 8, !tbaa !5
  %138 = getelementptr inbounds double, ptr %132, i64 %indvars.iv193
  %139 = load double, ptr %138, align 8, !tbaa !5
  %140 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv193
  %141 = load i32, ptr %140, align 4, !tbaa !11
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds double, ptr %20, i64 %142
  %144 = load double, ptr %143, align 8, !tbaa !5
  %145 = tail call double @llvm.fmuladd.f64(double %139, double %144, double %137)
  %146 = getelementptr inbounds double, ptr %19, i64 %indvars.iv193
  %147 = load double, ptr %146, align 8, !tbaa !5
  %148 = fdiv double %145, %147
  %149 = getelementptr inbounds double, ptr %21, i64 %indvars.iv193
  store double %148, ptr %149, align 8, !tbaa !5
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %150 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %151 = sext i32 %150 to i64
  %152 = icmp slt i64 %indvars.iv.next194, %151
  br i1 %152, label %.lr.ph168, label %.loopexit, !llvm.loop !18

153:                                              ; preds = %131
  %154 = fcmp oeq double %1, -1.000000e+00
  %155 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %156 = icmp sgt i32 %155, 0
  br i1 %154, label %.preheader160, label %.preheader162

.preheader162:                                    ; preds = %153
  br i1 %156, label %.lr.ph, label %.loopexit

.preheader160:                                    ; preds = %153
  br i1 %156, label %.lr.ph166, label %.loopexit

.lr.ph166:                                        ; preds = %.preheader160, %.lr.ph166
  %indvars.iv190 = phi i64 [ %indvars.iv.next191, %.lr.ph166 ], [ 0, %.preheader160 ]
  %157 = getelementptr inbounds double, ptr %109, i64 %indvars.iv190
  %158 = load double, ptr %157, align 8, !tbaa !5
  %159 = getelementptr inbounds double, ptr %132, i64 %indvars.iv190
  %160 = load double, ptr %159, align 8, !tbaa !5
  %161 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv190
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds double, ptr %20, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !5
  %166 = fneg double %160
  %167 = tail call double @llvm.fmuladd.f64(double %166, double %165, double %158)
  %168 = getelementptr inbounds double, ptr %19, i64 %indvars.iv190
  %169 = load double, ptr %168, align 8, !tbaa !5
  %170 = fdiv double %167, %169
  %171 = getelementptr inbounds double, ptr %21, i64 %indvars.iv190
  store double %170, ptr %171, align 8, !tbaa !5
  %indvars.iv.next191 = add nuw nsw i64 %indvars.iv190, 1
  %172 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %173 = sext i32 %172 to i64
  %174 = icmp slt i64 %indvars.iv.next191, %173
  br i1 %174, label %.lr.ph166, label %.loopexit, !llvm.loop !19

.lr.ph:                                           ; preds = %.preheader162, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader162 ]
  %175 = getelementptr inbounds double, ptr %109, i64 %indvars.iv
  %176 = load double, ptr %175, align 8, !tbaa !5
  %177 = getelementptr inbounds double, ptr %132, i64 %indvars.iv
  %178 = load double, ptr %177, align 8, !tbaa !5
  %179 = fmul double %178, %1
  %180 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv
  %181 = load i32, ptr %180, align 4, !tbaa !11
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds double, ptr %20, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !5
  %185 = tail call double @llvm.fmuladd.f64(double %179, double %184, double %176)
  %186 = getelementptr inbounds double, ptr %19, i64 %indvars.iv
  %187 = load double, ptr %186, align 8, !tbaa !5
  %188 = fdiv double %185, %187
  %189 = getelementptr inbounds double, ptr %21, i64 %indvars.iv
  store double %188, ptr %189, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %190 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %0)
  %191 = sext i32 %190 to i64
  %192 = icmp slt i64 %indvars.iv.next, %191
  br i1 %192, label %.lr.ph, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph166, %.lr.ph168, %.lr.ph170, %.lr.ph172, %.lr.ph174, %.lr.ph176, %.lr.ph178, %.lr.ph180, %.preheader162, %.preheader160, %.preheader158, %111, %.preheader155, %.preheader153, %.preheader151, %.preheader149, %.preheader, %16
  ret void
}

declare void @_ZNK10SimTKIpopt6Matrix18SinvBlrmZMTdBrImplEdRKNS_6VectorES3_S3_S3_RS1_(ptr noundef nonnull align 8 dereferenceable(69), double noundef, ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205), ptr noundef nonnull align 8 dereferenceable(205)) unnamed_addr #6

attributes #0 = { mustprogress nofree nounwind willreturn memory(read) }
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 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 #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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