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

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

%"struct.std::_List_iterator" = type { ptr }
%"class.SimTKIpopt::AdaptiveMuUpdate" = type { %"class.SimTKIpopt::MuUpdate.base", double, double, double, i8, double, double, double, double, double, double, i32, i32, i32, i32, double, double, double, %"class.SimTKIpopt::SmartPtr.10", %"class.SimTKIpopt::SmartPtr.11", %"class.SimTKIpopt::SmartPtr.11", double, double, i32, %"class.std::__cxx11::list", double, %"class.SimTKIpopt::Filter", i8, i8, i8, %"class.SimTKIpopt::SmartPtr.20" }
%"class.SimTKIpopt::MuUpdate.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::SmartPtr.10" = type { ptr }
%"class.SimTKIpopt::SmartPtr.11" = type { ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<double, std::allocator<double>>::_List_impl" }
%"struct.std::__cxx11::_List_base<double, std::allocator<double>>::_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::Filter" = type { i32, %"class.std::__cxx11::list.15" }
%"class.std::__cxx11::list.15" = type { %"class.std::__cxx11::_List_base.16" }
%"class.std::__cxx11::_List_base.16" = 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" }
%"class.SimTKIpopt::SmartPtr.20" = 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10SimTKIpopt3MinEdd(double noundef, double noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt16AdaptiveMuUpdate23CheckSufficientProgressEv(ptr noundef nonnull align 8 dereferenceable(304) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca %"struct.std::_List_iterator", align 8
  %7 = alloca %"struct.std::_List_iterator", align 8
  %8 = alloca %"struct.std::_List_iterator", align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #6
  store i8 1, ptr %3, align 1, !tbaa !9
  %12 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 14
  %13 = load i32, ptr %12, align 4, !tbaa !11
  switch i32 %13, label %69 [
    i32 0, label %14
    i32 1, label %46
    i32 2, label %67
    i32 3, label %68
  ]

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %15 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 24
  %16 = call noundef i64 @_ZNKSt7__cxx114listIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %4, align 4, !tbaa !39
  %18 = load i32, ptr %4, align 4, !tbaa !39
  %19 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 23
  %20 = load i32, ptr %19, align 8, !tbaa !40
  %21 = icmp sge i32 %18, %20
  br i1 %21, label %22, label %45

22:                                               ; preds = %14
  store i8 0, ptr %3, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %23 = call noundef double @_ZN10SimTKIpopt16AdaptiveMuUpdate26quality_function_pd_systemEv(ptr noundef nonnull align 8 dereferenceable(304) %11)
  store double %23, ptr %5, align 8, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @_ZNSt14_List_iteratorIdEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 24
  %25 = call ptr @_ZNSt7__cxx114listIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  %26 = getelementptr inbounds %"struct.std::_List_iterator", ptr %7, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %7, i64 8, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %27

27:                                               ; preds = %42, %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %28 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 24
  %29 = call ptr @_ZNSt7__cxx114listIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #6
  %30 = getelementptr inbounds %"struct.std::_List_iterator", ptr %8, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIdES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br i1 %31, label %32, label %44

32:                                               ; preds = %27
  %33 = load double, ptr %5, align 8, !tbaa !41
  %34 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 25
  %35 = load double, ptr %34, align 8, !tbaa !43
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIdEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %37 = load double, ptr %36, align 8, !tbaa !41
  %38 = fmul double %35, %37
  %39 = fcmp ole double %33, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %32
  store i8 1, ptr %3, align 1, !tbaa !9
  br label %41

41:                                               ; preds = %40, %32
  br label %42

42:                                               ; preds = %41
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIdEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %27, !llvm.loop !44

44:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %45

45:                                               ; preds = %44, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %70

46:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %47 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %11)
  %48 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities14curr_nlp_errorEv(ptr noundef nonnull align 8 dereferenceable(2025) %47)
  store double %48, ptr %9, align 8, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %49 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 16
  %50 = load double, ptr %49, align 8, !tbaa !46
  %51 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 15
  %52 = load double, ptr %51, align 8, !tbaa !47
  %53 = load double, ptr %9, align 8, !tbaa !41
  %54 = call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %52, double noundef %53)
  %55 = fmul double %50, %54
  store double %55, ptr %10, align 8, !tbaa !41
  %56 = getelementptr inbounds %"class.SimTKIpopt::AdaptiveMuUpdate", ptr %11, i32 0, i32 26
  %57 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %11)
  %58 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities6curr_fEv(ptr noundef nonnull align 8 dereferenceable(2025) %57)
  %59 = load double, ptr %10, align 8, !tbaa !41
  %60 = fadd double %58, %59
  %61 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %11)
  %62 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities25curr_constraint_violationEv(ptr noundef nonnull align 8 dereferenceable(2025) %61)
  %63 = load double, ptr %10, align 8, !tbaa !41
  %64 = fadd double %62, %63
  %65 = call noundef zeroext i1 @_ZNK10SimTKIpopt6Filter10AcceptableEdd(ptr noundef nonnull align 8 dereferenceable(32) %56, double noundef %60, double noundef %64)
  %66 = zext i1 %65 to i8
  store i8 %66, ptr %3, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %70

67:                                               ; preds = %1
  br label %70

68:                                               ; preds = %1
  store i8 1, ptr %3, align 1, !tbaa !9
  br label %70

69:                                               ; preds = %1
  br label %70

70:                                               ; preds = %69, %68, %67, %46, %45
  %71 = load i8, ptr %3, align 1, !tbaa !9, !range !48, !noundef !49
  %72 = trunc i8 %71 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  ret i1 %72
}

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities14curr_nlp_errorEv(ptr noundef nonnull align 8 dereferenceable(2025)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx114listIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN10SimTKIpopt16AdaptiveMuUpdate26quality_function_pd_systemEv(ptr noundef nonnull align 8 dereferenceable(304)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt14_List_iteratorIdES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10SimTKIpopt6Filter10AcceptableEdd(ptr noundef nonnull align 8 dereferenceable(32), double noundef, double noundef) #2 align 2

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities6curr_fEv(ptr noundef nonnull align 8 dereferenceable(2025)) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint 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 = { 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 #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, !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, !25, i64 148}
!12 = !{!"_ZTSN10SimTKIpopt16AdaptiveMuUpdateE", !13, i64 0, !21, i64 56, !21, i64 64, !21, i64 72, !10, i64 80, !21, i64 88, !21, i64 96, !21, i64 104, !21, i64 112, !21, i64 120, !21, i64 128, !22, i64 136, !23, i64 140, !24, i64 144, !25, i64 148, !21, i64 152, !21, i64 160, !21, i64 168, !26, i64 176, !27, i64 184, !27, i64 192, !21, i64 200, !21, i64 208, !16, i64 216, !28, i64 224, !21, i64 248, !34, i64 256, !10, i64 288, !10, i64 289, !10, i64 290, !38, i64 296}
!13 = !{!"_ZTSN10SimTKIpopt8MuUpdateE", !14, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !15, i64 0, !17, i64 16, !18, i64 24, !19, i64 32, !20, i64 40, !10, 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 = !{!"double", !7, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt23QualityFunctionMuOracle8NormEnumE", !7, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt23QualityFunctionMuOracle14CentralityEnumE", !7, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt23QualityFunctionMuOracle17BalancingTermEnumE", !7, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt16AdaptiveMuUpdate27AdaptiveMuGlobalizationEnumE", !7, i64 0}
!26 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_10LineSearchEEE", !6, i64 0}
!27 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8MuOracleEEE", !6, i64 0}
!28 = !{!"_ZTSNSt7__cxx114listIdSaIdEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIdSaIdEEE", !30, i64 0}
!30 = !{!"_ZTSNSt7__cxx1110_List_baseIdSaIdEE10_List_implE", !31, i64 0}
!31 = !{!"_ZTSNSt8__detail17_List_node_headerE", !32, i64 0, !33, i64 16}
!32 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!33 = !{!"long", !7, i64 0}
!34 = !{!"_ZTSN10SimTKIpopt6FilterE", !16, i64 0, !35, i64 8}
!35 = !{!"_ZTSNSt7__cxx114listIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !36, i64 0}
!36 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !37, i64 0}
!37 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EE10_List_implE", !31, i64 0}
!38 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEEE", !6, i64 0}
!39 = !{!16, !16, i64 0}
!40 = !{!12, !16, i64 216}
!41 = !{!21, !21, i64 0}
!42 = !{i64 0, i64 8, !5}
!43 = !{!12, !21, i64 248}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}
!46 = !{!12, !21, i64 160}
!47 = !{!12, !21, i64 152}
!48 = !{i8 0, i8 2}
!49 = !{}


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

%"struct.std::_List_iterator" = type { ptr }

; 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 noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10SimTKIpopt3MinEdd(double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt16AdaptiveMuUpdate23CheckSufficientProgressEv(ptr noundef nonnull align 8 dereferenceable(304) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.std::_List_iterator", align 8
  %3 = alloca %"struct.std::_List_iterator", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 148
  %5 = load i32, ptr %4, align 4, !tbaa !5
  switch i32 %5, label %44 [
    i32 0, label %6
    i32 1, label %27
  ]

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 224
  %8 = tail call noundef i64 @_ZNKSt7__cxx114listIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %9 = trunc i64 %8 to i32
  %10 = getelementptr inbounds i8, ptr %0, i64 216
  %11 = load i32, ptr %10, align 8, !tbaa !37
  %.not = icmp sgt i32 %11, %9
  br i1 %.not, label %44, label %12

12:                                               ; preds = %6
  %13 = tail call noundef double @_ZN10SimTKIpopt16AdaptiveMuUpdate26quality_function_pd_systemEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @_ZNSt14_List_iteratorIdEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %14 = call ptr @_ZNSt7__cxx114listIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %14, ptr %2, align 8, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %15 = call ptr @_ZNSt7__cxx114listIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %15, ptr %3, align 8
  %16 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIdES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 248
  br label %18

18:                                               ; preds = %.lr.ph, %18
  %.06 = phi i1 [ false, %.lr.ph ], [ %.1, %18 ]
  %19 = load double, ptr %17, align 8, !tbaa !39
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIdEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %21 = load double, ptr %20, align 8, !tbaa !40
  %22 = fmul double %19, %21
  %23 = fcmp ole double %13, %22
  %.1 = select i1 %23, i1 true, i1 %.06
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIdEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %25 = call ptr @_ZNSt7__cxx114listIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %25, ptr %3, align 8
  %26 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIdES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br i1 %26, label %18, label %._crit_edge, !llvm.loop !41

._crit_edge:                                      ; preds = %18, %12
  %.0.lcssa = phi i1 [ false, %12 ], [ %.1, %18 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %44

27:                                               ; preds = %1
  %28 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %29 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities14curr_nlp_errorEv(ptr noundef nonnull align 8 dereferenceable(2025) %28)
  %30 = getelementptr inbounds i8, ptr %0, i64 160
  %31 = load double, ptr %30, align 8, !tbaa !43
  %32 = getelementptr inbounds i8, ptr %0, i64 152
  %33 = load double, ptr %32, align 8, !tbaa !44
  %34 = tail call noundef double @_ZN10SimTKIpopt3MinEdd(double noundef %33, double noundef %29)
  %35 = fmul double %31, %34
  %36 = getelementptr inbounds i8, ptr %0, i64 256
  %37 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %38 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities6curr_fEv(ptr noundef nonnull align 8 dereferenceable(2025) %37)
  %39 = fadd double %35, %38
  %40 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %41 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities25curr_constraint_violationEv(ptr noundef nonnull align 8 dereferenceable(2025) %40)
  %42 = fadd double %35, %41
  %43 = tail call noundef zeroext i1 @_ZNK10SimTKIpopt6Filter10AcceptableEdd(ptr noundef nonnull align 8 dereferenceable(32) %36, double noundef %39, double noundef %42)
  br label %44

44:                                               ; preds = %6, %._crit_edge, %1, %27
  %.3 = phi i1 [ %43, %27 ], [ %.0.lcssa, %._crit_edge ], [ true, %6 ], [ true, %1 ]
  ret i1 %.3
}

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities14curr_nlp_errorEv(ptr noundef nonnull align 8 dereferenceable(2025)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt7__cxx114listIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN10SimTKIpopt16AdaptiveMuUpdate26quality_function_pd_systemEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt14_List_iteratorIdES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt7__cxx114listIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10SimTKIpopt6Filter10AcceptableEdd(ptr noundef nonnull align 8 dereferenceable(32), double noundef, double noundef) local_unnamed_addr #1 align 2

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities6curr_fEv(ptr noundef nonnull align 8 dereferenceable(2025)) local_unnamed_addr #3

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

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 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 #3 = { "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 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 #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, !23, i64 148}
!6 = !{!"_ZTSN10SimTKIpopt16AdaptiveMuUpdateE", !7, i64 0, !19, i64 56, !19, i64 64, !19, i64 72, !18, i64 80, !19, i64 88, !19, i64 96, !19, i64 104, !19, i64 112, !19, i64 120, !19, i64 128, !20, i64 136, !21, i64 140, !22, i64 144, !23, i64 148, !19, i64 152, !19, i64 160, !19, i64 168, !24, i64 176, !25, i64 184, !25, i64 192, !19, i64 200, !19, i64 208, !10, i64 216, !26, i64 224, !19, i64 248, !32, i64 256, !18, i64 288, !18, i64 289, !18, i64 290, !36, i64 296}
!7 = !{!"_ZTSN10SimTKIpopt8MuUpdateE", !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 = !{!"_ZTSN10SimTKIpopt23QualityFunctionMuOracle8NormEnumE", !11, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt23QualityFunctionMuOracle14CentralityEnumE", !11, i64 0}
!22 = !{!"_ZTSN10SimTKIpopt23QualityFunctionMuOracle17BalancingTermEnumE", !11, i64 0}
!23 = !{!"_ZTSN10SimTKIpopt16AdaptiveMuUpdate27AdaptiveMuGlobalizationEnumE", !11, i64 0}
!24 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_10LineSearchEEE", !14, i64 0}
!25 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8MuOracleEEE", !14, i64 0}
!26 = !{!"_ZTSNSt7__cxx114listIdSaIdEEE", !27, i64 0}
!27 = !{!"_ZTSNSt7__cxx1110_List_baseIdSaIdEEE", !28, i64 0}
!28 = !{!"_ZTSNSt7__cxx1110_List_baseIdSaIdEE10_List_implE", !29, i64 0}
!29 = !{!"_ZTSNSt8__detail17_List_node_headerE", !30, i64 0, !31, i64 16}
!30 = !{!"_ZTSNSt8__detail15_List_node_baseE", !14, i64 0, !14, i64 8}
!31 = !{!"long", !11, i64 0}
!32 = !{!"_ZTSN10SimTKIpopt6FilterE", !10, i64 0, !33, i64 8}
!33 = !{!"_ZTSNSt7__cxx114listIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseIPN10SimTKIpopt11FilterEntryESaIS3_EE10_List_implE", !29, i64 0}
!36 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEEE", !14, i64 0}
!37 = !{!6, !10, i64 216}
!38 = !{!14, !14, i64 0}
!39 = !{!6, !19, i64 248}
!40 = !{!19, !19, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!6, !19, i64 160}
!44 = !{!6, !19, i64 152}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass