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

; 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::LapackSolverInterface" = type <{ %"class.SimTKIpopt::SparseSymLinearSolverInterface.base", [3 x i8], i32, i32, [4 x i8], ptr, ptr, ptr, ptr, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"class.SimTKIpopt::SparseSymLinearSolverInterface.base" = type { %"class.SimTKIpopt::AlgorithmStrategyObject.base" }
%"class.SimTKIpopt::AlgorithmStrategyObject.base" = type <{ %"class.SimTKIpopt::ReferencedObject.base", [4 x i8], %"class.SimTKIpopt::SmartPtr.6", %"class.SimTKIpopt::SmartPtr.7", %"class.SimTKIpopt::SmartPtr.8", %"class.SimTKIpopt::SmartPtr.9", i8 }>
%"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 }

@.str = external hidden unnamed_addr constant [7 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

; 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 @_ZdaPv(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface10MultiSolveEbPKiS2_iPdbi(ptr noundef nonnull align 8 dereferenceable(113) %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, i1 noundef zeroext %6, i32 noundef %7) unnamed_addr #2 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca double, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca [2 x double], align 16
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca i8, align 1
  %35 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  %36 = zext i1 %1 to i8
  store i8 %36, ptr %10, align 1, !tbaa !9
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i32 %4, ptr %13, align 4, !tbaa !11
  store ptr %5, ptr %14, align 8, !tbaa !5
  %37 = zext i1 %6 to i8
  store i8 %37, ptr %15, align 1, !tbaa !9
  store i32 %7, ptr %16, align 4, !tbaa !11
  %38 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !13
  %39 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 4, !tbaa !15
  %41 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %42 = load i32, ptr %41, align 4, !tbaa !15
  %43 = mul nsw i32 %40, %42
  %44 = sext i32 %43 to i64
  %45 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %44, i64 8)
  %46 = extractvalue { i64, i1 } %45, 1
  %47 = extractvalue { i64, i1 } %45, 0
  %48 = select i1 %46, i64 -1, i64 %47
  %49 = call noalias noundef nonnull ptr @_Znam(i64 noundef %48) #8
  store ptr %49, ptr %18, align 8, !tbaa !5
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %69, %8
  %51 = load i32, ptr %17, align 4, !tbaa !11
  %52 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %53 = load i32, ptr %52, align 4, !tbaa !15
  %54 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %55 = load i32, ptr %54, align 4, !tbaa !15
  %56 = mul nsw i32 %53, %55
  %57 = icmp slt i32 %51, %56
  br i1 %57, label %58, label %72

58:                                               ; preds = %50
  %59 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 5
  %60 = load ptr, ptr %59, align 8, !tbaa !24
  %61 = load i32, ptr %17, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !25
  %65 = load ptr, ptr %18, align 8, !tbaa !5
  %66 = load i32, ptr %17, align 4, !tbaa !11
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %65, i64 %67
  store double %64, ptr %68, align 8, !tbaa !25
  br label %69

69:                                               ; preds = %58
  %70 = load i32, ptr %17, align 4, !tbaa !11
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %17, align 4, !tbaa !11
  br label %50, !llvm.loop !27

72:                                               ; preds = %50
  %73 = load i8, ptr %10, align 1, !tbaa !9, !range !29, !noundef !30
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %89

75:                                               ; preds = %72
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load i8, ptr %15, align 1, !tbaa !9, !range !29, !noundef !30
  %79 = trunc i8 %78 to i1
  %80 = load i32, ptr %16, align 4, !tbaa !11
  %81 = call noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface13FactorizationEPKiS2_bi(ptr noundef nonnull align 8 dereferenceable(113) %38, ptr noundef %76, ptr noundef %77, i1 noundef zeroext %79, i32 noundef %80)
  store i32 %81, ptr %19, align 4, !tbaa !13
  %82 = load i32, ptr %19, align 4, !tbaa !13
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %75
  %85 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 12
  store i8 1, ptr %85, align 8, !tbaa !31
  br label %88

86:                                               ; preds = %75
  %87 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 12
  store i8 0, ptr %87, align 8, !tbaa !31
  br label %88

88:                                               ; preds = %86, %84
  br label %89

89:                                               ; preds = %88, %72
  %90 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 12
  %91 = load i8, ptr %90, align 8, !tbaa !31, !range !29, !noundef !30
  %92 = trunc i8 %91 to i1
  br i1 %92, label %93, label %99

93:                                               ; preds = %89
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !11
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = call noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface5SolveEPKiS2_iPd(ptr noundef nonnull align 8 dereferenceable(113) %38, ptr noundef %94, ptr noundef %95, i32 noundef %96, ptr noundef %97)
  store i32 %98, ptr %19, align 4, !tbaa !13
  br label %190

99:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store double -1.000000e+00, ptr %20, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 1, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  store ptr @.str, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #7
  store i8 32, ptr %34, align 1, !tbaa !32
  %100 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %101 = load i32, ptr %100, align 4, !tbaa !15
  %102 = sext i32 %101 to i64
  %103 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %102, i64 8)
  %104 = extractvalue { i64, i1 } %103, 1
  %105 = extractvalue { i64, i1 } %103, 0
  %106 = select i1 %104, i64 -1, i64 %105
  %107 = call noalias noundef nonnull ptr @_Znam(i64 noundef %106) #8
  store ptr %107, ptr %21, align 8, !tbaa !5
  store i32 25, ptr %29, align 4, !tbaa !11
  %108 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %109 = load i32, ptr %108, align 4, !tbaa !15
  %110 = load i32, ptr %29, align 4, !tbaa !11
  %111 = add nsw i32 %110, 1
  %112 = sdiv i32 %109, %111
  store i32 %112, ptr %32, align 4, !tbaa !11
  %113 = load i32, ptr %32, align 4, !tbaa !11
  %114 = sitofp i32 %113 to double
  %115 = call double @log10(double noundef %114) #7
  %116 = call double @log10(double noundef 2.000000e+00) #7
  %117 = fdiv double %115, %116
  %118 = fptosi double %117 to i32
  %119 = add nsw i32 %118, 2
  store i32 %119, ptr %28, align 4, !tbaa !11
  %120 = load i32, ptr %28, align 4, !tbaa !11
  %121 = icmp slt i32 %120, 0
  br i1 %121, label %122, label %123

122:                                              ; preds = %99
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %123

123:                                              ; preds = %122, %99
  %124 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %125 = load i32, ptr %124, align 4, !tbaa !15
  %126 = mul nsw i32 3, %125
  %127 = load i32, ptr %28, align 4, !tbaa !11
  %128 = mul nsw i32 %126, %127
  %129 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %130 = load i32, ptr %129, align 4, !tbaa !15
  %131 = mul nsw i32 11, %130
  %132 = add nsw i32 %128, %131
  store i32 %132, ptr %31, align 4, !tbaa !11
  %133 = load i32, ptr %31, align 4, !tbaa !11
  %134 = sext i32 %133 to i64
  %135 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %134, i64 4)
  %136 = extractvalue { i64, i1 } %135, 1
  %137 = extractvalue { i64, i1 } %135, 0
  %138 = select i1 %136, i64 -1, i64 %137
  %139 = call noalias noundef nonnull ptr @_Znam(i64 noundef %138) #8
  store ptr %139, ptr %26, align 8, !tbaa !5
  %140 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %141 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %142 = load ptr, ptr %18, align 8, !tbaa !5
  %143 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %146 = load ptr, ptr %21, align 8, !tbaa !5
  %147 = getelementptr inbounds [2 x double], ptr %23, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  store i32 -1, ptr %35, align 4, !tbaa !11
  %148 = load ptr, ptr %26, align 8, !tbaa !5
  call void @dgelsd_(ptr noundef nonnull align 4 dereferenceable(4) %140, ptr noundef nonnull align 4 dereferenceable(4) %141, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef %142, ptr noundef nonnull align 4 dereferenceable(4) %143, ptr noundef %144, ptr noundef nonnull align 4 dereferenceable(4) %145, ptr noundef %146, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef %147, ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef %148, ptr noundef nonnull align 4 dereferenceable(4) %25)
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  %149 = getelementptr inbounds [2 x double], ptr %23, i64 0, i64 0
  %150 = load double, ptr %149, align 16, !tbaa !25
  %151 = fptosi double %150 to i32
  store i32 %151, ptr %30, align 4, !tbaa !11
  %152 = load i32, ptr %30, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %153, i64 8)
  %155 = extractvalue { i64, i1 } %154, 1
  %156 = extractvalue { i64, i1 } %154, 0
  %157 = select i1 %155, i64 -1, i64 %156
  %158 = call noalias noundef nonnull ptr @_Znam(i64 noundef %157) #8
  store ptr %158, ptr %22, align 8, !tbaa !5
  %159 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %160 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %161 = load ptr, ptr %18, align 8, !tbaa !5
  %162 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %163 = load ptr, ptr %14, align 8, !tbaa !5
  %164 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %38, i32 0, i32 2
  %165 = load ptr, ptr %21, align 8, !tbaa !5
  %166 = load ptr, ptr %22, align 8, !tbaa !5
  %167 = load ptr, ptr %26, align 8, !tbaa !5
  call void @dgelsd_(ptr noundef nonnull align 4 dereferenceable(4) %159, ptr noundef nonnull align 4 dereferenceable(4) %160, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef %161, ptr noundef nonnull align 4 dereferenceable(4) %162, ptr noundef %163, ptr noundef nonnull align 4 dereferenceable(4) %164, ptr noundef %165, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef %166, ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef %167, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %168 = load ptr, ptr %22, align 8, !tbaa !5
  %169 = icmp eq ptr %168, null
  br i1 %169, label %171, label %170

170:                                              ; preds = %123
  call void @_ZdaPv(ptr noundef %168) #9
  br label %171

171:                                              ; preds = %170, %123
  %172 = load ptr, ptr %21, align 8, !tbaa !5
  %173 = icmp eq ptr %172, null
  br i1 %173, label %175, label %174

174:                                              ; preds = %171
  call void @_ZdaPv(ptr noundef %172) #9
  br label %175

175:                                              ; preds = %174, %171
  %176 = load ptr, ptr %26, align 8, !tbaa !5
  %177 = icmp eq ptr %176, null
  br i1 %177, label %179, label %178

178:                                              ; preds = %175
  call void @_ZdaPv(ptr noundef %176) #9
  br label %179

179:                                              ; preds = %178, %175
  %180 = load i32, ptr %25, align 4, !tbaa !11
  %181 = icmp sgt i32 %180, 0
  br i1 %181, label %182, label %183

182:                                              ; preds = %179
  br label %189

183:                                              ; preds = %179
  %184 = load i32, ptr %25, align 4, !tbaa !11
  %185 = icmp slt i32 %184, 0
  br i1 %185, label %186, label %187

186:                                              ; preds = %183
  br label %188

187:                                              ; preds = %183
  store i32 0, ptr %19, align 4, !tbaa !13
  br label %188

188:                                              ; preds = %187, %186
  br label %189

189:                                              ; preds = %188, %182
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %190

190:                                              ; preds = %189, %93
  %191 = load ptr, ptr %18, align 8, !tbaa !5
  %192 = icmp eq ptr %191, null
  br i1 %192, label %194, label %193

193:                                              ; preds = %190
  call void @_ZdaPv(ptr noundef %191) #9
  br label %194

194:                                              ; preds = %193, %190
  %195 = load i32, ptr %19, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  ret i32 %195
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface13FactorizationEPKiS2_bi(ptr noundef nonnull align 8 dereferenceable(113), ptr noundef, ptr noundef, i1 noundef zeroext, i32 noundef) #2 align 2

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

; Function Attrs: nounwind
declare double @log10(double noundef) #5

declare void @dgelsd_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #6

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt16ESymSolverStatusE", !7, i64 0}
!15 = !{!16, !12, i64 52}
!16 = !{!"_ZTSN10SimTKIpopt21LapackSolverInterfaceE", !17, i64 0, !12, i64 52, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !6, i64 104, !10, i64 112}
!17 = !{!"_ZTSN10SimTKIpopt30SparseSymLinearSolverInterfaceE", !18, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !19, i64 0, !20, i64 16, !21, i64 24, !22, i64 32, !23, i64 40, !10, i64 48}
!19 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !12, i64 8}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !6, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !6, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !6, i64 0}
!24 = !{!16, !6, i64 64}
!25 = !{!26, !26, i64 0}
!26 = !{!"double", !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!16, !10, i64 112}
!32 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface10MultiSolveEbPKiS2_iPdbi(ptr noundef nonnull align 8 dereferenceable(113) %0, i1 noundef zeroext %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, i1 noundef zeroext %6, i32 noundef %7) unnamed_addr #2 align 2 {
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca [2 x double], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 %4, ptr %9, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 52
  %17 = load i32, ptr %16, align 4, !tbaa !9
  %18 = mul nsw i32 %17, %17
  %19 = zext nneg i32 %18 to i64
  %20 = shl nuw nsw i64 %19, 3
  %21 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #7
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %22 = ptrtoint ptr %21 to i64
  %23 = getelementptr inbounds i8, ptr %0, i64 64
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  %umax = tail call i32 @llvm.umax.i32(i32 %18, i32 1)
  %wide.trip.count = zext nneg i32 %umax to i64
  %min.iters.check = icmp ult i32 %18, 6
  %25 = ptrtoint ptr %24 to i64
  %26 = sub i64 %22, %25
  %diff.check = icmp ult i64 %26, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %27 = getelementptr inbounds double, ptr %24, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load = load <2 x double>, ptr %27, align 8, !tbaa !21
  %wide.load43 = load <2 x double>, ptr %28, align 8, !tbaa !21
  %29 = getelementptr inbounds double, ptr %21, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  store <2 x double> %wide.load, ptr %29, align 8, !tbaa !21
  store <2 x double> %wide.load43, ptr %30, align 8, !tbaa !21
  %index.next = add nuw i64 %index, 4
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %middle.block, label %vector.body, !llvm.loop !23

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

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %32 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.prol
  %33 = load double, ptr %32, align 8, !tbaa !21
  %34 = getelementptr inbounds double, ptr %21, i64 %indvars.iv.prol
  store double %33, ptr %34, align 8, !tbaa !21
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !27

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %35 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %36 = icmp ugt i64 %35, -4
  br i1 %36, label %._crit_edge, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %37 = getelementptr inbounds double, ptr %24, i64 %indvars.iv
  %38 = load double, ptr %37, align 8, !tbaa !21
  %39 = getelementptr inbounds double, ptr %21, i64 %indvars.iv
  store double %38, ptr %39, align 8, !tbaa !21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.next
  %41 = load double, ptr %40, align 8, !tbaa !21
  %42 = getelementptr inbounds double, ptr %21, i64 %indvars.iv.next
  store double %41, ptr %42, align 8, !tbaa !21
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %43 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.next.1
  %44 = load double, ptr %43, align 8, !tbaa !21
  %45 = getelementptr inbounds double, ptr %21, i64 %indvars.iv.next.1
  store double %44, ptr %45, align 8, !tbaa !21
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %46 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.next.2
  %47 = load double, ptr %46, align 8, !tbaa !21
  %48 = getelementptr inbounds double, ptr %21, i64 %indvars.iv.next.2
  store double %47, ptr %48, align 8, !tbaa !21
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph, !llvm.loop !29

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %8
  br i1 %1, label %49, label %53

49:                                               ; preds = %._crit_edge
  %50 = tail call noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface13FactorizationEPKiS2_bi(ptr noundef nonnull align 8 dereferenceable(113) %0, ptr noundef %2, ptr noundef %3, i1 noundef zeroext %6, i32 noundef %7)
  %51 = icmp eq i32 %50, 0
  %52 = getelementptr inbounds i8, ptr %0, i64 112
  br i1 %51, label %.thread, label %.thread40

.thread:                                          ; preds = %49
  store i8 1, ptr %52, align 8, !tbaa !30
  br label %55

.thread40:                                        ; preds = %49
  store i8 0, ptr %52, align 8, !tbaa !30
  br label %57

53:                                               ; preds = %._crit_edge
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 112
  %.pre = load i8, ptr %.phi.trans.insert, align 8, !tbaa !30, !range !31
  %54 = trunc nuw i8 %.pre to i1
  br i1 %54, label %55, label %57

55:                                               ; preds = %.thread, %53
  %56 = tail call noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface5SolveEPKiS2_iPd(ptr noundef nonnull align 8 dereferenceable(113) %0, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5)
  br label %85

57:                                               ; preds = %.thread40, %53
  %.03442 = phi i32 [ %50, %.thread40 ], [ 0, %53 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  store double -1.000000e+00, ptr %10, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %58 = load i32, ptr %16, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = icmp slt i32 %58, 0
  %61 = shl nsw i64 %59, 3
  %62 = select i1 %60, i64 -1, i64 %61
  %63 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %62) #7
  %64 = sdiv i32 %58, 26
  %65 = sitofp i32 %64 to double
  %66 = tail call double @log10(double noundef %65) #8
  %67 = fdiv double %66, 0x3FD34413509F79FF
  %68 = fptosi double %67 to i32
  %69 = tail call i32 @llvm.smax.i32(i32 %68, i32 -2)
  %70 = load i32, ptr %16, align 4, !tbaa !9
  %71 = mul i32 %69, 3
  %reass.add = add i32 %71, 17
  %reass.mul = mul i32 %reass.add, %70
  %72 = sext i32 %reass.mul to i64
  %73 = icmp slt i32 %reass.mul, 0
  %74 = shl nsw i64 %72, 2
  %75 = select i1 %73, i64 -1, i64 %74
  %76 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %75) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  store i32 -1, ptr %15, align 4, !tbaa !5
  call void @dgelsd_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull %21, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef %5, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull %63, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull %11, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull %76, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  %77 = load double, ptr %11, align 16, !tbaa !21
  %78 = fptosi double %77 to i32
  store i32 %78, ptr %14, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = icmp slt i32 %78, 0
  %81 = shl nsw i64 %79, 3
  %82 = select i1 %80, i64 -1, i64 %81
  %83 = call noalias noundef nonnull ptr @_Znam(i64 noundef %82) #7
  call void @dgelsd_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull %21, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef %5, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull %63, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull %83, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull %76, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @_ZdaPv(ptr noundef nonnull %83) #9
  call void @_ZdaPv(ptr noundef nonnull %63) #9
  call void @_ZdaPv(ptr noundef nonnull %76) #9
  %84 = load i32, ptr %12, align 4
  %or.cond.not = icmp eq i32 %84, 0
  %.1 = select i1 %or.cond.not, i32 0, i32 %.03442
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %85

85:                                               ; preds = %55, %57
  %.2 = phi i32 [ %56, %55 ], [ %.1, %57 ]
  call void @_ZdaPv(ptr noundef nonnull %21) #9
  ret i32 %.2
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface13FactorizationEPKiS2_bi(ptr noundef nonnull align 8 dereferenceable(113), ptr noundef, ptr noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log10(double noundef) local_unnamed_addr #4

declare void @dgelsd_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
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, !6, i64 52}
!10 = !{!"_ZTSN10SimTKIpopt21LapackSolverInterfaceE", !11, i64 0, !6, i64 52, !6, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !6, i64 96, !15, i64 104, !19, i64 112}
!11 = !{!"_ZTSN10SimTKIpopt30SparseSymLinearSolverInterfaceE", !12, i64 0}
!12 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !13, i64 0, !14, i64 16, !16, i64 24, !17, i64 32, !18, i64 40, !19, i64 48}
!13 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !6, i64 8}
!14 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !15, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !15, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !15, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!10, !15, i64 64}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = distinct !{!23, !24, !25, !26}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!"llvm.loop.isvectorized", i32 1}
!26 = !{!"llvm.loop.unroll.runtime.disable"}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.unroll.disable"}
!29 = distinct !{!29, !24, !25}
!30 = !{!10, !19, i64 112}
!31 = !{i8 0, i8 2}


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