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

; 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::SmartPtr.31" = type { ptr }
%"class.SimTKIpopt::SmartPtr.23" = type { ptr }
%"class.SimTKIpopt::OptimalityErrorConvergenceCheck" = type <{ %"class.SimTKIpopt::ConvergenceCheck.base", [3 x i8], i32, double, double, double, i32, [4 x i8], double, double, double, double, double, i32, [4 x i8] }>
%"class.SimTKIpopt::ConvergenceCheck.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 }

; 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14IteratesVector1xEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8, ptr noundef nonnull align 8 dereferenceable(280)) #1 align 2

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

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

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

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

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities32unscaled_curr_dual_infeasibilityENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025), i32 noundef) #3

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities38unscaled_curr_nlp_constraint_violationENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025), i32 noundef) #3

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities29unscaled_curr_complementarityEdNS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025), double noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt9IpoptData4currEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.23") align 8, ptr noundef nonnull align 8 dereferenceable(864)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14IteratesVector3y_cEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8, ptr noundef nonnull align 8 dereferenceable(280)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt31OptimalityErrorConvergenceCheck19CurrentIsAcceptableEv(ptr noundef nonnull align 8 dereferenceable(132) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca %"class.SimTKIpopt::SmartPtr.31", align 8
  %8 = alloca %"class.SimTKIpopt::SmartPtr.23", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.SimTKIpopt::SmartPtr.31", align 8
  %12 = alloca %"class.SimTKIpopt::SmartPtr.23", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %14 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %13)
  %15 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities14curr_nlp_errorEv(ptr noundef nonnull align 8 dereferenceable(2025) %14)
  store double %15, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %16 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %13)
  %17 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities32unscaled_curr_dual_infeasibilityENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025) %16, i32 noundef 2)
  store double %17, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %18 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %13)
  %19 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities38unscaled_curr_nlp_constraint_violationENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025) %18, i32 noundef 2)
  store double %19, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %20 = call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %13)
  %21 = call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities29unscaled_curr_complementarityEdNS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025) %20, double noundef 0.000000e+00, i32 noundef 2)
  store double %21, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %22 = call noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %13)
  call void @_ZNK10SimTKIpopt9IpoptData4currEv(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.23") align 8 %8, ptr noundef nonnull align 8 dereferenceable(864) %22)
  %23 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %24 unwind label %44

24:                                               ; preds = %1
  invoke void @_ZNK10SimTKIpopt14IteratesVector1xEv(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8 %7, ptr noundef nonnull align 8 dereferenceable(280) %23)
          to label %25 unwind label %44

25:                                               ; preds = %24
  %26 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %27 unwind label %48

27:                                               ; preds = %25
  %28 = invoke noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %26)
          to label %29 unwind label %48

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %30 = invoke noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %13)
          to label %31 unwind label %52

31:                                               ; preds = %29
  invoke void @_ZNK10SimTKIpopt9IpoptData4currEv(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.23") align 8 %12, ptr noundef nonnull align 8 dereferenceable(864) %30)
          to label %32 unwind label %52

32:                                               ; preds = %31
  %33 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %34 unwind label %56

34:                                               ; preds = %32
  invoke void @_ZNK10SimTKIpopt14IteratesVector3y_cEv(ptr dead_on_unwind writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8 %11, ptr noundef nonnull align 8 dereferenceable(280) %33)
          to label %35 unwind label %56

35:                                               ; preds = %34
  %36 = invoke noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %37 unwind label %60

37:                                               ; preds = %35
  %38 = invoke noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %36)
          to label %39 unwind label %60

39:                                               ; preds = %37
  %40 = icmp eq i32 %28, %38
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br i1 %40, label %41, label %68

41:                                               ; preds = %39
  %42 = getelementptr inbounds %"class.SimTKIpopt::OptimalityErrorConvergenceCheck", ptr %13, i32 0, i32 9
  store double 1.000000e+300, ptr %42, align 8, !tbaa !11
  %43 = getelementptr inbounds %"class.SimTKIpopt::OptimalityErrorConvergenceCheck", ptr %13, i32 0, i32 11
  store double 1.000000e+300, ptr %43, align 8, !tbaa !22
  br label %68

44:                                               ; preds = %24, %1
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  br label %67

48:                                               ; preds = %27, %25
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %9, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %10, align 4
  br label %66

52:                                               ; preds = %31, %29
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %9, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %10, align 4
  br label %65

56:                                               ; preds = %34, %32
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %9, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %10, align 4
  br label %64

60:                                               ; preds = %37, %35
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %9, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %10, align 4
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br label %64

64:                                               ; preds = %60, %56
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br label %65

65:                                               ; preds = %64, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %66

66:                                               ; preds = %65, %48
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br label %67

67:                                               ; preds = %66, %44
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %90

68:                                               ; preds = %41, %39
  %69 = load double, ptr %3, align 8, !tbaa !9
  %70 = getelementptr inbounds %"class.SimTKIpopt::OptimalityErrorConvergenceCheck", ptr %13, i32 0, i32 8
  %71 = load double, ptr %70, align 8, !tbaa !23
  %72 = fcmp ole double %69, %71
  br i1 %72, label %73, label %88

73:                                               ; preds = %68
  %74 = load double, ptr %4, align 8, !tbaa !9
  %75 = getelementptr inbounds %"class.SimTKIpopt::OptimalityErrorConvergenceCheck", ptr %13, i32 0, i32 9
  %76 = load double, ptr %75, align 8, !tbaa !11
  %77 = fcmp ole double %74, %76
  br i1 %77, label %78, label %88

78:                                               ; preds = %73
  %79 = load double, ptr %5, align 8, !tbaa !9
  %80 = getelementptr inbounds %"class.SimTKIpopt::OptimalityErrorConvergenceCheck", ptr %13, i32 0, i32 10
  %81 = load double, ptr %80, align 8, !tbaa !24
  %82 = fcmp ole double %79, %81
  br i1 %82, label %83, label %88

83:                                               ; preds = %78
  %84 = load double, ptr %6, align 8, !tbaa !9
  %85 = getelementptr inbounds %"class.SimTKIpopt::OptimalityErrorConvergenceCheck", ptr %13, i32 0, i32 11
  %86 = load double, ptr %85, align 8, !tbaa !22
  %87 = fcmp ole double %84, %86
  br label %88

88:                                               ; preds = %83, %78, %73, %68
  %89 = phi i1 [ false, %78 ], [ false, %73 ], [ false, %68 ], [ %87, %83 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret i1 %89

90:                                               ; preds = %67
  %91 = load ptr, ptr %9, align 8
  %92 = load i32, ptr %10, align 4
  %93 = insertvalue { ptr, i32 } poison, ptr %91, 0
  %94 = insertvalue { ptr, i32 } %93, i32 %92, 1
  resume { ptr, i32 } %94
}

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 = { 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 = { 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 #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 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 96}
!12 = !{!"_ZTSN10SimTKIpopt31OptimalityErrorConvergenceCheckE", !13, i64 0, !16, i64 52, !10, i64 56, !10, i64 64, !10, i64 72, !16, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !16, i64 128}
!13 = !{!"_ZTSN10SimTKIpopt16ConvergenceCheckE", !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 = !{!12, !10, i64 112}
!23 = !{!12, !10, i64 88}
!24 = !{!12, !10, i64 104}


; 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.SimTKIpopt::SmartPtr.31" = type { ptr }
%"class.SimTKIpopt::SmartPtr.23" = type { ptr }

; 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14IteratesVector1xEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8, ptr noundef nonnull align 8 dereferenceable(280)) local_unnamed_addr #1 align 2

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

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

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

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

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities32unscaled_curr_dual_infeasibilityENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025), i32 noundef) local_unnamed_addr #3

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities38unscaled_curr_nlp_constraint_violationENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025), i32 noundef) local_unnamed_addr #3

declare noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities29unscaled_curr_complementarityEdNS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025), double noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt9IpoptData4currEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.23") align 8, ptr noundef nonnull align 8 dereferenceable(864)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK10SimTKIpopt14IteratesVector3y_cEv(ptr dead_on_unwind noalias writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8, ptr noundef nonnull align 8 dereferenceable(280)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10SimTKIpopt31OptimalityErrorConvergenceCheck19CurrentIsAcceptableEv(ptr noundef nonnull align 8 dereferenceable(132) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.SimTKIpopt::SmartPtr.31", align 8
  %3 = alloca %"class.SimTKIpopt::SmartPtr.23", align 8
  %4 = alloca %"class.SimTKIpopt::SmartPtr.31", align 8
  %5 = alloca %"class.SimTKIpopt::SmartPtr.23", align 8
  %6 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %7 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities14curr_nlp_errorEv(ptr noundef nonnull align 8 dereferenceable(2025) %6)
  %8 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %9 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities32unscaled_curr_dual_infeasibilityENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025) %8, i32 noundef 2)
  %10 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %11 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities38unscaled_curr_nlp_constraint_violationENS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025) %10, i32 noundef 2)
  %12 = tail call noundef nonnull align 8 dereferenceable(2025) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject4IpCqEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  %13 = tail call noundef double @_ZN10SimTKIpopt25IpoptCalculatedQuantities29unscaled_curr_complementarityEdNS_9ENormTypeE(ptr noundef nonnull align 8 dereferenceable(2025) %12, double noundef 0.000000e+00, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %14 = tail call noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
  call void @_ZNK10SimTKIpopt9IpoptData4currEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.23") align 8 %3, ptr noundef nonnull align 8 dereferenceable(864) %14)
  %15 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  invoke void @_ZNK10SimTKIpopt14IteratesVector1xEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8 %2, ptr noundef nonnull align 8 dereferenceable(280) %15)
          to label %16 unwind label %32

16:                                               ; preds = %1
  %17 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
  %18 = invoke noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %17)
          to label %19 unwind label %34

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %20 = invoke noundef nonnull align 8 dereferenceable(864) ptr @_ZNK10SimTKIpopt23AlgorithmStrategyObject6IpDataEv(ptr noundef nonnull align 8 dereferenceable(49) %0)
          to label %21 unwind label %36

21:                                               ; preds = %19
  invoke void @_ZNK10SimTKIpopt9IpoptData4currEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.23") align 8 %5, ptr noundef nonnull align 8 dereferenceable(864) %20)
          to label %22 unwind label %36

22:                                               ; preds = %21
  %23 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNK10SimTKIpopt14IteratesVector3y_cEv(ptr dead_on_unwind nonnull writable sret(%"class.SimTKIpopt::SmartPtr.31") align 8 %4, ptr noundef nonnull align 8 dereferenceable(280) %23)
          to label %24 unwind label %38

24:                                               ; preds = %22
  %25 = call noundef ptr @_ZNK10SimTKIpopt8SmartPtrIKNS_6VectorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %26 = invoke noundef i32 @_ZNK10SimTKIpopt6Vector3DimEv(ptr noundef nonnull align 8 dereferenceable(205) %25)
          to label %27 unwind label %40

27:                                               ; preds = %24
  %28 = icmp eq i32 %18, %26
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %29 = getelementptr inbounds i8, ptr %0, i64 96
  br i1 %28, label %30, label %._crit_edge

._crit_edge:                                      ; preds = %27
  %.pre = load double, ptr %29, align 8
  br label %46

30:                                               ; preds = %27
  store double 1.000000e+300, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 112
  store double 1.000000e+300, ptr %31, align 8, !tbaa !20
  br label %46

32:                                               ; preds = %1
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %45

34:                                               ; preds = %16
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %44

36:                                               ; preds = %21, %19
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %43

38:                                               ; preds = %22
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %24
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br label %43

43:                                               ; preds = %42, %36
  %.pn.pn = phi { ptr, i32 } [ %.pn, %42 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %44

44:                                               ; preds = %43, %34
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %43 ], [ %35, %34 ]
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_6VectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  br label %45

45:                                               ; preds = %44, %32
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %44 ], [ %33, %32 ]
  call void @_ZN10SimTKIpopt8SmartPtrIKNS_14IteratesVectorEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn.pn.pn.pn

46:                                               ; preds = %._crit_edge, %30
  %47 = phi double [ %.pre, %._crit_edge ], [ 1.000000e+300, %30 ]
  %48 = getelementptr inbounds i8, ptr %0, i64 88
  %49 = load double, ptr %48, align 8, !tbaa !21
  %50 = fcmp ugt double %7, %49
  %51 = fcmp ugt double %9, %47
  %or.cond = select i1 %50, i1 true, i1 %51
  %52 = getelementptr inbounds i8, ptr %0, i64 104
  %53 = load double, ptr %52, align 8
  %54 = fcmp ugt double %11, %53
  %or.cond18 = select i1 %or.cond, i1 true, i1 %54
  br i1 %or.cond18, label %59, label %55

55:                                               ; preds = %46
  %56 = getelementptr inbounds i8, ptr %0, i64 112
  %57 = load double, ptr %56, align 8, !tbaa !20
  %58 = fcmp ole double %13, %57
  br label %59

59:                                               ; preds = %55, %46
  %60 = phi i1 [ false, %46 ], [ %58, %55 ]
  ret i1 %60
}

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 = { 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 = { 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 #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, !19, i64 96}
!6 = !{!"_ZTSN10SimTKIpopt31OptimalityErrorConvergenceCheckE", !7, i64 0, !10, i64 52, !19, i64 56, !19, i64 64, !19, i64 72, !10, i64 80, !19, i64 88, !19, i64 96, !19, i64 104, !19, i64 112, !19, i64 120, !10, i64 128}
!7 = !{!"_ZTSN10SimTKIpopt16ConvergenceCheckE", !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 = !{!6, !19, i64 112}
!21 = !{!6, !19, i64 88}


; Effective O3 passes: BDCEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass