; LLVM IR from ERGO-Code/HiGHS :: src/mip/HighsNodeQueue.ll (ZN14HighsNodeQueue6unlinkEl)

; 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.HighsNodeQueue = type <{ %"class.std::unique_ptr", %"class.std::vector", %"class.std::priority_queue", %"class.std::unique_ptr.14", %"class.std::unique_ptr.14", i64, i64, i64, i64, i64, i64, i64, double, i32, [4 x i8] }>
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HighsNodeQueue::OpenNode, std::allocator<HighsNodeQueue::OpenNode>>::_Vector_impl" }
%"struct.std::_Vector_base<HighsNodeQueue::OpenNode, std::allocator<HighsNodeQueue::OpenNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<HighsNodeQueue::OpenNode, std::allocator<HighsNodeQueue::OpenNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HighsNodeQueue::OpenNode, std::allocator<HighsNodeQueue::OpenNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector.9", [8 x i8] }>
%"class.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unique_ptr.14" = type { %"struct.std::__uniq_ptr_data.15" }
%"struct.std::__uniq_ptr_data.15" = type { %"class.std::__uniq_ptr_impl.16" }
%"class.std::__uniq_ptr_impl.16" = type { %"class.std::tuple.17" }
%"class.std::tuple.17" = type { %"struct.std::_Tuple_impl.18" }
%"struct.std::_Tuple_impl.18" = type { %"struct.std::_Head_base.21" }
%"struct.std::_Head_base.21" = type { ptr }
%"struct.HighsNodeQueue::OpenNode" = type { %"class.std::vector.22", %"class.std::vector.27", %"class.std::vector.32", double, double, i32, %"struct.highs::RbTreeLinks", %"struct.highs::RbTreeLinks" }
%"class.std::vector.22" = type { %"struct.std::_Vector_base.23" }
%"struct.std::_Vector_base.23" = type { %"struct.std::_Vector_base<HighsDomainChange, std::allocator<HighsDomainChange>>::_Vector_impl" }
%"struct.std::_Vector_base<HighsDomainChange, std::allocator<HighsDomainChange>>::_Vector_impl" = type { %"struct.std::_Vector_base<HighsDomainChange, std::allocator<HighsDomainChange>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HighsDomainChange, std::allocator<HighsDomainChange>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.27" = type { %"struct.std::_Vector_base.28" }
%"struct.std::_Vector_base.28" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.32" = type { %"struct.std::_Vector_base.33" }
%"struct.std::_Vector_base.33" = type { %"struct.std::_Vector_base<std::_Rb_tree_const_iterator<std::pair<double, long>>, std::allocator<std::_Rb_tree_const_iterator<std::pair<double, long>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::_Rb_tree_const_iterator<std::pair<double, long>>, std::allocator<std::_Rb_tree_const_iterator<std::pair<double, long>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::_Rb_tree_const_iterator<std::pair<double, long>>, std::allocator<std::_Rb_tree_const_iterator<std::pair<double, long>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::_Rb_tree_const_iterator<std::pair<double, long>>, std::allocator<std::_Rb_tree_const_iterator<std::pair<double, long>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.highs::RbTreeLinks" = type { [2 x i64], i64 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue12unlink_estimEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue12unlink_lowerEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue17unlink_suboptimalEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN14HighsNodeQueue8OpenNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue14unlink_domchgsEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14HighsNodeQueue6unlinkEl(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %5 = load ptr, ptr %3, align 8
  %6 = getelementptr inbounds %class.HighsNodeQueue, ptr %5, i32 0, i32 1
  %7 = load i64, ptr %4, align 8, !tbaa !9
  %8 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN14HighsNodeQueue8OpenNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %7) #2
  %9 = getelementptr inbounds %"struct.HighsNodeQueue::OpenNode", ptr %8, i32 0, i32 4
  %10 = load double, ptr %9, align 8, !tbaa !11
  %11 = fcmp oeq double %10, 0x7FF0000000000000
  br i1 %11, label %12, label %14

12:                                               ; preds = %2
  %13 = load i64, ptr %4, align 8, !tbaa !9
  call void @_ZN14HighsNodeQueue17unlink_suboptimalEl(ptr noundef nonnull align 8 dereferenceable(148) %5, i64 noundef %13)
  br label %17

14:                                               ; preds = %2
  %15 = load i64, ptr %4, align 8, !tbaa !9
  call void @_ZN14HighsNodeQueue12unlink_estimEl(ptr noundef nonnull align 8 dereferenceable(148) %5, i64 noundef %15)
  %16 = load i64, ptr %4, align 8, !tbaa !9
  call void @_ZN14HighsNodeQueue12unlink_lowerEl(ptr noundef nonnull align 8 dereferenceable(148) %5, i64 noundef %16)
  br label %17

17:                                               ; preds = %14, %12
  %18 = load i64, ptr %4, align 8, !tbaa !9
  call void @_ZN14HighsNodeQueue14unlink_domchgsEl(ptr noundef nonnull align 8 dereferenceable(148) %5, i64 noundef %18)
  %19 = getelementptr inbounds %class.HighsNodeQueue, ptr %5, i32 0, i32 2
  call void @_ZNSt14priority_queueIlSt6vectorIlSaIlEESt7greaterIlEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(25) %19, ptr noundef nonnull align 8 dereferenceable(8) %4)
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIlSt6vectorIlSaIlEESt7greaterIlEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !25, i64 80}
!12 = !{!"_ZTSN14HighsNodeQueue8OpenNodeE", !13, i64 0, !17, i64 24, !21, i64 48, !25, i64 72, !25, i64 80, !26, i64 88, !27, i64 96, !27, i64 120}
!13 = !{!"_ZTSSt6vectorI17HighsDomainChangeSaIS0_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseI17HighsDomainChangeSaIS0_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseI17HighsDomainChangeSaIS0_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseI17HighsDomainChangeSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSSt6vectorIiSaIiEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"double", !7, i64 0}
!26 = !{!"int", !7, i64 0}
!27 = !{!"_ZTSN5highs11RbTreeLinksIlEE", !7, i64 0, !10, i64 16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue12unlink_estimEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue12unlink_lowerEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue17unlink_suboptimalEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN14HighsNodeQueue8OpenNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14HighsNodeQueue14unlink_domchgsEl(ptr noundef nonnull align 8 dereferenceable(148), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14HighsNodeQueue6unlinkEl(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 noundef %1) local_unnamed_addr #0 align 2 {
  %3 = alloca i64, align 8
  store i64 %1, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = tail call noundef nonnull align 8 dereferenceable(144) ptr @_ZNSt6vectorIN14HighsNodeQueue8OpenNodeESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %1) #2
  %6 = getelementptr inbounds i8, ptr %5, i64 80
  %7 = load double, ptr %6, align 8, !tbaa !9
  %8 = fcmp oeq double %7, 0x7FF0000000000000
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  tail call void @_ZN14HighsNodeQueue17unlink_suboptimalEl(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 noundef %1)
  br label %11

10:                                               ; preds = %2
  tail call void @_ZN14HighsNodeQueue12unlink_estimEl(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 noundef %1)
  tail call void @_ZN14HighsNodeQueue12unlink_lowerEl(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 noundef %1)
  br label %11

11:                                               ; preds = %10, %9
  tail call void @_ZN14HighsNodeQueue14unlink_domchgsEl(ptr noundef nonnull align 8 dereferenceable(148) %0, i64 noundef %1)
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  call void @_ZNSt14priority_queueIlSt6vectorIlSaIlEESt7greaterIlEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(25) %12, ptr noundef nonnull align 8 dereferenceable(8) %3)
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIlSt6vectorIlSaIlEESt7greaterIlEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !24, i64 80}
!10 = !{!"_ZTSN14HighsNodeQueue8OpenNodeE", !11, i64 0, !16, i64 24, !20, i64 48, !24, i64 72, !24, i64 80, !25, i64 88, !26, i64 96, !26, i64 120}
!11 = !{!"_ZTSSt6vectorI17HighsDomainChangeSaIS0_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseI17HighsDomainChangeSaIS0_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseI17HighsDomainChangeSaIS0_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseI17HighsDomainChangeSaIS0_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIiSaIiEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!20 = !{!"_ZTSSt6vectorISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt23_Rb_tree_const_iteratorISt4pairIdlEESaIS3_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!24 = !{!"double", !7, i64 0}
!25 = !{!"int", !7, i64 0}
!26 = !{!"_ZTSN5highs11RbTreeLinksIlEE", !7, i64 0, !6, i64 16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,SROAPass,TailCallElimPass