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

; 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::FilterLSAcceptor" = type { %"class.SimTKIpopt::BacktrackingLSAcceptor.base", double, double, double, double, double, double, double, double, double, double, double, i32, double, double, i32, double, i8, i8, i32, i32, double, double, double, double, double, double, %"class.SimTKIpopt::Filter", double, i32, i32, %"class.SimTKIpopt::SmartPtr.13" }
%"class.SimTKIpopt::BacktrackingLSAcceptor.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 }
%"class.SimTKIpopt::Filter" = type { i32, %"class.std::__cxx11::list" }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<SimTKIpopt::FilterEntry *, std::allocator<SimTKIpopt::FilterEntry *>>::_List_impl" }
%"struct.std::__cxx11::_List_base<SimTKIpopt::FilterEntry *, std::allocator<SimTKIpopt::FilterEntry *>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.SimTKIpopt::SmartPtr.13" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10SimTKIpopt16FilterLSAcceptor18InitThisLineSearchEb(ptr noundef nonnull align 8 dereferenceable(304) %0, i1 noundef zeroext %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  %5 = zext i1 %1 to i8
  store i8 %5, ptr %4, align 1, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  %7 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %8 = trunc i8 %7 to i1
  br i1 %8, label %19, label %9

9:                                                ; preds = %2
  %10 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %6)
  %11 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities25curr_constraint_violationEv(ptr noundef nonnull align 8 dereferenceable(2025) %10)
  %12 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 21
  store double %11, ptr %12, align 8, !tbaa !13
  %13 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %6)
  %14 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities16curr_barrier_objEv(ptr noundef nonnull align 8 dereferenceable(2025) %13)
  %15 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 22
  store double %14, ptr %15, align 8, !tbaa !33
  %16 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %6)
  %17 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities19curr_gradBarrTDeltaEv(ptr noundef nonnull align 8 dereferenceable(2025) %16)
  %18 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 23
  store double %17, ptr %18, align 8, !tbaa !34
  br label %29

19:                                               ; preds = %2
  %20 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 24
  %21 = load double, ptr %20, align 8, !tbaa !35
  %22 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 21
  store double %21, ptr %22, align 8, !tbaa !13
  %23 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 25
  %24 = load double, ptr %23, align 8, !tbaa !36
  %25 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 22
  store double %24, ptr %25, align 8, !tbaa !33
  %26 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 26
  %27 = load double, ptr %26, align 8, !tbaa !37
  %28 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 23
  store double %27, ptr %28, align 8, !tbaa !34
  br label %29

29:                                               ; preds = %19, %9
  %30 = getelementptr inbounds %"class.SimTKIpopt::FilterLSAcceptor", ptr %6, i32 0, i32 27
  %31 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject5JnlstEv(ptr noundef nonnull align 8 dereferenceable(49) %6)
  call void @_ZN10SimTKIpopt6Filter5PrintERKNS_10JournalistE(ptr noundef nonnull align 8 dereferenceable(32) %30, ptr noundef nonnull align 8 dereferenceable(40) %31)
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49)) #0 align 2

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities25curr_constraint_violationEv(ptr noundef nonnull align 8 dereferenceable(2025)) #1

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities16curr_barrier_objEv(ptr noundef nonnull align 8 dereferenceable(2025)) #1

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities19curr_gradBarrTDeltaEv(ptr noundef nonnull align 8 dereferenceable(2025)) #1

declare void @_ZN10SimTKIpopt6Filter5PrintERKNS_10JournalistE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject5JnlstEv(ptr noundef nonnull align 8 dereferenceable(49)) #0 align 2

attributes #0 = { 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 #1 = { "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" }

!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 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !23, i64 200}
!14 = !{!"_ZTSN10SimTKIpopt16FilterLSAcceptorE", !15, i64 0, !23, i64 56, !23, i64 64, !23, i64 72, !23, i64 80, !23, i64 88, !23, i64 96, !23, i64 104, !23, i64 112, !23, i64 120, !23, i64 128, !23, i64 136, !18, i64 144, !23, i64 152, !23, i64 160, !24, i64 168, !23, i64 176, !10, i64 184, !10, i64 185, !18, i64 188, !18, i64 192, !23, i64 200, !23, i64 208, !23, i64 216, !23, i64 224, !23, i64 232, !23, i64 240, !25, i64 248, !23, i64 280, !18, i64 288, !18, i64 292, !32, i64 296}
!15 = !{!"_ZTSN10SimTKIpopt22BacktrackingLSAcceptorE", !16, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !17, i64 0, !19, i64 16, !20, i64 24, !21, i64 32, !22, i64 40, !10, i64 48}
!17 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !18, i64 8}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !6, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !6, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !6, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt16FilterLSAcceptor17CorrectorTypeEnumE", !7, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt6FilterE", !18, i64 0, !26, i64 8}
!26 = !{!"_ZTSNSt7__cxx114listIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !27, i64 0}
!27 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !28, i64 0}
!28 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EE10_List_implE", !29, i64 0}
!29 = !{!"_ZTSNSt8__detail17_List_node_headerE", !30, i64 0, !31, i64 16}
!30 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!31 = !{!"long", !7, i64 0}
!32 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_14PDSystemSolverEEE", !6, i64 0}
!33 = !{!14, !23, i64 208}
!34 = !{!14, !23, i64 216}
!35 = !{!14, !23, i64 224}
!36 = !{!14, !23, i64 232}
!37 = !{!14, !23, i64 240}


; 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 uwtable
define dso_local void @_ZN10SimTKIpopt16FilterLSAcceptor18InitThisLineSearchEb(ptr noundef nonnull align 8 dereferenceable(304) %0, i1 noundef zeroext %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 200
  br i1 %1, label %12, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 208
  %6 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %7 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities25curr_constraint_violationEv(ptr noundef nonnull align 8 dereferenceable(2025) %6)
  store double %7, ptr %3, align 8, !tbaa !5
  %8 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %9 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities16curr_barrier_objEv(ptr noundef nonnull align 8 dereferenceable(2025) %8)
  store double %9, ptr %5, align 8, !tbaa !29
  %10 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %11 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities19curr_gradBarrTDeltaEv(ptr noundef nonnull align 8 dereferenceable(2025) %10)
  br label %17

12:                                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 224
  %14 = load <2 x double>, ptr %13, align 8, !tbaa !30
  store <2 x double> %14, ptr %3, align 8, !tbaa !30
  %15 = getelementptr inbounds i8, ptr %0, i64 240
  %16 = load double, ptr %15, align 8, !tbaa !31
  br label %17

17:                                               ; preds = %12, %4
  %.sink = phi double [ %16, %12 ], [ %11, %4 ]
  %18 = getelementptr inbounds i8, ptr %0, i64 216
  store double %.sink, ptr %18, align 8
  %19 = getelementptr inbounds i8, ptr %0, i64 248
  %20 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject5JnlstEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  tail call void @_ZN10SimTKIpopt6Filter5PrintERKNS_10JournalistE(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(40) %20)
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #0 align 2

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities25curr_constraint_violationEv(ptr noundef nonnull align 8 dereferenceable(2025)) local_unnamed_addr #1

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities16curr_barrier_objEv(ptr noundef nonnull align 8 dereferenceable(2025)) local_unnamed_addr #1

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities19curr_gradBarrTDeltaEv(ptr noundef nonnull align 8 dereferenceable(2025)) local_unnamed_addr #1

declare void @_ZN10SimTKIpopt6Filter5PrintERKNS_10JournalistE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject5JnlstEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { "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" }

!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, !19, i64 200}
!6 = !{!"_ZTSN10SimTKIpopt16FilterLSAcceptorE", !7, i64 0, !19, i64 56, !19, i64 64, !19, i64 72, !19, i64 80, !19, i64 88, !19, i64 96, !19, i64 104, !19, i64 112, !19, i64 120, !19, i64 128, !19, i64 136, !10, i64 144, !19, i64 152, !19, i64 160, !20, i64 168, !19, i64 176, !18, i64 184, !18, i64 185, !10, i64 188, !10, i64 192, !19, i64 200, !19, i64 208, !19, i64 216, !19, i64 224, !19, i64 232, !19, i64 240, !21, i64 248, !19, i64 280, !10, i64 288, !10, i64 292, !28, i64 296}
!7 = !{!"_ZTSN10SimTKIpopt22BacktrackingLSAcceptorE", !8, i64 0}
!8 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !9, i64 0, !13, i64 16, !15, i64 24, !16, i64 32, !17, i64 40, !18, i64 48}
!9 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !10, i64 8}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !14, i64 0}
!14 = !{!"any pointer", !11, i64 0}
!15 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !14, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !14, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !14, i64 0}
!18 = !{!"bool", !11, i64 0}
!19 = !{!"double", !11, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt16FilterLSAcceptor17CorrectorTypeEnumE", !11, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt6FilterE", !10, i64 0, !22, i64 8}
!22 = !{!"_ZTSNSt7__cxx114listIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !23, i64 0}
!23 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !24, i64 0}
!24 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EE10_List_implE", !25, i64 0}
!25 = !{!"_ZTSNSt8__detail17_List_node_headerE", !26, i64 0, !27, i64 16}
!26 = !{!"_ZTSNSt8__detail15_List_node_baseE", !14, i64 0, !14, i64 8}
!27 = !{!"long", !11, i64 0}
!28 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_14PDSystemSolverEEE", !14, i64 0}
!29 = !{!6, !19, i64 208}
!30 = !{!19, !19, i64 0}
!31 = !{!6, !19, i64 240}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MergedLoadStoreMotionPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass