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

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

%struct.IpoptProblemInfo = type { i32, ptr, ptr, i32, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, %"class.SimTKIpopt::SmartPtr.6" }
%"class.SimTKIpopt::SmartPtr.6" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local ptr @CreateIpoptProblem(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13) #2 personality ptr @__gxx_personality_v0 {
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  store i32 %0, ptr %16, align 4, !tbaa !5
  store ptr %1, ptr %17, align 8, !tbaa !9
  store ptr %2, ptr %18, align 8, !tbaa !9
  store i32 %3, ptr %19, align 4, !tbaa !5
  store ptr %4, ptr %20, align 8, !tbaa !9
  store ptr %5, ptr %21, align 8, !tbaa !9
  store i32 %6, ptr %22, align 4, !tbaa !5
  store i32 %7, ptr %23, align 4, !tbaa !5
  store i32 %8, ptr %24, align 4, !tbaa !5
  store ptr %9, ptr %25, align 8, !tbaa !9
  store ptr %10, ptr %26, align 8, !tbaa !9
  store ptr %11, ptr %27, align 8, !tbaa !9
  store ptr %12, ptr %28, align 8, !tbaa !9
  store ptr %13, ptr %29, align 8, !tbaa !9
  %37 = load i32, ptr %16, align 4, !tbaa !5
  %38 = icmp slt i32 %37, 1
  br i1 %38, label %87, label %39

39:                                               ; preds = %14
  %40 = load i32, ptr %19, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 0
  br i1 %41, label %87, label %42

42:                                               ; preds = %39
  %43 = load ptr, ptr %17, align 8, !tbaa !9
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %87

45:                                               ; preds = %42
  %46 = load ptr, ptr %18, align 8, !tbaa !9
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %87

48:                                               ; preds = %45
  %49 = load i32, ptr %19, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %51, label %57

51:                                               ; preds = %48
  %52 = load ptr, ptr %20, align 8, !tbaa !9
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %87

54:                                               ; preds = %51
  %55 = load ptr, ptr %21, align 8, !tbaa !9
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %87

57:                                               ; preds = %54, %48
  %58 = load i32, ptr %19, align 4, !tbaa !5
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %57
  %61 = load i32, ptr %22, align 4, !tbaa !5
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %87, label %63

63:                                               ; preds = %60, %57
  %64 = load i32, ptr %19, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %66, label %69

66:                                               ; preds = %63
  %67 = load i32, ptr %22, align 4, !tbaa !5
  %68 = icmp slt i32 %67, 1
  br i1 %68, label %87, label %69

69:                                               ; preds = %66, %63
  %70 = load i32, ptr %23, align 4, !tbaa !5
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %87, label %72

72:                                               ; preds = %69
  %73 = load ptr, ptr %25, align 8, !tbaa !9
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %87

75:                                               ; preds = %72
  %76 = load ptr, ptr %27, align 8, !tbaa !9
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %87

78:                                               ; preds = %75
  %79 = load i32, ptr %19, align 4, !tbaa !5
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %81, label %88

81:                                               ; preds = %78
  %82 = load ptr, ptr %26, align 8, !tbaa !9
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %87

84:                                               ; preds = %81
  %85 = load ptr, ptr %28, align 8, !tbaa !9
  %86 = icmp ne ptr %85, null
  br i1 %86, label %88, label %87

87:                                               ; preds = %84, %81, %75, %72, %69, %66, %60, %54, %51, %45, %42, %39, %14
  store ptr null, ptr %15, align 8
  br label %265

88:                                               ; preds = %84, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %89 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 112) #8
  invoke void @_ZN16IpoptProblemInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %89)
          to label %90 unwind label %108

90:                                               ; preds = %88
  store ptr %89, ptr %30, align 8, !tbaa !9
  %91 = load i32, ptr %16, align 4, !tbaa !5
  %92 = load ptr, ptr %30, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %92, i32 0, i32 0
  store i32 %91, ptr %93, align 8, !tbaa !11
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %95, i64 8)
  %97 = extractvalue { i64, i1 } %96, 1
  %98 = extractvalue { i64, i1 } %96, 0
  %99 = select i1 %97, i64 -1, i64 %98
  %100 = call noalias noundef nonnull ptr @_Znam(i64 noundef %99) #8
  %101 = load ptr, ptr %30, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %101, i32 0, i32 1
  store ptr %100, ptr %102, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %124, %90
  %104 = load i32, ptr %33, align 4, !tbaa !5
  %105 = load i32, ptr %16, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %112, label %107

107:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %127

108:                                              ; preds = %88
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %31, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %32, align 4
  call void @_ZdlPvm(ptr noundef %89, i64 noundef 112) #9
  br label %264

112:                                              ; preds = %103
  %113 = load ptr, ptr %17, align 8, !tbaa !9
  %114 = load i32, ptr %33, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %113, i64 %115
  %117 = load double, ptr %116, align 8, !tbaa !15
  %118 = load ptr, ptr %30, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !14
  %121 = load i32, ptr %33, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds double, ptr %120, i64 %122
  store double %117, ptr %123, align 8, !tbaa !15
  br label %124

124:                                              ; preds = %112
  %125 = load i32, ptr %33, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %33, align 4, !tbaa !5
  br label %103, !llvm.loop !17

127:                                              ; preds = %107
  %128 = load i32, ptr %16, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %129, i64 8)
  %131 = extractvalue { i64, i1 } %130, 1
  %132 = extractvalue { i64, i1 } %130, 0
  %133 = select i1 %131, i64 -1, i64 %132
  %134 = call noalias noundef nonnull ptr @_Znam(i64 noundef %133) #8
  %135 = load ptr, ptr %30, align 8, !tbaa !9
  %136 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %135, i32 0, i32 2
  store ptr %134, ptr %136, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %154, %127
  %138 = load i32, ptr %34, align 4, !tbaa !5
  %139 = load i32, ptr %16, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %157

142:                                              ; preds = %137
  %143 = load ptr, ptr %18, align 8, !tbaa !9
  %144 = load i32, ptr %34, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds double, ptr %143, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !15
  %148 = load ptr, ptr %30, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !19
  %151 = load i32, ptr %34, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds double, ptr %150, i64 %152
  store double %147, ptr %153, align 8, !tbaa !15
  br label %154

154:                                              ; preds = %142
  %155 = load i32, ptr %34, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %34, align 4, !tbaa !5
  br label %137, !llvm.loop !20

157:                                              ; preds = %141
  %158 = load i32, ptr %19, align 4, !tbaa !5
  %159 = load ptr, ptr %30, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %159, i32 0, i32 3
  store i32 %158, ptr %160, align 8, !tbaa !21
  %161 = load i32, ptr %19, align 4, !tbaa !5
  %162 = icmp sgt i32 %161, 0
  br i1 %162, label %163, label %224

163:                                              ; preds = %157
  %164 = load i32, ptr %19, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %165, i64 8)
  %167 = extractvalue { i64, i1 } %166, 1
  %168 = extractvalue { i64, i1 } %166, 0
  %169 = select i1 %167, i64 -1, i64 %168
  %170 = call noalias noundef nonnull ptr @_Znam(i64 noundef %169) #8
  %171 = load ptr, ptr %30, align 8, !tbaa !9
  %172 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %171, i32 0, i32 4
  store ptr %170, ptr %172, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  store i32 0, ptr %35, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %190, %163
  %174 = load i32, ptr %35, align 4, !tbaa !5
  %175 = load i32, ptr %19, align 4, !tbaa !5
  %176 = icmp slt i32 %174, %175
  br i1 %176, label %178, label %177

177:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  br label %193

178:                                              ; preds = %173
  %179 = load ptr, ptr %20, align 8, !tbaa !9
  %180 = load i32, ptr %35, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds double, ptr %179, i64 %181
  %183 = load double, ptr %182, align 8, !tbaa !15
  %184 = load ptr, ptr %30, align 8, !tbaa !9
  %185 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %184, i32 0, i32 4
  %186 = load ptr, ptr %185, align 8, !tbaa !22
  %187 = load i32, ptr %35, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds double, ptr %186, i64 %188
  store double %183, ptr %189, align 8, !tbaa !15
  br label %190

190:                                              ; preds = %178
  %191 = load i32, ptr %35, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %35, align 4, !tbaa !5
  br label %173, !llvm.loop !23

193:                                              ; preds = %177
  %194 = load i32, ptr %19, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %195, i64 8)
  %197 = extractvalue { i64, i1 } %196, 1
  %198 = extractvalue { i64, i1 } %196, 0
  %199 = select i1 %197, i64 -1, i64 %198
  %200 = call noalias noundef nonnull ptr @_Znam(i64 noundef %199) #8
  %201 = load ptr, ptr %30, align 8, !tbaa !9
  %202 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %201, i32 0, i32 5
  store ptr %200, ptr %202, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %220, %193
  %204 = load i32, ptr %36, align 4, !tbaa !5
  %205 = load i32, ptr %19, align 4, !tbaa !5
  %206 = icmp slt i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %223

208:                                              ; preds = %203
  %209 = load ptr, ptr %21, align 8, !tbaa !9
  %210 = load i32, ptr %36, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds double, ptr %209, i64 %211
  %213 = load double, ptr %212, align 8, !tbaa !15
  %214 = load ptr, ptr %30, align 8, !tbaa !9
  %215 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %214, i32 0, i32 5
  %216 = load ptr, ptr %215, align 8, !tbaa !24
  %217 = load i32, ptr %36, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds double, ptr %216, i64 %218
  store double %213, ptr %219, align 8, !tbaa !15
  br label %220

220:                                              ; preds = %208
  %221 = load i32, ptr %36, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %36, align 4, !tbaa !5
  br label %203, !llvm.loop !25

223:                                              ; preds = %207
  br label %229

224:                                              ; preds = %157
  %225 = load ptr, ptr %30, align 8, !tbaa !9
  %226 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %225, i32 0, i32 4
  store ptr null, ptr %226, align 8, !tbaa !22
  %227 = load ptr, ptr %30, align 8, !tbaa !9
  %228 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %227, i32 0, i32 5
  store ptr null, ptr %228, align 8, !tbaa !24
  br label %229

229:                                              ; preds = %224, %223
  %230 = load i32, ptr %22, align 4, !tbaa !5
  %231 = load ptr, ptr %30, align 8, !tbaa !9
  %232 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %231, i32 0, i32 6
  store i32 %230, ptr %232, align 8, !tbaa !26
  %233 = load i32, ptr %23, align 4, !tbaa !5
  %234 = load ptr, ptr %30, align 8, !tbaa !9
  %235 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %234, i32 0, i32 7
  store i32 %233, ptr %235, align 4, !tbaa !27
  %236 = load i32, ptr %24, align 4, !tbaa !5
  %237 = load ptr, ptr %30, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %237, i32 0, i32 8
  store i32 %236, ptr %238, align 8, !tbaa !28
  %239 = load ptr, ptr %25, align 8, !tbaa !9
  %240 = load ptr, ptr %30, align 8, !tbaa !9
  %241 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %240, i32 0, i32 9
  store ptr %239, ptr %241, align 8, !tbaa !29
  %242 = load ptr, ptr %26, align 8, !tbaa !9
  %243 = load ptr, ptr %30, align 8, !tbaa !9
  %244 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %243, i32 0, i32 10
  store ptr %242, ptr %244, align 8, !tbaa !30
  %245 = load ptr, ptr %27, align 8, !tbaa !9
  %246 = load ptr, ptr %30, align 8, !tbaa !9
  %247 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %246, i32 0, i32 11
  store ptr %245, ptr %247, align 8, !tbaa !31
  %248 = load ptr, ptr %28, align 8, !tbaa !9
  %249 = load ptr, ptr %30, align 8, !tbaa !9
  %250 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %249, i32 0, i32 12
  store ptr %248, ptr %250, align 8, !tbaa !32
  %251 = load ptr, ptr %29, align 8, !tbaa !9
  %252 = load ptr, ptr %30, align 8, !tbaa !9
  %253 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %252, i32 0, i32 13
  store ptr %251, ptr %253, align 8, !tbaa !33
  %254 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 88) #8
  invoke void @_ZN10SimTKIpopt16IpoptApplicationC1Eb(ptr noundef nonnull align 8 dereferenceable(88) %254, i1 noundef zeroext true)
          to label %255 unwind label %260

255:                                              ; preds = %229
  %256 = load ptr, ptr %30, align 8, !tbaa !9
  %257 = getelementptr inbounds %struct.IpoptProblemInfo, ptr %256, i32 0, i32 14
  %258 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %257, ptr noundef %254)
  %259 = load ptr, ptr %30, align 8, !tbaa !9
  store ptr %259, ptr %15, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %265

260:                                              ; preds = %229
  %261 = landingpad { ptr, i32 }
          cleanup
  %262 = extractvalue { ptr, i32 } %261, 0
  store ptr %262, ptr %31, align 8
  %263 = extractvalue { ptr, i32 } %261, 1
  store i32 %263, ptr %32, align 4
  call void @_ZdlPvm(ptr noundef %254, i64 noundef 88) #9
  br label %264

264:                                              ; preds = %260, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %267

265:                                              ; preds = %255, %87
  %266 = load ptr, ptr %15, align 8
  ret ptr %266

267:                                              ; preds = %264
  %268 = load ptr, ptr %31, align 8
  %269 = load i32, ptr %32, align 4
  %270 = insertvalue { ptr, i32 } poison, ptr %268, 0
  %271 = insertvalue { ptr, i32 } %270, i32 %269, 1
  resume { ptr, i32 } %271
}

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

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

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

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

declare void @_ZN10SimTKIpopt16IpoptApplicationC1Eb(ptr noundef nonnull align 8 dereferenceable(88), i1 noundef zeroext) unnamed_addr #6

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS16IpoptProblemInfo", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !13, i64 104}
!13 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEE", !10, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!12, !10, i64 16}
!20 = distinct !{!20, !18}
!21 = !{!12, !6, i64 24}
!22 = !{!12, !10, i64 32}
!23 = distinct !{!23, !18}
!24 = !{!12, !10, i64 40}
!25 = distinct !{!25, !18}
!26 = !{!12, !6, i64 48}
!27 = !{!12, !6, i64 52}
!28 = !{!12, !6, i64 56}
!29 = !{!12, !10, i64 64}
!30 = !{!12, !10, i64 72}
!31 = !{!12, !10, i64 80}
!32 = !{!12, !10, i64 88}
!33 = !{!12, !10, i64 96}


; 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"

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @CreateIpoptProblem(i32 noundef %0, ptr noundef readonly %1, ptr noundef readonly %2, i32 noundef %3, ptr noundef readonly %4, ptr noundef readonly %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %15 = icmp sgt i32 %0, 0
  %16 = icmp sgt i32 %3, -1
  %or.cond.not112 = and i1 %15, %16
  %17 = icmp ne ptr %1, null
  %or.cond3 = and i1 %17, %or.cond.not112
  %18 = icmp ne ptr %2, null
  %or.cond5 = and i1 %18, %or.cond3
  br i1 %or.cond5, label %19, label %75

19:                                               ; preds = %14
  %20 = icmp ne i32 %3, 0
  br i1 %20, label %21, label %24

21:                                               ; preds = %19
  %22 = icmp ne ptr %4, null
  %23 = icmp ne ptr %5, null
  %or.cond7 = and i1 %22, %23
  br i1 %or.cond7, label %.thread, label %75

24:                                               ; preds = %19
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %.thread, label %75

.thread:                                          ; preds = %21, %24
  %25 = icmp slt i32 %6, 1
  %or.cond11 = and i1 %20, %25
  %26 = icmp slt i32 %7, 0
  %or.cond13 = or i1 %or.cond11, %26
  %or.cond13.not = xor i1 %or.cond13, true
  %27 = icmp ne ptr %9, null
  %or.cond15 = and i1 %27, %or.cond13.not
  %28 = icmp ne ptr %11, null
  %or.cond17 = and i1 %or.cond15, %28
  br i1 %or.cond17, label %29, label %75

29:                                               ; preds = %.thread
  br i1 %20, label %30, label %33

30:                                               ; preds = %29
  %31 = icmp ne ptr %10, null
  %32 = icmp ne ptr %12, null
  %or.cond19 = and i1 %31, %32
  br i1 %or.cond19, label %33, label %75

33:                                               ; preds = %30, %29
  %34 = tail call noalias noundef nonnull dereferenceable(112) ptr @_Znwm(i64 noundef 112) #7
  invoke void @_ZN16IpoptProblemInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %34)
          to label %._crit_edge119 unwind label %35

35:                                               ; preds = %33
  %36 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %34, i64 noundef 112) #8
  br label %74

._crit_edge119:                                   ; preds = %33
  store i32 %0, ptr %34, align 8, !tbaa !5
  %37 = zext nneg i32 %0 to i64
  %38 = shl nuw nsw i64 %37, 3
  %39 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %38) #7
  %40 = getelementptr inbounds i8, ptr %34, i64 8
  store ptr %39, ptr %40, align 8, !tbaa !12
  %41 = zext nneg i32 %0 to i64
  %42 = shl nuw nsw i64 %41, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %39, ptr noundef nonnull align 8 dereferenceable(1) %1, i64 %42, i1 false), !tbaa !13
  %43 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %38) #7
  %44 = getelementptr inbounds i8, ptr %34, i64 16
  store ptr %43, ptr %44, align 8, !tbaa !15
  %45 = zext nneg i32 %0 to i64
  %46 = shl nuw nsw i64 %45, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %43, ptr noundef nonnull align 8 dereferenceable(1) %2, i64 %46, i1 false), !tbaa !13
  %47 = getelementptr inbounds i8, ptr %34, i64 24
  store i32 %3, ptr %47, align 8, !tbaa !16
  br i1 %20, label %.lr.ph126.preheader, label %58

.lr.ph126.preheader:                              ; preds = %._crit_edge119
  %48 = zext nneg i32 %3 to i64
  %49 = shl nuw nsw i64 %48, 3
  %50 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %49) #7
  %51 = getelementptr inbounds i8, ptr %34, i64 32
  store ptr %50, ptr %51, align 8, !tbaa !17
  %52 = zext nneg i32 %3 to i64
  %53 = shl nuw nsw i64 %52, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %50, ptr noundef nonnull align 8 dereferenceable(1) %4, i64 %53, i1 false), !tbaa !13
  %54 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %49) #7
  %55 = getelementptr inbounds i8, ptr %34, i64 40
  store ptr %54, ptr %55, align 8, !tbaa !18
  %56 = zext nneg i32 %3 to i64
  %57 = shl nuw nsw i64 %56, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %54, ptr noundef nonnull align 8 dereferenceable(1) %5, i64 %57, i1 false), !tbaa !13
  br label %.loopexit

58:                                               ; preds = %._crit_edge119
  %59 = getelementptr inbounds i8, ptr %34, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %59, i8 0, i64 16, i1 false)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph126.preheader, %58
  %60 = getelementptr inbounds i8, ptr %34, i64 48
  store i32 %6, ptr %60, align 8, !tbaa !19
  %61 = getelementptr inbounds i8, ptr %34, i64 52
  store i32 %7, ptr %61, align 4, !tbaa !20
  %62 = getelementptr inbounds i8, ptr %34, i64 56
  store i32 %8, ptr %62, align 8, !tbaa !21
  %63 = getelementptr inbounds i8, ptr %34, i64 64
  store ptr %9, ptr %63, align 8, !tbaa !22
  %64 = getelementptr inbounds i8, ptr %34, i64 72
  store ptr %10, ptr %64, align 8, !tbaa !23
  %65 = getelementptr inbounds i8, ptr %34, i64 80
  store ptr %11, ptr %65, align 8, !tbaa !24
  %66 = getelementptr inbounds i8, ptr %34, i64 88
  store ptr %12, ptr %66, align 8, !tbaa !25
  %67 = getelementptr inbounds i8, ptr %34, i64 96
  store ptr %13, ptr %67, align 8, !tbaa !26
  %68 = tail call noalias noundef nonnull dereferenceable(88) ptr @_Znwm(i64 noundef 88) #7
  invoke void @_ZN10SimTKIpopt16IpoptApplicationC1Eb(ptr noundef nonnull align 8 dereferenceable(88) %68, i1 noundef zeroext true)
          to label %69 unwind label %72

69:                                               ; preds = %.loopexit
  %70 = getelementptr inbounds i8, ptr %34, i64 104
  %71 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull %68)
  br label %75

72:                                               ; preds = %.loopexit
  %73 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %68, i64 noundef 88) #8
  br label %74

74:                                               ; preds = %72, %35
  %.pn = phi { ptr, i32 } [ %73, %72 ], [ %36, %35 ]
  resume { ptr, i32 } %.pn

75:                                               ; preds = %14, %21, %30, %24, %.thread, %69
  %.0104 = phi ptr [ %34, %69 ], [ null, %.thread ], [ null, %24 ], [ null, %30 ], [ null, %21 ], [ null, %14 ]
  ret ptr %.0104
}

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

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

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

declare void @_ZN10SimTKIpopt16IpoptApplicationC1Eb(ptr noundef nonnull align 8 dereferenceable(88), i1 noundef zeroext) unnamed_addr #4

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { 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 #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 = { 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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS16IpoptProblemInfo", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !11, i64 104}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_16IpoptApplicationEEE", !10, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !7, i64 24}
!17 = !{!6, !10, i64 32}
!18 = !{!6, !10, i64 40}
!19 = !{!6, !7, i64 48}
!20 = !{!6, !7, i64 52}
!21 = !{!6, !7, i64 56}
!22 = !{!6, !10, i64 64}
!23 = !{!6, !10, i64 72}
!24 = !{!6, !10, i64 80}
!25 = !{!6, !10, i64 88}
!26 = !{!6, !10, i64 96}


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