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

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

@_ZTVN10SimTKIpopt16TSymLinearSolverE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN10SimTKIpopt16TSymLinearSolverD2Ev(ptr noundef nonnull align 8 dereferenceable(141) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  store ptr getelementptr inbounds inrange(-16, 56) ({ [9 x ptr] }, ptr @_ZTVN10SimTKIpopt16TSymLinearSolverE, i32 0, i32 0, i32 2), ptr %3, align 8, !tbaa !9
  %4 = getelementptr inbounds %"class.SimTKIpopt::TSymLinearSolver", ptr %3, i32 0, i32 16
  %5 = load ptr, ptr %4, align 8, !tbaa !11
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %7

7:                                                ; preds = %1
  call void @_ZdaPv(ptr noundef %5) #2
  br label %8

8:                                                ; preds = %7, %1
  %9 = getelementptr inbounds %"class.SimTKIpopt::TSymLinearSolver", ptr %3, i32 0, i32 17
  %10 = load ptr, ptr %9, align 8, !tbaa !27
  %11 = icmp eq ptr %10, null
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  call void @_ZdaPv(ptr noundef %10) #2
  br label %13

13:                                               ; preds = %12, %8
  %14 = getelementptr inbounds %"class.SimTKIpopt::TSymLinearSolver", ptr %3, i32 0, i32 12
  %15 = load ptr, ptr %14, align 8, !tbaa !28
  %16 = icmp eq ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @_ZdaPv(ptr noundef %15) #2
  br label %18

18:                                               ; preds = %17, %13
  %19 = getelementptr inbounds %"class.SimTKIpopt::TSymLinearSolver", ptr %3, i32 0, i32 19
  call void @_ZN10SimTKIpopt8SmartPtrINS_23TripletToDenseConverterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #3
  %20 = getelementptr inbounds %"class.SimTKIpopt::TSymLinearSolver", ptr %3, i32 0, i32 18
  call void @_ZN10SimTKIpopt8SmartPtrINS_21TripletToCSRConverterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #3
  %21 = getelementptr inbounds %"class.SimTKIpopt::TSymLinearSolver", ptr %3, i32 0, i32 11
  call void @_ZN10SimTKIpopt8SmartPtrINS_17TSymScalingMethodEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #3
  %22 = getelementptr inbounds %"class.SimTKIpopt::TSymLinearSolver", ptr %3, i32 0, i32 10
  call void @_ZN10SimTKIpopt8SmartPtrINS_30SparseSymLinearSolverInterfaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #3
  call void @_ZN10SimTKIpopt23AlgorithmStrategyObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(49) %3) #3
  ret void
}

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

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

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

attributes #0 = { 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 #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 = { builtin nounwind }
attributes #3 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 104}
!12 = !{!"_ZTSN10SimTKIpopt16TSymLinearSolverE", !13, i64 0, !16, i64 52, !16, i64 56, !16, i64 60, !16, i64 64, !21, i64 68, !21, i64 69, !21, i64 70, !22, i64 72, !23, i64 80, !6, i64 88, !21, i64 96, !21, i64 97, !6, i64 104, !6, i64 112, !24, i64 120, !25, i64 128, !26, i64 136, !21, i64 140}
!13 = !{!"_ZTSN10SimTKIpopt15SymLinearSolverE", !14, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !15, i64 0, !17, i64 16, !18, i64 24, !19, i64 32, !20, i64 40, !21, i64 48}
!15 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !16, i64 8}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !6, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !6, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !6, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_30SparseSymLinearSolverInterfaceEEE", !6, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_17TSymScalingMethodEEE", !6, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_21TripletToCSRConverterEEE", !6, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_23TripletToDenseConverterEEE", !6, i64 0}
!26 = !{!"_ZTSN10SimTKIpopt30SparseSymLinearSolverInterface13EMatrixFormatE", !7, i64 0}
!27 = !{!12, !6, i64 112}
!28 = !{!12, !6, i64 88}


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

@_ZTVN10SimTKIpopt16TSymLinearSolverE = external dso_local unnamed_addr constant { [9 x ptr] }, align 8

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN10SimTKIpopt16TSymLinearSolverD2Ev(ptr noundef nonnull align 8 dereferenceable(141) %0) unnamed_addr #0 align 2 {
  store ptr getelementptr inbounds inrange(-16, 56) (i8, ptr @_ZTVN10SimTKIpopt16TSymLinearSolverE, i64 16), ptr %0, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 104
  %3 = load ptr, ptr %2, align 8, !tbaa !8
  %4 = icmp eq ptr %3, null
  br i1 %4, label %6, label %5

5:                                                ; preds = %1
  tail call void @_ZdaPv(ptr noundef nonnull %3) #2
  br label %6

6:                                                ; preds = %5, %1
  %7 = getelementptr inbounds i8, ptr %0, i64 112
  %8 = load ptr, ptr %7, align 8, !tbaa !26
  %9 = icmp eq ptr %8, null
  br i1 %9, label %11, label %10

10:                                               ; preds = %6
  tail call void @_ZdaPv(ptr noundef nonnull %8) #2
  br label %11

11:                                               ; preds = %10, %6
  %12 = getelementptr inbounds i8, ptr %0, i64 88
  %13 = load ptr, ptr %12, align 8, !tbaa !27
  %14 = icmp eq ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  tail call void @_ZdaPv(ptr noundef nonnull %13) #2
  br label %16

16:                                               ; preds = %15, %11
  %17 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @_ZN10SimTKIpopt8SmartPtrINS_23TripletToDenseConverterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  %18 = getelementptr inbounds i8, ptr %0, i64 120
  tail call void @_ZN10SimTKIpopt8SmartPtrINS_21TripletToCSRConverterEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #3
  %19 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN10SimTKIpopt8SmartPtrINS_17TSymScalingMethodEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #3
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @_ZN10SimTKIpopt8SmartPtrINS_30SparseSymLinearSolverInterfaceEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %20) #3
  tail call void @_ZN10SimTKIpopt23AlgorithmStrategyObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(49) %0) #3
  ret void
}

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

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

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

attributes #0 = { 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 #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 = { builtin nounwind }
attributes #3 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !16, i64 104}
!9 = !{!"_ZTSN10SimTKIpopt16TSymLinearSolverE", !10, i64 0, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !20, i64 68, !20, i64 69, !20, i64 70, !21, i64 72, !22, i64 80, !16, i64 88, !20, i64 96, !20, i64 97, !16, i64 104, !16, i64 112, !23, i64 120, !24, i64 128, !25, i64 136, !20, i64 140}
!10 = !{!"_ZTSN10SimTKIpopt15SymLinearSolverE", !11, i64 0}
!11 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !12, i64 0, !15, i64 16, !17, i64 24, !18, i64 32, !19, i64 40, !20, i64 48}
!12 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !13, i64 8}
!13 = !{!"int", !14, i64 0}
!14 = !{!"omnipotent char", !7, i64 0}
!15 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !16, i64 0}
!16 = !{!"any pointer", !14, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !16, i64 0}
!18 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !16, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !16, i64 0}
!20 = !{!"bool", !14, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_30SparseSymLinearSolverInterfaceEEE", !16, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_17TSymScalingMethodEEE", !16, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_21TripletToCSRConverterEEE", !16, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_23TripletToDenseConverterEEE", !16, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt30SparseSymLinearSolverInterface13EMatrixFormatE", !14, i64 0}
!26 = !{!9, !16, i64 112}
!27 = !{!9, !16, i64 88}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InstCombinePass,SROAPass,TailCallElimPass