; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.11" = type { i8 }
%"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 }

@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZTIN10SimTKIpopt14OPTION_INVALIDE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt6VectorE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt11DenseVectorE = external constant ptr
@.str.56 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [64 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare ptr @__cxa_allocate_exception(i64)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare void @__cxa_free_exception(ptr)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt14OPTION_INVALIDC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef, ptr noundef, i32 noundef) unnamed_addr #2 align 2

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

declare void @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, ptr noundef, ...) #4

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt11TNLPAdapter20GetScalingParametersENS_8SmartPtrIKNS_11VectorSpaceEEES4_S4_RdRNS1_INS_6VectorEEES8_S8_(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca ptr, 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 ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i8, align 1
  %25 = alloca i8, align 1
  %26 = alloca ptr, align 8
  %27 = alloca i8, align 1
  %28 = alloca %"class.std::__cxx11::basic_string", align 8
  %29 = alloca %"class.std::allocator.11", align 1
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca %"class.std::__cxx11::basic_string", align 8
  %33 = alloca %"class.std::allocator.11", align 1
  %34 = alloca i1, align 1
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca i8, align 1
  %38 = alloca %"class.std::__cxx11::basic_string", align 8
  %39 = alloca %"class.std::allocator.11", align 1
  %40 = alloca %"class.std::__cxx11::basic_string", align 8
  %41 = alloca %"class.std::allocator.11", align 1
  %42 = alloca i1, align 1
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  %45 = alloca double, align 8
  %46 = alloca ptr, align 8
  %47 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  %48 = load ptr, ptr %9, align 8
  %49 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds ptr, ptr %50, i64 2
  %52 = load ptr, ptr %51, align 8
  %53 = call noundef ptr %52(ptr noundef nonnull align 8 dereferenceable(16) %49)
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef %53)
  %56 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %57, i64 2
  %59 = load ptr, ptr %58, align 8
  %60 = call noundef ptr %59(ptr noundef nonnull align 8 dereferenceable(16) %56)
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef %60)
  %63 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds ptr, ptr %64, i64 2
  %66 = load ptr, ptr %65, align 8
  %67 = call noundef ptr %66(ptr noundef nonnull align 8 dereferenceable(16) %63)
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef %67)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %70)
  %72 = icmp eq ptr %71, null
  br i1 %72, label %75, label %73

73:                                               ; preds = %8
  %74 = call ptr @__dynamic_cast(ptr %71, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %76

75:                                               ; preds = %8
  br label %76

76:                                               ; preds = %75, %73
  %77 = phi ptr [ %74, %73 ], [ null, %75 ]
  store ptr %77, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %78)
  %80 = icmp eq ptr %79, null
  br i1 %80, label %83, label %81

81:                                               ; preds = %76
  %82 = call ptr @__dynamic_cast(ptr %79, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %84

83:                                               ; preds = %76
  br label %84

84:                                               ; preds = %83, %81
  %85 = phi ptr [ %82, %81 ], [ null, %83 ]
  store ptr %85, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %86 = load ptr, ptr %16, align 8, !tbaa !5
  %87 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %86)
  %88 = icmp eq ptr %87, null
  br i1 %88, label %91, label %89

89:                                               ; preds = %84
  %90 = call ptr @__dynamic_cast(ptr %87, ptr @_ZTIN10SimTKIpopt6VectorE, ptr @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #9
  br label %92

91:                                               ; preds = %84
  br label %92

92:                                               ; preds = %91, %89
  %93 = phi ptr [ %90, %89 ], [ null, %91 ]
  store ptr %93, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %94 = load ptr, ptr %17, align 8, !tbaa !5
  %95 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %94)
  store ptr %95, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %96 = load ptr, ptr %18, align 8, !tbaa !5
  %97 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %96)
  store ptr %97, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %98 = load ptr, ptr %19, align 8, !tbaa !5
  %99 = call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %98)
  store ptr %99, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %100 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 13
  %101 = load i32, ptr %100, align 4, !tbaa !11
  %102 = sext i32 %101 to i64
  %103 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %102, i64 8)
  %104 = extractvalue { i64, i1 } %103, 1
  %105 = extractvalue { i64, i1 } %103, 0
  %106 = select i1 %104, i64 -1, i64 %105
  %107 = call noalias noundef nonnull ptr @_Znam(i64 noundef %106) #10
  store ptr %107, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #9
  store i8 1, ptr %24, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #9
  store i8 1, ptr %25, align 1, !tbaa !29
  %108 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 46
  %109 = call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %108)
  br i1 %109, label %110, label %195

110:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %111 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 12
  %112 = load i32, ptr %111, align 8, !tbaa !30
  %113 = sext i32 %112 to i64
  %114 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %113, i64 8)
  %115 = extractvalue { i64, i1 } %114, 1
  %116 = extractvalue { i64, i1 } %114, 0
  %117 = select i1 %115, i64 -1, i64 %116
  %118 = call noalias noundef nonnull ptr @_Znam(i64 noundef %117) #10
  store ptr %118, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #9
  %119 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 1
  %120 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %119)
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 12
  %123 = load i32, ptr %122, align 8, !tbaa !30
  %124 = load ptr, ptr %26, align 8, !tbaa !5
  %125 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 13
  %126 = load i32, ptr %125, align 4, !tbaa !11
  %127 = load ptr, ptr %23, align 8, !tbaa !5
  %128 = load ptr, ptr %120, align 8, !tbaa !9
  %129 = getelementptr inbounds ptr, ptr %128, i64 4
  %130 = load ptr, ptr %129, align 8
  %131 = call noundef zeroext i1 %130(ptr noundef nonnull align 8 dereferenceable(12) %120, ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef nonnull align 1 dereferenceable(1) %24, i32 noundef %123, ptr noundef %124, ptr noundef nonnull align 1 dereferenceable(1) %25, i32 noundef %126, ptr noundef %127)
  %132 = zext i1 %131 to i8
  store i8 %132, ptr %27, align 1, !tbaa !29
  %133 = load i8, ptr %27, align 1, !tbaa !29, !range !31, !noundef !32
  %134 = trunc i8 %133 to i1
  br i1 %134, label %159, label %135

135:                                              ; preds = %110
  %136 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 2
  %137 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %136)
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %137, i32 noundef 1, i32 noundef 3, ptr noundef @.str.56)
  store i1 true, ptr %34, align 1
  %138 = call ptr @__cxa_allocate_exception(i64 112) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %28, ptr noundef @.str.57, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %139 unwind label %142

139:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %33)
          to label %140 unwind label %146

140:                                              ; preds = %139
  invoke void @_ZN10SimTKIpopt14OPTION_INVALIDC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(ptr noundef nonnull align 8 dereferenceable(112) %138, ptr noundef %28, ptr noundef %32, i32 noundef 1162)
          to label %141 unwind label %150

141:                                              ; preds = %140
  store i1 false, ptr %34, align 1
  invoke void @__cxa_throw(ptr %138, ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE, ptr @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #11
          to label %331 unwind label %150

142:                                              ; preds = %135
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %30, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %31, align 4
  br label %155

146:                                              ; preds = %139
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %30, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %31, align 4
  br label %154

150:                                              ; preds = %141, %140
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %30, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %31, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #9
  br label %154

154:                                              ; preds = %150, %146
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #9
  br label %155

155:                                              ; preds = %154, %142
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #9
  %156 = load i1, ptr %34, align 1
  br i1 %156, label %157, label %158

157:                                              ; preds = %155
  call void @__cxa_free_exception(ptr %138) #9
  br label %158

158:                                              ; preds = %157, %155
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %325

159:                                              ; preds = %110
  %160 = load i8, ptr %24, align 1, !tbaa !29, !range !31, !noundef !32
  %161 = trunc i8 %160 to i1
  br i1 %161, label %162, label %190

162:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %163 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 46
  %164 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %163)
  %165 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %164)
  store ptr %165, 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 %166

166:                                              ; preds = %186, %162
  %167 = load i32, ptr %36, align 4, !tbaa !33
  %168 = load ptr, ptr %17, align 8, !tbaa !5
  %169 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %168)
  %170 = icmp slt i32 %167, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %189

172:                                              ; preds = %166
  %173 = load ptr, ptr %26, align 8, !tbaa !5
  %174 = load ptr, ptr %35, align 8, !tbaa !5
  %175 = load i32, ptr %36, align 4, !tbaa !33
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %174, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !33
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds double, ptr %173, i64 %179
  %181 = load double, ptr %180, align 8, !tbaa !34
  %182 = load ptr, ptr %20, align 8, !tbaa !5
  %183 = load i32, ptr %36, align 4, !tbaa !33
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds double, ptr %182, i64 %184
  store double %181, ptr %185, align 8, !tbaa !34
  br label %186

186:                                              ; preds = %172
  %187 = load i32, ptr %36, align 4, !tbaa !33
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %36, align 4, !tbaa !33
  br label %166, !llvm.loop !35

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

190:                                              ; preds = %189, %159
  %191 = load ptr, ptr %26, align 8, !tbaa !5
  %192 = icmp eq ptr %191, null
  br i1 %192, label %194, label %193

193:                                              ; preds = %190
  call void @_ZdaPv(ptr noundef %191) #12
  br label %194

194:                                              ; preds = %193, %190
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %237

195:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #9
  %196 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 1
  %197 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %196)
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 12
  %200 = load i32, ptr %199, align 8, !tbaa !30
  %201 = load ptr, ptr %20, align 8, !tbaa !5
  %202 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 13
  %203 = load i32, ptr %202, align 4, !tbaa !11
  %204 = load ptr, ptr %23, align 8, !tbaa !5
  %205 = load ptr, ptr %197, align 8, !tbaa !9
  %206 = getelementptr inbounds ptr, ptr %205, i64 4
  %207 = load ptr, ptr %206, align 8
  %208 = call noundef zeroext i1 %207(ptr noundef nonnull align 8 dereferenceable(12) %197, ptr noundef nonnull align 8 dereferenceable(8) %198, ptr noundef nonnull align 1 dereferenceable(1) %24, i32 noundef %200, ptr noundef %201, ptr noundef nonnull align 1 dereferenceable(1) %25, i32 noundef %203, ptr noundef %204)
  %209 = zext i1 %208 to i8
  store i8 %209, ptr %37, align 1, !tbaa !29
  %210 = load i8, ptr %37, align 1, !tbaa !29, !range !31, !noundef !32
  %211 = trunc i8 %210 to i1
  br i1 %211, label %236, label %212

212:                                              ; preds = %195
  %213 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 2
  %214 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %213)
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %214, i32 noundef 1, i32 noundef 3, ptr noundef @.str.56)
  store i1 true, ptr %42, align 1
  %215 = call ptr @__cxa_allocate_exception(i64 112) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %39) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef @.str.57, ptr noundef nonnull align 1 dereferenceable(1) %39)
          to label %216 unwind label %219

216:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 1, ptr %41) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %40, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %41)
          to label %217 unwind label %223

217:                                              ; preds = %216
  invoke void @_ZN10SimTKIpopt14OPTION_INVALIDC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(ptr noundef nonnull align 8 dereferenceable(112) %215, ptr noundef %38, ptr noundef %40, i32 noundef 1183)
          to label %218 unwind label %227

218:                                              ; preds = %217
  store i1 false, ptr %42, align 1
  invoke void @__cxa_throw(ptr %215, ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE, ptr @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #11
          to label %331 unwind label %227

219:                                              ; preds = %212
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %30, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %31, align 4
  br label %232

223:                                              ; preds = %216
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %30, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %31, align 4
  br label %231

227:                                              ; preds = %218, %217
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %30, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %31, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %40) #9
  br label %231

231:                                              ; preds = %227, %223
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %41) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %41) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %38) #9
  br label %232

232:                                              ; preds = %231, %219
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %39) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %39) #9
  %233 = load i1, ptr %42, align 1
  br i1 %233, label %234, label %235

234:                                              ; preds = %232
  call void @__cxa_free_exception(ptr %215) #9
  br label %235

235:                                              ; preds = %234, %232
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #9
  br label %325

236:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #9
  br label %237

237:                                              ; preds = %236, %194
  %238 = load i8, ptr %24, align 1, !tbaa !29, !range !31, !noundef !32
  %239 = trunc i8 %238 to i1
  br i1 %239, label %243, label %240

240:                                              ; preds = %237
  %241 = load ptr, ptr %14, align 8, !tbaa !5
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %241, ptr noundef null)
  br label %243

243:                                              ; preds = %240, %237
  %244 = load i8, ptr %25, align 1, !tbaa !29, !range !31, !noundef !32
  %245 = trunc i8 %244 to i1
  br i1 %245, label %246, label %315

246:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #9
  %247 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 53
  %248 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %247)
  %249 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %248)
  store ptr %249, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #9
  store i32 0, ptr %44, align 4, !tbaa !33
  br label %250

250:                                              ; preds = %271, %246
  %251 = load i32, ptr %44, align 4, !tbaa !33
  %252 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 53
  %253 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %252)
  %254 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %253)
  %255 = icmp slt i32 %251, %254
  br i1 %255, label %257, label %256

256:                                              ; preds = %250
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  br label %274

257:                                              ; preds = %250
  %258 = load ptr, ptr %23, align 8, !tbaa !5
  %259 = load ptr, ptr %43, align 8, !tbaa !5
  %260 = load i32, ptr %44, align 4, !tbaa !33
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds i32, ptr %259, i64 %261
  %263 = load i32, ptr %262, align 4, !tbaa !33
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds double, ptr %258, i64 %264
  %266 = load double, ptr %265, align 8, !tbaa !34
  %267 = load ptr, ptr %21, align 8, !tbaa !5
  %268 = load i32, ptr %44, align 4, !tbaa !33
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds double, ptr %267, i64 %269
  store double %266, ptr %270, align 8, !tbaa !34
  br label %271

271:                                              ; preds = %257
  %272 = load i32, ptr %44, align 4, !tbaa !33
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %44, align 4, !tbaa !33
  br label %250, !llvm.loop !37

274:                                              ; preds = %256
  %275 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 5
  %276 = load i32, ptr %275, align 8, !tbaa !38
  %277 = icmp eq i32 %276, 1
  br i1 %277, label %278, label %287

278:                                              ; preds = %274
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #9
  store double 1.000000e+00, ptr %45, align 8, !tbaa !34
  %279 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 20
  %280 = load i32, ptr %279, align 8, !tbaa !39
  %281 = load ptr, ptr %21, align 8, !tbaa !5
  %282 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 53
  %283 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %282)
  %284 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %283)
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds double, ptr %281, i64 %285
  call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %280, ptr noundef %45, i32 noundef 0, ptr noundef %286, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #9
  br label %287

287:                                              ; preds = %278, %274
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #9
  %288 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %48, i32 0, i32 55
  %289 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %288)
  %290 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %289)
  store ptr %290, ptr %46, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #9
  store i32 0, ptr %47, align 4, !tbaa !33
  br label %291

291:                                              ; preds = %311, %287
  %292 = load i32, ptr %47, align 4, !tbaa !33
  %293 = load ptr, ptr %19, align 8, !tbaa !5
  %294 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %293)
  %295 = icmp slt i32 %292, %294
  br i1 %295, label %297, label %296

296:                                              ; preds = %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #9
  br label %314

297:                                              ; preds = %291
  %298 = load ptr, ptr %23, align 8, !tbaa !5
  %299 = load ptr, ptr %46, align 8, !tbaa !5
  %300 = load i32, ptr %47, align 4, !tbaa !33
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds i32, ptr %299, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !33
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds double, ptr %298, i64 %304
  %306 = load double, ptr %305, align 8, !tbaa !34
  %307 = load ptr, ptr %22, align 8, !tbaa !5
  %308 = load i32, ptr %47, align 4, !tbaa !33
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds double, ptr %307, i64 %309
  store double %306, ptr %310, align 8, !tbaa !34
  br label %311

311:                                              ; preds = %297
  %312 = load i32, ptr %47, align 4, !tbaa !33
  %313 = add nsw i32 %312, 1
  store i32 %313, ptr %47, align 4, !tbaa !33
  br label %291, !llvm.loop !40

314:                                              ; preds = %296
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #9
  br label %320

315:                                              ; preds = %243
  %316 = load ptr, ptr %15, align 8, !tbaa !5
  %317 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %316, ptr noundef null)
  %318 = load ptr, ptr %16, align 8, !tbaa !5
  %319 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %318, ptr noundef null)
  br label %320

320:                                              ; preds = %315, %314
  %321 = load ptr, ptr %23, align 8, !tbaa !5
  %322 = icmp eq ptr %321, null
  br i1 %322, label %324, label %323

323:                                              ; preds = %320
  call void @_ZdaPv(ptr noundef %321) #12
  br label %324

324:                                              ; preds = %323, %320
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  ret void

325:                                              ; preds = %235, %158
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %326

326:                                              ; preds = %325
  %327 = load ptr, ptr %30, align 8
  %328 = load i32, ptr %31, align 4
  %329 = insertvalue { ptr, i32 } poison, ptr %327, 0
  %330 = insertvalue { ptr, i32 } %329, i32 %328, 1
  resume { ptr, i32 } %330

331:                                              ; preds = %218, %141
  unreachable
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { noreturn }
attributes #12 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !15, i64 84}
!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, !21, i64 72, !21, i64 73, !22, 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, !23, i64 116, !24, i64 120, !24, i64 128, !24, i64 136, !24, i64 144, !25, i64 152, !24, i64 160, !25, i64 168, !24, i64 176, !25, i64 184, !24, i64 192, !25, i64 200, !25, i64 208, !25, i64 216, !26, 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, !27, i64 296, !28, i64 304, !27, i64 312, !28, i64 320, !27, i64 328, !28, i64 336, !28, i64 344, !27, i64 352, !28, i64 360, !27, 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 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !7, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt4TNLP14IndexStyleEnumE", !7, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !6, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !6, i64 0}
!26 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14SymMatrixSpaceEEE", !6, i64 0}
!27 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEE", !6, i64 0}
!28 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEE", !6, i64 0}
!29 = !{!21, !21, i64 0}
!30 = !{!12, !15, i64 80}
!31 = !{i8 0, i8 2}
!32 = !{}
!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}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.11" = type { i8 }

@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZTIN10SimTKIpopt14OPTION_INVALIDE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt6VectorE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt11DenseVectorE = external constant ptr
@.str.56 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [64 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt14OPTION_INVALIDC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef, ptr noundef, i32 noundef) unnamed_addr #2 align 2

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

declare void @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 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 #2

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

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

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

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

; 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 #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK10SimTKIpopt11TNLPAdapter20GetScalingParametersENS_8SmartPtrIKNS_11VectorSpaceEEES4_S4_RdRNS1_INS_6VectorEEES8_S8_(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator.11", align 1
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::allocator.11", align 1
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator.11", align 1
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::allocator.11", align 1
  %19 = alloca double, align 8
  %20 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %23 = load ptr, ptr %22, align 8
  %24 = tail call noundef ptr %23(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %24)
  %26 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %29 = load ptr, ptr %28, align 8
  %30 = tail call noundef ptr %29(ptr noundef nonnull align 8 dereferenceable(16) %26)
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %30)
  %32 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load ptr, ptr %34, align 8
  %36 = tail call noundef ptr %35(ptr noundef nonnull align 8 dereferenceable(16) %32)
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %36)
  %38 = tail call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %39 = icmp eq ptr %38, null
  br i1 %39, label %42, label %40

40:                                               ; preds = %8
  %41 = tail call ptr @__dynamic_cast(ptr nonnull %38, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %42

42:                                               ; preds = %8, %40
  %43 = phi ptr [ %41, %40 ], [ null, %8 ]
  %44 = tail call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %45 = icmp eq ptr %44, null
  br i1 %45, label %48, label %46

46:                                               ; preds = %42
  %47 = tail call ptr @__dynamic_cast(ptr nonnull %44, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %48

48:                                               ; preds = %42, %46
  %49 = phi ptr [ %47, %46 ], [ null, %42 ]
  %50 = tail call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_6VectorEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %51 = icmp eq ptr %50, null
  br i1 %51, label %54, label %52

52:                                               ; preds = %48
  %53 = tail call ptr @__dynamic_cast(ptr nonnull %50, ptr nonnull @_ZTIN10SimTKIpopt6VectorE, ptr nonnull @_ZTIN10SimTKIpopt11DenseVectorE, i64 0) #8
  br label %54

54:                                               ; preds = %48, %52
  %55 = phi ptr [ %53, %52 ], [ null, %48 ]
  %56 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %43)
  %57 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %49)
  %58 = tail call noundef ptr @_ZN10SimTKIpopt11DenseVector6ValuesEv(ptr noundef nonnull align 8 dereferenceable(240) %55)
  %59 = getelementptr inbounds i8, ptr %0, i64 84
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = icmp slt i32 %60, 0
  %63 = shl nsw i64 %61, 3
  %64 = select i1 %62, i64 -1, i64 %63
  %65 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %64) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #8
  store i8 1, ptr %9, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #8
  store i8 1, ptr %10, align 1, !tbaa !28
  %66 = getelementptr inbounds i8, ptr %0, i64 296
  %67 = tail call noundef zeroext i1 @_ZN10SimTKIpopt7IsValidINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %66)
  br i1 %67, label %68, label %114

68:                                               ; preds = %54
  %69 = getelementptr inbounds i8, ptr %0, i64 80
  %70 = load i32, ptr %69, align 8, !tbaa !29
  %71 = sext i32 %70 to i64
  %72 = icmp slt i32 %70, 0
  %73 = shl nsw i64 %71, 3
  %74 = select i1 %72, i64 -1, i64 %73
  %75 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %74) #9
  %76 = getelementptr inbounds i8, ptr %0, i64 16
  %77 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %76)
  %78 = load i32, ptr %69, align 8, !tbaa !29
  %79 = load i32, ptr %59, align 4, !tbaa !8
  %80 = load ptr, ptr %77, align 8, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %80, i64 32
  %82 = load ptr, ptr %81, align 8
  %83 = call noundef zeroext i1 %82(ptr noundef nonnull align 8 dereferenceable(12) %77, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %9, i32 noundef %78, ptr noundef nonnull %75, ptr noundef nonnull align 1 dereferenceable(1) %10, i32 noundef %79, ptr noundef nonnull %65)
  br i1 %83, label %97, label %84

84:                                               ; preds = %68
  %85 = getelementptr inbounds i8, ptr %0, i64 24
  %86 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %85)
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %86, i32 noundef 1, i32 noundef 3, ptr noundef nonnull @.str.56)
  %87 = call ptr @__cxa_allocate_exception(i64 112) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull @.str.57, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %88 unwind label %.thread

88:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %89 unwind label %92

89:                                               ; preds = %88
  invoke void @_ZN10SimTKIpopt14OPTION_INVALIDC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(ptr noundef nonnull align 8 dereferenceable(112) %87, ptr noundef nonnull %11, ptr noundef nonnull %13, i32 noundef 1162)
          to label %90 unwind label %94

90:                                               ; preds = %89
  invoke void @__cxa_throw(ptr nonnull %87, ptr nonnull @_ZTIN10SimTKIpopt14OPTION_INVALIDE, ptr nonnull @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #10
          to label %191 unwind label %94

.thread:                                          ; preds = %84
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #8
  br label %.sink.split

92:                                               ; preds = %88
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %96

94:                                               ; preds = %90, %89
  %.060 = phi i1 [ false, %90 ], [ true, %89 ]
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #8
  br label %96

96:                                               ; preds = %92, %94
  %.161 = phi i1 [ %.060, %94 ], [ true, %92 ]
  %.pn69 = phi { ptr, i32 } [ %95, %94 ], [ %93, %92 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #8
  br i1 %.161, label %.sink.split, label %190

97:                                               ; preds = %68
  %98 = load i8, ptr %9, align 1, !tbaa !28, !range !30, !noundef !31
  %99 = trunc nuw i8 %98 to i1
  br i1 %99, label %100, label %.loopexit80

100:                                              ; preds = %97
  %101 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %66)
  %102 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %101)
  %103 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %43)
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %.lr.ph, label %.loopexit80

.lr.ph:                                           ; preds = %100, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %100 ]
  %105 = getelementptr inbounds i32, ptr %102, i64 %indvars.iv
  %106 = load i32, ptr %105, align 4, !tbaa !32
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %75, i64 %107
  %109 = load double, ptr %108, align 8, !tbaa !33
  %110 = getelementptr inbounds double, ptr %56, i64 %indvars.iv
  store double %109, ptr %110, align 8, !tbaa !33
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %111 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %43)
  %112 = sext i32 %111 to i64
  %113 = icmp slt i64 %indvars.iv.next, %112
  br i1 %113, label %.lr.ph, label %.loopexit80, !llvm.loop !34

.loopexit80:                                      ; preds = %.lr.ph, %100, %97
  call void @_ZdaPv(ptr noundef nonnull %75) #11
  br label %137

114:                                              ; preds = %54
  %115 = getelementptr inbounds i8, ptr %0, i64 16
  %116 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %115)
  %117 = getelementptr inbounds i8, ptr %0, i64 80
  %118 = load i32, ptr %117, align 8, !tbaa !29
  %119 = load i32, ptr %59, align 4, !tbaa !8
  %120 = load ptr, ptr %116, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i64 32
  %122 = load ptr, ptr %121, align 8
  %123 = call noundef zeroext i1 %122(ptr noundef nonnull align 8 dereferenceable(12) %116, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %9, i32 noundef %118, ptr noundef %56, ptr noundef nonnull align 1 dereferenceable(1) %10, i32 noundef %119, ptr noundef nonnull %65)
  br i1 %123, label %137, label %124

124:                                              ; preds = %114
  %125 = getelementptr inbounds i8, ptr %0, i64 24
  %126 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %125)
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %126, i32 noundef 1, i32 noundef 3, ptr noundef nonnull @.str.56)
  %127 = call ptr @__cxa_allocate_exception(i64 112) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull @.str.57, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %128 unwind label %.thread76

128:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %18) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %129 unwind label %132

129:                                              ; preds = %128
  invoke void @_ZN10SimTKIpopt14OPTION_INVALIDC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(ptr noundef nonnull align 8 dereferenceable(112) %127, ptr noundef nonnull %15, ptr noundef nonnull %17, i32 noundef 1183)
          to label %130 unwind label %134

130:                                              ; preds = %129
  invoke void @__cxa_throw(ptr nonnull %127, ptr nonnull @_ZTIN10SimTKIpopt14OPTION_INVALIDE, ptr nonnull @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #10
          to label %191 unwind label %134

.thread76:                                        ; preds = %124
  %131 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #8
  br label %.sink.split

132:                                              ; preds = %128
  %133 = landingpad { ptr, i32 }
          cleanup
  br label %136

134:                                              ; preds = %130, %129
  %.057 = phi i1 [ false, %130 ], [ true, %129 ]
  %135 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  br label %136

136:                                              ; preds = %132, %134
  %.158 = phi i1 [ %.057, %134 ], [ true, %132 ]
  %.pn = phi { ptr, i32 } [ %135, %134 ], [ %133, %132 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #8
  br i1 %.158, label %.sink.split, label %190

137:                                              ; preds = %114, %.loopexit80
  %138 = load i8, ptr %9, align 1, !tbaa !28, !range !30, !noundef !31
  %139 = trunc nuw i8 %138 to i1
  br i1 %139, label %142, label %140

140:                                              ; preds = %137
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef null)
  br label %142

142:                                              ; preds = %140, %137
  %143 = load i8, ptr %10, align 1, !tbaa !28, !range !30, !noundef !31
  %144 = trunc nuw i8 %143 to i1
  br i1 %144, label %145, label %187

145:                                              ; preds = %142
  %146 = getelementptr inbounds i8, ptr %0, i64 352
  %147 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %146)
  %148 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %147)
  %149 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %146)
  %150 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %149)
  %151 = icmp sgt i32 %150, 0
  br i1 %151, label %.lr.ph83, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph83, %145
  %152 = getelementptr inbounds i8, ptr %0, i64 48
  %153 = load i32, ptr %152, align 8, !tbaa !36
  %154 = icmp eq i32 %153, 1
  br i1 %154, label %165, label %172

.lr.ph83:                                         ; preds = %145, %.lr.ph83
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph83 ], [ 0, %145 ]
  %155 = getelementptr inbounds i32, ptr %148, i64 %indvars.iv88
  %156 = load i32, ptr %155, align 4, !tbaa !32
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds double, ptr %65, i64 %157
  %159 = load double, ptr %158, align 8, !tbaa !33
  %160 = getelementptr inbounds double, ptr %57, i64 %indvars.iv88
  store double %159, ptr %160, align 8, !tbaa !33
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %161 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %146)
  %162 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %161)
  %163 = sext i32 %162 to i64
  %164 = icmp slt i64 %indvars.iv.next89, %163
  br i1 %164, label %.lr.ph83, label %._crit_edge, !llvm.loop !37

165:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #8
  store double 1.000000e+00, ptr %19, align 8, !tbaa !33
  %166 = getelementptr inbounds i8, ptr %0, i64 112
  %167 = load i32, ptr %166, align 8, !tbaa !38
  %168 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %146)
  %169 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %168)
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds double, ptr %57, i64 %170
  call void @_ZN10SimTKIpopt11IpBlasDcopyEiPKdiPdi(i32 noundef %167, ptr noundef nonnull %19, i32 noundef 0, ptr noundef %171, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  br label %172

172:                                              ; preds = %165, %._crit_edge
  %173 = getelementptr inbounds i8, ptr %0, i64 368
  %174 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %173)
  %175 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix18ExpandedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %174)
  %176 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %55)
  %177 = icmp sgt i32 %176, 0
  br i1 %177, label %.lr.ph86, label %.loopexit

.lr.ph86:                                         ; preds = %172, %.lr.ph86
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.lr.ph86 ], [ 0, %172 ]
  %178 = getelementptr inbounds i32, ptr %175, i64 %indvars.iv91
  %179 = load i32, ptr %178, align 4, !tbaa !32
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds double, ptr %65, i64 %180
  %182 = load double, ptr %181, align 8, !tbaa !33
  %183 = getelementptr inbounds double, ptr %58, i64 %indvars.iv91
  store double %182, ptr %183, align 8, !tbaa !33
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %184 = call noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %55)
  %185 = sext i32 %184 to i64
  %186 = icmp slt i64 %indvars.iv.next92, %185
  br i1 %186, label %.lr.ph86, label %.loopexit, !llvm.loop !39

187:                                              ; preds = %142
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef null)
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6VectorEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef null)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph86, %172, %187
  call void @_ZdaPv(ptr noundef nonnull %65) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #8
  ret void

.sink.split:                                      ; preds = %136, %.thread76, %96, %.thread
  %.sink = phi ptr [ %87, %.thread ], [ %87, %96 ], [ %127, %.thread76 ], [ %127, %136 ]
  %.pn69.pn.pn.ph = phi { ptr, i32 } [ %91, %.thread ], [ %.pn69, %96 ], [ %131, %.thread76 ], [ %.pn, %136 ]
  call void @__cxa_free_exception(ptr %.sink) #8
  br label %190

190:                                              ; preds = %.sink.split, %136, %96
  %.pn69.pn.pn = phi { ptr, i32 } [ %.pn69, %96 ], [ %.pn, %136 ], [ %.pn69.pn.pn.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #8
  resume { ptr, i32 } %.pn69.pn.pn

191:                                              ; preds = %130, %90
  unreachable
}

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

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

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

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

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


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