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

; 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::DenseGenMatrix" = type <{ %"class.SimTKIpopt::Matrix.base", [3 x i8], ptr, ptr, i8, [7 x i8] }>
%"class.SimTKIpopt::Matrix.base" = type <{ %"class.SimTKIpopt::TaggedObject", %"class.SimTKIpopt::SmartPtr.5", i32, i8 }>
%"class.SimTKIpopt::TaggedObject" = type { %"class.SimTKIpopt::ReferencedObject.base", %"class.SimTKIpopt::Subject", i32, i32 }
%"class.SimTKIpopt::ReferencedObject.base" = type <{ ptr, i32 }>
%"class.SimTKIpopt::Subject" = type { ptr, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl" }
%"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl" = type { %"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SimTKIpopt::Observer *, std::allocator<SimTKIpopt::Observer *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.SimTKIpopt::SmartPtr.5" = 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: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt12TaggedObject13ObjectChangedEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt14DenseGenMatrix21ComputeCholeskyFactorERKNS_14DenseSymMatrixE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 8 dereferenceable(97) %1) #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = call noundef i32 @_ZNK10SimTKIpopt9SymMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
  store i32 %16, ptr %6, align 4, !tbaa !9
  call void @_ZN10SimTKIpopt12TaggedObject13ObjectChangedEv(ptr noundef nonnull align 8 dereferenceable(56) %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNK10SimTKIpopt14DenseSymMatrix6ValuesEv(ptr noundef nonnull align 8 dereferenceable(97) %17)
  store ptr %18, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %54, %2
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %57

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %25 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %25, ptr %10, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %50, %24
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %53

31:                                               ; preds = %26
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = mul nsw i32 %34, %35
  %37 = add nsw i32 %33, %36
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %32, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %"class.SimTKIpopt::DenseGenMatrix", ptr %14, i32 0, i32 3
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = mul nsw i32 %44, %45
  %47 = add nsw i32 %43, %46
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds double, ptr %42, i64 %48
  store double %40, ptr %49, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %31
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %10, align 4, !tbaa !9
  br label %26, !llvm.loop !25

53:                                               ; preds = %30
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %8, align 4, !tbaa !9
  br label %19, !llvm.loop !27

57:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.SimTKIpopt::DenseGenMatrix", ptr %14, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  %61 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN10SimTKIpopt14IpLapackDpotrfEiPdiRi(i32 noundef %58, ptr noundef %60, i32 noundef %61, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %57
  %65 = getelementptr inbounds %"class.SimTKIpopt::DenseGenMatrix", ptr %14, i32 0, i32 4
  store i8 0, ptr %65, align 8, !tbaa !28
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %97

66:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %92, %66
  %68 = load i32, ptr %12, align 4, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %95

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %88, %72
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %91

78:                                               ; preds = %73
  %79 = getelementptr inbounds %"class.SimTKIpopt::DenseGenMatrix", ptr %14, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !13
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = load i32, ptr %6, align 4, !tbaa !9
  %84 = mul nsw i32 %82, %83
  %85 = add nsw i32 %81, %84
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds double, ptr %80, i64 %86
  store double 0.000000e+00, ptr %87, align 8, !tbaa !11
  br label %88

88:                                               ; preds = %78
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %13, align 4, !tbaa !9
  br label %73, !llvm.loop !29

91:                                               ; preds = %77
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %12, align 4, !tbaa !9
  br label %67, !llvm.loop !30

95:                                               ; preds = %71
  %96 = getelementptr inbounds %"class.SimTKIpopt::DenseGenMatrix", ptr %14, i32 0, i32 4
  store i8 1, ptr %96, align 8, !tbaa !28
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %97

97:                                               ; preds = %95, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %98 = load i1, ptr %3, align 1
  ret i1 %98
}

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

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

declare void @_ZN10SimTKIpopt14IpLapackDpotrfEiPdiRi(i32 noundef, ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #4

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 80}
!14 = !{!"_ZTSN10SimTKIpopt14DenseGenMatrixE", !15, i64 0, !6, i64 72, !6, i64 80, !24, i64 88}
!15 = !{!"_ZTSN10SimTKIpopt6MatrixE", !16, i64 0, !23, i64 56, !10, i64 64, !24, i64 68}
!16 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !17, i64 0, !18, i64 16, !10, i64 48, !10, i64 52}
!17 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !10, i64 8}
!18 = !{!"_ZTSN10SimTKIpopt7SubjectE", !19, i64 8}
!19 = !{!"_ZTSSt6vectorIPN10SimTKIpopt8ObserverESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !6, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = !{!14, !24, i64 88}
!29 = distinct !{!29, !26}
!30 = distinct !{!30, !26}


; 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: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt12TaggedObject13ObjectChangedEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt14DenseGenMatrix21ComputeCholeskyFactorERKNS_14DenseSymMatrixE(ptr noundef nonnull align 8 dereferenceable(89) %0, ptr noundef nonnull align 8 dereferenceable(97) %1) local_unnamed_addr #1 align 2 {
  %3 = alloca i32, align 4
  %4 = tail call noundef i32 @_ZNK10SimTKIpopt9SymMatrix3DimEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  tail call void @_ZN10SimTKIpopt12TaggedObject13ObjectChangedEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %5 = tail call noundef ptr @_ZNK10SimTKIpopt14DenseSymMatrix6ValuesEv(ptr noundef nonnull align 8 dereferenceable(97) %1)
  %6 = icmp sgt i32 %4, 0
  %7 = getelementptr inbounds i8, ptr %0, i64 80
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  br i1 %6, label %.preheader34.lr.ph, label %._crit_edge

.preheader34.lr.ph:                               ; preds = %2
  %9 = ptrtoint ptr %8 to i64
  %10 = ptrtoint ptr %5 to i64
  %11 = zext nneg i32 %4 to i64
  %12 = sub i64 %9, %10
  %diff.check = icmp ult i64 %12, 32
  br label %.preheader34

.preheader34:                                     ; preds = %.preheader34.lr.ph, %.loopexit
  %indvars.iv = phi i64 [ 0, %.preheader34.lr.ph ], [ %indvars.iv.next, %.loopexit ]
  %13 = sub nsw i64 %11, %indvars.iv
  %14 = mul nuw nsw i64 %indvars.iv, %11
  %min.iters.check = icmp ult i64 %13, 4
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader34
  %indvars.iv41.ph = phi i64 [ %indvars.iv, %.preheader34 ], [ %ind.end, %middle.block ]
  %15 = sub i64 %11, %indvars.iv41.ph
  %xtraiter = and i64 %15, 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.iv41.prol = phi i64 [ %indvars.iv.next42.prol, %scalar.ph.prol ], [ %indvars.iv41.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %16 = add nuw nsw i64 %indvars.iv41.prol, %14
  %17 = getelementptr inbounds double, ptr %5, i64 %16
  %18 = load double, ptr %17, align 8, !tbaa !21
  %19 = getelementptr inbounds double, ptr %8, i64 %16
  store double %18, ptr %19, align 8, !tbaa !21
  %indvars.iv.next42.prol = add nuw nsw i64 %indvars.iv41.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 !23

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv41.unr = phi i64 [ %indvars.iv41.ph, %scalar.ph.preheader ], [ %indvars.iv.next42.prol, %scalar.ph.prol ]
  %20 = sub i64 %indvars.iv41.ph, %11
  %21 = icmp ugt i64 %20, -4
  br i1 %21, label %.loopexit, label %scalar.ph

vector.ph:                                        ; preds = %.preheader34
  %n.vec = and i64 %13, -4
  %ind.end = add i64 %indvars.iv, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %indvars.iv, %index
  %22 = add nuw nsw i64 %offset.idx, %14
  %23 = getelementptr inbounds double, ptr %5, i64 %22
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %wide.load = load <2 x double>, ptr %23, align 8, !tbaa !21
  %wide.load53 = load <2 x double>, ptr %24, align 8, !tbaa !21
  %25 = getelementptr inbounds double, ptr %8, i64 %22
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  store <2 x double> %wide.load, ptr %25, align 8, !tbaa !21
  store <2 x double> %wide.load53, ptr %26, align 8, !tbaa !21
  %index.next = add nuw i64 %index, 4
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !25

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %13, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %.loopexit, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %28 = getelementptr inbounds i8, ptr %0, i64 80
  call void @_ZN10SimTKIpopt14IpLapackDpotrfEiPdiRi(i32 noundef %4, ptr noundef %8, i32 noundef %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = load i32, ptr %3, align 4, !tbaa !29
  %.not = icmp eq i32 %29, 0
  br i1 %.not, label %.preheader33, label %._crit_edge39

.preheader33:                                     ; preds = %._crit_edge
  %30 = icmp sgt i32 %4, 1
  br i1 %30, label %.preheader.lr.ph, label %._crit_edge39

.preheader.lr.ph:                                 ; preds = %.preheader33
  %31 = load ptr, ptr %28, align 8, !tbaa !5
  %32 = zext nneg i32 %4 to i64
  %33 = shl nuw nsw i64 %32, 3
  %34 = add nsw i32 %4, -1
  %wide.trip.count50 = zext nneg i32 %34 to i64
  %35 = add nsw i64 %wide.trip.count50, -1
  %xtraiter54 = and i64 %wide.trip.count50, 3
  %36 = icmp ult i64 %35, 3
  br i1 %36, label %._crit_edge39.loopexit.unr-lcssa, label %.preheader.lr.ph.new

.preheader.lr.ph.new:                             ; preds = %.preheader.lr.ph
  %unroll_iter = and i64 %wide.trip.count50, 2147483644
  br label %.preheader

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond46.not = icmp eq i64 %indvars.iv.next, %11
  br i1 %exitcond46.not, label %._crit_edge, label %.preheader34, !llvm.loop !30

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv41 = phi i64 [ %indvars.iv.next42.3, %scalar.ph ], [ %indvars.iv41.unr, %scalar.ph.prol.loopexit ]
  %37 = add nuw nsw i64 %indvars.iv41, %14
  %38 = getelementptr inbounds double, ptr %5, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !21
  %40 = getelementptr inbounds double, ptr %8, i64 %37
  store double %39, ptr %40, align 8, !tbaa !21
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %41 = add nuw nsw i64 %indvars.iv.next42, %14
  %42 = getelementptr inbounds double, ptr %5, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !21
  %44 = getelementptr inbounds double, ptr %8, i64 %41
  store double %43, ptr %44, align 8, !tbaa !21
  %indvars.iv.next42.1 = add nuw nsw i64 %indvars.iv41, 2
  %45 = add nuw nsw i64 %indvars.iv.next42.1, %14
  %46 = getelementptr inbounds double, ptr %5, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !21
  %48 = getelementptr inbounds double, ptr %8, i64 %45
  store double %47, ptr %48, align 8, !tbaa !21
  %indvars.iv.next42.2 = add nuw nsw i64 %indvars.iv41, 3
  %49 = add nuw nsw i64 %indvars.iv.next42.2, %14
  %50 = getelementptr inbounds double, ptr %5, i64 %49
  %51 = load double, ptr %50, align 8, !tbaa !21
  %52 = getelementptr inbounds double, ptr %8, i64 %49
  store double %51, ptr %52, align 8, !tbaa !21
  %indvars.iv.next42.3 = add nuw nsw i64 %indvars.iv41, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next42.3, %11
  br i1 %exitcond.not.3, label %.loopexit, label %scalar.ph, !llvm.loop !31

.preheader:                                       ; preds = %.preheader, %.preheader.lr.ph.new
  %indvar = phi i64 [ 0, %.preheader.lr.ph.new ], [ %indvar.next.3, %.preheader ]
  %niter = phi i64 [ 0, %.preheader.lr.ph.new ], [ %niter.next.3, %.preheader ]
  %53 = or disjoint i64 %indvar, 1
  %54 = mul i64 %33, %53
  %scevgep = getelementptr i8, ptr %31, i64 %54
  %55 = shl nuw nsw i64 %indvar, 3
  %56 = or disjoint i64 %55, 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i8 0, i64 %56, i1 false), !tbaa !21
  %57 = or disjoint i64 %indvar, 2
  %58 = mul i64 %33, %57
  %scevgep.1 = getelementptr i8, ptr %31, i64 %58
  %indvar.next = shl i64 %indvar, 3
  %59 = or disjoint i64 %indvar.next, 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.1, i8 0, i64 %59, i1 false), !tbaa !21
  %60 = or disjoint i64 %indvar, 3
  %61 = mul i64 %33, %60
  %scevgep.2 = getelementptr i8, ptr %31, i64 %61
  %indvar.next.1 = shl i64 %indvar, 3
  %62 = or disjoint i64 %indvar.next.1, 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.2, i8 0, i64 %62, i1 false), !tbaa !21
  %63 = add nuw i64 %indvar, 4
  %64 = mul i64 %33, %63
  %scevgep.3 = getelementptr i8, ptr %31, i64 %64
  %indvar.next.2 = shl i64 %indvar, 3
  %65 = add nuw nsw i64 %indvar.next.2, 32
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.3, i8 0, i64 %65, i1 false), !tbaa !21
  %indvar.next.3 = add nuw nsw i64 %indvar, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge39.loopexit.unr-lcssa, label %.preheader, !llvm.loop !32

._crit_edge39.loopexit.unr-lcssa:                 ; preds = %.preheader, %.preheader.lr.ph
  %indvar.unr = phi i64 [ 0, %.preheader.lr.ph ], [ %indvar.next.3, %.preheader ]
  %lcmp.mod55.not = icmp eq i64 %xtraiter54, 0
  br i1 %lcmp.mod55.not, label %._crit_edge39, label %.preheader.epil

.preheader.epil:                                  ; preds = %._crit_edge39.loopexit.unr-lcssa, %.preheader.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader.epil ], [ %indvar.unr, %._crit_edge39.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader.epil ], [ 0, %._crit_edge39.loopexit.unr-lcssa ]
  %66 = add nuw i64 %indvar.epil, 1
  %67 = mul i64 %33, %66
  %scevgep.epil = getelementptr i8, ptr %31, i64 %67
  %68 = shl nuw nsw i64 %indvar.epil, 3
  %69 = add nuw nsw i64 %68, 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep.epil, i8 0, i64 %69, i1 false), !tbaa !21
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter54
  br i1 %epil.iter.cmp.not, label %._crit_edge39, label %.preheader.epil, !llvm.loop !33

._crit_edge39:                                    ; preds = %._crit_edge39.loopexit.unr-lcssa, %.preheader.epil, %.preheader33, %._crit_edge
  %.sink = phi i8 [ 0, %._crit_edge ], [ 1, %.preheader33 ], [ 1, %.preheader.epil ], [ 1, %._crit_edge39.loopexit.unr-lcssa ]
  %70 = getelementptr inbounds i8, ptr %0, i64 88
  store i8 %.sink, ptr %70, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret i1 %.not
}

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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: write) }
attributes #6 = { 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, !18, i64 80}
!6 = !{!"_ZTSN10SimTKIpopt14DenseGenMatrixE", !7, i64 0, !18, i64 72, !18, i64 80, !20, i64 88}
!7 = !{!"_ZTSN10SimTKIpopt6MatrixE", !8, i64 0, !19, i64 56, !10, i64 64, !20, i64 68}
!8 = !{!"_ZTSN10SimTKIpopt12TaggedObjectE", !9, i64 0, !13, i64 16, !10, i64 48, !10, i64 52}
!9 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !10, i64 8}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN10SimTKIpopt7SubjectE", !14, i64 8}
!14 = !{!"_ZTSSt6vectorIPN10SimTKIpopt8ObserverESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN10SimTKIpopt8ObserverESaIS2_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !11, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_11MatrixSpaceEEE", !18, i64 0}
!20 = !{!"bool", !11, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !11, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !26, !27, !28}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!"llvm.loop.isvectorized", i32 1}
!28 = !{!"llvm.loop.unroll.runtime.disable"}
!29 = !{!10, !10, i64 0}
!30 = distinct !{!30, !26}
!31 = distinct !{!31, !26, !27}
!32 = distinct !{!32, !26}
!33 = distinct !{!33, !24}
!34 = !{!6, !20, i64 88}


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