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

; 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::TNLPAdapter" = type { %"class.SimTKIpopt::NLP.base", %"class.SimTKIpopt::SmartPtr.6", %"class.SimTKIpopt::SmartPtr.7", double, double, i32, i32, double, double, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr.5", %"class.SimTKIpopt::SmartPtr.8", ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.9", ptr, ptr, ptr }
%"class.SimTKIpopt::NLP.base" = type { %"class.SimTKIpopt::ReferencedObject.base" }
%"class.SimTKIpopt::ReferencedObject.base" = type <{ ptr, i32 }>
%"class.SimTKIpopt::SmartPtr.6" = type { ptr }
%"class.SimTKIpopt::SmartPtr.7" = type { ptr }
%"class.SimTKIpopt::SmartPtr" = type { ptr }
%"class.SimTKIpopt::SmartPtr.5" = type { ptr }
%"class.SimTKIpopt::SmartPtr.8" = type { ptr }
%"class.SimTKIpopt::SmartPtr.10" = type { ptr }
%"class.SimTKIpopt::SmartPtr.9" = type { ptr }

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter16GetStartingPointENS_8SmartPtrINS_6VectorEEEbS3_bS3_bS3_bS3_b(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %1, i1 noundef zeroext %2, ptr noundef %3, i1 noundef zeroext %4, ptr noundef %5, i1 noundef zeroext %6, ptr noundef %7, i1 noundef zeroext %8, ptr noundef %9, i1 noundef zeroext %10) unnamed_addr #5 align 2 {
  %12 = alloca i1, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca i8, align 1
  %22 = alloca ptr, align 8
  %23 = alloca i8, align 1
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i8, align 1
  %29 = alloca i8, align 1
  %30 = alloca i8, align 1
  %31 = alloca i8, align 1
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca i32, align 4
  %41 = alloca double, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca ptr, align 8
  %45 = alloca i32, align 4
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  %48 = alloca ptr, align 8
  %49 = alloca ptr, align 8
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca ptr, align 8
  %55 = alloca ptr, align 8
  %56 = alloca ptr, align 8
  %57 = alloca ptr, align 8
  %58 = alloca i32, align 4
  %59 = alloca i32, align 4
  %60 = alloca i32, align 4
  %61 = alloca i32, align 4
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  %62 = zext i1 %2 to i8
  store i8 %62, ptr %15, align 1, !tbaa !9
  store ptr %3, ptr %16, align 8, !tbaa !5
  %63 = zext i1 %4 to i8
  store i8 %63, ptr %17, align 1, !tbaa !9
  store ptr %5, ptr %18, align 8, !tbaa !5
  %64 = zext i1 %6 to i8
  store i8 %64, ptr %19, align 1, !tbaa !9
  store ptr %7, ptr %20, align 8, !tbaa !5
  %65 = zext i1 %8 to i8
  store i8 %65, ptr %21, align 1, !tbaa !9
  store ptr %9, ptr %22, align 8, !tbaa !5
  %66 = zext i1 %10 to i8
  store i8 %66, ptr %23, align 1, !tbaa !9
  %67 = load ptr, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %68 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 12
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %70, i64 8)
  %72 = extractvalue { i64, i1 } %71, 1
  %73 = extractvalue { i64, i1 } %71, 0
  %74 = select i1 %72, i64 -1, i64 %73
  %75 = call noalias noundef nonnull ptr @_Znam(i64 noundef %74) #10
  store ptr %75, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %76 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 12
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = sext i32 %77 to i64
  %79 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %78, i64 8)
  %80 = extractvalue { i64, i1 } %79, 1
  %81 = extractvalue { i64, i1 } %79, 0
  %82 = select i1 %80, i64 -1, i64 %81
  %83 = call noalias noundef nonnull ptr @_Znam(i64 noundef %82) #10
  store ptr %83, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %84 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 12
  %85 = load i32, ptr %84, align 8, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %86, i64 8)
  %88 = extractvalue { i64, i1 } %87, 1
  %89 = extractvalue { i64, i1 } %87, 0
  %90 = select i1 %88, i64 -1, i64 %89
  %91 = call noalias noundef nonnull ptr @_Znam(i64 noundef %90) #10
  store ptr %91, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %92 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 13
  %93 = load i32, ptr %92, align 4, !tbaa !28
  %94 = sext i32 %93 to i64
  %95 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %94, i64 8)
  %96 = extractvalue { i64, i1 } %95, 1
  %97 = extractvalue { i64, i1 } %95, 0
  %98 = select i1 %96, i64 -1, i64 %97
  %99 = call noalias noundef nonnull ptr @_Znam(i64 noundef %98) #10
  store ptr %99, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #9
  %100 = load i8, ptr %15, align 1, !tbaa !9, !range !29, !noundef !30
  %101 = trunc i8 %100 to i1
  %102 = zext i1 %101 to i8
  store i8 %102, ptr %28, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #9
  %103 = load i8, ptr %21, align 1, !tbaa !9, !range !29, !noundef !30
  %104 = trunc i8 %103 to i1
  br i1 %104, label %105, label %108

105:                                              ; preds = %11
  %106 = load i8, ptr %23, align 1, !tbaa !9, !range !29, !noundef !30
  %107 = trunc i8 %106 to i1
  br label %108

108:                                              ; preds = %105, %11
  %109 = phi i1 [ false, %11 ], [ %107, %105 ]
  %110 = zext i1 %109 to i8
  store i8 %110, ptr %29, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #9
  %111 = load i8, ptr %17, align 1, !tbaa !9, !range !29, !noundef !30
  %112 = trunc i8 %111 to i1
  br i1 %112, label %113, label %116

113:                                              ; preds = %108
  %114 = load i8, ptr %19, align 1, !tbaa !9, !range !29, !noundef !30
  %115 = trunc i8 %114 to i1
  br label %116

116:                                              ; preds = %113, %108
  %117 = phi i1 [ false, %108 ], [ %115, %113 ]
  %118 = zext i1 %117 to i8
  store i8 %118, ptr %30, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #9
  %119 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 1
  %120 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %119)
  %121 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 12
  %122 = load i32, ptr %121, align 8, !tbaa !11
  %123 = load i8, ptr %28, align 1, !tbaa !9, !range !29, !noundef !30
  %124 = trunc i8 %123 to i1
  %125 = load ptr, ptr %24, align 8, !tbaa !5
  %126 = load i8, ptr %29, align 1, !tbaa !9, !range !29, !noundef !30
  %127 = trunc i8 %126 to i1
  %128 = load ptr, ptr %25, align 8, !tbaa !5
  %129 = load ptr, ptr %26, align 8, !tbaa !5
  %130 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 13
  %131 = load i32, ptr %130, align 4, !tbaa !28
  %132 = load i8, ptr %30, align 1, !tbaa !9, !range !29, !noundef !30
  %133 = trunc i8 %132 to i1
  %134 = load ptr, ptr %27, align 8, !tbaa !5
  %135 = load ptr, ptr %120, align 8, !tbaa !31
  %136 = getelementptr inbounds ptr, ptr %135, i64 5
  %137 = load ptr, ptr %136, align 8
  %138 = call noundef zeroext i1 %137(ptr noundef nonnull align 8 dereferenceable(12) %120, i32 noundef %122, i1 noundef zeroext %124, ptr noundef %125, i1 noundef zeroext %127, ptr noundef %128, ptr noundef %129, i32 noundef %131, i1 noundef zeroext %133, ptr noundef %134)
  %139 = zext i1 %138 to i8
  store i8 %139, ptr %31, align 1, !tbaa !9
  %140 = load i8, ptr %31, align 1, !tbaa !9, !range !29, !noundef !30
  %141 = trunc i8 %140 to i1
  br i1 %141, label %143, label %142

142:                                              ; preds = %116
  store i1 false, ptr %12, align 1
  store i32 1, ptr %32, align 4
  br label %461

143:                                              ; preds = %116
  %144 = load i8, ptr %15, align 1, !tbaa !9, !range !29, !noundef !30
  %145 = trunc i8 %144 to i1
  br i1 %145, label %146, label %192

146:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #9
  %147 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %148 = icmp eq ptr %147, null
  br i1 %148, label %151, label %149

149:                                              ; preds = %146
  %150 = call ptr @__dynamic_cast(ptr %147, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %152

151:                                              ; preds = %146
  br label %152

152:                                              ; preds = %151, %149
  %153 = phi ptr [ %150, %149 ], [ null, %151 ]
  store ptr %153, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  %154 = load ptr, ptr %33, align 8, !tbaa !5
  %155 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %154)
  store ptr %155, ptr %34, align 8, !tbaa !5
  %156 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 46
  %157 = call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %156)
  br i1 %157, label %158, label %186

158:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %159 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 46
  %160 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %159)
  %161 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %160)
  store ptr %161, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  store i32 0, ptr %36, align 4, !tbaa !33
  br label %162

162:                                              ; preds = %182, %158
  %163 = load i32, ptr %36, align 4, !tbaa !33
  %164 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %165 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %164)
  %166 = icmp slt i32 %163, %165
  br i1 %166, label %168, label %167

167:                                              ; preds = %162
  store i32 2, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %185

168:                                              ; preds = %162
  %169 = load ptr, ptr %24, align 8, !tbaa !5
  %170 = load ptr, ptr %35, align 8, !tbaa !5
  %171 = load i32, ptr %36, align 4, !tbaa !33
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds i32, ptr %170, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !33
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds double, ptr %169, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !34
  %178 = load ptr, ptr %34, align 8, !tbaa !5
  %179 = load i32, ptr %36, align 4, !tbaa !33
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds double, ptr %178, i64 %180
  store double %177, ptr %181, align 8, !tbaa !34
  br label %182

182:                                              ; preds = %168
  %183 = load i32, ptr %36, align 4, !tbaa !33
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %36, align 4, !tbaa !33
  br label %162, !llvm.loop !35

185:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  br label %191

186:                                              ; preds = %152
  %187 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %188 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %187)
  %189 = load ptr, ptr %24, align 8, !tbaa !5
  %190 = load ptr, ptr %34, align 8, !tbaa !5
  call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %188, ptr noundef %189, i32 noundef 1, ptr noundef %190, i32 noundef 1)
  br label %191

191:                                              ; preds = %186, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  br label %192

192:                                              ; preds = %191, %143
  %193 = load i8, ptr %17, align 1, !tbaa !9, !range !29, !noundef !30
  %194 = trunc i8 %193 to i1
  br i1 %194, label %195, label %246

195:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #9
  %196 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %197 = icmp eq ptr %196, null
  br i1 %197, label %200, label %198

198:                                              ; preds = %195
  %199 = call ptr @__dynamic_cast(ptr %196, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %201

200:                                              ; preds = %195
  br label %201

201:                                              ; preds = %200, %198
  %202 = phi ptr [ %199, %198 ], [ null, %200 ]
  store ptr %202, ptr %37, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #9
  %203 = load ptr, ptr %37, align 8, !tbaa !5
  %204 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %203)
  store ptr %204, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #9
  %205 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 53
  %206 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %205)
  %207 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %206)
  store ptr %207, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  store i32 0, ptr %40, align 4, !tbaa !33
  br label %208

208:                                              ; preds = %229, %201
  %209 = load i32, ptr %40, align 4, !tbaa !33
  %210 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 53
  %211 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %210)
  %212 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %211)
  %213 = icmp slt i32 %209, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %208
  store i32 5, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %232

215:                                              ; preds = %208
  %216 = load ptr, ptr %27, align 8, !tbaa !5
  %217 = load ptr, ptr %39, align 8, !tbaa !5
  %218 = load i32, ptr %40, align 4, !tbaa !33
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds i32, ptr %217, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !33
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds double, ptr %216, i64 %222
  %224 = load double, ptr %223, align 8, !tbaa !34
  %225 = load ptr, ptr %38, align 8, !tbaa !5
  %226 = load i32, ptr %40, align 4, !tbaa !33
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds double, ptr %225, i64 %227
  store double %224, ptr %228, align 8, !tbaa !34
  br label %229

229:                                              ; preds = %215
  %230 = load i32, ptr %40, align 4, !tbaa !33
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %40, align 4, !tbaa !33
  br label %208, !llvm.loop !37

232:                                              ; preds = %214
  %233 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 5
  %234 = load i32, ptr %233, align 8, !tbaa !38
  %235 = icmp eq i32 %234, 1
  br i1 %235, label %236, label %245

236:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #9
  store double 0.000000e+00, ptr %41, align 8, !tbaa !34
  %237 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 20
  %238 = load i32, ptr %237, align 8, !tbaa !39
  %239 = load ptr, ptr %38, align 8, !tbaa !5
  %240 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 53
  %241 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %240)
  %242 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %241)
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds double, ptr %239, i64 %243
  call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %238, ptr noundef %41, i32 noundef 0, ptr noundef %244, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #9
  br label %245

245:                                              ; preds = %236, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #9
  br label %246

246:                                              ; preds = %245, %192
  %247 = load i8, ptr %19, align 1, !tbaa !9, !range !29, !noundef !30
  %248 = trunc i8 %247 to i1
  br i1 %248, label %249, label %286

249:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #9
  %250 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %251 = icmp eq ptr %250, null
  br i1 %251, label %254, label %252

252:                                              ; preds = %249
  %253 = call ptr @__dynamic_cast(ptr %250, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %255

254:                                              ; preds = %249
  br label %255

255:                                              ; preds = %254, %252
  %256 = phi ptr [ %253, %252 ], [ null, %254 ]
  store ptr %256, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #9
  %257 = load ptr, ptr %42, align 8, !tbaa !5
  %258 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %257)
  store ptr %258, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #9
  %259 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 55
  %260 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %259)
  %261 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %260)
  store ptr %261, ptr %44, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #9
  store i32 0, ptr %45, align 4, !tbaa !33
  br label %262

262:                                              ; preds = %282, %255
  %263 = load i32, ptr %45, align 4, !tbaa !33
  %264 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %265 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %264)
  %266 = icmp slt i32 %263, %265
  br i1 %266, label %268, label %267

267:                                              ; preds = %262
  store i32 8, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #9
  br label %285

268:                                              ; preds = %262
  %269 = load ptr, ptr %27, align 8, !tbaa !5
  %270 = load ptr, ptr %44, align 8, !tbaa !5
  %271 = load i32, ptr %45, align 4, !tbaa !33
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds i32, ptr %270, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !33
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds double, ptr %269, i64 %275
  %277 = load double, ptr %276, align 8, !tbaa !34
  %278 = load ptr, ptr %43, align 8, !tbaa !5
  %279 = load i32, ptr %45, align 4, !tbaa !33
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds double, ptr %278, i64 %280
  store double %277, ptr %281, align 8, !tbaa !34
  br label %282

282:                                              ; preds = %268
  %283 = load i32, ptr %45, align 4, !tbaa !33
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %45, align 4, !tbaa !33
  br label %262, !llvm.loop !40

285:                                              ; preds = %267
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #9
  br label %286

286:                                              ; preds = %285, %246
  %287 = load i8, ptr %21, align 1, !tbaa !9, !range !29, !noundef !30
  %288 = trunc i8 %287 to i1
  br i1 %288, label %289, label %365

289:                                              ; preds = %286
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #9
  %290 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %291 = icmp eq ptr %290, null
  br i1 %291, label %294, label %292

292:                                              ; preds = %289
  %293 = call ptr @__dynamic_cast(ptr %290, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %295

294:                                              ; preds = %289
  br label %295

295:                                              ; preds = %294, %292
  %296 = phi ptr [ %293, %292 ], [ null, %294 ]
  store ptr %296, ptr %46, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #9
  %297 = load ptr, ptr %46, align 8, !tbaa !5
  %298 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %297)
  store ptr %298, ptr %47, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #9
  %299 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 48
  %300 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %299)
  %301 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %300)
  store ptr %301, ptr %48, align 8, !tbaa !5
  %302 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 46
  %303 = call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %302)
  br i1 %303, label %304, label %338

304:                                              ; preds = %295
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #9
  %305 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 46
  %306 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %305)
  %307 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %306)
  store ptr %307, ptr %49, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #9
  store i32 0, ptr %50, align 4, !tbaa !33
  br label %308

308:                                              ; preds = %334, %304
  %309 = load i32, ptr %50, align 4, !tbaa !33
  %310 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %311 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %310)
  %312 = icmp slt i32 %309, %311
  br i1 %312, label %314, label %313

313:                                              ; preds = %308
  store i32 11, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #9
  br label %337

314:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #9
  %315 = load ptr, ptr %48, align 8, !tbaa !5
  %316 = load i32, ptr %50, align 4, !tbaa !33
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds i32, ptr %315, i64 %317
  %319 = load i32, ptr %318, align 4, !tbaa !33
  store i32 %319, ptr %51, align 4, !tbaa !33
  %320 = load ptr, ptr %49, align 8, !tbaa !5
  %321 = load i32, ptr %51, align 4, !tbaa !33
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds i32, ptr %320, i64 %322
  %324 = load i32, ptr %323, align 4, !tbaa !33
  store i32 %324, ptr %51, align 4, !tbaa !33
  %325 = load ptr, ptr %25, align 8, !tbaa !5
  %326 = load i32, ptr %51, align 4, !tbaa !33
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds double, ptr %325, i64 %327
  %329 = load double, ptr %328, align 8, !tbaa !34
  %330 = load ptr, ptr %47, align 8, !tbaa !5
  %331 = load i32, ptr %50, align 4, !tbaa !33
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds double, ptr %330, i64 %332
  store double %329, ptr %333, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #9
  br label %334

334:                                              ; preds = %314
  %335 = load i32, ptr %50, align 4, !tbaa !33
  %336 = add nsw i32 %335, 1
  store i32 %336, ptr %50, align 4, !tbaa !33
  br label %308, !llvm.loop !41

337:                                              ; preds = %313
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #9
  br label %364

338:                                              ; preds = %295
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #9
  store i32 0, ptr %52, align 4, !tbaa !33
  br label %339

339:                                              ; preds = %360, %338
  %340 = load i32, ptr %52, align 4, !tbaa !33
  %341 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %342 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %341)
  %343 = icmp slt i32 %340, %342
  br i1 %343, label %345, label %344

344:                                              ; preds = %339
  store i32 14, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #9
  br label %363

345:                                              ; preds = %339
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #9
  %346 = load ptr, ptr %48, align 8, !tbaa !5
  %347 = load i32, ptr %52, align 4, !tbaa !33
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds i32, ptr %346, i64 %348
  %350 = load i32, ptr %349, align 4, !tbaa !33
  store i32 %350, ptr %53, align 4, !tbaa !33
  %351 = load ptr, ptr %25, align 8, !tbaa !5
  %352 = load i32, ptr %53, align 4, !tbaa !33
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds double, ptr %351, i64 %353
  %355 = load double, ptr %354, align 8, !tbaa !34
  %356 = load ptr, ptr %47, align 8, !tbaa !5
  %357 = load i32, ptr %52, align 4, !tbaa !33
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds double, ptr %356, i64 %358
  store double %355, ptr %359, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #9
  br label %360

360:                                              ; preds = %345
  %361 = load i32, ptr %52, align 4, !tbaa !33
  %362 = add nsw i32 %361, 1
  store i32 %362, ptr %52, align 4, !tbaa !33
  br label %339, !llvm.loop !42

363:                                              ; preds = %344
  br label %364

364:                                              ; preds = %363, %337
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #9
  br label %365

365:                                              ; preds = %364, %286
  %366 = load i8, ptr %23, align 1, !tbaa !9, !range !29, !noundef !30
  %367 = trunc i8 %366 to i1
  br i1 %367, label %368, label %444

368:                                              ; preds = %365
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #9
  %369 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %370 = icmp eq ptr %369, null
  br i1 %370, label %373, label %371

371:                                              ; preds = %368
  %372 = call ptr @__dynamic_cast(ptr %369, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %374

373:                                              ; preds = %368
  br label %374

374:                                              ; preds = %373, %371
  %375 = phi ptr [ %372, %371 ], [ null, %373 ]
  store ptr %375, ptr %54, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #9
  %376 = load ptr, ptr %54, align 8, !tbaa !5
  %377 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %376)
  store ptr %377, ptr %55, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #9
  %378 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 50
  %379 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %378)
  %380 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %379)
  store ptr %380, ptr %56, align 8, !tbaa !5
  %381 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 46
  %382 = call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %381)
  br i1 %382, label %383, label %417

383:                                              ; preds = %374
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #9
  %384 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %67, i32 0, i32 46
  %385 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %384)
  %386 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %385)
  store ptr %386, ptr %57, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %58) #9
  store i32 0, ptr %58, align 4, !tbaa !33
  br label %387

387:                                              ; preds = %413, %383
  %388 = load i32, ptr %58, align 4, !tbaa !33
  %389 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %390 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %389)
  %391 = icmp slt i32 %388, %390
  br i1 %391, label %393, label %392

392:                                              ; preds = %387
  store i32 17, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #9
  br label %416

393:                                              ; preds = %387
  call void @llvm.lifetime.start.p0(i64 4, ptr %59) #9
  %394 = load ptr, ptr %56, align 8, !tbaa !5
  %395 = load i32, ptr %58, align 4, !tbaa !33
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds i32, ptr %394, i64 %396
  %398 = load i32, ptr %397, align 4, !tbaa !33
  store i32 %398, ptr %59, align 4, !tbaa !33
  %399 = load ptr, ptr %57, align 8, !tbaa !5
  %400 = load i32, ptr %59, align 4, !tbaa !33
  %401 = sext i32 %400 to i64
  %402 = getelementptr inbounds i32, ptr %399, i64 %401
  %403 = load i32, ptr %402, align 4, !tbaa !33
  store i32 %403, ptr %59, align 4, !tbaa !33
  %404 = load ptr, ptr %26, align 8, !tbaa !5
  %405 = load i32, ptr %59, align 4, !tbaa !33
  %406 = sext i32 %405 to i64
  %407 = getelementptr inbounds double, ptr %404, i64 %406
  %408 = load double, ptr %407, align 8, !tbaa !34
  %409 = load ptr, ptr %55, align 8, !tbaa !5
  %410 = load i32, ptr %58, align 4, !tbaa !33
  %411 = sext i32 %410 to i64
  %412 = getelementptr inbounds double, ptr %409, i64 %411
  store double %408, ptr %412, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %59) #9
  br label %413

413:                                              ; preds = %393
  %414 = load i32, ptr %58, align 4, !tbaa !33
  %415 = add nsw i32 %414, 1
  store i32 %415, ptr %58, align 4, !tbaa !33
  br label %387, !llvm.loop !43

416:                                              ; preds = %392
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #9
  br label %443

417:                                              ; preds = %374
  call void @llvm.lifetime.start.p0(i64 4, ptr %60) #9
  store i32 0, ptr %60, align 4, !tbaa !33
  br label %418

418:                                              ; preds = %439, %417
  %419 = load i32, ptr %60, align 4, !tbaa !33
  %420 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %421 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %420)
  %422 = icmp slt i32 %419, %421
  br i1 %422, label %424, label %423

423:                                              ; preds = %418
  store i32 20, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %60) #9
  br label %442

424:                                              ; preds = %418
  call void @llvm.lifetime.start.p0(i64 4, ptr %61) #9
  %425 = load ptr, ptr %56, align 8, !tbaa !5
  %426 = load i32, ptr %60, align 4, !tbaa !33
  %427 = sext i32 %426 to i64
  %428 = getelementptr inbounds i32, ptr %425, i64 %427
  %429 = load i32, ptr %428, align 4, !tbaa !33
  store i32 %429, ptr %61, align 4, !tbaa !33
  %430 = load ptr, ptr %26, align 8, !tbaa !5
  %431 = load i32, ptr %61, align 4, !tbaa !33
  %432 = sext i32 %431 to i64
  %433 = getelementptr inbounds double, ptr %430, i64 %432
  %434 = load double, ptr %433, align 8, !tbaa !34
  %435 = load ptr, ptr %55, align 8, !tbaa !5
  %436 = load i32, ptr %60, align 4, !tbaa !33
  %437 = sext i32 %436 to i64
  %438 = getelementptr inbounds double, ptr %435, i64 %437
  store double %434, ptr %438, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %61) #9
  br label %439

439:                                              ; preds = %424
  %440 = load i32, ptr %60, align 4, !tbaa !33
  %441 = add nsw i32 %440, 1
  store i32 %441, ptr %60, align 4, !tbaa !33
  br label %418, !llvm.loop !44

442:                                              ; preds = %423
  br label %443

443:                                              ; preds = %442, %416
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #9
  br label %444

444:                                              ; preds = %443, %365
  %445 = load ptr, ptr %24, align 8, !tbaa !5
  %446 = icmp eq ptr %445, null
  br i1 %446, label %448, label %447

447:                                              ; preds = %444
  call void @_ZdaPv(ptr noundef %445) #11
  br label %448

448:                                              ; preds = %447, %444
  store ptr null, ptr %24, align 8, !tbaa !5
  %449 = load ptr, ptr %25, align 8, !tbaa !5
  %450 = icmp eq ptr %449, null
  br i1 %450, label %452, label %451

451:                                              ; preds = %448
  call void @_ZdaPv(ptr noundef %449) #11
  br label %452

452:                                              ; preds = %451, %448
  store ptr null, ptr %25, align 8, !tbaa !5
  %453 = load ptr, ptr %26, align 8, !tbaa !5
  %454 = icmp eq ptr %453, null
  br i1 %454, label %456, label %455

455:                                              ; preds = %452
  call void @_ZdaPv(ptr noundef %453) #11
  br label %456

456:                                              ; preds = %455, %452
  store ptr null, ptr %26, align 8, !tbaa !5
  %457 = load ptr, ptr %27, align 8, !tbaa !5
  %458 = icmp eq ptr %457, null
  br i1 %458, label %460, label %459

459:                                              ; preds = %456
  call void @_ZdaPv(ptr noundef %457) #11
  br label %460

460:                                              ; preds = %459, %456
  store ptr null, ptr %27, align 8, !tbaa !5
  store i1 true, ptr %12, align 1
  store i32 1, ptr %32, align 4
  br label %461

461:                                              ; preds = %460, %142
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  %462 = load i1, ptr %12, align 1
  ret i1 %462
}

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

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

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

declare void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #8

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 willreturn memory(read) }
attributes #7 = { 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 #8 = { "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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !15, i64 80}
!12 = !{!"_ZTSN10SimTKIpopt11TNLPAdapterE", !13, i64 0, !16, i64 16, !17, i64 24, !18, i64 32, !18, i64 40, !19, i64 48, !20, i64 52, !18, i64 56, !18, i64 64, !10, i64 72, !10, i64 73, !21, i64 76, !15, i64 80, !15, i64 84, !15, i64 88, !15, i64 92, !15, i64 96, !15, i64 100, !15, i64 104, !15, i64 108, !15, i64 112, !22, i64 116, !23, i64 120, !23, i64 128, !23, i64 136, !23, i64 144, !24, i64 152, !23, i64 160, !24, i64 168, !23, i64 176, !24, i64 184, !23, i64 192, !24, i64 200, !24, i64 208, !24, i64 216, !25, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !15, i64 272, !15, i64 276, !15, i64 280, !15, i64 284, !15, i64 288, !26, i64 296, !27, i64 304, !26, i64 312, !27, i64 320, !26, i64 328, !27, i64 336, !27, i64 344, !26, i64 352, !27, i64 360, !26, i64 368, !6, i64 376, !6, i64 384, !6, i64 392}
!13 = !{!"_ZTSN10SimTKIpopt3NLPE", !14, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !15, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_4TNLPEEE", !6, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter26FixedVariableTreatmentEnumE", !7, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter18DerivativeTestEnumE", !7, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !7, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt4TNLP14IndexStyleEnumE", !7, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !6, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !6, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14SymMatrixSpaceEEE", !6, i64 0}
!26 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEE", !6, i64 0}
!27 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEE", !6, i64 0}
!28 = !{!12, !15, i64 84}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!32, !32, i64 0}
!32 = !{!"vtable pointer", !8, i64 0}
!33 = !{!15, !15, i64 0}
!34 = !{!18, !18, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}
!38 = !{!12, !19, i64 48}
!39 = !{!12, !15, i64 112}
!40 = distinct !{!40, !36}
!41 = distinct !{!41, !36}
!42 = distinct !{!42, !36}
!43 = distinct !{!43, !36}
!44 = distinct !{!44, !36}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt11TNLPAdapter16GetStartingPointENS_8SmartPtrINS_6VectorEEEbS3_bS3_bS3_bS3_b(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %1, i1 noundef zeroext %2, ptr noundef %3, i1 noundef zeroext %4, ptr noundef %5, i1 noundef zeroext %6, ptr noundef %7, i1 noundef zeroext %8, ptr noundef %9, i1 noundef zeroext %10) unnamed_addr #4 align 2 {
  %12 = alloca double, align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i32 %14, 0
  %17 = shl nsw i64 %15, 3
  %18 = select i1 %16, i64 -1, i64 %17
  %19 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
  %20 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
  %21 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #9
  %22 = getelementptr inbounds i8, ptr %0, i64 84
  %23 = load i32, ptr %22, align 4, !tbaa !26
  %24 = sext i32 %23 to i64
  %25 = icmp slt i32 %23, 0
  %26 = shl nsw i64 %24, 3
  %27 = select i1 %25, i64 -1, i64 %26
  %28 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %27) #9
  %29 = and i1 %8, %10
  %30 = and i1 %4, %6
  %31 = getelementptr inbounds i8, ptr %0, i64 16
  %32 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = load i32, ptr %13, align 8, !tbaa !5
  %34 = load i32, ptr %22, align 4, !tbaa !26
  %35 = load ptr, ptr %32, align 8, !tbaa !27
  %36 = getelementptr inbounds i8, ptr %35, i64 40
  %37 = load ptr, ptr %36, align 8
  %38 = tail call noundef zeroext i1 %37(ptr noundef nonnull align 8 dereferenceable(12) %32, i32 noundef %33, i1 noundef zeroext %2, ptr noundef nonnull %19, i1 noundef zeroext %29, ptr noundef nonnull %20, ptr noundef nonnull %21, i32 noundef %34, i1 noundef zeroext %30, ptr noundef nonnull %28)
  br i1 %38, label %39, label %203

39:                                               ; preds = %11
  br i1 %2, label %40, label %.loopexit105

40:                                               ; preds = %39
  %41 = tail call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %42 = icmp ne ptr %41, null
  tail call void @llvm.assume(i1 %42)
  %43 = tail call ptr @__dynamic_cast(ptr nonnull %41, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #10
  %44 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %43)
  %45 = getelementptr inbounds i8, ptr %0, i64 296
  %46 = tail call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %45)
  br i1 %46, label %47, label %63

47:                                               ; preds = %40
  %48 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %45)
  %49 = tail call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %48)
  %50 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %51 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %50)
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph, label %.loopexit105

.lr.ph:                                           ; preds = %47, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %47 ]
  %53 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv
  %54 = load i32, ptr %53, align 4, !tbaa !29
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds double, ptr %19, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !30
  %58 = getelementptr inbounds double, ptr %44, i64 %indvars.iv
  store double %57, ptr %58, align 8, !tbaa !30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %60 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %59)
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next, %61
  br i1 %62, label %.lr.ph, label %.loopexit105, !llvm.loop !31

63:                                               ; preds = %40
  %64 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %65 = tail call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %64)
  tail call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %65, ptr noundef nonnull %19, i32 noundef 1, ptr noundef %44, i32 noundef 1)
  br label %.loopexit105

.loopexit105:                                     ; preds = %.lr.ph, %47, %63, %39
  br i1 %4, label %66, label %97

66:                                               ; preds = %.loopexit105
  %67 = tail call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %68 = icmp ne ptr %67, null
  tail call void @llvm.assume(i1 %68)
  %69 = tail call ptr @__dynamic_cast(ptr nonnull %67, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #10
  %70 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %69)
  %71 = getelementptr inbounds i8, ptr %0, i64 352
  %72 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %71)
  %73 = tail call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %72)
  %74 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %71)
  %75 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %74)
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.lr.ph108, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph108, %66
  %77 = getelementptr inbounds i8, ptr %0, i64 48
  %78 = load i32, ptr %77, align 8, !tbaa !33
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %90, label %97

.lr.ph108:                                        ; preds = %66, %.lr.ph108
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %.lr.ph108 ], [ 0, %66 ]
  %80 = getelementptr inbounds i32, ptr %73, i64 %indvars.iv125
  %81 = load i32, ptr %80, align 4, !tbaa !29
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %28, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !30
  %85 = getelementptr inbounds double, ptr %70, i64 %indvars.iv125
  store double %84, ptr %85, align 8, !tbaa !30
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %86 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %71)
  %87 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %86)
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next126, %88
  br i1 %89, label %.lr.ph108, label %._crit_edge, !llvm.loop !34

90:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #10
  store double 0.000000e+00, ptr %12, align 8, !tbaa !30
  %91 = getelementptr inbounds i8, ptr %0, i64 112
  %92 = load i32, ptr %91, align 8, !tbaa !35
  %93 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %71)
  %94 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %93)
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %70, i64 %95
  call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %92, ptr noundef nonnull %12, i32 noundef 0, ptr noundef %96, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  br label %97

97:                                               ; preds = %._crit_edge, %90, %.loopexit105
  br i1 %6, label %98, label %.loopexit104

98:                                               ; preds = %97
  %99 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %100 = icmp ne ptr %99, null
  call void @llvm.assume(i1 %100)
  %101 = call ptr @__dynamic_cast(ptr nonnull %99, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #10
  %102 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %101)
  %103 = getelementptr inbounds i8, ptr %0, i64 368
  %104 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %103)
  %105 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %104)
  %106 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %107 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %106)
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %.lr.ph111, label %.loopexit104

.lr.ph111:                                        ; preds = %98, %.lr.ph111
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %.lr.ph111 ], [ 0, %98 ]
  %109 = getelementptr inbounds i32, ptr %105, i64 %indvars.iv128
  %110 = load i32, ptr %109, align 4, !tbaa !29
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds double, ptr %28, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !30
  %114 = getelementptr inbounds double, ptr %102, i64 %indvars.iv128
  store double %113, ptr %114, align 8, !tbaa !30
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %115 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %116 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %115)
  %117 = sext i32 %116 to i64
  %118 = icmp slt i64 %indvars.iv.next129, %117
  br i1 %118, label %.lr.ph111, label %.loopexit104, !llvm.loop !36

.loopexit104:                                     ; preds = %.lr.ph111, %98, %97
  br i1 %8, label %119, label %.loopexit101

119:                                              ; preds = %.loopexit104
  %120 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %121 = icmp ne ptr %120, null
  call void @llvm.assume(i1 %121)
  %122 = call ptr @__dynamic_cast(ptr nonnull %120, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #10
  %123 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %122)
  %124 = getelementptr inbounds i8, ptr %0, i64 312
  %125 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %124)
  %126 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %125)
  %127 = getelementptr inbounds i8, ptr %0, i64 296
  %128 = call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %127)
  br i1 %128, label %132, label %.preheader102

.preheader102:                                    ; preds = %119
  %129 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %130 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %129)
  %131 = icmp sgt i32 %130, 0
  br i1 %131, label %.lr.ph113, label %.loopexit101

132:                                              ; preds = %119
  %133 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %127)
  %134 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %133)
  %135 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %136 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %135)
  %137 = icmp sgt i32 %136, 0
  br i1 %137, label %.lr.ph116, label %.loopexit101

.lr.ph116:                                        ; preds = %132, %.lr.ph116
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %.lr.ph116 ], [ 0, %132 ]
  %138 = getelementptr inbounds i32, ptr %126, i64 %indvars.iv134
  %139 = load i32, ptr %138, align 4, !tbaa !29
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds i32, ptr %134, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !29
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds double, ptr %20, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !30
  %146 = getelementptr inbounds double, ptr %123, i64 %indvars.iv134
  store double %145, ptr %146, align 8, !tbaa !30
  %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
  %147 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %148 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %147)
  %149 = sext i32 %148 to i64
  %150 = icmp slt i64 %indvars.iv.next135, %149
  br i1 %150, label %.lr.ph116, label %.loopexit101, !llvm.loop !37

.lr.ph113:                                        ; preds = %.preheader102, %.lr.ph113
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %.lr.ph113 ], [ 0, %.preheader102 ]
  %151 = getelementptr inbounds i32, ptr %126, i64 %indvars.iv131
  %152 = load i32, ptr %151, align 4, !tbaa !29
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds double, ptr %20, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !30
  %156 = getelementptr inbounds double, ptr %123, i64 %indvars.iv131
  store double %155, ptr %156, align 8, !tbaa !30
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %157 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %158 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %157)
  %159 = sext i32 %158 to i64
  %160 = icmp slt i64 %indvars.iv.next132, %159
  br i1 %160, label %.lr.ph113, label %.loopexit101, !llvm.loop !38

.loopexit101:                                     ; preds = %.lr.ph113, %.lr.ph116, %.preheader102, %132, %.loopexit104
  br i1 %10, label %161, label %.loopexit

161:                                              ; preds = %.loopexit101
  %162 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %163 = icmp ne ptr %162, null
  call void @llvm.assume(i1 %163)
  %164 = call ptr @__dynamic_cast(ptr nonnull %162, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #10
  %165 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %164)
  %166 = getelementptr inbounds i8, ptr %0, i64 328
  %167 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %166)
  %168 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %167)
  %169 = getelementptr inbounds i8, ptr %0, i64 296
  %170 = call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %169)
  br i1 %170, label %174, label %.preheader

.preheader:                                       ; preds = %161
  %171 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %172 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %171)
  %173 = icmp sgt i32 %172, 0
  br i1 %173, label %.lr.ph118, label %.loopexit

174:                                              ; preds = %161
  %175 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %169)
  %176 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %175)
  %177 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %178 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %177)
  %179 = icmp sgt i32 %178, 0
  br i1 %179, label %.lr.ph121, label %.loopexit

.lr.ph121:                                        ; preds = %174, %.lr.ph121
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.lr.ph121 ], [ 0, %174 ]
  %180 = getelementptr inbounds i32, ptr %168, i64 %indvars.iv140
  %181 = load i32, ptr %180, align 4, !tbaa !29
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr %176, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !29
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds double, ptr %21, i64 %185
  %187 = load double, ptr %186, align 8, !tbaa !30
  %188 = getelementptr inbounds double, ptr %165, i64 %indvars.iv140
  store double %187, ptr %188, align 8, !tbaa !30
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %189 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %190 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %189)
  %191 = sext i32 %190 to i64
  %192 = icmp slt i64 %indvars.iv.next141, %191
  br i1 %192, label %.lr.ph121, label %.loopexit, !llvm.loop !39

.lr.ph118:                                        ; preds = %.preheader, %.lr.ph118
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %.lr.ph118 ], [ 0, %.preheader ]
  %193 = getelementptr inbounds i32, ptr %168, i64 %indvars.iv137
  %194 = load i32, ptr %193, align 4, !tbaa !29
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds double, ptr %21, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !30
  %198 = getelementptr inbounds double, ptr %165, i64 %indvars.iv137
  store double %197, ptr %198, align 8, !tbaa !30
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %199 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %200 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %199)
  %201 = sext i32 %200 to i64
  %202 = icmp slt i64 %indvars.iv.next138, %201
  br i1 %202, label %.lr.ph118, label %.loopexit, !llvm.loop !40

.loopexit:                                        ; preds = %.lr.ph118, %.lr.ph121, %.preheader, %174, %.loopexit101
  call void @_ZdaPv(ptr noundef nonnull %19) #11
  call void @_ZdaPv(ptr noundef nonnull %20) #11
  call void @_ZdaPv(ptr noundef nonnull %21) #11
  call void @_ZdaPv(ptr noundef nonnull %28) #11
  br label %203

203:                                              ; preds = %11, %.loopexit
  ret i1 %38
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205)) local_unnamed_addr #6 align 2

declare void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nobuiltin allocsize(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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #6 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { builtin 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, !9, i64 80}
!6 = !{!"_ZTSN10SimTKIpopt11TNLPAdapterE", !7, i64 0, !12, i64 16, !14, i64 24, !15, i64 32, !15, i64 40, !16, i64 48, !17, i64 52, !15, i64 56, !15, i64 64, !18, i64 72, !18, i64 73, !19, i64 76, !9, i64 80, !9, i64 84, !9, i64 88, !9, i64 92, !9, i64 96, !9, i64 100, !9, i64 104, !9, i64 108, !9, i64 112, !20, i64 116, !21, i64 120, !21, i64 128, !21, i64 136, !21, i64 144, !22, i64 152, !21, i64 160, !22, i64 168, !21, i64 176, !22, i64 184, !21, i64 192, !22, i64 200, !22, i64 208, !22, i64 216, !23, i64 224, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !9, i64 272, !9, i64 276, !9, i64 280, !9, i64 284, !9, i64 288, !24, i64 296, !25, i64 304, !24, i64 312, !25, i64 320, !24, i64 328, !25, i64 336, !25, i64 344, !24, i64 352, !25, i64 360, !24, i64 368, !13, i64 376, !13, i64 384, !13, i64 392}
!7 = !{!"_ZTSN10SimTKIpopt3NLPE", !8, i64 0}
!8 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !9, i64 8}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_4TNLPEEE", !13, i64 0}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !13, i64 0}
!15 = !{!"double", !10, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter26FixedVariableTreatmentEnumE", !10, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter18DerivativeTestEnumE", !10, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !10, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt4TNLP14IndexStyleEnumE", !10, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !13, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !13, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14SymMatrixSpaceEEE", !13, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEE", !13, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEE", !13, i64 0}
!26 = !{!6, !9, i64 84}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !11, i64 0}
!29 = !{!9, !9, i64 0}
!30 = !{!15, !15, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!6, !16, i64 48}
!34 = distinct !{!34, !32}
!35 = !{!6, !9, i64 112}
!36 = distinct !{!36, !32}
!37 = distinct !{!37, !32}
!38 = distinct !{!38, !32}
!39 = distinct !{!39, !32}
!40 = distinct !{!40, !32}


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