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

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10SimTKIpopt21LapackSolverInterface13FactorizationEPKiS2_bi(ptr noundef nonnull align 8 dereferenceable(113) %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3, i32 noundef %4) #4 align 2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  %22 = zext i1 %3 to i8
  store i8 %22, ptr %10, align 1, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !11
  %23 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  store i8 78, ptr %18, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  store i8 76, ptr %19, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %24 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 11
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  %26 = icmp eq ptr %25, null
  br i1 %26, label %28, label %27

27:                                               ; preds = %5
  call void @_ZdaPv(ptr noundef %25) #7
  br label %28

28:                                               ; preds = %27, %5
  %29 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %30 = load i32, ptr %29, align 4, !tbaa !25
  %31 = sext i32 %30 to i64
  %32 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %31, i64 4)
  %33 = extractvalue { i64, i1 } %32, 1
  %34 = extractvalue { i64, i1 } %32, 0
  %35 = select i1 %33, i64 -1, i64 %34
  %36 = call noalias noundef nonnull ptr @_Znam(i64 noundef %35) #8
  %37 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 11
  store ptr %36, ptr %37, align 8, !tbaa !16
  %38 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 9
  store i32 0, ptr %38, align 8, !tbaa !26
  %39 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %40 = load i32, ptr %39, align 4, !tbaa !25
  %41 = sext i32 %40 to i64
  %42 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %41, i64 8)
  %43 = extractvalue { i64, i1 } %42, 1
  %44 = extractvalue { i64, i1 } %42, 0
  %45 = select i1 %43, i64 -1, i64 %44
  %46 = call noalias noundef nonnull ptr @_Znam(i64 noundef %45) #8
  store ptr %46, ptr %15, align 8, !tbaa !5
  %47 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !25
  %49 = mul nsw i32 3, %48
  store i32 %49, ptr %14, align 4, !tbaa !11
  %50 = load i32, ptr %14, align 4, !tbaa !11
  %51 = sext i32 %50 to i64
  %52 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %51, i64 8)
  %53 = extractvalue { i64, i1 } %52, 1
  %54 = extractvalue { i64, i1 } %52, 0
  %55 = select i1 %53, i64 -1, i64 %54
  %56 = call noalias noundef nonnull ptr @_Znam(i64 noundef %55) #8
  store ptr %56, ptr %16, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %58 = load i32, ptr %57, align 4, !tbaa !25
  %59 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %60 = load i32, ptr %59, align 4, !tbaa !25
  %61 = mul nsw i32 %58, %60
  %62 = sext i32 %61 to i64
  %63 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %62, i64 8)
  %64 = extractvalue { i64, i1 } %63, 1
  %65 = extractvalue { i64, i1 } %63, 0
  %66 = select i1 %64, i64 -1, i64 %65
  %67 = call noalias noundef nonnull ptr @_Znam(i64 noundef %66) #8
  store ptr %67, ptr %17, align 8, !tbaa !5
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %68

68:                                               ; preds = %87, %28
  %69 = load i32, ptr %20, align 4, !tbaa !11
  %70 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !25
  %72 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !25
  %74 = mul nsw i32 %71, %73
  %75 = icmp slt i32 %69, %74
  br i1 %75, label %76, label %90

76:                                               ; preds = %68
  %77 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 5
  %78 = load ptr, ptr %77, align 8, !tbaa !27
  %79 = load i32, ptr %20, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %78, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !28
  %83 = load ptr, ptr %17, align 8, !tbaa !5
  %84 = load i32, ptr %20, align 4, !tbaa !11
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %83, i64 %85
  store double %82, ptr %86, align 8, !tbaa !28
  br label %87

87:                                               ; preds = %76
  %88 = load i32, ptr %20, align 4, !tbaa !11
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %20, align 4, !tbaa !11
  br label %68, !llvm.loop !30

90:                                               ; preds = %68
  %91 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %92 = load ptr, ptr %17, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = load ptr, ptr %16, align 8, !tbaa !5
  call void @dsyev_(ptr noundef nonnull align 1 dereferenceable(1) %18, ptr noundef nonnull align 1 dereferenceable(1) %19, ptr noundef nonnull align 4 dereferenceable(4) %91, ptr noundef %92, ptr noundef nonnull align 4 dereferenceable(4) %93, ptr noundef %94, ptr noundef %95, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %13, i32 noundef 1, i32 noundef 1)
  %96 = load i32, ptr %13, align 4, !tbaa !11
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %111

98:                                               ; preds = %90
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  %100 = icmp eq ptr %99, null
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  call void @_ZdaPv(ptr noundef %99) #7
  br label %102

102:                                              ; preds = %101, %98
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = icmp eq ptr %103, null
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  call void @_ZdaPv(ptr noundef %103) #7
  br label %106

106:                                              ; preds = %105, %102
  %107 = load ptr, ptr %17, align 8, !tbaa !5
  %108 = icmp eq ptr %107, null
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  call void @_ZdaPv(ptr noundef %107) #7
  br label %110

110:                                              ; preds = %109, %106
  store i32 4, ptr %6, align 4
  store i32 1, ptr %21, align 4
  br label %170

111:                                              ; preds = %90
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %112

112:                                              ; preds = %129, %111
  %113 = load i32, ptr %20, align 4, !tbaa !11
  %114 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %115 = load i32, ptr %114, align 4, !tbaa !25
  %116 = icmp slt i32 %113, %115
  br i1 %116, label %117, label %132

117:                                              ; preds = %112
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = load i32, ptr %20, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %118, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !28
  %123 = fcmp olt double %122, 0.000000e+00
  br i1 %123, label %124, label %128

124:                                              ; preds = %117
  %125 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 9
  %126 = load i32, ptr %125, align 8, !tbaa !26
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %125, align 8, !tbaa !26
  br label %128

128:                                              ; preds = %124, %117
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %20, align 4, !tbaa !11
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %20, align 4, !tbaa !11
  br label %112, !llvm.loop !32

132:                                              ; preds = %112
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = icmp eq ptr %133, null
  br i1 %134, label %136, label %135

135:                                              ; preds = %132
  call void @_ZdaPv(ptr noundef %133) #7
  br label %136

136:                                              ; preds = %135, %132
  %137 = load ptr, ptr %16, align 8, !tbaa !5
  %138 = icmp eq ptr %137, null
  br i1 %138, label %140, label %139

139:                                              ; preds = %136
  call void @_ZdaPv(ptr noundef %137) #7
  br label %140

140:                                              ; preds = %139, %136
  %141 = load i8, ptr %10, align 1, !tbaa !9, !range !33, !noundef !34
  %142 = trunc i8 %141 to i1
  br i1 %142, label %143, label %153

143:                                              ; preds = %140
  %144 = load i32, ptr %11, align 4, !tbaa !11
  %145 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 9
  %146 = load i32, ptr %145, align 8, !tbaa !26
  %147 = icmp ne i32 %144, %146
  br i1 %147, label %148, label %153

148:                                              ; preds = %143
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  %150 = icmp eq ptr %149, null
  br i1 %150, label %152, label %151

151:                                              ; preds = %148
  call void @_ZdaPv(ptr noundef %149) #7
  br label %152

152:                                              ; preds = %151, %148
  store i32 2, ptr %6, align 4
  store i32 1, ptr %21, align 4
  br label %170

153:                                              ; preds = %143, %140
  %154 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %155 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %156 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 5
  %157 = load ptr, ptr %156, align 8, !tbaa !27
  %158 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 2
  %159 = getelementptr inbounds %"class.SimTKIpopt::LapackSolverInterface", ptr %23, i32 0, i32 11
  %160 = load ptr, ptr %159, align 8, !tbaa !16
  call void @dgetrf_(ptr noundef nonnull align 4 dereferenceable(4) %154, ptr noundef nonnull align 4 dereferenceable(4) %155, ptr noundef %157, ptr noundef nonnull align 4 dereferenceable(4) %158, ptr noundef %160, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %161 = load ptr, ptr %17, align 8, !tbaa !5
  %162 = icmp eq ptr %161, null
  br i1 %162, label %164, label %163

163:                                              ; preds = %153
  call void @_ZdaPv(ptr noundef %161) #7
  br label %164

164:                                              ; preds = %163, %153
  %165 = load i32, ptr %13, align 4, !tbaa !11
  %166 = icmp sgt i32 %165, 0
  br i1 %166, label %167, label %168

167:                                              ; preds = %164
  store i32 1, ptr %12, align 4, !tbaa !13
  br label %168

168:                                              ; preds = %167, %164
  %169 = load i32, ptr %12, align 4, !tbaa !13
  store i32 %169, ptr %6, align 4
  store i32 1, ptr %21, align 4
  br label %170

170:                                              ; preds = %168, %152, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 1, 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 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %171 = load i32, ptr %6, align 4
  ret i32 %171
}

declare void @dsyev_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) #5

declare void @dgetrf_(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)) #5

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 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 = { builtin nounwind }
attributes #8 = { builtin allocsize(0) }

!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 = !{!7, !7, i64 0}
!16 = !{!17, !6, i64 104}
!17 = !{!"_ZTSN10SimTKIpopt21LapackSolverInterfaceE", !18, 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}
!18 = !{!"_ZTSN10SimTKIpopt30SparseSymLinearSolverInterfaceE", !19, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !20, i64 0, !21, i64 16, !22, i64 24, !23, i64 32, !24, i64 40, !10, i64 48}
!20 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !12, i64 8}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !6, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !6, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !6, i64 0}
!25 = !{!17, !12, i64 52}
!26 = !{!17, !12, i64 96}
!27 = !{!17, !6, i64 64}
!28 = !{!29, !29, i64 0}
!29 = !{!"double", !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = !{i8 0, i8 2}
!34 = !{}


; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 5) i32 @_ZN10SimTKIpopt21LapackSolverInterface13FactorizationEPKiS2_bi(ptr noundef nonnull align 8 dereferenceable(113) %0, ptr nocapture noundef readnone %1, ptr nocapture noundef readnone %2, i1 noundef zeroext %3, i32 noundef %4) local_unnamed_addr #3 align 2 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  store i8 78, ptr %8, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #6
  store i8 76, ptr %9, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 104
  %11 = load ptr, ptr %10, align 8, !tbaa !8
  %12 = icmp eq ptr %11, null
  br i1 %12, label %14, label %13

13:                                               ; preds = %5
  tail call void @_ZdaPv(ptr noundef nonnull %11) #7
  br label %14

14:                                               ; preds = %13, %5
  %15 = getelementptr inbounds i8, ptr %0, i64 52
  %16 = load i32, ptr %15, align 4, !tbaa !20
  %17 = sext i32 %16 to i64
  %18 = icmp slt i32 %16, 0
  %19 = shl nsw i64 %17, 2
  %20 = select i1 %18, i64 -1, i64 %19
  %21 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #8
  store ptr %21, ptr %10, align 8, !tbaa !8
  %22 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 0, ptr %22, align 8, !tbaa !21
  %23 = shl nsw i64 %17, 3
  %24 = select i1 %18, i64 -1, i64 %23
  %25 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #8
  %26 = mul nsw i32 %16, 3
  store i32 %26, ptr %7, align 4, !tbaa !22
  %27 = sext i32 %26 to i64
  %28 = shl nsw i64 %27, 3
  %29 = select i1 %18, i64 -1, i64 %28
  %30 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %29) #8
  %31 = mul nsw i32 %16, %16
  %32 = zext nneg i32 %31 to i64
  %33 = shl nuw nsw i64 %32, 3
  %34 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %33) #8
  %.not32 = icmp eq i32 %16, 0
  br i1 %.not32, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14
  %35 = ptrtoint ptr %34 to i64
  %36 = getelementptr inbounds i8, ptr %0, i64 64
  %37 = load ptr, ptr %36, align 8, !tbaa !23
  %umax = tail call i32 @llvm.umax.i32(i32 %31, i32 1)
  %wide.trip.count = zext nneg i32 %umax to i64
  %min.iters.check = icmp ult i32 %31, 6
  %38 = ptrtoint ptr %37 to i64
  %39 = sub i64 %35, %38
  %diff.check = icmp ult i64 %39, 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 ]
  %40 = getelementptr inbounds double, ptr %37, i64 %index
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load = load <2 x double>, ptr %40, align 8, !tbaa !24
  %wide.load39 = load <2 x double>, ptr %41, align 8, !tbaa !24
  %42 = getelementptr inbounds double, ptr %34, i64 %index
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store <2 x double> %wide.load, ptr %42, align 8, !tbaa !24
  store <2 x double> %wide.load39, ptr %43, align 8, !tbaa !24
  %index.next = add nuw i64 %index, 4
  %44 = icmp eq i64 %index.next, %n.vec
  br i1 %44, label %middle.block, label %vector.body, !llvm.loop !26

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 ]
  %45 = getelementptr inbounds double, ptr %37, i64 %indvars.iv.prol
  %46 = load double, ptr %45, align 8, !tbaa !24
  %47 = getelementptr inbounds double, ptr %34, i64 %indvars.iv.prol
  store double %46, ptr %47, align 8, !tbaa !24
  %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 !30

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 ]
  %48 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %49 = icmp ugt i64 %48, -4
  br i1 %49, 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 ]
  %50 = getelementptr inbounds double, ptr %37, i64 %indvars.iv
  %51 = load double, ptr %50, align 8, !tbaa !24
  %52 = getelementptr inbounds double, ptr %34, i64 %indvars.iv
  store double %51, ptr %52, align 8, !tbaa !24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = getelementptr inbounds double, ptr %37, i64 %indvars.iv.next
  %54 = load double, ptr %53, align 8, !tbaa !24
  %55 = getelementptr inbounds double, ptr %34, i64 %indvars.iv.next
  store double %54, ptr %55, align 8, !tbaa !24
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %56 = getelementptr inbounds double, ptr %37, i64 %indvars.iv.next.1
  %57 = load double, ptr %56, align 8, !tbaa !24
  %58 = getelementptr inbounds double, ptr %34, i64 %indvars.iv.next.1
  store double %57, ptr %58, align 8, !tbaa !24
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %59 = getelementptr inbounds double, ptr %37, i64 %indvars.iv.next.2
  %60 = load double, ptr %59, align 8, !tbaa !24
  %61 = getelementptr inbounds double, ptr %34, i64 %indvars.iv.next.2
  store double %60, ptr %61, align 8, !tbaa !24
  %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 !32

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %14
  call void @dsyev_(ptr noundef nonnull align 1 dereferenceable(1) %8, ptr noundef nonnull align 1 dereferenceable(1) %9, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull %34, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull %25, ptr noundef nonnull %30, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef 1, i32 noundef 1)
  %62 = load i32, ptr %6, align 4, !tbaa !22
  %.not = icmp eq i32 %62, 0
  br i1 %.not, label %.preheader, label %66

.preheader:                                       ; preds = %._crit_edge
  %63 = load i32, ptr %15, align 4, !tbaa !20
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph30.preheader, label %._crit_edge31

.lr.ph30.preheader:                               ; preds = %.preheader
  %.promoted = load i32, ptr %22, align 8, !tbaa !21
  %wide.trip.count37 = zext nneg i32 %63 to i64
  %xtraiter41 = and i64 %wide.trip.count37, 1
  %65 = icmp eq i32 %63, 1
  br i1 %65, label %._crit_edge31.loopexit.unr-lcssa, label %.lr.ph30.preheader.new

.lr.ph30.preheader.new:                           ; preds = %.lr.ph30.preheader
  %unroll_iter = and i64 %wide.trip.count37, 2147483646
  br label %.lr.ph30

66:                                               ; preds = %._crit_edge
  call void @_ZdaPv(ptr noundef nonnull %25) #7
  call void @_ZdaPv(ptr noundef nonnull %30) #7
  call void @_ZdaPv(ptr noundef nonnull %34) #7
  br label %94

.lr.ph30:                                         ; preds = %79, %.lr.ph30.preheader.new
  %indvars.iv34 = phi i64 [ 0, %.lr.ph30.preheader.new ], [ %indvars.iv.next35.1, %79 ]
  %67 = phi i32 [ %.promoted, %.lr.ph30.preheader.new ], [ %80, %79 ]
  %niter = phi i64 [ 0, %.lr.ph30.preheader.new ], [ %niter.next.1, %79 ]
  %68 = getelementptr inbounds double, ptr %25, i64 %indvars.iv34
  %69 = load double, ptr %68, align 8, !tbaa !24
  %70 = fcmp olt double %69, 0.000000e+00
  br i1 %70, label %71, label %.lr.ph30.1

71:                                               ; preds = %.lr.ph30
  %72 = add nsw i32 %67, 1
  store i32 %72, ptr %22, align 8, !tbaa !21
  br label %.lr.ph30.1

.lr.ph30.1:                                       ; preds = %.lr.ph30, %71
  %73 = phi i32 [ %67, %.lr.ph30 ], [ %72, %71 ]
  %indvars.iv.next35 = or disjoint i64 %indvars.iv34, 1
  %74 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next35
  %75 = load double, ptr %74, align 8, !tbaa !24
  %76 = fcmp olt double %75, 0.000000e+00
  br i1 %76, label %77, label %79

77:                                               ; preds = %.lr.ph30.1
  %78 = add nsw i32 %73, 1
  store i32 %78, ptr %22, align 8, !tbaa !21
  br label %79

79:                                               ; preds = %77, %.lr.ph30.1
  %80 = phi i32 [ %73, %.lr.ph30.1 ], [ %78, %77 ]
  %indvars.iv.next35.1 = add nuw nsw i64 %indvars.iv34, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge31.loopexit.unr-lcssa, label %.lr.ph30, !llvm.loop !33

._crit_edge31.loopexit.unr-lcssa:                 ; preds = %79, %.lr.ph30.preheader
  %indvars.iv34.unr = phi i64 [ 0, %.lr.ph30.preheader ], [ %indvars.iv.next35.1, %79 ]
  %.unr = phi i32 [ %.promoted, %.lr.ph30.preheader ], [ %80, %79 ]
  %lcmp.mod42.not = icmp eq i64 %xtraiter41, 0
  br i1 %lcmp.mod42.not, label %._crit_edge31, label %.lr.ph30.epil

.lr.ph30.epil:                                    ; preds = %._crit_edge31.loopexit.unr-lcssa
  %81 = getelementptr inbounds double, ptr %25, i64 %indvars.iv34.unr
  %82 = load double, ptr %81, align 8, !tbaa !24
  %83 = fcmp olt double %82, 0.000000e+00
  br i1 %83, label %84, label %._crit_edge31

84:                                               ; preds = %.lr.ph30.epil
  %85 = add nsw i32 %.unr, 1
  store i32 %85, ptr %22, align 8, !tbaa !21
  br label %._crit_edge31

._crit_edge31:                                    ; preds = %._crit_edge31.loopexit.unr-lcssa, %84, %.lr.ph30.epil, %.preheader
  call void @_ZdaPv(ptr noundef nonnull %25) #7
  call void @_ZdaPv(ptr noundef nonnull %30) #7
  %86 = load i32, ptr %22, align 8
  %.not26 = icmp ne i32 %86, %4
  %or.cond.not = select i1 %3, i1 %.not26, i1 false
  br i1 %or.cond.not, label %87, label %88

87:                                               ; preds = %._crit_edge31
  call void @_ZdaPv(ptr noundef nonnull %34) #7
  br label %94

88:                                               ; preds = %._crit_edge31
  %89 = getelementptr inbounds i8, ptr %0, i64 64
  %90 = load ptr, ptr %89, align 8, !tbaa !23
  %91 = load ptr, ptr %10, align 8, !tbaa !8
  call void @dgetrf_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef %90, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef %91, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZdaPv(ptr noundef nonnull %34) #7
  %92 = load i32, ptr %6, align 4, !tbaa !22
  %93 = icmp sgt i32 %92, 0
  %.024 = zext i1 %93 to i32
  br label %94

94:                                               ; preds = %88, %87, %66
  %.023 = phi i32 [ 4, %66 ], [ 2, %87 ], [ %.024, %88 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  ret i32 %.023
}

declare void @dsyev_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) local_unnamed_addr #4

declare void @dgetrf_(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)) local_unnamed_addr #4

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

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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { builtin nounwind }
attributes #8 = { builtin allocsize(0) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !15, i64 104}
!9 = !{!"_ZTSN10SimTKIpopt21LapackSolverInterfaceE", !10, i64 0, !13, i64 52, !13, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !13, i64 96, !15, i64 104, !19, i64 112}
!10 = !{!"_ZTSN10SimTKIpopt30SparseSymLinearSolverInterfaceE", !11, i64 0}
!11 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !12, i64 0, !14, i64 16, !16, i64 24, !17, i64 32, !18, i64 40, !19, i64 48}
!12 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !13, i64 8}
!13 = !{!"int", !6, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !15, i64 0}
!15 = !{!"any pointer", !6, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !15, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !15, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !15, i64 0}
!19 = !{!"bool", !6, i64 0}
!20 = !{!9, !13, i64 52}
!21 = !{!9, !13, i64 96}
!22 = !{!13, !13, i64 0}
!23 = !{!9, !15, i64 64}
!24 = !{!25, !25, i64 0}
!25 = !{!"double", !6, i64 0}
!26 = distinct !{!26, !27, !28, !29}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!"llvm.loop.isvectorized", i32 1}
!29 = !{!"llvm.loop.unroll.runtime.disable"}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.unroll.disable"}
!32 = distinct !{!32, !27, !28}
!33 = distinct !{!33, !27}


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