; LLVM IR from PetarV-/Algorithms :: Data Structures/Pairing Heap.ll (ZN5PHeap10extractMinEv)

; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl" }
%"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl" = type { %"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%struct.PNode = type { i32, ptr, ptr, ptr }
%class.PHeap = type { ptr }

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5PHeap10extractMinEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::queue", align 8
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %18 = call noundef ptr @_ZN5PHeap5firstEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
  store ptr %18, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.PNode, ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %21, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %27

24:                                               ; preds = %1
  %25 = getelementptr inbounds %class.PHeap, ptr %17, i32 0, i32 0
  store ptr null, ptr %25, align 8, !tbaa !12
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %26, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %125

27:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #6
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #6
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %28 unwind label %42

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %40, %28
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %55

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.PNode, ptr %33, i32 0, i32 2
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  store ptr %35, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %36 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #7
          to label %37 unwind label %46

37:                                               ; preds = %32
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN5PHeapC1EP5PNode(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef %38)
          to label %39 unwind label %50

39:                                               ; preds = %37
  store ptr %36, ptr %12, align 8, !tbaa !5
  invoke void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %40 unwind label %46

40:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %41, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %29, !llvm.loop !15

42:                                               ; preds = %27
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %9, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %10, align 4
  br label %124

46:                                               ; preds = %39, %32
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %9, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %10, align 4
  br label %54

50:                                               ; preds = %37
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %9, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %36, i64 noundef 8) #8
  br label %54

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %123

55:                                               ; preds = %29
  br label %56

56:                                               ; preds = %87, %55
  %57 = invoke noundef zeroext i1 @_ZNKSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %58 unwind label %74

58:                                               ; preds = %56
  %59 = xor i1 %57, true
  br i1 %59, label %60, label %89

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %62 unwind label %78

62:                                               ; preds = %60
  %63 = load ptr, ptr %61, align 8, !tbaa !5
  store ptr %63, ptr %13, align 8, !tbaa !5
  invoke void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %64 unwind label %78

64:                                               ; preds = %62
  %65 = invoke noundef zeroext i1 @_ZNKSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %66 unwind label %78

66:                                               ; preds = %64
  br i1 %65, label %86, label %67

67:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %69 unwind label %82

69:                                               ; preds = %67
  %70 = load ptr, ptr %68, align 8, !tbaa !5
  store ptr %70, ptr %14, align 8, !tbaa !5
  invoke void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %71 unwind label %82

71:                                               ; preds = %69
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN5PHeap5mergeEPS_(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef %73)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %86

74:                                               ; preds = %115, %90, %56
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %9, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %10, align 4
  br label %123

78:                                               ; preds = %86, %64, %62, %60
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %9, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %10, align 4
  br label %88

82:                                               ; preds = %69, %67
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %9, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %88

86:                                               ; preds = %71, %66
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %87 unwind label %78

87:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %56, !llvm.loop !17

88:                                               ; preds = %82, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %123

89:                                               ; preds = %58
  br label %90

90:                                               ; preds = %105, %89
  %91 = invoke noundef i64 @_ZNKSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %92 unwind label %74

92:                                               ; preds = %90
  %93 = icmp ugt i64 %91, 1
  br i1 %93, label %94, label %115

94:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %96 unwind label %106

96:                                               ; preds = %94
  %97 = load ptr, ptr %95, align 8, !tbaa !5
  store ptr %97, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %98 unwind label %106

98:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %99 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %100 unwind label %110

100:                                              ; preds = %98
  %101 = load ptr, ptr %99, align 8, !tbaa !5
  store ptr %101, ptr %16, align 8, !tbaa !5
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %102 unwind label %110

102:                                              ; preds = %100
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_ZN5PHeap5mergeEPS_(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef %104)
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %105 unwind label %110

105:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %90, !llvm.loop !18

106:                                              ; preds = %96, %94
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %9, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %10, align 4
  br label %114

110:                                              ; preds = %102, %100, %98
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %9, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %114

114:                                              ; preds = %110, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %123

115:                                              ; preds = %92
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %117 unwind label %74

117:                                              ; preds = %115
  %118 = load ptr, ptr %116, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.PHeap, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !12
  %121 = getelementptr inbounds %class.PHeap, ptr %17, i32 0, i32 0
  store ptr %120, ptr %121, align 8, !tbaa !12
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %122, ptr %2, align 8
  store i32 1, ptr %6, align 4
  call void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #6
  br label %125

123:                                              ; preds = %114, %88, %74, %54
  call void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  br label %124

124:                                              ; preds = %123, %42
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %127

125:                                              ; preds = %117, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %126 = load ptr, ptr %2, align 8
  ret ptr %126

127:                                              ; preds = %124
  %128 = load ptr, ptr %9, align 8
  %129 = load i32, ptr %10, align 4
  %130 = insertvalue { ptr, i32 } poison, ptr %128, 0
  %131 = insertvalue { ptr, i32 } %130, i32 %129, 1
  resume { ptr, i32 } %131
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

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

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

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

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

declare void @_ZN5PHeapC1EP5PNode(ptr, ptr)

attributes #0 = { 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 #1 = { nobuiltin allocsize(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 = { nobuiltin 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 24}
!10 = !{!"_ZTS5PNode", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS5PHeap", !6, i64 0}
!14 = !{!10, !6, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !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"

%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl" }
%"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl" = type { %"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<PHeap *, std::allocator<PHeap *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5PHeap10extractMinEv(ptr noundef nonnull align 8 dereferenceable(8) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca %"class.std::stack", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = tail call noundef ptr @_ZN5PHeap5firstEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
  %8 = getelementptr inbounds i8, ptr %7, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %1
  store ptr null, ptr %0, align 8, !tbaa !11
  br label %56

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #6
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %.preheader22 unwind label %20

.preheader21:                                     ; preds = %19
  %13 = call noundef zeroext i1 @_ZNKSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %13, label %.preheader, label %.lr.ph

.preheader22:                                     ; preds = %12, %19
  %.01323 = phi ptr [ %15, %19 ], [ %9, %12 ]
  %14 = getelementptr inbounds i8, ptr %.01323, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %16 = invoke noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #7
          to label %17 unwind label %22

17:                                               ; preds = %.preheader22
  invoke void @_ZN5PHeapC1EP5PNode(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull %.01323)
          to label %18 unwind label %24

18:                                               ; preds = %17
  store ptr %16, ptr %4, align 8, !tbaa !14
  invoke void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %19 unwind label %22

19:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %.preheader21, label %.preheader22, !llvm.loop !15

20:                                               ; preds = %12
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %55

22:                                               ; preds = %18, %.preheader22
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %26

24:                                               ; preds = %17
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %16, i64 noundef 8) #8
  br label %26

26:                                               ; preds = %24, %22
  %.pn = phi { ptr, i32 } [ %23, %22 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %54

.preheader:                                       ; preds = %39, %.preheader21
  %27 = call noundef i64 @_ZNKSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %28 = icmp ugt i64 %27, 1
  br i1 %28, label %.lr.ph24, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader21, %39
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %30 = load ptr, ptr %29, align 8, !tbaa !14
  store ptr %30, ptr %5, align 8, !tbaa !14
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %31 = call noundef zeroext i1 @_ZNKSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %31, label %38, label %32

32:                                               ; preds = %.lr.ph
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %35 = load ptr, ptr %5, align 8, !tbaa !14
  call void @_ZN5PHeap5mergeEPS_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef %34)
  br label %38

36:                                               ; preds = %38
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %54

38:                                               ; preds = %32, %.lr.ph
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %39 unwind label %36

39:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %40 = call noundef zeroext i1 @_ZNKSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %40, label %.preheader, label %.lr.ph, !llvm.loop !17

.lr.ph24:                                         ; preds = %.preheader, %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  store ptr %42, ptr %6, align 8, !tbaa !14
  call void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %44 = load ptr, ptr %43, align 8, !tbaa !14
  call void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %45 = load ptr, ptr %6, align 8, !tbaa !14
  call void @_ZN5PHeap5mergeEPS_(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef %44)
  invoke void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %46 unwind label %49

46:                                               ; preds = %.lr.ph24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %47 = call noundef i64 @_ZNKSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %48 = icmp ugt i64 %47, 1
  br i1 %48, label %.lr.ph24, label %._crit_edge, !llvm.loop !18

49:                                               ; preds = %.lr.ph24
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %54

._crit_edge:                                      ; preds = %46, %.preheader
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  store ptr %53, ptr %0, align 8, !tbaa !11
  call void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  br label %56

54:                                               ; preds = %49, %36, %26
  %.pn.pn = phi { ptr, i32 } [ %.pn, %26 ], [ %37, %36 ], [ %50, %49 ]
  call void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  br label %55

55:                                               ; preds = %54, %20
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %54 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  call void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn.pn.pn

56:                                               ; preds = %._crit_edge, %11
  ret ptr %7
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIP5PHeapSt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIP5PHeapSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

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

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

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

declare void @_ZN5PHeapC1EP5PNode(ptr, ptr) local_unnamed_addr

attributes #0 = { 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 #1 = { nobuiltin allocsize(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 = { nobuiltin 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !10, i64 24}
!6 = !{!"_ZTS5PNode", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS5PHeap", !10, i64 0}
!13 = !{!6, !10, i64 16}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


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