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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.SimTKIpopt::SmartPtr.6" = type { ptr }
%"class.SimTKIpopt::SmartPtr.9" = type { ptr }
%"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.38" = type { i8 }

@_ZTIN10SimTKIpopt6MatrixE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt10GenTMatrixE = external constant ptr
@_ZTIN10SimTKIpopt10SymTMatrixE = external constant ptr
@_ZTIN10SimTKIpopt12ScaledMatrixE = external constant ptr
@_ZTIN10SimTKIpopt15SymScaledMatrixE = external constant ptr
@_ZTIN10SimTKIpopt10DiagMatrixE = external constant ptr
@_ZTIN10SimTKIpopt14IdentityMatrixE = external constant ptr
@_ZTIN10SimTKIpopt15ExpansionMatrixE = external constant ptr
@_ZTIN10SimTKIpopt9SumMatrixE = external constant ptr
@_ZTIN10SimTKIpopt12SumSymMatrixE = external constant ptr
@_ZTIN10SimTKIpopt10ZeroMatrixE = external constant ptr
@_ZTIN10SimTKIpopt14CompoundMatrixE = external constant ptr
@_ZTIN10SimTKIpopt17CompoundSymMatrixE = external constant ptr
@.str = external hidden unnamed_addr constant [62 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@_ZTIN10SimTKIpopt13TripletHelper19UNKNOWN_MATRIX_TYPEE = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

30:                                               ; preds = %1
  %31 = call ptr @__dynamic_cast(ptr %28, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt10GenTMatrixE, i64 0) #6
  br label %33

32:                                               ; preds = %1
  br label %33

33:                                               ; preds = %32, %30
  %34 = phi ptr [ %31, %30 ], [ null, %32 ]
  store ptr %34, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %40

37:                                               ; preds = %33
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call noundef i32 @_ZNK10SimTKIpopt10GenTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(89) %38)
  store i32 %39, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %229

40:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %45, label %43

43:                                               ; preds = %40
  %44 = call ptr @__dynamic_cast(ptr %41, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt10SymTMatrixE, i64 0) #6
  br label %46

45:                                               ; preds = %40
  br label %46

46:                                               ; preds = %45, %43
  %47 = phi ptr [ %44, %43 ], [ null, %45 ]
  store ptr %47, ptr %7, align 8, !tbaa !5
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %53

50:                                               ; preds = %46
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %51)
  store i32 %52, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %228

53:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = icmp eq ptr %54, null
  br i1 %55, label %58, label %56

56:                                               ; preds = %53
  %57 = call ptr @__dynamic_cast(ptr %54, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt12ScaledMatrixE, i64 0) #6
  br label %59

58:                                               ; preds = %53
  br label %59

59:                                               ; preds = %58, %56
  %60 = phi ptr [ %57, %56 ], [ null, %58 ]
  store ptr %60, ptr %8, align 8, !tbaa !5
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %73

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZNK10SimTKIpopt12ScaledMatrix17GetUnscaledMatrixEv(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.6") align 8 %9, ptr noundef nonnull align 8 dereferenceable(96) %64)
  %65 = invoke noundef ptr @_ZN10SimTKIpopt9GetRawPtrIKNS_6MatrixEEEPT_RKNS_8SmartPtrIS3_EE(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %66 unwind label %69

66:                                               ; preds = %63
  %67 = invoke noundef i32 @_ZN10SimTKIpopt13TripletHelper16GetNumberEntriesERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(69) %65)
          to label %68 unwind label %69

68:                                               ; preds = %66
  store i32 %67, ptr %2, align 4
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6MatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  store i32 1, ptr %6, align 4
  br label %226

69:                                               ; preds = %66, %63
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %10, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %11, align 4
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6MatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %227

73:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %78, label %76

76:                                               ; preds = %73
  %77 = call ptr @__dynamic_cast(ptr %74, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt15SymScaledMatrixE, i64 0) #6
  br label %79

78:                                               ; preds = %73
  br label %79

79:                                               ; preds = %78, %76
  %80 = phi ptr [ %77, %76 ], [ null, %78 ]
  store ptr %80, ptr %12, align 8, !tbaa !5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %93

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZNK10SimTKIpopt15SymScaledMatrix17GetUnscaledMatrixEv(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.9") align 8 %13, ptr noundef nonnull align 8 dereferenceable(104) %84)
  %85 = invoke noundef ptr @_ZN10SimTKIpopt9GetRawPtrIKNS_9SymMatrixEEEPT_RKNS_8SmartPtrIS3_EE(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %86 unwind label %89

86:                                               ; preds = %83
  %87 = invoke noundef i32 @_ZN10SimTKIpopt13TripletHelper16GetNumberEntriesERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(69) %85)
          to label %88 unwind label %89

88:                                               ; preds = %86
  store i32 %87, ptr %2, align 4
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_9SymMatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  store i32 1, ptr %6, align 4
  br label %224

89:                                               ; preds = %86, %83
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %10, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %11, align 4
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_9SymMatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %225

93:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = icmp eq ptr %94, null
  br i1 %95, label %98, label %96

96:                                               ; preds = %93
  %97 = call ptr @__dynamic_cast(ptr %94, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt10DiagMatrixE, i64 0) #6
  br label %99

98:                                               ; preds = %93
  br label %99

99:                                               ; preds = %98, %96
  %100 = phi ptr [ %97, %96 ], [ null, %98 ]
  store ptr %100, ptr %14, align 8, !tbaa !5
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %106

103:                                              ; preds = %99
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = call noundef i32 @_ZNK10SimTKIpopt9SymMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(80) %104)
  store i32 %105, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %223

106:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = icmp eq ptr %107, null
  br i1 %108, label %111, label %109

109:                                              ; preds = %106
  %110 = call ptr @__dynamic_cast(ptr %107, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt14IdentityMatrixE, i64 0) #6
  br label %112

111:                                              ; preds = %106
  br label %112

112:                                              ; preds = %111, %109
  %113 = phi ptr [ %110, %109 ], [ null, %111 ]
  store ptr %113, ptr %15, align 8, !tbaa !5
  %114 = load ptr, ptr %15, align 8, !tbaa !5
  %115 = icmp ne ptr %114, null
  br i1 %115, label %116, label %119

116:                                              ; preds = %112
  %117 = load ptr, ptr %15, align 8, !tbaa !5
  %118 = call noundef i32 @_ZNK10SimTKIpopt14IdentityMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(88) %117)
  store i32 %118, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %222

119:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = icmp eq ptr %120, null
  br i1 %121, label %124, label %122

122:                                              ; preds = %119
  %123 = call ptr @__dynamic_cast(ptr %120, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt15ExpansionMatrixE, i64 0) #6
  br label %125

124:                                              ; preds = %119
  br label %125

125:                                              ; preds = %124, %122
  %126 = phi ptr [ %123, %122 ], [ null, %124 ]
  store ptr %126, ptr %16, align 8, !tbaa !5
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %132

129:                                              ; preds = %125
  %130 = load ptr, ptr %16, align 8, !tbaa !5
  %131 = call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %130)
  store i32 %131, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %221

132:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = icmp eq ptr %133, null
  br i1 %134, label %137, label %135

135:                                              ; preds = %132
  %136 = call ptr @__dynamic_cast(ptr %133, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt9SumMatrixE, i64 0) #6
  br label %138

137:                                              ; preds = %132
  br label %138

138:                                              ; preds = %137, %135
  %139 = phi ptr [ %136, %135 ], [ null, %137 ]
  store ptr %139, ptr %17, align 8, !tbaa !5
  %140 = load ptr, ptr %17, align 8, !tbaa !5
  %141 = icmp ne ptr %140, null
  br i1 %141, label %142, label %145

142:                                              ; preds = %138
  %143 = load ptr, ptr %17, align 8, !tbaa !5
  %144 = call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_9SumMatrixE(ptr noundef nonnull align 8 dereferenceable(128) %143)
  store i32 %144, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %220

145:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = icmp eq ptr %146, null
  br i1 %147, label %150, label %148

148:                                              ; preds = %145
  %149 = call ptr @__dynamic_cast(ptr %146, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt12SumSymMatrixE, i64 0) #6
  br label %151

150:                                              ; preds = %145
  br label %151

151:                                              ; preds = %150, %148
  %152 = phi ptr [ %149, %148 ], [ null, %150 ]
  store ptr %152, ptr %18, align 8, !tbaa !5
  %153 = load ptr, ptr %18, align 8, !tbaa !5
  %154 = icmp ne ptr %153, null
  br i1 %154, label %155, label %158

155:                                              ; preds = %151
  %156 = load ptr, ptr %18, align 8, !tbaa !5
  %157 = call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_12SumSymMatrixE(ptr noundef nonnull align 8 dereferenceable(136) %156)
  store i32 %157, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %219

158:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = icmp eq ptr %159, null
  br i1 %160, label %163, label %161

161:                                              ; preds = %158
  %162 = call ptr @__dynamic_cast(ptr %159, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt10ZeroMatrixE, i64 0) #6
  br label %164

163:                                              ; preds = %158
  br label %164

164:                                              ; preds = %163, %161
  %165 = phi ptr [ %162, %161 ], [ null, %163 ]
  store ptr %165, ptr %19, align 8, !tbaa !5
  %166 = load ptr, ptr %19, align 8, !tbaa !5
  %167 = icmp ne ptr %166, null
  br i1 %167, label %168, label %169

168:                                              ; preds = %164
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %218

169:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = icmp eq ptr %170, null
  br i1 %171, label %174, label %172

172:                                              ; preds = %169
  %173 = call ptr @__dynamic_cast(ptr %170, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt14CompoundMatrixE, i64 0) #6
  br label %175

174:                                              ; preds = %169
  br label %175

175:                                              ; preds = %174, %172
  %176 = phi ptr [ %173, %172 ], [ null, %174 ]
  store ptr %176, ptr %20, align 8, !tbaa !5
  %177 = load ptr, ptr %20, align 8, !tbaa !5
  %178 = icmp ne ptr %177, null
  br i1 %178, label %179, label %182

179:                                              ; preds = %175
  %180 = load ptr, ptr %20, align 8, !tbaa !5
  %181 = call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_14CompoundMatrixE(ptr noundef nonnull align 8 dereferenceable(129) %180)
  store i32 %181, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %217

182:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = icmp eq ptr %183, null
  br i1 %184, label %187, label %185

185:                                              ; preds = %182
  %186 = call ptr @__dynamic_cast(ptr %183, ptr @_ZTIN10SimTKIpopt6MatrixE, ptr @_ZTIN10SimTKIpopt17CompoundSymMatrixE, i64 0) #6
  br label %188

187:                                              ; preds = %182
  br label %188

188:                                              ; preds = %187, %185
  %189 = phi ptr [ %186, %185 ], [ null, %187 ]
  store ptr %189, ptr %21, align 8, !tbaa !5
  %190 = load ptr, ptr %21, align 8, !tbaa !5
  %191 = icmp ne ptr %190, null
  br i1 %191, label %192, label %195

192:                                              ; preds = %188
  %193 = load ptr, ptr %21, align 8, !tbaa !5
  %194 = call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_17CompoundSymMatrixE(ptr noundef nonnull align 8 dereferenceable(137) %193)
  store i32 %194, ptr %2, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %217

195:                                              ; preds = %188
  store i1 true, ptr %26, align 1
  %196 = call ptr @__cxa_allocate_exception(i64 112) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %197 unwind label %200

197:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %25)
          to label %198 unwind label %204

198:                                              ; preds = %197
  invoke void @_ZN10SimTKIpopt13TripletHelper19UNKNOWN_MATRIX_TYPEC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_i(ptr noundef nonnull align 8 dereferenceable(112) %196, ptr noundef %22, ptr noundef %24, i32 noundef 95)
          to label %199 unwind label %208

199:                                              ; preds = %198
  store i1 false, ptr %26, align 1
  invoke void @__cxa_throw(ptr %196, ptr @_ZTIN10SimTKIpopt13TripletHelper19UNKNOWN_MATRIX_TYPEE, ptr @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #7
          to label %236 unwind label %208

200:                                              ; preds = %195
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %10, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %11, align 4
  br label %213

204:                                              ; preds = %197
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %10, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %11, align 4
  br label %212

208:                                              ; preds = %199, %198
  %209 = landingpad { ptr, i32 }
          cleanup
  %210 = extractvalue { ptr, i32 } %209, 0
  store ptr %210, ptr %10, align 8
  %211 = extractvalue { ptr, i32 } %209, 1
  store i32 %211, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %24) #6
  br label %212

212:                                              ; preds = %208, %204
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %25) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  br label %213

213:                                              ; preds = %212, %200
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  %214 = load i1, ptr %26, align 1
  br i1 %214, label %215, label %216

215:                                              ; preds = %213
  call void @__cxa_free_exception(ptr %196) #6
  br label %216

216:                                              ; preds = %215, %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %225

217:                                              ; preds = %192, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %218

218:                                              ; preds = %217, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %219

219:                                              ; preds = %218, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %220

220:                                              ; preds = %219, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %221

221:                                              ; preds = %220, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %222

222:                                              ; preds = %221, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %223

223:                                              ; preds = %222, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %224

224:                                              ; preds = %223, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %226

225:                                              ; preds = %216, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %227

226:                                              ; preds = %224, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %228

227:                                              ; preds = %225, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %231

228:                                              ; preds = %226, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %229

229:                                              ; preds = %228, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %230 = load i32, ptr %2, align 4
  ret i32 %230

231:                                              ; preds = %227
  %232 = load ptr, ptr %10, align 8
  %233 = load i32, ptr %11, align 4
  %234 = insertvalue { ptr, i32 } poison, ptr %232, 0
  %235 = insertvalue { ptr, i32 } %234, i32 %233, 1
  resume { ptr, i32 } %235

236:                                              ; preds = %199
  unreachable
}

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt15SymScaledMatrix17GetUnscaledMatrixEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.9") align 8, ptr noundef nonnull align 8 dereferenceable(104)) #3 align 2

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

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

declare noundef i32 @_ZNK10SimTKIpopt14IdentityMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(88)) #5

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

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

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

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

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

declare ptr @__cxa_allocate_exception(i64)

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

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

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #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

declare void @__cxa_free_exception(ptr)

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind willreturn memory(read) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 }
attributes #7 = { noreturn }

!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"}


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

@_ZTIN10SimTKIpopt6MatrixE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN10SimTKIpopt10GenTMatrixE = external constant ptr
@_ZTIN10SimTKIpopt10SymTMatrixE = external constant ptr
@_ZTIN10SimTKIpopt12ScaledMatrixE = external constant ptr
@_ZTIN10SimTKIpopt15SymScaledMatrixE = external constant ptr
@_ZTIN10SimTKIpopt10DiagMatrixE = external constant ptr
@_ZTIN10SimTKIpopt14IdentityMatrixE = external constant ptr
@_ZTIN10SimTKIpopt15ExpansionMatrixE = external constant ptr
@_ZTIN10SimTKIpopt9SumMatrixE = external constant ptr
@_ZTIN10SimTKIpopt12SumSymMatrixE = external constant ptr
@_ZTIN10SimTKIpopt10ZeroMatrixE = external constant ptr
@_ZTIN10SimTKIpopt14CompoundMatrixE = external constant ptr
@_ZTIN10SimTKIpopt17CompoundSymMatrixE = external constant ptr
@.str = external hidden unnamed_addr constant [62 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@_ZTIN10SimTKIpopt13TripletHelper19UNKNOWN_MATRIX_TYPEE = 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10SimTKIpopt13TripletHelper16GetNumberEntriesERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(69) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.SimTKIpopt::SmartPtr.6", align 8
  %3 = alloca %"class.SimTKIpopt::SmartPtr.9", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.38", align 1
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.38", align 1
  %8 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt10GenTMatrixE, i64 0) #6
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %11, label %9

9:                                                ; preds = %1
  %10 = tail call noundef i32 @_ZNK10SimTKIpopt10GenTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(89) %8)
  br label %74

11:                                               ; preds = %1
  %12 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt10SymTMatrixE, i64 0) #6
  %.not61 = icmp eq ptr %12, null
  br i1 %.not61, label %15, label %13

13:                                               ; preds = %11
  %14 = tail call noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97) %12)
  br label %74

15:                                               ; preds = %11
  %16 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt12ScaledMatrixE, i64 0) #6
  %.not62 = icmp eq ptr %16, null
  br i1 %.not62, label %23, label %17

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @_ZNK10SimTKIpopt12ScaledMatrix17GetUnscaledMatrixEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.6") align 8 %2, ptr noundef nonnull align 8 dereferenceable(96) %16)
  %18 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrIKNS_6MatrixEEEPT_RKNS_8SmartPtrIS3_EE(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %19 = invoke noundef i32 @_ZN10SimTKIpopt13TripletHelper16GetNumberEntriesERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(69) %18)
          to label %20 unwind label %21

20:                                               ; preds = %17
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6MatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %74

21:                                               ; preds = %17
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6MatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %73

23:                                               ; preds = %15
  %24 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt15SymScaledMatrixE, i64 0) #6
  %.not63 = icmp eq ptr %24, null
  br i1 %.not63, label %31, label %25

25:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @_ZNK10SimTKIpopt15SymScaledMatrix17GetUnscaledMatrixEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.9") align 8 %3, ptr noundef nonnull align 8 dereferenceable(104) %24)
  %26 = call noundef ptr @_ZN10SimTKIpopt9GetRawPtrIKNS_9SymMatrixEEEPT_RKNS_8SmartPtrIS3_EE(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %27 = invoke noundef i32 @_ZN10SimTKIpopt13TripletHelper16GetNumberEntriesERKNS_6MatrixE(ptr noundef nonnull align 8 dereferenceable(69) %26)
          to label %28 unwind label %29

28:                                               ; preds = %25
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_9SymMatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %74

29:                                               ; preds = %25
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_9SymMatrixEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %73

31:                                               ; preds = %23
  %32 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt10DiagMatrixE, i64 0) #6
  %.not64 = icmp eq ptr %32, null
  br i1 %.not64, label %35, label %33

33:                                               ; preds = %31
  %34 = tail call noundef i32 @_ZNK10SimTKIpopt9SymMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(80) %32)
  br label %74

35:                                               ; preds = %31
  %36 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt14IdentityMatrixE, i64 0) #6
  %.not65 = icmp eq ptr %36, null
  br i1 %.not65, label %39, label %37

37:                                               ; preds = %35
  %38 = tail call noundef i32 @_ZNK10SimTKIpopt14IdentityMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(88) %36)
  br label %74

39:                                               ; preds = %35
  %40 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt15ExpansionMatrixE, i64 0) #6
  %.not66 = icmp eq ptr %40, null
  br i1 %.not66, label %43, label %41

41:                                               ; preds = %39
  %42 = tail call noundef i32 @_ZNK10SimTKIpopt6Matrix5NColsEv(ptr noundef nonnull align 8 dereferenceable(69) %40)
  br label %74

43:                                               ; preds = %39
  %44 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt9SumMatrixE, i64 0) #6
  %.not67 = icmp eq ptr %44, null
  br i1 %.not67, label %47, label %45

45:                                               ; preds = %43
  %46 = tail call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_9SumMatrixE(ptr noundef nonnull align 8 dereferenceable(128) %44)
  br label %74

47:                                               ; preds = %43
  %48 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt12SumSymMatrixE, i64 0) #6
  %.not68 = icmp eq ptr %48, null
  br i1 %.not68, label %51, label %49

49:                                               ; preds = %47
  %50 = tail call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_12SumSymMatrixE(ptr noundef nonnull align 8 dereferenceable(136) %48)
  br label %74

51:                                               ; preds = %47
  %52 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt10ZeroMatrixE, i64 0) #6
  %.not69 = icmp eq ptr %52, null
  br i1 %.not69, label %53, label %74

53:                                               ; preds = %51
  %54 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt14CompoundMatrixE, i64 0) #6
  %.not70 = icmp eq ptr %54, null
  br i1 %.not70, label %57, label %55

55:                                               ; preds = %53
  %56 = tail call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_14CompoundMatrixE(ptr noundef nonnull align 8 dereferenceable(129) %54)
  br label %74

57:                                               ; preds = %53
  %58 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN10SimTKIpopt6MatrixE, ptr nonnull @_ZTIN10SimTKIpopt17CompoundSymMatrixE, i64 0) #6
  %.not71 = icmp eq ptr %58, null
  br i1 %.not71, label %61, label %59

59:                                               ; preds = %57
  %60 = tail call noundef i32 @_ZN10SimTKIpopt13TripletHelper17GetNumberEntries_ERKNS_17CompoundSymMatrixE(ptr noundef nonnull align 8 dereferenceable(137) %58)
  br label %74

61:                                               ; preds = %57
  %62 = tail call ptr @__cxa_allocate_exception(i64 112) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %63 unwind label %.thread

63:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %64 unwind label %67

64:                                               ; preds = %63
  invoke void @_ZN10SimTKIpopt13TripletHelper19UNKNOWN_MATRIX_TYPEC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_i(ptr noundef nonnull align 8 dereferenceable(112) %62, ptr noundef nonnull %4, ptr noundef nonnull %6, i32 noundef 95)
          to label %65 unwind label %69

65:                                               ; preds = %64
  invoke void @__cxa_throw(ptr nonnull %62, ptr nonnull @_ZTIN10SimTKIpopt13TripletHelper19UNKNOWN_MATRIX_TYPEE, ptr nonnull @_ZN10SimTKIpopt14IpoptExceptionD2Ev) #7
          to label %75 unwind label %69

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

67:                                               ; preds = %63
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %71

69:                                               ; preds = %65, %64
  %.0 = phi i1 [ false, %65 ], [ true, %64 ]
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br label %71

71:                                               ; preds = %67, %69
  %.pn = phi { ptr, i32 } [ %70, %69 ], [ %68, %67 ]
  %.1 = phi i1 [ %.0, %69 ], [ true, %67 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  br i1 %.1, label %72, label %73

72:                                               ; preds = %.thread, %71
  %.pn.pn80 = phi { ptr, i32 } [ %66, %.thread ], [ %.pn, %71 ]
  call void @__cxa_free_exception(ptr %62) #6
  br label %73

73:                                               ; preds = %29, %72, %71, %21
  %.pn76 = phi { ptr, i32 } [ %22, %21 ], [ %30, %29 ], [ %.pn.pn80, %72 ], [ %.pn, %71 ]
  resume { ptr, i32 } %.pn76

74:                                               ; preds = %13, %28, %37, %45, %51, %59, %55, %49, %41, %33, %20, %9
  %.10 = phi i32 [ %10, %9 ], [ %14, %13 ], [ %19, %20 ], [ %27, %28 ], [ %34, %33 ], [ %38, %37 ], [ %42, %41 ], [ %46, %45 ], [ %50, %49 ], [ 0, %51 ], [ %56, %55 ], [ %60, %59 ]
  ret i32 %.10

75:                                               ; preds = %65
  unreachable
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK10SimTKIpopt10GenTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(89)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK10SimTKIpopt10SymTMatrix8NonzerosEv(ptr noundef nonnull align 8 dereferenceable(97)) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt15SymScaledMatrix17GetUnscaledMatrixEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.9") align 8, ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #3 align 2

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

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

declare noundef i32 @_ZNK10SimTKIpopt14IdentityMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #5

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

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

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

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 }
attributes #7 = { noreturn }

!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)"}


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