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

; 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.16" = type { i8 }
%"class.SimTKIpopt::SmartPtr.22" = type { ptr }
%"class.SimTKIpopt::SmartPtr.7" = type { ptr }
%struct.IpoptProblemInfo = type { i32, ptr, ptr, i32, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, %"class.SimTKIpopt::SmartPtr.6" }
%"class.SimTKIpopt::SmartPtr.6" = type { ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE = external dso_local constant { ptr, ptr, ptr }, align 8

; 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #1

declare ptr @__cxa_begin_catch(ptr)

; 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) #2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @IpoptSolve(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #6 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 %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::allocator.16", align 1
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.SimTKIpopt::SmartPtr.22", align 8
  %30 = alloca i8, align 1
  %31 = alloca ptr, align 8
  %32 = alloca %"class.SimTKIpopt::SmartPtr.7", align 8
  %33 = 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
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %34, i32 0, i32 14
  %36 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %35)
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %37 unwind label %55

37:                                               ; preds = %8
  invoke void @_ZN10SimTKIpopt16IpoptApplication10InitializeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88) %36, ptr noundef %17)
          to label %38 unwind label %59

38:                                               ; preds = %37
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %39, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %42, i64 8)
  %44 = extractvalue { i64, i1 } %43, 1
  %45 = extractvalue { i64, i1 } %43, 0
  %46 = select i1 %44, i64 -1, i64 %45
  %47 = call noalias noundef nonnull ptr @_Znam(i64 noundef %46) #10
  store ptr %47, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !13
  br label %48

48:                                               ; preds = %74, %38
  %49 = load i32, ptr %22, align 4, !tbaa !13
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %50, i32 0, i32 0
  %52 = load i32, ptr %51, align 8, !tbaa !9
  %53 = icmp slt i32 %49, %52
  br i1 %53, label %64, label %54

54:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %77

55:                                               ; preds = %8
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %19, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %20, align 4
  br label %63

59:                                               ; preds = %37
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %19, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %20, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #9
  br label %63

63:                                               ; preds = %59, %55
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #9
  br label %312

64:                                               ; preds = %48
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = load i32, ptr %22, align 4, !tbaa !13
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %65, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !14
  %70 = load ptr, ptr %21, align 8, !tbaa !5
  %71 = load i32, ptr %22, align 4, !tbaa !13
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds double, ptr %70, i64 %72
  store double %69, ptr %73, align 8, !tbaa !14
  br label %74

74:                                               ; preds = %64
  %75 = load i32, ptr %22, align 4, !tbaa !13
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %22, align 4, !tbaa !13
  br label %48, !llvm.loop !16

77:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  store ptr null, ptr %25, align 8, !tbaa !5
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %111

80:                                               ; preds = %77
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %81, i32 0, i32 3
  %83 = load i32, ptr %82, align 8, !tbaa !18
  %84 = sext i32 %83 to i64
  %85 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %84, i64 8)
  %86 = extractvalue { i64, i1 } %85, 1
  %87 = extractvalue { i64, i1 } %85, 0
  %88 = select i1 %86, i64 -1, i64 %87
  %89 = call noalias noundef nonnull ptr @_Znam(i64 noundef %88) #10
  store ptr %89, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !13
  br label %90

90:                                               ; preds = %107, %80
  %91 = load i32, ptr %26, align 4, !tbaa !13
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %92, i32 0, i32 3
  %94 = load i32, ptr %93, align 8, !tbaa !18
  %95 = icmp slt i32 %91, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  br label %110

97:                                               ; preds = %90
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = load i32, ptr %26, align 4, !tbaa !13
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %98, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !14
  %103 = load ptr, ptr %23, align 8, !tbaa !5
  %104 = load i32, ptr %26, align 4, !tbaa !13
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds double, ptr %103, i64 %105
  store double %102, ptr %106, align 8, !tbaa !14
  br label %107

107:                                              ; preds = %97
  %108 = load i32, ptr %26, align 4, !tbaa !13
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %26, align 4, !tbaa !13
  br label %90, !llvm.loop !19

110:                                              ; preds = %96
  br label %111

111:                                              ; preds = %110, %77
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = icmp ne ptr %112, null
  br i1 %113, label %114, label %145

114:                                              ; preds = %111
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 8, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %118, i64 8)
  %120 = extractvalue { i64, i1 } %119, 1
  %121 = extractvalue { i64, i1 } %119, 0
  %122 = select i1 %120, i64 -1, i64 %121
  %123 = call noalias noundef nonnull ptr @_Znam(i64 noundef %122) #10
  store ptr %123, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  store i32 0, ptr %27, align 4, !tbaa !13
  br label %124

124:                                              ; preds = %141, %114
  %125 = load i32, ptr %27, align 4, !tbaa !13
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !9
  %129 = icmp slt i32 %125, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %144

131:                                              ; preds = %124
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  %133 = load i32, ptr %27, align 4, !tbaa !13
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %132, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !14
  %137 = load ptr, ptr %24, align 8, !tbaa !5
  %138 = load i32, ptr %27, align 4, !tbaa !13
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds double, ptr %137, i64 %139
  store double %136, ptr %140, align 8, !tbaa !14
  br label %141

141:                                              ; preds = %131
  %142 = load i32, ptr %27, align 4, !tbaa !13
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %27, align 4, !tbaa !13
  br label %124, !llvm.loop !20

144:                                              ; preds = %130
  br label %145

145:                                              ; preds = %144, %111
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %179

148:                                              ; preds = %145
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %149, i32 0, i32 0
  %151 = load i32, ptr %150, align 8, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %152, i64 8)
  %154 = extractvalue { i64, i1 } %153, 1
  %155 = extractvalue { i64, i1 } %153, 0
  %156 = select i1 %154, i64 -1, i64 %155
  %157 = call noalias noundef nonnull ptr @_Znam(i64 noundef %156) #10
  store ptr %157, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  store i32 0, ptr %28, align 4, !tbaa !13
  br label %158

158:                                              ; preds = %175, %148
  %159 = load i32, ptr %28, align 4, !tbaa !13
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %160, i32 0, i32 0
  %162 = load i32, ptr %161, align 8, !tbaa !9
  %163 = icmp slt i32 %159, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %178

165:                                              ; preds = %158
  %166 = load ptr, ptr %15, align 8, !tbaa !5
  %167 = load i32, ptr %28, align 4, !tbaa !13
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds double, ptr %166, i64 %168
  %170 = load double, ptr %169, align 8, !tbaa !14
  %171 = load ptr, ptr %25, align 8, !tbaa !5
  %172 = load i32, ptr %28, align 4, !tbaa !13
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds double, ptr %171, i64 %173
  store double %170, ptr %174, align 8, !tbaa !14
  br label %175

175:                                              ; preds = %165
  %176 = load i32, ptr %28, align 4, !tbaa !13
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %28, align 4, !tbaa !13
  br label %158, !llvm.loop !21

178:                                              ; preds = %164
  br label %179

179:                                              ; preds = %178, %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  call void @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %29)
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #9
  store i8 0, ptr %30, align 1, !tbaa !22
  %180 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 216) #10
          to label %181 unwind label %238

181:                                              ; preds = %179
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !9
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %185, i32 0, i32 1
  %187 = load ptr, ptr %186, align 8, !tbaa !24
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %188, i32 0, i32 2
  %190 = load ptr, ptr %189, align 8, !tbaa !25
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %191, i32 0, i32 3
  %193 = load i32, ptr %192, align 8, !tbaa !18
  %194 = load ptr, ptr %9, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %194, i32 0, i32 4
  %196 = load ptr, ptr %195, align 8, !tbaa !26
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %197, i32 0, i32 5
  %199 = load ptr, ptr %198, align 8, !tbaa !27
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %200, i32 0, i32 6
  %202 = load i32, ptr %201, align 8, !tbaa !28
  %203 = load ptr, ptr %9, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %203, i32 0, i32 7
  %205 = load i32, ptr %204, align 4, !tbaa !29
  %206 = load ptr, ptr %9, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %206, i32 0, i32 8
  %208 = load i32, ptr %207, align 8, !tbaa !30
  %209 = load ptr, ptr %21, align 8, !tbaa !5
  %210 = load ptr, ptr %23, align 8, !tbaa !5
  %211 = load ptr, ptr %24, align 8, !tbaa !5
  %212 = load ptr, ptr %25, align 8, !tbaa !5
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %213, i32 0, i32 9
  %215 = load ptr, ptr %214, align 8, !tbaa !31
  %216 = load ptr, ptr %9, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %216, i32 0, i32 10
  %218 = load ptr, ptr %217, align 8, !tbaa !32
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %219, i32 0, i32 11
  %221 = load ptr, ptr %220, align 8, !tbaa !33
  %222 = load ptr, ptr %9, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %222, i32 0, i32 12
  %224 = load ptr, ptr %223, align 8, !tbaa !34
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %225, i32 0, i32 13
  %227 = load ptr, ptr %226, align 8, !tbaa !35
  %228 = load ptr, ptr %10, align 8, !tbaa !5
  %229 = load ptr, ptr %14, align 8, !tbaa !5
  %230 = load ptr, ptr %15, align 8, !tbaa !5
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = load ptr, ptr %13, align 8, !tbaa !5
  %233 = load ptr, ptr %12, align 8, !tbaa !5
  %234 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZN10SimTKIpopt16StdInterfaceTNLPC1EiPKdS2_iS2_S2_iiiS2_S2_S2_S2_PFiiS2_iPdPvEPFiiS2_iiS3_S4_ES6_PFiiS2_iiiPiS9_S3_S4_EPFiiS2_idiS3_iiS9_S9_S3_S4_ES3_S3_S3_S3_S3_S3_S4_(ptr noundef nonnull align 8 dereferenceable(216) %180, i32 noundef %184, ptr noundef %187, ptr noundef %190, i32 noundef %193, ptr noundef %196, ptr noundef %199, i32 noundef %202, i32 noundef %205, i32 noundef %208, ptr noundef %209, ptr noundef %210, ptr noundef %211, ptr noundef %212, ptr noundef %215, ptr noundef %218, ptr noundef %221, ptr noundef %224, ptr noundef %227, ptr noundef %228, ptr noundef %229, ptr noundef %230, ptr noundef %231, ptr noundef %232, ptr noundef %233, ptr noundef %234)
          to label %235 unwind label %242

235:                                              ; preds = %181
  %236 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef %180)
          to label %237 unwind label %238

237:                                              ; preds = %235
  br label %263

238:                                              ; preds = %235, %179
  %239 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %19, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %20, align 4
  br label %246

242:                                              ; preds = %181
  %243 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %19, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %20, align 4
  call void @_ZdlPvm(ptr noundef %180, i64 noundef 216) #11
  br label %246

246:                                              ; preds = %242, %238
  %247 = load i32, ptr %20, align 4
  %248 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE) #9
  %249 = icmp eq i32 %247, %248
  br i1 %249, label %250, label %311

250:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  %251 = load ptr, ptr %19, align 8
  %252 = call ptr @__cxa_begin_catch(ptr %251) #9
  store ptr %252, ptr %31, align 8
  %253 = load ptr, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  %254 = load ptr, ptr %9, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %254, i32 0, i32 14
  %256 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %255)
          to label %257 unwind label %273

257:                                              ; preds = %250
  invoke void @_ZN10SimTKIpopt16IpoptApplication5JnlstEv(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.7") align 8 %32, ptr noundef nonnull align 8 dereferenceable(88) %256)
          to label %258 unwind label %273

258:                                              ; preds = %257
  %259 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %260 unwind label %277

260:                                              ; preds = %258
  invoke void @_ZNK10SimTKIpopt14IpoptException15ReportExceptionERKNS_10JournalistENS_13EJournalLevelE(ptr noundef nonnull align 8 dereferenceable(112) %253, ptr noundef nonnull align 8 dereferenceable(40) %259, i32 noundef 1)
          to label %261 unwind label %277

261:                                              ; preds = %260
  call void @_ZN10SimTKIpopt8SmartPtrINS_10JournalistEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %32) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  store i8 1, ptr %30, align 1, !tbaa !22
  invoke void @__cxa_end_catch()
          to label %262 unwind label %282

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

263:                                              ; preds = %262, %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %264 = load i8, ptr %30, align 1, !tbaa !22, !range !36, !noundef !37
  %265 = trunc i8 %264 to i1
  br i1 %265, label %292, label %266

266:                                              ; preds = %263
  %267 = load ptr, ptr %9, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %267, i32 0, i32 14
  %269 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %268)
          to label %270 unwind label %288

270:                                              ; preds = %266
  %271 = invoke noundef i32 @_ZN10SimTKIpopt16IpoptApplication12OptimizeTNLPERKNS_8SmartPtrINS_4TNLPEEE(ptr noundef nonnull align 8 dereferenceable(88) %269, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %272 unwind label %288

272:                                              ; preds = %270
  store i32 %271, ptr %33, align 4, !tbaa !38
  br label %293

273:                                              ; preds = %257, %250
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %19, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %20, align 4
  br label %281

277:                                              ; preds = %260, %258
  %278 = landingpad { ptr, i32 }
          cleanup
  %279 = extractvalue { ptr, i32 } %278, 0
  store ptr %279, ptr %19, align 8
  %280 = extractvalue { ptr, i32 } %278, 1
  store i32 %280, ptr %20, align 4
  call void @_ZN10SimTKIpopt8SmartPtrINS_10JournalistEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %32) #9
  br label %281

281:                                              ; preds = %277, %273
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  invoke void @__cxa_end_catch()
          to label %286 unwind label %317

282:                                              ; preds = %261
  %283 = landingpad { ptr, i32 }
          cleanup
  %284 = extractvalue { ptr, i32 } %283, 0
  store ptr %284, ptr %19, align 8
  %285 = extractvalue { ptr, i32 } %283, 1
  store i32 %285, ptr %20, align 4
  br label %287

286:                                              ; preds = %281
  br label %287

287:                                              ; preds = %286, %282
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  br label %311

288:                                              ; preds = %270, %266
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %19, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  br label %311

292:                                              ; preds = %263
  store i32 -11, ptr %33, align 4, !tbaa !38
  br label %293

293:                                              ; preds = %292, %272
  %294 = load ptr, ptr %21, align 8, !tbaa !5
  %295 = icmp eq ptr %294, null
  br i1 %295, label %297, label %296

296:                                              ; preds = %293
  call void @_ZdaPv(ptr noundef %294) #11
  br label %297

297:                                              ; preds = %296, %293
  %298 = load ptr, ptr %23, align 8, !tbaa !5
  %299 = icmp eq ptr %298, null
  br i1 %299, label %301, label %300

300:                                              ; preds = %297
  call void @_ZdaPv(ptr noundef %298) #11
  br label %301

301:                                              ; preds = %300, %297
  %302 = load ptr, ptr %24, align 8, !tbaa !5
  %303 = icmp eq ptr %302, null
  br i1 %303, label %305, label %304

304:                                              ; preds = %301
  call void @_ZdaPv(ptr noundef %302) #11
  br label %305

305:                                              ; preds = %304, %301
  %306 = load ptr, ptr %25, align 8, !tbaa !5
  %307 = icmp eq ptr %306, null
  br i1 %307, label %309, label %308

308:                                              ; preds = %305
  call void @_ZdaPv(ptr noundef %306) #11
  br label %309

309:                                              ; preds = %308, %305
  %310 = load i32, ptr %33, align 4, !tbaa !38
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #9
  call void @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  ret i32 %310

311:                                              ; preds = %288, %287, %246
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #9
  call void @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %312

312:                                              ; preds = %311, %63
  %313 = load ptr, ptr %19, align 8
  %314 = load i32, ptr %20, align 4
  %315 = insertvalue { ptr, i32 } poison, ptr %313, 0
  %316 = insertvalue { ptr, i32 } %315, i32 %314, 1
  resume { ptr, i32 } %316

317:                                              ; preds = %281
  %318 = landingpad { ptr, i32 }
          catch ptr null
  %319 = extractvalue { ptr, i32 } %318, 0
  call void @__clang_call_terminate(ptr %319) #12
  unreachable
}

declare void @_ZN10SimTKIpopt16IpoptApplication10InitializeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef) #7

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

declare void @_ZN10SimTKIpopt16StdInterfaceTNLPC1EiPKdS2_iS2_S2_iiiS2_S2_S2_S2_PFiiS2_iPdPvEPFiiS2_iiS3_S4_ES6_PFiiS2_iiiPiS9_S3_S4_EPFiiS2_idiS3_iiS9_S9_S3_S4_ES3_S3_S3_S3_S3_S3_S4_(ptr noundef nonnull align 8 dereferenceable(216), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #7

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

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt16IpoptApplication5JnlstEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.7") align 8, ptr noundef nonnull align 8 dereferenceable(88)) #6 align 2

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

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

declare void @__cxa_end_catch()

declare noundef i32 @_ZN10SimTKIpopt16IpoptApplication12OptimizeTNLPERKNS_8SmartPtrINS_4TNLPEEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(8)) #7

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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 = { 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 #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind memory(none) }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }
attributes #12 = { noreturn 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, !11, i64 0}
!10 = !{!"_ZTS16IpoptProblemInfo", !11, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !12, i64 104}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEE", !6, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!10, !11, i64 24}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = !{!23, !23, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!10, !6, i64 8}
!25 = !{!10, !6, i64 16}
!26 = !{!10, !6, i64 32}
!27 = !{!10, !6, i64 40}
!28 = !{!10, !11, i64 48}
!29 = !{!10, !11, i64 52}
!30 = !{!10, !11, i64 56}
!31 = !{!10, !6, i64 64}
!32 = !{!10, !6, i64 72}
!33 = !{!10, !6, i64 80}
!34 = !{!10, !6, i64 88}
!35 = !{!10, !6, i64 96}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!39, !39, i64 0}
!39 = !{!"_ZTSN10SimTKIpopt23ApplicationReturnStatusE", !7, i64 0}


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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE = external dso_local constant { ptr, ptr, ptr }, align 8

; 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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #1

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @IpoptSolve(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator.16", align 1
  %11 = alloca %"class.SimTKIpopt::SmartPtr.22", align 8
  %12 = alloca %"class.SimTKIpopt::SmartPtr.7", align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 104
  %14 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %15 unwind label %26

15:                                               ; preds = %8
  invoke void @_ZN10SimTKIpopt16IpoptApplication10InitializeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88) %14, ptr noundef nonnull %9)
          to label %16 unwind label %28

16:                                               ; preds = %15
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #9
  %17 = load i32, ptr %0, align 8, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i32 %17, 0
  %20 = shl nsw i64 %18, 3
  %21 = select i1 %19, i64 -1, i64 %20
  %22 = call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #10
  %23 = icmp sgt i32 %17, 0
  br i1 %23, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %16
  %24 = zext nneg i32 %17 to i64
  %25 = shl nuw nsw i64 %24, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %22, ptr align 8 %1, i64 %25, i1 false), !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %16
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %.loopexit101, label %31

26:                                               ; preds = %8
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %30

28:                                               ; preds = %15
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  br label %30

30:                                               ; preds = %28, %26
  %.pn = phi { ptr, i32 } [ %29, %28 ], [ %27, %26 ]
  %.073 = extractvalue { ptr, i32 } %.pn, 0
  %.082 = extractvalue { ptr, i32 } %.pn, 1
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #9
  br label %122

31:                                               ; preds = %._crit_edge
  %32 = getelementptr inbounds i8, ptr %0, i64 24
  %33 = load i32, ptr %32, align 8, !tbaa !14
  %34 = sext i32 %33 to i64
  %35 = icmp slt i32 %33, 0
  %36 = shl nsw i64 %34, 3
  %37 = select i1 %35, i64 -1, i64 %36
  %38 = call noalias noundef nonnull ptr @_Znam(i64 noundef %37) #10
  %39 = icmp sgt i32 %33, 0
  br i1 %39, label %.lr.ph105.preheader, label %.loopexit101

.lr.ph105.preheader:                              ; preds = %31
  %40 = zext nneg i32 %33 to i64
  %41 = shl nuw nsw i64 %40, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %38, ptr nonnull align 8 %4, i64 %41, i1 false), !tbaa !12
  br label %.loopexit101

.loopexit101:                                     ; preds = %.lr.ph105.preheader, %31, %._crit_edge
  %.080 = phi ptr [ null, %._crit_edge ], [ %38, %31 ], [ %38, %.lr.ph105.preheader ]
  %.not92 = icmp eq ptr %5, null
  br i1 %.not92, label %.loopexit100, label %42

42:                                               ; preds = %.loopexit101
  %43 = call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #10
  br i1 %23, label %.loopexit100.thread123, label %.loopexit100.thread

.loopexit100:                                     ; preds = %.loopexit101
  %.not93 = icmp eq ptr %6, null
  br i1 %.not93, label %.loopexit, label %48

.loopexit100.thread123:                           ; preds = %42
  %44 = zext nneg i32 %17 to i64
  %45 = shl nuw nsw i64 %44, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %43, ptr nonnull align 8 %5, i64 %45, i1 false), !tbaa !12
  %.not93125 = icmp eq ptr %6, null
  br i1 %.not93125, label %.loopexit, label %.thread126

.thread126:                                       ; preds = %.loopexit100.thread123
  %46 = call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #10
  br label %.lr.ph111.preheader

.loopexit100.thread:                              ; preds = %42
  %.not93117 = icmp eq ptr %6, null
  br i1 %.not93117, label %.loopexit, label %.thread

.thread:                                          ; preds = %.loopexit100.thread
  %47 = call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #10
  br label %.loopexit

48:                                               ; preds = %.loopexit100
  %49 = call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #10
  br i1 %23, label %.lr.ph111.preheader, label %.loopexit

.lr.ph111.preheader:                              ; preds = %.thread126, %48
  %50 = phi ptr [ %46, %.thread126 ], [ %49, %48 ]
  %.079118128 = phi ptr [ %43, %.thread126 ], [ null, %48 ]
  %51 = zext nneg i32 %17 to i64
  %52 = shl nuw nsw i64 %51, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %50, ptr nonnull align 8 %6, i64 %52, i1 false), !tbaa !12
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit100.thread123, %.thread, %.loopexit100.thread, %.lr.ph111.preheader, %48, %.loopexit100
  %.079119 = phi ptr [ null, %.loopexit100 ], [ null, %48 ], [ %.079118128, %.lr.ph111.preheader ], [ %43, %.loopexit100.thread ], [ %43, %.thread ], [ %43, %.loopexit100.thread123 ]
  %.078 = phi ptr [ null, %.loopexit100 ], [ %49, %48 ], [ %50, %.lr.ph111.preheader ], [ null, %.loopexit100.thread ], [ %47, %.thread ], [ null, %.loopexit100.thread123 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  call void @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %53 = invoke noalias noundef nonnull dereferenceable(216) ptr @_Znwm(i64 noundef 216) #10
          to label %54 unwind label %84

54:                                               ; preds = %.loopexit
  %55 = load i32, ptr %0, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %0, i64 8
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = getelementptr inbounds i8, ptr %0, i64 16
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = getelementptr inbounds i8, ptr %0, i64 24
  %61 = load i32, ptr %60, align 8, !tbaa !14
  %62 = getelementptr inbounds i8, ptr %0, i64 32
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %64 = getelementptr inbounds i8, ptr %0, i64 40
  %65 = load ptr, ptr %64, align 8, !tbaa !18
  %66 = getelementptr inbounds i8, ptr %0, i64 48
  %67 = load i32, ptr %66, align 8, !tbaa !19
  %68 = getelementptr inbounds i8, ptr %0, i64 52
  %69 = load i32, ptr %68, align 4, !tbaa !20
  %70 = getelementptr inbounds i8, ptr %0, i64 56
  %71 = load i32, ptr %70, align 8, !tbaa !21
  %72 = getelementptr inbounds i8, ptr %0, i64 64
  %73 = load ptr, ptr %72, align 8, !tbaa !22
  %74 = getelementptr inbounds i8, ptr %0, i64 72
  %75 = load ptr, ptr %74, align 8, !tbaa !23
  %76 = getelementptr inbounds i8, ptr %0, i64 80
  %77 = load ptr, ptr %76, align 8, !tbaa !24
  %78 = getelementptr inbounds i8, ptr %0, i64 88
  %79 = load ptr, ptr %78, align 8, !tbaa !25
  %80 = getelementptr inbounds i8, ptr %0, i64 96
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  invoke void @_ZN10SimTKIpopt16StdInterfaceTNLPC1EiPKdS2_iS2_S2_iiiS2_S2_S2_S2_PFiiS2_iPdPvEPFiiS2_iiS3_S4_ES6_PFiiS2_iiiPiS9_S3_S4_EPFiiS2_idiS3_iiS9_S9_S3_S4_ES3_S3_S3_S3_S3_S3_S4_(ptr noundef nonnull align 8 dereferenceable(216) %53, i32 noundef %55, ptr noundef %57, ptr noundef %59, i32 noundef %61, ptr noundef %63, ptr noundef %65, i32 noundef %67, i32 noundef %69, i32 noundef %71, ptr noundef nonnull %22, ptr noundef %.080, ptr noundef %.079119, ptr noundef %.078, ptr noundef %73, ptr noundef %75, ptr noundef %77, ptr noundef %79, ptr noundef %81, ptr noundef %1, ptr noundef %5, ptr noundef %6, ptr noundef %2, ptr noundef %4, ptr noundef %3, ptr noundef %7)
          to label %82 unwind label %86

82:                                               ; preds = %54
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull %53)
          to label %.critedge unwind label %84

84:                                               ; preds = %82, %.loopexit
  %85 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE
  br label %88

86:                                               ; preds = %54
  %87 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE
  call void @_ZdlPvm(ptr noundef nonnull %53, i64 noundef 216) #11
  br label %88

88:                                               ; preds = %86, %84
  %.pn94 = phi { ptr, i32 } [ %85, %84 ], [ %87, %86 ]
  %.1 = extractvalue { ptr, i32 } %.pn94, 0
  %.183 = extractvalue { ptr, i32 } %.pn94, 1
  %89 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN10SimTKIpopt24INVALID_STDINTERFACE_NLPE) #9
  %90 = icmp eq i32 %.183, %89
  br i1 %90, label %91, label %121

91:                                               ; preds = %88
  %92 = call ptr @__cxa_begin_catch(ptr %.1) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  %93 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
  invoke void @_ZN10SimTKIpopt16IpoptApplication5JnlstEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.7") align 8 %12, ptr noundef nonnull align 8 dereferenceable(88) %93)
          to label %94 unwind label %99

94:                                               ; preds = %91
  %95 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
  invoke void @_ZNK10SimTKIpopt14IpoptException15ReportExceptionERKNS_10JournalistENS_13EJournalLevelE(ptr noundef nonnull align 8 dereferenceable(112) %92, ptr noundef nonnull align 8 dereferenceable(40) %95, i32 noundef 1)
          to label %96 unwind label %101

96:                                               ; preds = %94
  call void @_ZN10SimTKIpopt8SmartPtrINS_10JournalistEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  invoke void @__cxa_end_catch()
          to label %111 unwind label %104

.critedge:                                        ; preds = %82
  %97 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
  %98 = invoke noundef i32 @_ZN10SimTKIpopt16IpoptApplication12OptimizeTNLPERKNS_8SmartPtrINS_4TNLPEEE(ptr noundef nonnull align 8 dereferenceable(88) %97, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %111 unwind label %107

99:                                               ; preds = %91
  %100 = landingpad { ptr, i32 }
          cleanup
  br label %103

101:                                              ; preds = %94
  %102 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10SimTKIpopt8SmartPtrINS_10JournalistEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  br label %103

103:                                              ; preds = %101, %99
  %.pn96 = phi { ptr, i32 } [ %102, %101 ], [ %100, %99 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  invoke void @__cxa_end_catch()
          to label %106 unwind label %125

104:                                              ; preds = %96
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %106

106:                                              ; preds = %103, %104
  %.pn98 = phi { ptr, i32 } [ %105, %104 ], [ %.pn96, %103 ]
  %.3 = extractvalue { ptr, i32 } %.pn98, 0
  %.385 = extractvalue { ptr, i32 } %.pn98, 1
  br label %121

107:                                              ; preds = %.critedge
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  %110 = extractvalue { ptr, i32 } %108, 1
  br label %121

111:                                              ; preds = %.critedge, %96
  %.0 = phi i32 [ %98, %.critedge ], [ -11, %96 ]
  call void @_ZdaPv(ptr noundef nonnull %22) #11
  %112 = icmp eq ptr %.080, null
  br i1 %112, label %114, label %113

113:                                              ; preds = %111
  call void @_ZdaPv(ptr noundef nonnull %.080) #11
  br label %114

114:                                              ; preds = %113, %111
  %115 = icmp eq ptr %.079119, null
  br i1 %115, label %117, label %116

116:                                              ; preds = %114
  call void @_ZdaPv(ptr noundef nonnull %.079119) #11
  br label %117

117:                                              ; preds = %116, %114
  %118 = icmp eq ptr %.078, null
  br i1 %118, label %120, label %119

119:                                              ; preds = %117
  call void @_ZdaPv(ptr noundef nonnull %.078) #11
  br label %120

120:                                              ; preds = %119, %117
  call void @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  ret i32 %.0

121:                                              ; preds = %107, %106, %88
  %.486 = phi i32 [ %110, %107 ], [ %.385, %106 ], [ %.183, %88 ]
  %.4 = phi ptr [ %109, %107 ], [ %.3, %106 ], [ %.1, %88 ]
  call void @_ZN10SimTKIpopt8SmartPtrINS_4TNLPEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  br label %122

122:                                              ; preds = %121, %30
  %.587 = phi i32 [ %.486, %121 ], [ %.082, %30 ]
  %.5 = phi ptr [ %.4, %121 ], [ %.073, %30 ]
  %123 = insertvalue { ptr, i32 } poison, ptr %.5, 0
  %124 = insertvalue { ptr, i32 } %123, i32 %.587, 1
  resume { ptr, i32 } %124

125:                                              ; preds = %103
  %126 = landingpad { ptr, i32 }
          catch ptr null
  %127 = extractvalue { ptr, i32 } %126, 0
  call void @__clang_call_terminate(ptr %127) #12
  unreachable
}

declare void @_ZN10SimTKIpopt16IpoptApplication10InitializeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef) local_unnamed_addr #6

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

declare void @_ZN10SimTKIpopt16StdInterfaceTNLPC1EiPKdS2_iS2_S2_iiiS2_S2_S2_S2_PFiiS2_iPdPvEPFiiS2_iiS3_S4_ES6_PFiiS2_iiiPiS9_S3_S4_EPFiiS2_idiS3_iiS9_S9_S3_S4_ES3_S3_S3_S3_S3_S3_S4_(ptr noundef nonnull align 8 dereferenceable(216), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #6

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

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14IpoptException15ReportExceptionERKNS_10JournalistENS_13EJournalLevelE(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt16IpoptApplication5JnlstEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.7") align 8, ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #5 align 2

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

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

declare void @__cxa_end_catch() local_unnamed_addr

declare noundef i32 @_ZN10SimTKIpopt16IpoptApplication12OptimizeTNLPERKNS_8SmartPtrINS_4TNLPEEE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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 = { 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 #3 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nosync nounwind memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }
attributes #12 = { noreturn 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, !7, i64 0}
!6 = !{!"_ZTS16IpoptProblemInfo", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !11, i64 104}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEE", !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!6, !7, i64 24}
!15 = !{!6, !10, i64 8}
!16 = !{!6, !10, i64 16}
!17 = !{!6, !10, i64 32}
!18 = !{!6, !10, i64 40}
!19 = !{!6, !7, i64 48}
!20 = !{!6, !7, i64 52}
!21 = !{!6, !7, i64 56}
!22 = !{!6, !10, i64 64}
!23 = !{!6, !10, i64 72}
!24 = !{!6, !10, i64 80}
!25 = !{!6, !10, i64 88}
!26 = !{!6, !10, i64 96}


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