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

; 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.23" = type { i8 }
%"class.SimTKIpopt::SmartPtr.10" = type { ptr }
%"class.std::bad_alloc" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }
%"class.SimTKIpopt::IpoptApplication" = type { %"class.SimTKIpopt::ReferencedObject.base", i8, %"class.SimTKIpopt::SmartPtr.6", %"class.SimTKIpopt::SmartPtr.7", %"class.SimTKIpopt::SmartPtr.8", %"class.SimTKIpopt::SmartPtr.9", %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.11", %"class.SimTKIpopt::SmartPtr.12", %"class.SimTKIpopt::SmartPtr.13", %"class.SimTKIpopt::SmartPtr.14" }
%"class.SimTKIpopt::ReferencedObject.base" = type <{ ptr, i32 }>
%"class.SimTKIpopt::SmartPtr.6" = type { ptr }
%"class.SimTKIpopt::SmartPtr.7" = type { ptr }
%"class.SimTKIpopt::SmartPtr.8" = type { ptr }
%"class.SimTKIpopt::SmartPtr.9" = type { ptr }
%"class.SimTKIpopt::SmartPtr.11" = type { ptr }
%"class.SimTKIpopt::SmartPtr.12" = type { ptr }
%"class.SimTKIpopt::SmartPtr.13" = type { ptr }
%"class.SimTKIpopt::SmartPtr.14" = type { ptr }

@_ZTIN10SimTKIpopt14IpoptExceptionE = external dso_local constant { ptr, ptr }, align 8
@_ZTISt9bad_alloc = external constant ptr
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZTIN10SimTKIpopt14OPTION_INVALIDE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.135 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [36 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: 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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

declare void @__cxa_end_catch()

declare ptr @__cxa_get_exception_ptr(ptr)

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

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

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #8

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10SimTKIpopt16IpoptApplication11OptimizeNLPERKNS_8SmartPtrINS_3NLPEEENS1_INS_16AlgorithmBuilderEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2) #5 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 i32, align 4
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.23", align 1
  %12 = alloca %"class.SimTKIpopt::SmartPtr.10", align 8
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::allocator.23", align 1
  %15 = alloca %"class.std::bad_alloc", align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, 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
  %18 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 -199, ptr %7, align 4, !tbaa !9
  %19 = invoke noundef zeroext i1 @_ZN10SimTKIpopt6IsNullINS_16AlgorithmBuilderEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %20 unwind label %27

20:                                               ; preds = %3
  br i1 %19, label %21, label %35

21:                                               ; preds = %20
  %22 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #10
          to label %23 unwind label %27

23:                                               ; preds = %21
  invoke void @_ZN10SimTKIpopt16AlgorithmBuilderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %22)
          to label %24 unwind label %31

24:                                               ; preds = %23
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_16AlgorithmBuilderEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %22)
          to label %26 unwind label %27

26:                                               ; preds = %24
  br label %35

27:                                               ; preds = %70, %40, %37, %35, %24, %21, %3
  %28 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %8, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %9, align 4
  br label %101

31:                                               ; preds = %23
  %32 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %8, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %22, i64 noundef 16) #11
  br label %101

35:                                               ; preds = %26, %20
  %36 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16AlgorithmBuilderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %37 unwind label %27

37:                                               ; preds = %35
  %38 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %39 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %40 unwind label %27

40:                                               ; preds = %37
  %41 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 4
  %42 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZNK10SimTKIpopt8SmartPtrINS_11OptionsListEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %41)
          to label %43 unwind label %27

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %44 unwind label %73

44:                                               ; preds = %43
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 7
  %47 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 8
  %48 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 9
  %49 = load ptr, ptr %36, align 8, !tbaa !11
  %50 = getelementptr inbounds ptr, ptr %49, i64 2
  %51 = load ptr, ptr %50, align 8
  invoke void %51(ptr noundef nonnull align 8 dereferenceable(12) %36, ptr noundef nonnull align 8 dereferenceable(40) %39, ptr noundef nonnull align 8 dereferenceable(112) %42, ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull align 8 dereferenceable(8) %48)
          to label %52 unwind label %77

52:                                               ; preds = %44
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %53 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16AlgorithmBuilderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %54 unwind label %82

54:                                               ; preds = %52
  %55 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %56 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %55)
          to label %57 unwind label %82

57:                                               ; preds = %54
  %58 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 4
  %59 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZNK10SimTKIpopt8SmartPtrINS_11OptionsListEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %58)
          to label %60 unwind label %82

60:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %61 unwind label %86

61:                                               ; preds = %60
  %62 = load ptr, ptr %53, align 8, !tbaa !11
  %63 = getelementptr inbounds ptr, ptr %62, i64 3
  %64 = load ptr, ptr %63, align 8
  invoke void %64(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.10") align 8 %12, ptr noundef nonnull align 8 dereferenceable(12) %53, ptr noundef nonnull align 8 dereferenceable(40) %56, ptr noundef nonnull align 8 dereferenceable(112) %59, ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %65 unwind label %90

65:                                               ; preds = %61
  %66 = invoke noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_14IpoptAlgorithmEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %67 unwind label %94

67:                                               ; preds = %65
  %68 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 6
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_14IpoptAlgorithmEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef %66)
          to label %70 unwind label %94

70:                                               ; preds = %67
  call void @_ZN10SimTKIpopt8SmartPtrINS_14IpoptAlgorithmEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  %71 = invoke noundef i32 @_ZN10SimTKIpopt16IpoptApplication13call_optimizeEv(ptr noundef nonnull align 8 dereferenceable(88) %18)
          to label %72 unwind label %27

72:                                               ; preds = %70
  store i32 %71, ptr %7, align 4, !tbaa !9
  br label %117

73:                                               ; preds = %43
  %74 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %8, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %9, align 4
  br label %81

77:                                               ; preds = %44
  %78 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %8, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  br label %81

81:                                               ; preds = %77, %73
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #9
  br label %101

82:                                               ; preds = %57, %54, %52
  %83 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %8, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %9, align 4
  br label %100

86:                                               ; preds = %60
  %87 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %8, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %9, align 4
  br label %99

90:                                               ; preds = %61
  %91 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %8, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %9, align 4
  br label %98

94:                                               ; preds = %67, %65
  %95 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %8, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %9, align 4
  call void @_ZN10SimTKIpopt8SmartPtrINS_14IpoptAlgorithmEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  br label %98

98:                                               ; preds = %94, %90
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #9
  br label %99

99:                                               ; preds = %98, %86
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #9
  br label %100

100:                                              ; preds = %99, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %101

101:                                              ; preds = %100, %81, %31, %27
  %102 = load i32, ptr %9, align 4
  %103 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE) #9
  %104 = icmp eq i32 %102, %103
  br i1 %104, label %105, label %121

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %106 = load ptr, ptr %8, align 8
  %107 = call ptr @__cxa_begin_catch(ptr %106) #9
  store ptr %107, ptr %17, align 8
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %110 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %109)
          to label %111 unwind label %157

111:                                              ; preds = %105
  invoke void @_ZNK10SimTKIpopt14IpoptException15ReportExceptionERKNS_10JournalistENS_13EJournalLevelE(ptr noundef nonnull align 8 dereferenceable(112) %108, ptr noundef nonnull align 8 dereferenceable(40) %110, i32 noundef 1)
          to label %112 unwind label %157

112:                                              ; preds = %111
  %113 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %114 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %113)
          to label %115 unwind label %157

115:                                              ; preds = %112
  invoke void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %114, i32 noundef 3, i32 noundef 2, ptr noundef @.str.136)
          to label %116 unwind label %157

116:                                              ; preds = %115
  store i32 -12, ptr %7, align 4, !tbaa !9
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %117

117:                                              ; preds = %146, %135, %116, %72
  %118 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %119 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %118)
  call void @_ZNK10SimTKIpopt10Journalist11FlushBufferEv(ptr noundef nonnull align 8 dereferenceable(40) %119)
  %120 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  ret i32 %120

121:                                              ; preds = %101
  %122 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN10SimTKIpopt14IpoptExceptionE) #9
  %123 = icmp eq i32 %102, %122
  br i1 %123, label %124, label %136

124:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %125 = load ptr, ptr %8, align 8
  %126 = call ptr @__cxa_begin_catch(ptr %125) #9
  store ptr %126, ptr %16, align 8
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %129 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %128)
          to label %130 unwind label %152

130:                                              ; preds = %124
  invoke void @_ZNK10SimTKIpopt14IpoptException15ReportExceptionERKNS_10JournalistENS_13EJournalLevelE(ptr noundef nonnull align 8 dereferenceable(112) %127, ptr noundef nonnull align 8 dereferenceable(40) %129, i32 noundef 1)
          to label %131 unwind label %152

131:                                              ; preds = %130
  %132 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %133 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %132)
          to label %134 unwind label %152

134:                                              ; preds = %131
  invoke void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %133, i32 noundef 3, i32 noundef 2, ptr noundef @.str.135)
          to label %135 unwind label %152

135:                                              ; preds = %134
  store i32 -100, ptr %7, align 4, !tbaa !9
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %117

136:                                              ; preds = %121
  %137 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9bad_alloc) #9
  %138 = icmp eq i32 %102, %137
  br i1 %138, label %139, label %162

139:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %140 = load ptr, ptr %8, align 8
  %141 = call ptr @__cxa_get_exception_ptr(ptr %140) #9
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %141) #9
  %142 = call ptr @__cxa_begin_catch(ptr %140) #9
  store i32 -102, ptr %7, align 4, !tbaa !9
  %143 = getelementptr inbounds %"class.SimTKIpopt::IpoptApplication", ptr %18, i32 0, i32 2
  %144 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %143)
          to label %145 unwind label %147

145:                                              ; preds = %139
  invoke void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %144, i32 noundef 3, i32 noundef 2, ptr noundef @.str.7)
          to label %146 unwind label %147

146:                                              ; preds = %145
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #9
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %117

147:                                              ; preds = %145, %139
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %8, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %9, align 4
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #9
  invoke void @__cxa_end_catch()
          to label %151 unwind label %168

151:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %162

152:                                              ; preds = %134, %131, %130, %124
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %8, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %9, align 4
  invoke void @__cxa_end_catch()
          to label %156 unwind label %168

156:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %162

157:                                              ; preds = %115, %112, %111, %105
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %8, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %9, align 4
  invoke void @__cxa_end_catch()
          to label %161 unwind label %168

161:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %162

162:                                              ; preds = %161, %156, %151, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %8, align 8
  %165 = load i32, ptr %9, align 4
  %166 = insertvalue { ptr, i32 } poison, ptr %164, 0
  %167 = insertvalue { ptr, i32 } %166, i32 %165, 1
  resume { ptr, i32 } %167

168:                                              ; preds = %157, %152, %147
  %169 = landingpad { ptr, i32 }
          catch ptr null
  %170 = extractvalue { ptr, i32 } %169, 0
  call void @__clang_call_terminate(ptr %170) #12
  unreachable
}

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

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

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

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

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

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

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

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

declare void @_ZNK10SimTKIpopt10Journalist11FlushBufferEv(ptr noundef nonnull align 8 dereferenceable(40)) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 = { 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 = { nounwind memory(none) }
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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }
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, !10, i64 0}
!10 = !{!"_ZTSN10SimTKIpopt23ApplicationReturnStatusE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, 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.23" = type { i8 }
%"class.SimTKIpopt::SmartPtr.10" = type { ptr }
%"class.std::bad_alloc" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }

@_ZTIN10SimTKIpopt14IpoptExceptionE = external dso_local constant { ptr, ptr }, align 8
@_ZTISt9bad_alloc = external constant ptr
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@_ZTIN10SimTKIpopt14OPTION_INVALIDE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.135 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [36 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: 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 allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

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

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

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

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

; 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 #4 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 #3 align 2

declare void @__cxa_end_catch() local_unnamed_addr

declare ptr @__cxa_get_exception_ptr(ptr) local_unnamed_addr

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

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

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10SimTKIpopt16IpoptApplication11OptimizeNLPERKNS_8SmartPtrINS_3NLPEEENS1_INS_16AlgorithmBuilderEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.23", align 1
  %6 = alloca %"class.SimTKIpopt::SmartPtr.10", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator.23", align 1
  %9 = alloca %"class.std::bad_alloc", align 8
  %10 = tail call noundef zeroext i1 @_ZN10SimTKIpopt6IsNullINS_16AlgorithmBuilderEEEbRKNS_8SmartPtrIT_EE(ptr noundef nonnull align 8 dereferenceable(8) %2)
  br i1 %10, label %11, label %17

11:                                               ; preds = %3
  %12 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #8
          to label %13 unwind label %15

13:                                               ; preds = %11
  tail call void @_ZN10SimTKIpopt16AlgorithmBuilderC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %12)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_16AlgorithmBuilderEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull %12)
  br label %17

15:                                               ; preds = %42, %11
  %16 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  br label %57

17:                                               ; preds = %13, %3
  %18 = tail call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16AlgorithmBuilderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = tail call noundef nonnull align 8 dereferenceable(112) ptr @_ZNK10SimTKIpopt8SmartPtrINS_11OptionsListEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #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.10, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %23 unwind label %44

23:                                               ; preds = %17
  %24 = getelementptr inbounds i8, ptr %0, i64 56
  %25 = getelementptr inbounds i8, ptr %0, i64 64
  %26 = getelementptr inbounds i8, ptr %0, i64 72
  %27 = load ptr, ptr %18, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %29 = load ptr, ptr %28, align 8
  invoke void %29(ptr noundef nonnull align 8 dereferenceable(12) %18, ptr noundef nonnull align 8 dereferenceable(40) %20, ptr noundef nonnull align 8 dereferenceable(112) %22, ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %30 unwind label %46

30:                                               ; preds = %23
  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
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %31 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_16AlgorithmBuilderEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %32 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %33 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNK10SimTKIpopt8SmartPtrINS_11OptionsListEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %34 unwind label %49

34:                                               ; preds = %30
  %35 = load ptr, ptr %31, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 24
  %37 = load ptr, ptr %36, align 8
  invoke void %37(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.10") align 8 %6, ptr noundef nonnull align 8 dereferenceable(12) %31, ptr noundef nonnull align 8 dereferenceable(40) %32, ptr noundef nonnull align 8 dereferenceable(112) %33, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %38 unwind label %51

38:                                               ; preds = %34
  %39 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrINS_14IpoptAlgorithmEEEPT_RKNS_8SmartPtrIS2_EE(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %40 = getelementptr inbounds i8, ptr %0, i64 48
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_14IpoptAlgorithmEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef %39)
          to label %42 unwind label %53

42:                                               ; preds = %38
  call void @_ZN10SimTKIpopt8SmartPtrINS_14IpoptAlgorithmEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %43 = invoke noundef i32 @_ZN10SimTKIpopt16IpoptApplication13call_optimizeEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
          to label %67 unwind label %15

44:                                               ; preds = %17
  %45 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  br label %48

46:                                               ; preds = %23
  %47 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  br label %48

48:                                               ; preds = %46, %44
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %45, %44 ]
  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
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %57

49:                                               ; preds = %30
  %50 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  br label %56

51:                                               ; preds = %34
  %52 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  br label %55

53:                                               ; preds = %38
  %54 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN10SimTKIpopt14OPTION_INVALIDE
          catch ptr @_ZTIN10SimTKIpopt14IpoptExceptionE
          catch ptr @_ZTISt9bad_alloc
  call void @_ZN10SimTKIpopt8SmartPtrINS_14IpoptAlgorithmEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  br label %55

55:                                               ; preds = %53, %51
  %.pn17 = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  br label %56

56:                                               ; preds = %55, %49
  %.pn17.pn = phi { ptr, i32 } [ %.pn17, %55 ], [ %50, %49 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br label %57

57:                                               ; preds = %56, %48, %15
  %.pn20 = phi { ptr, i32 } [ %16, %15 ], [ %.pn17.pn, %56 ], [ %.pn, %48 ]
  %.3 = extractvalue { ptr, i32 } %.pn20, 0
  %.314 = extractvalue { ptr, i32 } %.pn20, 1
  %58 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN10SimTKIpopt14OPTION_INVALIDE) #9
  %59 = icmp eq i32 %.314, %58
  br i1 %59, label %60, label %70

60:                                               ; preds = %57
  %61 = call ptr @__cxa_begin_catch(ptr %.3) #9
  %62 = getelementptr inbounds i8, ptr %0, i64 16
  %63 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %62)
  invoke void @_ZNK10SimTKIpopt14IpoptException15ReportExceptionERKNS_10JournalistENS_13EJournalLevelE(ptr noundef nonnull align 8 dereferenceable(112) %61, ptr noundef nonnull align 8 dereferenceable(40) %63, i32 noundef 1)
          to label %64 unwind label %94

64:                                               ; preds = %60
  %65 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %62)
  invoke void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %65, i32 noundef 3, i32 noundef 2, ptr noundef nonnull @.str.136)
          to label %66 unwind label %94

66:                                               ; preds = %64
  call void @__cxa_end_catch()
  br label %67

67:                                               ; preds = %42, %88, %79, %66
  %.0 = phi i32 [ -12, %66 ], [ -100, %79 ], [ -102, %88 ], [ %43, %42 ]
  %68 = getelementptr inbounds i8, ptr %0, i64 16
  %69 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %68)
  call void @_ZNK10SimTKIpopt10Journalist11FlushBufferEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
  ret i32 %.0

70:                                               ; preds = %57
  %71 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN10SimTKIpopt14IpoptExceptionE) #9
  %72 = icmp eq i32 %.314, %71
  br i1 %72, label %73, label %80

73:                                               ; preds = %70
  %74 = call ptr @__cxa_begin_catch(ptr %.3) #9
  %75 = getelementptr inbounds i8, ptr %0, i64 16
  %76 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %75)
  invoke void @_ZNK10SimTKIpopt14IpoptException15ReportExceptionERKNS_10JournalistENS_13EJournalLevelE(ptr noundef nonnull align 8 dereferenceable(112) %74, ptr noundef nonnull align 8 dereferenceable(40) %76, i32 noundef 1)
          to label %77 unwind label %92

77:                                               ; preds = %73
  %78 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %75)
  invoke void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %78, i32 noundef 3, i32 noundef 2, ptr noundef nonnull @.str.135)
          to label %79 unwind label %92

79:                                               ; preds = %77
  call void @__cxa_end_catch()
  br label %67

80:                                               ; preds = %70
  %81 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9bad_alloc) #9
  %82 = icmp eq i32 %.314, %81
  br i1 %82, label %83, label %96

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %84 = call ptr @__cxa_get_exception_ptr(ptr %.3) #9
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %84) #9
  %85 = call ptr @__cxa_begin_catch(ptr %.3) #9
  %86 = getelementptr inbounds i8, ptr %0, i64 16
  %87 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrINS_10JournalistEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %86)
  invoke void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %87, i32 noundef 3, i32 noundef 2, ptr noundef nonnull @.str.7)
          to label %88 unwind label %89

88:                                               ; preds = %83
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %67

89:                                               ; preds = %83
  %90 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  invoke void @__cxa_end_catch()
          to label %91 unwind label %97

91:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %96

92:                                               ; preds = %77, %73
  %93 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %96 unwind label %97

94:                                               ; preds = %64, %60
  %95 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %96 unwind label %97

96:                                               ; preds = %94, %92, %91, %80
  %.merged = phi { ptr, i32 } [ %90, %91 ], [ %.pn20, %80 ], [ %93, %92 ], [ %95, %94 ]
  resume { ptr, i32 } %.merged

97:                                               ; preds = %94, %92, %89
  %98 = landingpad { ptr, i32 }
          catch ptr null
  %99 = extractvalue { ptr, i32 } %98, 0
  call void @__clang_call_terminate(ptr %99) #10
  unreachable
}

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

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

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

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

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

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

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

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

declare void @_ZNK10SimTKIpopt10Journalist11FlushBufferEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #6

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

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 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nosync nounwind memory(none) }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind "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 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass