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

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.11" = type { i8 }
%"class.SimTKIpopt::PDPerturbationHandler" = type { %"class.SimTKIpopt::AlgorithmStrategyObject.base", double, double, double, double, double, double, double, double, i8, i32, i32, i32, i32, double, double, double, double, double, double, double, double, i8, i32 }
%"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 }

@.str.28 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt9IpoptData18Append_info_stringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt21PDPerturbationHandler28get_deltas_for_wrong_inertiaERdS1_S1_S1_(ptr noundef nonnull align 8 dereferenceable(216) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.11", align 1
  %14 = alloca ptr, align 8
  %15 = 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
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %16 = load ptr, ptr %7, align 8
  %17 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %18 = load double, ptr %17, align 8, !tbaa !9
  %19 = fcmp oeq double %18, 0.000000e+00
  br i1 %19, label %20, label %39

20:                                               ; preds = %5
  %21 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 1
  %22 = load double, ptr %21, align 8, !tbaa !22
  %23 = fcmp oeq double %22, 0.000000e+00
  br i1 %23, label %24, label %28

24:                                               ; preds = %20
  %25 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 19
  %26 = load double, ptr %25, align 8, !tbaa !23
  %27 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  store double %26, ptr %27, align 8, !tbaa !9
  br label %38

28:                                               ; preds = %20
  %29 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 15
  %30 = load double, ptr %29, align 8, !tbaa !24
  %31 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 1
  %32 = load double, ptr %31, align 8, !tbaa !22
  %33 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 18
  %34 = load double, ptr %33, align 8, !tbaa !25
  %35 = fmul double %32, %34
  %36 = call noundef double @_ZN10SimTKIpopt3MaxEdd(double noundef %30, double noundef %35)
  %37 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  store double %36, ptr %37, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %28, %24
  br label %65

39:                                               ; preds = %5
  %40 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 1
  %41 = load double, ptr %40, align 8, !tbaa !22
  %42 = fcmp oeq double %41, 0.000000e+00
  br i1 %42, label %50, label %43

43:                                               ; preds = %39
  %44 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 1
  %45 = load double, ptr %44, align 8, !tbaa !22
  %46 = fmul double 1.000000e+05, %45
  %47 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = fcmp olt double %46, %48
  br i1 %49, label %50, label %57

50:                                               ; preds = %43, %39
  %51 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 16
  %52 = load double, ptr %51, align 8, !tbaa !26
  %53 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %54 = load double, ptr %53, align 8, !tbaa !9
  %55 = fmul double %52, %54
  %56 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  store double %55, ptr %56, align 8, !tbaa !9
  br label %64

57:                                               ; preds = %43
  %58 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 17
  %59 = load double, ptr %58, align 8, !tbaa !27
  %60 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = fmul double %59, %61
  %63 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  store double %62, ptr %63, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %57, %50
  br label %65

65:                                               ; preds = %64, %38
  %66 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 14
  %69 = load double, ptr %68, align 8, !tbaa !28
  %70 = fcmp ogt double %67, %69
  br i1 %70, label %71, label %89

71:                                               ; preds = %65
  %72 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject5JnlstEv(ptr noundef nonnull align 8 dereferenceable(49) %16)
  %73 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %74 = load double, ptr %73, align 8, !tbaa !9
  call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %72, i32 noundef 5, i32 noundef 7, ptr noundef @.str.28, double noundef %74)
  %75 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 1
  store double 0.000000e+00, ptr %75, align 8, !tbaa !22
  %76 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 2
  store double 0.000000e+00, ptr %76, align 8, !tbaa !29
  %77 = call noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %16)
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.29, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %78 unwind label %80

78:                                               ; preds = %71
  invoke void @_ZN10SimTKIpopt9IpoptData18Append_info_stringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(864) %77, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %79 unwind label %84

79:                                               ; preds = %78
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  store i1 false, ptr %6, align 1
  br label %109

80:                                               ; preds = %71
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %14, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %15, align 4
  br label %88

84:                                               ; preds = %78
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %14, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %15, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  br label %88

88:                                               ; preds = %84, %80
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  br label %111

89:                                               ; preds = %65
  %90 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %91 = load double, ptr %90, align 8, !tbaa !9
  %92 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 6
  store double %91, ptr %92, align 8, !tbaa !30
  %93 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 5
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  store double %94, ptr %95, align 8, !tbaa !31
  %96 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 6
  %97 = load double, ptr %96, align 8, !tbaa !30
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  store double %97, ptr %98, align 8, !tbaa !31
  %99 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 7
  %100 = load double, ptr %99, align 8, !tbaa !32
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  store double %100, ptr %101, align 8, !tbaa !31
  %102 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 8
  %103 = load double, ptr %102, align 8, !tbaa !33
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  store double %103, ptr %104, align 8, !tbaa !31
  %105 = call noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %16)
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = load double, ptr %106, align 8, !tbaa !31
  call void @_ZN10SimTKIpopt9IpoptData15Set_info_regu_xEd(ptr noundef nonnull align 8 dereferenceable(864) %105, double noundef %107)
  %108 = getelementptr inbounds %"class.SimTKIpopt::PDPerturbationHandler", ptr %16, i32 0, i32 9
  store i8 1, ptr %108, align 8, !tbaa !34
  store i1 true, ptr %6, align 1
  br label %109

109:                                              ; preds = %89, %79
  %110 = load i1, ptr %6, align 1
  ret i1 %110

111:                                              ; preds = %88
  %112 = load ptr, ptr %14, align 8
  %113 = load i32, ptr %15, align 4
  %114 = insertvalue { ptr, i32 } poison, ptr %112, 0
  %115 = insertvalue { ptr, i32 } %114, i32 %113, 1
  resume { ptr, i32 } %115
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt9IpoptData15Set_info_regu_xEd(ptr noundef nonnull align 8 dereferenceable(864), double noundef) #1 align 2

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

declare void @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, ptr noundef, ...) #3

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = { 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 #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, !19, i64 88}
!10 = !{!"_ZTSN10SimTKIpopt21PDPerturbationHandlerE", !11, 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, !18, i64 120, !20, i64 124, !20, i64 128, !13, i64 132, !21, i64 136, !19, i64 144, !19, i64 152, !19, i64 160, !19, i64 168, !19, i64 176, !19, i64 184, !19, i64 192, !19, i64 200, !18, i64 208, !13, i64 212}
!11 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !12, i64 0, !14, i64 16, !15, i64 24, !16, i64 32, !17, i64 40, !18, i64 48}
!12 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !6, i64 0}
!15 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !6, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !6, i64 0}
!17 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !6, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt21PDPerturbationHandler9DegenTypeE", !7, i64 0}
!21 = !{!"_ZTSN10SimTKIpopt21PDPerturbationHandler11TrialStatusE", !7, i64 0}
!22 = !{!10, !19, i64 56}
!23 = !{!10, !19, i64 184}
!24 = !{!10, !19, i64 152}
!25 = !{!10, !19, i64 176}
!26 = !{!10, !19, i64 160}
!27 = !{!10, !19, i64 168}
!28 = !{!10, !19, i64 144}
!29 = !{!10, !19, i64 64}
!30 = !{!10, !19, i64 96}
!31 = !{!19, !19, i64 0}
!32 = !{!10, !19, i64 104}
!33 = !{!10, !19, i64 112}
!34 = !{!10, !18, i64 120}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.11" = type { i8 }

@.str.28 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10SimTKIpopt9IpoptData18Append_info_stringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(864), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt21PDPerturbationHandler28get_deltas_for_wrong_inertiaERdS1_S1_S1_(ptr noundef nonnull align 8 dereferenceable(216) %0, ptr nocapture noundef nonnull align 8 dereferenceable(8) %1, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %4) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.11", align 1
  %8 = getelementptr inbounds i8, ptr %0, i64 88
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = fcmp oeq double %9, 0.000000e+00
  %11 = getelementptr inbounds i8, ptr %0, i64 56
  %12 = load double, ptr %11, align 8, !tbaa !21
  %13 = fcmp oeq double %12, 0.000000e+00
  br i1 %10, label %14, label %25

14:                                               ; preds = %5
  br i1 %13, label %15, label %18

15:                                               ; preds = %14
  %16 = getelementptr inbounds i8, ptr %0, i64 184
  %17 = load double, ptr %16, align 8, !tbaa !22
  br label %36

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 152
  %20 = load double, ptr %19, align 8, !tbaa !23
  %21 = getelementptr inbounds i8, ptr %0, i64 176
  %22 = load double, ptr %21, align 8, !tbaa !24
  %23 = fmul double %12, %22
  %24 = tail call noundef double @_ZN10SimTKIpopt3MaxEdd(double noundef %20, double noundef %23)
  br label %36

25:                                               ; preds = %5
  %26 = fmul double %12, 1.000000e+05
  %27 = fcmp olt double %26, %9
  %or.cond = or i1 %13, %27
  br i1 %or.cond, label %28, label %32

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 160
  %30 = load double, ptr %29, align 8, !tbaa !25
  %31 = fmul double %9, %30
  br label %36

32:                                               ; preds = %25
  %33 = getelementptr inbounds i8, ptr %0, i64 168
  %34 = load double, ptr %33, align 8, !tbaa !26
  %35 = fmul double %9, %34
  br label %36

36:                                               ; preds = %28, %32, %15, %18
  %.sink = phi double [ %31, %28 ], [ %35, %32 ], [ %17, %15 ], [ %24, %18 ]
  store double %.sink, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 144
  %38 = load double, ptr %37, align 8, !tbaa !27
  %39 = fcmp ule double %.sink, %38
  br i1 %39, label %52, label %40

40:                                               ; preds = %36
  %41 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject5JnlstEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %42 = load double, ptr %8, align 8, !tbaa !5
  tail call void (ptr, i32, i32, ptr, ...) @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %41, i32 noundef 5, i32 noundef 7, ptr noundef nonnull @.str.28, double noundef %42)
  %43 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %43, i8 0, i64 16, i1 false)
  %44 = tail call noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.29, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %45 unwind label %47

45:                                               ; preds = %40
  invoke void @_ZN10SimTKIpopt9IpoptData18Append_info_stringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(864) %44, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %46 unwind label %49

46:                                               ; preds = %45
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %62

47:                                               ; preds = %40
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %51

49:                                               ; preds = %45
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br label %51

51:                                               ; preds = %49, %47
  %.pn = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  resume { ptr, i32 } %.pn

52:                                               ; preds = %36
  %53 = getelementptr inbounds i8, ptr %0, i64 96
  store double %.sink, ptr %53, align 8, !tbaa !28
  store double %.sink, ptr %1, align 8, !tbaa !29
  %54 = load double, ptr %53, align 8, !tbaa !28
  store double %54, ptr %2, align 8, !tbaa !29
  %55 = getelementptr inbounds i8, ptr %0, i64 104
  %56 = load double, ptr %55, align 8, !tbaa !30
  store double %56, ptr %3, align 8, !tbaa !29
  %57 = getelementptr inbounds i8, ptr %0, i64 112
  %58 = load double, ptr %57, align 8, !tbaa !31
  store double %58, ptr %4, align 8, !tbaa !29
  %59 = tail call noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %60 = load double, ptr %1, align 8, !tbaa !29
  tail call void @_ZN10SimTKIpopt9IpoptData15Set_info_regu_xEd(ptr noundef nonnull align 8 dereferenceable(864) %59, double noundef %60)
  %61 = getelementptr inbounds i8, ptr %0, i64 120
  store i8 1, ptr %61, align 8, !tbaa !32
  br label %62

62:                                               ; preds = %52, %46
  ret i1 %39
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10SimTKIpopt9IpoptData15Set_info_regu_xEd(ptr noundef nonnull align 8 dereferenceable(864), double noundef) local_unnamed_addr #1 align 2

; 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 #2 align 2

declare void @_ZNK10SimTKIpopt10Journalist6PrintfENS_13EJournalLevelENS_16EJournalCategoryEPKcz(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #3

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

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

; 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 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 #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 = { "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 = { 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 #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 88}
!6 = !{!"_ZTSN10SimTKIpopt21PDPerturbationHandlerE", !7, i64 0, !18, i64 56, !18, i64 64, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !18, i64 104, !18, i64 112, !17, i64 120, !19, i64 124, !19, i64 128, !9, i64 132, !20, i64 136, !18, i64 144, !18, i64 152, !18, i64 160, !18, i64 168, !18, i64 176, !18, i64 184, !18, i64 192, !18, i64 200, !17, i64 208, !9, i64 212}
!7 = !{!"_ZTSN10SimTKIpopt23AlgorithmStrategyObjectE", !8, i64 0, !12, i64 16, !14, i64 24, !15, i64 32, !16, i64 40, !17, i64 48}
!8 = !{!"_ZTSN10SimTKIpopt16ReferencedObjectE", !9, i64 8}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN10SimTKIpopt8SmartPtrIKNS_10JournalistEEE", !13, i64 0}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_8IpoptNLPEEE", !13, i64 0}
!15 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_9IpoptDataEEE", !13, i64 0}
!16 = !{!"_ZTSN10SimTKIpopt8SmartPtrINS_25IpoptCalculatedQuantitiesEEE", !13, i64 0}
!17 = !{!"bool", !10, i64 0}
!18 = !{!"double", !10, i64 0}
!19 = !{!"_ZTSN10SimTKIpopt21PDPerturbationHandler9DegenTypeE", !10, i64 0}
!20 = !{!"_ZTSN10SimTKIpopt21PDPerturbationHandler11TrialStatusE", !10, i64 0}
!21 = !{!6, !18, i64 56}
!22 = !{!6, !18, i64 184}
!23 = !{!6, !18, i64 152}
!24 = !{!6, !18, i64 176}
!25 = !{!6, !18, i64 160}
!26 = !{!6, !18, i64 168}
!27 = !{!6, !18, i64 144}
!28 = !{!6, !18, i64 96}
!29 = !{!18, !18, i64 0}
!30 = !{!6, !18, i64 104}
!31 = !{!6, !18, i64 112}
!32 = !{!6, !17, i64 120}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass