; 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::SmartPtr.10" = type { ptr }
%"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.9" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZTIN10SimTKIpopt11TNLPAdapter12INVALID_TNLPE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.58 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [57 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 #3 align 2

declare ptr @__cxa_allocate_exception(i64)

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

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 #2 align 2

declare void @__cxa_free_exception(ptr)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 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)) #2 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt11TNLPAdapter33GetQuasiNewtonApproximationSpacesERNS_8SmartPtrINS_11VectorSpaceEEERNS1_INS_6MatrixEEE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.11", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::allocator.11", align 1
  %16 = alloca i1, align 1
  %17 = alloca i32, align 4
  %18 = alloca %"class.SimTKIpopt::SmartPtr.10", align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %"class.SimTKIpopt::SmartPtr.10", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %28 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 1
  %29 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 14
  %32 = load ptr, ptr %31, align 8
  %33 = call noundef i32 %32(ptr noundef nonnull align 8 dereferenceable(12) %29)
  store i32 %33, ptr %7, align 4, !tbaa !11
  %34 = load i32, ptr %7, align 4, !tbaa !11
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %41

36:                                               ; preds = %3
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef null)
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef null)
  br label %264

41:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %42 = load i32, ptr %7, align 4, !tbaa !11
  %43 = sext i32 %42 to i64
  %44 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %43, i64 4)
  %45 = extractvalue { i64, i1 } %44, 1
  %46 = extractvalue { i64, i1 } %44, 0
  %47 = select i1 %45, i64 -1, i64 %46
  %48 = call noalias noundef nonnull ptr @_Znam(i64 noundef %47) #9
  store ptr %48, ptr %8, align 8, !tbaa !5
  %49 = load i32, ptr %7, align 4, !tbaa !11
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %51, label %88

51:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #8
  %52 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 1
  %53 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %52)
  %54 = load i32, ptr %7, align 4, !tbaa !11
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = load ptr, ptr %53, align 8, !tbaa !9
  %57 = getelementptr inbounds ptr, ptr %56, i64 15
  %58 = load ptr, ptr %57, align 8
  %59 = call noundef zeroext i1 %58(ptr noundef nonnull align 8 dereferenceable(12) %53, i32 noundef %54, ptr noundef %55)
  %60 = zext i1 %59 to i8
  store i8 %60, ptr %9, align 1, !tbaa !13
  %61 = load i8, ptr %9, align 1, !tbaa !13, !range !15, !noundef !16
  %62 = trunc i8 %61 to i1
  br i1 %62, label %87, label %63

63:                                               ; preds = %51
  %64 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 2
  %65 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %64)
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %65, i32 noundef 1, i32 noundef 3, ptr noundef @.str.58)
  store i1 true, ptr %16, align 1
  %66 = call ptr @__cxa_allocate_exception(i64 112) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef @.str.59, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %67 unwind label %70

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %68 unwind label %74

68:                                               ; preds = %67
  invoke void @_ZN10SimTKIpopt11TNLPAdapter12INVALID_TNLPC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_i(ptr noundef nonnull align 8 dereferenceable(112) %66, ptr noundef %10, ptr noundef %14, i32 noundef 1304)
          to label %69 unwind label %78

69:                                               ; preds = %68
  store i1 false, ptr %16, align 1
  invoke void @__cxa_throw(ptr %66, ptr @_ZTIN10SimTKIpopt11TNLPAdapter12INVALID_TNLPE, ptr @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #10
          to label %270 unwind label %78

70:                                               ; preds = %63
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %12, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %13, align 4
  br label %83

74:                                               ; preds = %67
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %12, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %13, align 4
  br label %82

78:                                               ; preds = %69, %68
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %12, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %13, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  br label %82

82:                                               ; preds = %78, %74
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  br label %83

83:                                               ; preds = %82, %70
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  %84 = load i1, ptr %16, align 1
  br i1 %84, label %85, label %86

85:                                               ; preds = %83
  call void @__cxa_free_exception(ptr %66) #8
  br label %86

86:                                               ; preds = %85, %83
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  br label %263

87:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  br label %88

88:                                               ; preds = %87, %41
  %89 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 21
  %90 = load i32, ptr %89, align 4, !tbaa !17
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %109

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %93

93:                                               ; preds = %105, %92
  %94 = load i32, ptr %17, align 4, !tbaa !11
  %95 = load i32, ptr %7, align 4, !tbaa !11
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %108

98:                                               ; preds = %93
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = load i32, ptr %17, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %99, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !11
  %104 = add nsw i32 %103, -1
  store i32 %104, ptr %102, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %98
  %106 = load i32, ptr %17, align 4, !tbaa !11
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %17, align 4, !tbaa !11
  br label %93, !llvm.loop !33

108:                                              ; preds = %97
  br label %109

109:                                              ; preds = %108, %88
  %110 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 46
  %111 = call noundef zeroext i1 @_ZN10SimTKIpopt6IsNullINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %110)
  br i1 %111, label %112, label %161

112:                                              ; preds = %109
  %113 = load i32, ptr %7, align 4, !tbaa !11
  %114 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 12
  %115 = load i32, ptr %114, align 8, !tbaa !35
  %116 = icmp eq i32 %113, %115
  br i1 %116, label %117, label %122

117:                                              ; preds = %112
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef null)
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef null)
  br label %160

122:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %123 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #9
  %124 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 12
  %125 = load i32, ptr %124, align 8, !tbaa !35
  %126 = load i32, ptr %7, align 4, !tbaa !11
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN10SimTKIpopt20ExpansionMatrixSpaceC1EiiPKii(ptr noundef nonnull align 8 dereferenceable(40) %123, i32 noundef %125, i32 noundef %126, ptr noundef %127, i32 noundef 0)
          to label %128 unwind label %146

128:                                              ; preds = %122
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef %123)
  %129 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %130 unwind label %150

130:                                              ; preds = %128
  %131 = load ptr, ptr %129, align 8, !tbaa !9
  %132 = getelementptr inbounds ptr, ptr %131, i64 2
  %133 = load ptr, ptr %132, align 8
  %134 = invoke noundef ptr %133(ptr noundef nonnull align 8 dereferenceable(40) %129)
          to label %135 unwind label %150

135:                                              ; preds = %130
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef %134)
          to label %138 unwind label %150

138:                                              ; preds = %135
  %139 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #9
          to label %140 unwind label %150

140:                                              ; preds = %138
  %141 = load i32, ptr %7, align 4, !tbaa !11
  invoke void @_ZN10SimTKIpopt16DenseVectorSpaceC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %139, i32 noundef %141)
          to label %142 unwind label %154

142:                                              ; preds = %140
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef %139)
          to label %145 unwind label %150

145:                                              ; preds = %142
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %160

146:                                              ; preds = %122
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %12, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %123, i64 noundef 40) #11
  br label %159

150:                                              ; preds = %142, %138, %135, %130, %128
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %12, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %13, align 4
  br label %158

154:                                              ; preds = %140
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %12, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %139, i64 noundef 16) #11
  br label %158

158:                                              ; preds = %154, %150
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br label %159

159:                                              ; preds = %158, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %263

160:                                              ; preds = %145, %117
  br label %258

161:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %162 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 46
  %163 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %162)
  %164 = call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix20CompressedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %163)
  store ptr %164, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %165 = load i32, ptr %7, align 4, !tbaa !11
  %166 = sext i32 %165 to i64
  %167 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %166, i64 4)
  %168 = extractvalue { i64, i1 } %167, 1
  %169 = extractvalue { i64, i1 } %167, 0
  %170 = select i1 %168, i64 -1, i64 %169
  %171 = call noalias noundef nonnull ptr @_Znam(i64 noundef %170) #9
  store ptr %171, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %172

172:                                              ; preds = %199, %161
  %173 = load i32, ptr %22, align 4, !tbaa !11
  %174 = load i32, ptr %7, align 4, !tbaa !11
  %175 = icmp slt i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %202

177:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  %179 = load i32, ptr %22, align 4, !tbaa !11
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds i32, ptr %178, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !11
  store i32 %182, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %183 = load ptr, ptr %19, align 8, !tbaa !5
  %184 = load i32, ptr %23, align 4, !tbaa !11
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds i32, ptr %183, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !11
  store i32 %187, ptr %24, align 4, !tbaa !11
  %188 = load i32, ptr %24, align 4, !tbaa !11
  %189 = icmp sge i32 %188, 0
  br i1 %189, label %190, label %198

190:                                              ; preds = %177
  %191 = load i32, ptr %24, align 4, !tbaa !11
  %192 = load ptr, ptr %20, align 8, !tbaa !5
  %193 = load i32, ptr %21, align 4, !tbaa !11
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds i32, ptr %192, i64 %194
  store i32 %191, ptr %195, align 4, !tbaa !11
  %196 = load i32, ptr %21, align 4, !tbaa !11
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %21, align 4, !tbaa !11
  br label %198

198:                                              ; preds = %190, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %22, align 4, !tbaa !11
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %22, align 4, !tbaa !11
  br label %172, !llvm.loop !36

202:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %203 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 12
  %204 = load i32, ptr %203, align 8, !tbaa !35
  %205 = getelementptr inbounds %"class.SimTKIpopt::TNLPAdapter", ptr %27, i32 0, i32 20
  %206 = load i32, ptr %205, align 8, !tbaa !37
  %207 = sub nsw i32 %204, %206
  store i32 %207, ptr %25, align 4, !tbaa !11
  %208 = load i32, ptr %21, align 4, !tbaa !11
  %209 = load i32, ptr %25, align 4, !tbaa !11
  %210 = icmp eq i32 %208, %209
  br i1 %210, label %211, label %216

211:                                              ; preds = %202
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  %213 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %212, ptr noundef null)
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %214, ptr noundef null)
  br label %253

216:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %217 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #9
  %218 = load i32, ptr %25, align 4, !tbaa !11
  %219 = load i32, ptr %21, align 4, !tbaa !11
  %220 = load ptr, ptr %20, align 8, !tbaa !5
  invoke void @_ZN10SimTKIpopt20ExpansionMatrixSpaceC1EiiPKii(ptr noundef nonnull align 8 dereferenceable(40) %217, i32 noundef %218, i32 noundef %219, ptr noundef %220, i32 noundef 0)
          to label %221 unwind label %239

221:                                              ; preds = %216
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef %217)
  %222 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %223 unwind label %243

223:                                              ; preds = %221
  %224 = load ptr, ptr %222, align 8, !tbaa !9
  %225 = getelementptr inbounds ptr, ptr %224, i64 2
  %226 = load ptr, ptr %225, align 8
  %227 = invoke noundef ptr %226(ptr noundef nonnull align 8 dereferenceable(40) %222)
          to label %228 unwind label %243

228:                                              ; preds = %223
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %229, ptr noundef %227)
          to label %231 unwind label %243

231:                                              ; preds = %228
  %232 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #9
          to label %233 unwind label %243

233:                                              ; preds = %231
  %234 = load i32, ptr %21, align 4, !tbaa !11
  invoke void @_ZN10SimTKIpopt16DenseVectorSpaceC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %232, i32 noundef %234)
          to label %235 unwind label %247

235:                                              ; preds = %233
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  %237 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %236, ptr noundef %232)
          to label %238 unwind label %243

238:                                              ; preds = %235
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %253

239:                                              ; preds = %216
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %12, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %217, i64 noundef 40) #11
  br label %252

243:                                              ; preds = %235, %231, %228, %223, %221
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %12, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %13, align 4
  br label %251

247:                                              ; preds = %233
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %12, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %232, i64 noundef 16) #11
  br label %251

251:                                              ; preds = %247, %243
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  br label %252

252:                                              ; preds = %251, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %263

253:                                              ; preds = %238, %211
  %254 = load ptr, ptr %20, align 8, !tbaa !5
  %255 = icmp eq ptr %254, null
  br i1 %255, label %257, label %256

256:                                              ; preds = %253
  call void @_ZdaPv(ptr noundef %254) #11
  br label %257

257:                                              ; preds = %256, %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %258

258:                                              ; preds = %257, %160
  %259 = load ptr, ptr %8, align 8, !tbaa !5
  %260 = icmp eq ptr %259, null
  br i1 %260, label %262, label %261

261:                                              ; preds = %258
  call void @_ZdaPv(ptr noundef %259) #11
  br label %262

262:                                              ; preds = %261, %258
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %264

263:                                              ; preds = %252, %159, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %265

264:                                              ; preds = %262, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret void

265:                                              ; preds = %263
  %266 = load ptr, ptr %12, align 8
  %267 = load i32, ptr %13, align 4
  %268 = insertvalue { ptr, i32 } poison, ptr %266, 0
  %269 = insertvalue { ptr, i32 } %268, i32 %267, 1
  resume { ptr, i32 } %269

270:                                              ; preds = %69
  unreachable
}

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

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

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

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

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

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

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 = { 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 #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 = { 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 = !{!"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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !27, i64 116}
!18 = !{!"_ZTSN10SimTKIpopt11TNLPAdapterE", !19, i64 0, !21, i64 16, !22, i64 24, !23, i64 32, !23, i64 40, !24, i64 48, !25, i64 52, !23, i64 56, !23, i64 64, !14, i64 72, !14, i64 73, !26, 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, !27, i64 116, !28, i64 120, !28, i64 128, !28, i64 136, !28, i64 144, !29, i64 152, !28, i64 160, !29, i64 168, !28, i64 176, !29, i64 184, !28, i64 192, !29, i64 200, !29, i64 208, !29, i64 216, !30, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !12, i64 272, !12, i64 276, !12, i64 280, !12, i64 284, !12, i64 288, !31, i64 296, !32, i64 304, !31, i64 312, !32, i64 320, !31, i64 328, !32, i64 336, !32, i64 344, !31, i64 352, !32, i64 360, !31, i64 368, !6, i64 376, !6, i64 384, !6, i64 392}
!19 = !{!"_ZTSN10SimTKIpopt3NLPE", !20, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !12, i64 8}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_4TNLPEEE", !6, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter26FixedVariableTreatmentEnumE", !7, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt11TNLPAdapter18DerivativeTestEnumE", !7, i64 0}
!26 = !{!"_ZTSN10SimTKIpopt24HessianApproximationTypeE", !7, i64 0}
!27 = !{!"_ZTSN10SimTKIpopt4TNLP14IndexStyleEnumE", !7, i64 0}
!28 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11VectorSpaceEEE", !6, i64 0}
!29 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !6, i64 0}
!30 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14SymMatrixSpaceEEE", !6, i64 0}
!31 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEE", !6, i64 0}
!32 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEE", !6, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!18, !12, i64 80}
!36 = distinct !{!36, !34}
!37 = !{!18, !12, i64 112}


; 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 }
%"class.SimTKIpopt::SmartPtr.10" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [98 x i8], align 1
@_ZTIN10SimTKIpopt11TNLPAdapter12INVALID_TNLPE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.58 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [57 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 #3 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

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 #2 align 2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

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

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

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

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

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

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

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

; 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: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix20CompressedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt11TNLPAdapter33GetQuasiNewtonApproximationSpacesERNS_8SmartPtrINS_11VectorSpaceEEERNS1_INS_6MatrixEEE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.11", align 1
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.11", align 1
  %8 = alloca %"class.SimTKIpopt::SmartPtr.10", align 8
  %9 = alloca %"class.SimTKIpopt::SmartPtr.10", align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 112
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef i32 %14(ptr noundef nonnull align 8 dereferenceable(12) %11)
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %17, label %20

17:                                               ; preds = %3
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef null)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef null)
  br label %161

20:                                               ; preds = %3
  %21 = zext nneg i32 %15 to i64
  %22 = shl nuw nsw i64 %21, 2
  %23 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %22) #8
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %.loopexit, label %24

24:                                               ; preds = %20
  %25 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_4TNLPEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 120
  %28 = load ptr, ptr %27, align 8
  %29 = tail call noundef zeroext i1 %28(ptr noundef nonnull align 8 dereferenceable(12) %25, i32 noundef %15, ptr noundef nonnull %23)
  br i1 %29, label %44, label %30

30:                                               ; preds = %24
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %31)
  tail call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %32, i32 noundef 1, i32 noundef 3, ptr noundef nonnull @.str.58)
  %33 = tail call ptr @__cxa_allocate_exception(i64 112) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.59, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %34 unwind label %.thread

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %35 unwind label %38

35:                                               ; preds = %34
  invoke void @_ZN10SimTKIpopt11TNLPAdapter12INVALID_TNLPC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_i(ptr noundef nonnull align 8 dereferenceable(112) %33, ptr noundef nonnull %4, ptr noundef nonnull %6, i32 noundef 1304)
          to label %36 unwind label %40

36:                                               ; preds = %35
  invoke void @__cxa_throw(ptr nonnull %33, ptr nonnull @_ZTIN10SimTKIpopt11TNLPAdapter12INVALID_TNLPE, ptr nonnull @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #10
          to label %162 unwind label %40

.thread:                                          ; preds = %30
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #9
  br label %43

38:                                               ; preds = %34
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %36, %35
  %.056 = phi i1 [ false, %36 ], [ true, %35 ]
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  br label %42

42:                                               ; preds = %38, %40
  %.157 = phi i1 [ %.056, %40 ], [ true, %38 ]
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #9
  br i1 %.157, label %43, label %160

43:                                               ; preds = %.thread, %42
  %.pn.pn77 = phi { ptr, i32 } [ %37, %.thread ], [ %.pn, %42 ]
  call void @__cxa_free_exception(ptr %33) #9
  br label %160

44:                                               ; preds = %24
  %45 = getelementptr inbounds i8, ptr %0, i64 116
  %46 = load i32, ptr %45, align 4, !tbaa !8
  %47 = icmp eq i32 %46, 1
  br i1 %47, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %44
  %wide.trip.count = zext nneg i32 %15 to i64
  %min.iters.check = icmp ult i32 %15, 8
  br i1 %min.iters.check, label %.lr.ph.preheader93, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %48 = getelementptr inbounds i32, ptr %23, i64 %index
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %wide.load = load <4 x i32>, ptr %48, align 4, !tbaa !28
  %wide.load92 = load <4 x i32>, ptr %49, align 4, !tbaa !28
  %50 = add nsw <4 x i32> %wide.load, <i32 -1, i32 -1, i32 -1, i32 -1>
  %51 = add nsw <4 x i32> %wide.load92, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %50, ptr %48, align 4, !tbaa !28
  store <4 x i32> %51, ptr %49, align 4, !tbaa !28
  %index.next = add nuw i64 %index, 8
  %52 = icmp eq i64 %index.next, %n.vec
  br i1 %52, label %middle.block, label %vector.body, !llvm.loop !29

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.preheader93

.lr.ph.preheader93:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader93, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader93 ]
  %53 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv
  %54 = load i32, ptr %53, align 4, !tbaa !28
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %53, align 4, !tbaa !28
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !33

.loopexit:                                        ; preds = %.lr.ph, %middle.block, %20, %44
  %56 = getelementptr inbounds i8, ptr %0, i64 296
  %57 = tail call noundef zeroext i1 @_ZN10SimTKIpopt6IsNullINS_15ExpansionMatrixEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %56)
  br i1 %57, label %58, label %89

58:                                               ; preds = %.loopexit
  %59 = getelementptr inbounds i8, ptr %0, i64 80
  %60 = load i32, ptr %59, align 8, !tbaa !34
  %61 = icmp eq i32 %15, %60
  br i1 %61, label %62, label %65

62:                                               ; preds = %58
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef null)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef null)
  br label %159

65:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  %66 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #8
  invoke void @_ZN10SimTKIpopt20ExpansionMatrixSpaceC1EiiPKii(ptr noundef nonnull align 8 dereferenceable(40) %66, i32 noundef %60, i32 noundef %15, ptr noundef nonnull %23, i32 noundef 0)
          to label %67 unwind label %81

67:                                               ; preds = %65
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull %66)
  %68 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = load ptr, ptr %70, align 8
  %72 = invoke noundef ptr %71(ptr noundef nonnull align 8 dereferenceable(40) %68)
          to label %73 unwind label %83

73:                                               ; preds = %67
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %72)
          to label %75 unwind label %83

75:                                               ; preds = %73
  %76 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #8
          to label %77 unwind label %83

77:                                               ; preds = %75
  invoke void @_ZN10SimTKIpopt16DenseVectorSpaceC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %76, i32 noundef %15)
          to label %78 unwind label %85

78:                                               ; preds = %77
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %76)
          to label %80 unwind label %83

80:                                               ; preds = %78
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  br label %159

81:                                               ; preds = %65
  %82 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %66, i64 noundef 40) #11
  br label %88

83:                                               ; preds = %78, %75, %73, %67
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %87

85:                                               ; preds = %77
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %76, i64 noundef 16) #11
  br label %87

87:                                               ; preds = %85, %83
  %.pn71 = phi { ptr, i32 } [ %84, %83 ], [ %86, %85 ]
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  br label %88

88:                                               ; preds = %87, %81
  %.pn71.pn = phi { ptr, i32 } [ %.pn71, %87 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  br label %160

89:                                               ; preds = %.loopexit
  %90 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_15ExpansionMatrixEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %56)
  %91 = tail call noundef ptr @_ZNK10SimTKIpopt15ExpansionMatrix20CompressedPosIndicesEv(ptr noundef nonnull align 8 dereferenceable(80) %90)
  %92 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %22) #8
  br i1 %.not, label %._crit_edge, label %.lr.ph81.preheader

.lr.ph81.preheader:                               ; preds = %89
  %smax87 = tail call i32 @llvm.smax.i32(i32 %15, i32 1)
  %wide.trip.count88 = zext nneg i32 %smax87 to i64
  %xtraiter = and i64 %wide.trip.count88, 1
  %93 = icmp slt i32 %15, 2
  br i1 %93, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph81.preheader.new

.lr.ph81.preheader.new:                           ; preds = %.lr.ph81.preheader
  %unroll_iter = and i64 %wide.trip.count88, 2147483646
  br label %.lr.ph81

._crit_edge.loopexit.unr-lcssa:                   ; preds = %130, %.lr.ph81.preheader
  %.161.lcssa.ph = phi i32 [ poison, %.lr.ph81.preheader ], [ %.161.1, %130 ]
  %indvars.iv84.unr = phi i64 [ 0, %.lr.ph81.preheader ], [ %indvars.iv.next85.1, %130 ]
  %.06079.unr = phi i32 [ 0, %.lr.ph81.preheader ], [ %.161.1, %130 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph81.epil

.lr.ph81.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %94 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv84.unr
  %95 = load i32, ptr %94, align 4, !tbaa !28
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %91, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !28
  %99 = icmp sgt i32 %98, -1
  br i1 %99, label %100, label %._crit_edge

100:                                              ; preds = %.lr.ph81.epil
  %101 = sext i32 %.06079.unr to i64
  %102 = getelementptr inbounds i32, ptr %92, i64 %101
  store i32 %98, ptr %102, align 4, !tbaa !28
  %103 = add nsw i32 %.06079.unr, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %100, %.lr.ph81.epil, %89
  %.060.lcssa = phi i32 [ 0, %89 ], [ %.161.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %103, %100 ], [ %.06079.unr, %.lr.ph81.epil ]
  %104 = getelementptr inbounds i8, ptr %0, i64 80
  %105 = load i32, ptr %104, align 8, !tbaa !34
  %106 = getelementptr inbounds i8, ptr %0, i64 112
  %107 = load i32, ptr %106, align 8, !tbaa !35
  %108 = sub nsw i32 %105, %107
  %109 = icmp eq i32 %.060.lcssa, %108
  br i1 %109, label %131, label %134

.lr.ph81:                                         ; preds = %130, %.lr.ph81.preheader.new
  %indvars.iv84 = phi i64 [ 0, %.lr.ph81.preheader.new ], [ %indvars.iv.next85.1, %130 ]
  %.06079 = phi i32 [ 0, %.lr.ph81.preheader.new ], [ %.161.1, %130 ]
  %niter = phi i64 [ 0, %.lr.ph81.preheader.new ], [ %niter.next.1, %130 ]
  %110 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv84
  %111 = load i32, ptr %110, align 4, !tbaa !28
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %91, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !28
  %115 = icmp sgt i32 %114, -1
  br i1 %115, label %116, label %.lr.ph81.1

116:                                              ; preds = %.lr.ph81
  %117 = sext i32 %.06079 to i64
  %118 = getelementptr inbounds i32, ptr %92, i64 %117
  store i32 %114, ptr %118, align 4, !tbaa !28
  %119 = add nsw i32 %.06079, 1
  br label %.lr.ph81.1

.lr.ph81.1:                                       ; preds = %116, %.lr.ph81
  %.161 = phi i32 [ %119, %116 ], [ %.06079, %.lr.ph81 ]
  %indvars.iv.next85 = or disjoint i64 %indvars.iv84, 1
  %120 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv.next85
  %121 = load i32, ptr %120, align 4, !tbaa !28
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i32, ptr %91, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !28
  %125 = icmp sgt i32 %124, -1
  br i1 %125, label %126, label %130

126:                                              ; preds = %.lr.ph81.1
  %127 = sext i32 %.161 to i64
  %128 = getelementptr inbounds i32, ptr %92, i64 %127
  store i32 %124, ptr %128, align 4, !tbaa !28
  %129 = add nsw i32 %.161, 1
  br label %130

130:                                              ; preds = %126, %.lr.ph81.1
  %.161.1 = phi i32 [ %129, %126 ], [ %.161, %.lr.ph81.1 ]
  %indvars.iv.next85.1 = add nuw nsw i64 %indvars.iv84, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph81, !llvm.loop !36

131:                                              ; preds = %._crit_edge
  %132 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef null)
  %133 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef null)
  br label %158

134:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %135 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #8
  invoke void @_ZN10SimTKIpopt20ExpansionMatrixSpaceC1EiiPKii(ptr noundef nonnull align 8 dereferenceable(40) %135, i32 noundef %108, i32 noundef %.060.lcssa, ptr noundef nonnull %92, i32 noundef 0)
          to label %136 unwind label %150

136:                                              ; preds = %134
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull %135)
  %137 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %138, i64 16
  %140 = load ptr, ptr %139, align 8
  %141 = invoke noundef ptr %140(ptr noundef nonnull align 8 dereferenceable(40) %137)
          to label %142 unwind label %152

142:                                              ; preds = %136
  %143 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_6MatrixEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %141)
          to label %144 unwind label %152

144:                                              ; preds = %142
  %145 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #8
          to label %146 unwind label %152

146:                                              ; preds = %144
  invoke void @_ZN10SimTKIpopt16DenseVectorSpaceC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %145, i32 noundef %.060.lcssa)
          to label %147 unwind label %154

147:                                              ; preds = %146
  %148 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_11VectorSpaceEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %145)
          to label %149 unwind label %152

149:                                              ; preds = %147
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %158

150:                                              ; preds = %134
  %151 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %135, i64 noundef 40) #11
  br label %157

152:                                              ; preds = %147, %144, %142, %136
  %153 = landingpad { ptr, i32 }
          cleanup
  br label %156

154:                                              ; preds = %146
  %155 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %145, i64 noundef 16) #11
  br label %156

156:                                              ; preds = %154, %152
  %.pn68 = phi { ptr, i32 } [ %153, %152 ], [ %155, %154 ]
  call void @_ZN10SimTKIpopt8SmartPtrINS_20ExpansionMatrixSpaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  br label %157

157:                                              ; preds = %156, %150
  %.pn68.pn = phi { ptr, i32 } [ %.pn68, %156 ], [ %151, %150 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %160

158:                                              ; preds = %131, %149
  call void @_ZdaPv(ptr noundef nonnull %92) #11
  br label %159

159:                                              ; preds = %158, %80, %62
  call void @_ZdaPv(ptr noundef nonnull %23) #11
  br label %161

160:                                              ; preds = %42, %43, %157, %88
  %.pn71.pn.pn = phi { ptr, i32 } [ %.pn71.pn, %88 ], [ %.pn68.pn, %157 ], [ %.pn.pn77, %43 ], [ %.pn, %42 ]
  resume { ptr, i32 } %.pn71.pn.pn

161:                                              ; preds = %159, %17
  ret void

162:                                              ; preds = %36
  unreachable
}

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

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 = { 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 #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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
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, !22, i64 116}
!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 = !{!12, !12, i64 0}
!29 = distinct !{!29, !30, !31, !32}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!"llvm.loop.isvectorized", i32 1}
!32 = !{!"llvm.loop.unroll.runtime.disable"}
!33 = distinct !{!33, !30, !32, !31}
!34 = !{!9, !12, i64 80}
!35 = !{!9, !12, i64 112}
!36 = distinct !{!36, !30}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass