; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 06. Sorting/cartesian_tree_sorting.ll (Z16pQBasedTraversalP4Node)

; 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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, ptr }
%struct.Node = type { i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16pQBasedTraversalP4Node(ptr noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::priority_queue", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #6
  call void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EEC2IS6_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.Node, ptr %10, i32 0, i32 0
  %12 = invoke { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %13 unwind label %52

13:                                               ; preds = %1
  %14 = getelementptr inbounds { i32, ptr }, ptr %4, i32 0, i32 0
  %15 = extractvalue { i32, ptr } %12, 0
  store i32 %15, ptr %14, align 8
  %16 = getelementptr inbounds { i32, ptr }, ptr %4, i32 0, i32 1
  %17 = extractvalue { i32, ptr } %12, 1
  store ptr %17, ptr %16, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE4pushEOS3_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %18 unwind label %52

18:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  br label %19

19:                                               ; preds = %94, %18
  %20 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %21 unwind label %56

21:                                               ; preds = %19
  %22 = xor i1 %20, true
  br i1 %22, label %23, label %96

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %25 unwind label %60

25:                                               ; preds = %23
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %24, i64 16, i1 false)
  %26 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %27)
          to label %29 unwind label %60

29:                                               ; preds = %25
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %30 unwind label %60

30:                                               ; preds = %29
  %31 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  %33 = getelementptr inbounds %struct.Node, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %68

36:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  %37 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  %39 = getelementptr inbounds %struct.Node, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds %struct.Node, ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !12
  %44 = getelementptr inbounds %struct.Node, ptr %43, i32 0, i32 1
  %45 = invoke { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 8 dereferenceable(8) %44)
          to label %46 unwind label %64

46:                                               ; preds = %36
  %47 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 0
  %48 = extractvalue { i32, ptr } %45, 0
  store i32 %48, ptr %47, align 8
  %49 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 1
  %50 = extractvalue { i32, ptr } %45, 1
  store ptr %50, ptr %49, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE4pushEOS3_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %51 unwind label %64

51:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  br label %68

52:                                               ; preds = %13, %1
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %5, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  br label %97

56:                                               ; preds = %19
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %5, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %6, align 4
  br label %97

60:                                               ; preds = %29, %25, %23
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %5, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %6, align 4
  br label %95

64:                                               ; preds = %46, %36
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %5, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  br label %95

68:                                               ; preds = %51, %30
  %69 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !12
  %71 = getelementptr inbounds %struct.Node, ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !15
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %94

74:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %75 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !12
  %77 = getelementptr inbounds %struct.Node, ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !15
  %79 = getelementptr inbounds %struct.Node, ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !12
  %82 = getelementptr inbounds %struct.Node, ptr %81, i32 0, i32 2
  %83 = invoke { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef nonnull align 8 dereferenceable(8) %82)
          to label %84 unwind label %90

84:                                               ; preds = %74
  %85 = getelementptr inbounds { i32, ptr }, ptr %9, i32 0, i32 0
  %86 = extractvalue { i32, ptr } %83, 0
  store i32 %86, ptr %85, align 8
  %87 = getelementptr inbounds { i32, ptr }, ptr %9, i32 0, i32 1
  %88 = extractvalue { i32, ptr } %83, 1
  store ptr %88, ptr %87, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE4pushEOS3_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %89 unwind label %90

89:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %94

90:                                               ; preds = %84, %74
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %5, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %95

94:                                               ; preds = %89, %68
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %19, !llvm.loop !16

95:                                               ; preds = %90, %64, %60
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  br label %97

96:                                               ; preds = %21
  call void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  ret void

97:                                               ; preds = %95, %56, %52
  call void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %5, align 8
  %100 = load i32, ptr %6, align 4
  %101 = insertvalue { ptr, i32 } poison, ptr %99, 0
  %102 = insertvalue { ptr, i32 } %101, i32 %100, 1
  resume { ptr, i32 } %102
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) #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) #1

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

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

; 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) #3

declare i32 @printf(ptr noundef, ...) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #5 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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, !11, i64 0}
!10 = !{!"_ZTSSt4pairIiP4NodeE", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTS4Node", !11, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!14, !6, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; 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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, Node *>, std::allocator<std::pair<int, Node *>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16pQBasedTraversalP4Node(ptr noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::priority_queue", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EEC2IS6_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %7 = invoke { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %8 unwind label %28

8:                                                ; preds = %1
  %9 = extractvalue { i32, ptr } %7, 0
  store i32 %9, ptr %4, align 8
  %10 = getelementptr inbounds i8, ptr %4, i64 8
  %11 = extractvalue { i32, ptr } %7, 1
  store ptr %11, ptr %10, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE4pushEOS3_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %12 unwind label %28

12:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %13 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  br i1 %13, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %12
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  %15 = getelementptr inbounds i8, ptr %6, i64 8
  br label %16

16:                                               ; preds = %.lr.ph, %45
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  %.sroa.0.0.copyload = load i32, ptr %17, align 8
  %.sroa.51.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 8
  %.sroa.51.0.copyload = load ptr, ptr %.sroa.51.0..sroa_idx, align 8
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.sroa.0.0.copyload)
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %19 unwind label %30

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %.sroa.51.0.copyload, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %34, label %22

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %23 = invoke { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %24 unwind label %32

24:                                               ; preds = %22
  %25 = extractvalue { i32, ptr } %23, 0
  store i32 %25, ptr %5, align 8
  %26 = extractvalue { i32, ptr } %23, 1
  store ptr %26, ptr %14, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE4pushEOS3_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %27 unwind label %32

27:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %34

28:                                               ; preds = %8, %1
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %47

30:                                               ; preds = %16
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %47

32:                                               ; preds = %24, %22
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %47

34:                                               ; preds = %27, %19
  %35 = getelementptr inbounds i8, ptr %.sroa.51.0.copyload, i64 16
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  %.not9 = icmp eq ptr %36, null
  br i1 %.not9, label %45, label %37

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %38 = invoke { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %39 unwind label %43

39:                                               ; preds = %37
  %40 = extractvalue { i32, ptr } %38, 0
  store i32 %40, ptr %6, align 8
  %41 = extractvalue { i32, ptr } %38, 1
  store ptr %41, ptr %15, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE4pushEOS3_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %42 unwind label %43

42:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %45

43:                                               ; preds = %39, %37
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %47

45:                                               ; preds = %42, %34
  %46 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  br i1 %46, label %._crit_edge, label %16, !llvm.loop !13

._crit_edge:                                      ; preds = %45, %12
  call void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  ret void

47:                                               ; preds = %30, %32, %43, %28
  %.pn.pn = phi { ptr, i32 } [ %29, %28 ], [ %44, %43 ], [ %33, %32 ], [ %31, %30 ]
  call void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZSt9make_pairIRiRP4NodeESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS5_INS6_IT0_E4typeEE6__typeEEOS7_OSC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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) #1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiP4NodeESt6vectorIS3_SaIS3_EESt7greaterIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #4 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nofree nounwind "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, !6, i64 8}
!10 = !{!"_ZTS4Node", !11, i64 0, !6, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass