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

; 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.BinHeap = type { ptr, ptr }
%struct.BinNode = type { i32, i32, ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7BinHeap5mergeEPS_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %14 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #6
  invoke void @_ZN7BinHeapC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %15 unwind label %27

15:                                               ; preds = %2
  store ptr %14, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef ptr @_ZN7BinHeap10mergeRootsEPS_S0_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef %13, ptr noundef %16)
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %class.BinHeap, ptr %18, i32 0, i32 0
  store ptr %17, ptr %19, align 8, !tbaa !9
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.BinHeap, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %31

24:                                               ; preds = %15
  %25 = getelementptr inbounds %class.BinHeap, ptr %13, i32 0, i32 0
  store ptr null, ptr %25, align 8, !tbaa !9
  %26 = getelementptr inbounds %class.BinHeap, ptr %13, i32 0, i32 1
  store ptr null, ptr %26, align 8, !tbaa !11
  store i32 1, ptr %8, align 4
  br label %134

27:                                               ; preds = %2
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %6, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %14, i64 noundef 16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %137

31:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.BinHeap, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  store ptr %34, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.BinNode, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !12
  store ptr %37, ptr %11, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %99, %31
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %103

41:                                               ; preds = %38
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.BinNode, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !15
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.BinNode, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !15
  %48 = icmp ne i32 %44, %47
  br i1 %48, label %64, label %49

49:                                               ; preds = %41
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.BinNode, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !12
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %67

54:                                               ; preds = %49
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.BinNode, ptr %55, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !12
  %58 = getelementptr inbounds %struct.BinNode, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 4, !tbaa !15
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.BinNode, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !15
  %63 = icmp eq i32 %59, %62
  br i1 %63, label %64, label %67

64:                                               ; preds = %54, %41
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %65, ptr %9, align 8, !tbaa !5
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %66, ptr %10, align 8, !tbaa !5
  br label %99

67:                                               ; preds = %54, %49
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.BinNode, ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !16
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.BinNode, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !16
  %74 = icmp sle i32 %70, %73
  br i1 %74, label %75, label %83

75:                                               ; preds = %67
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.BinNode, ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !12
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.BinNode, ptr %79, i32 0, i32 2
  store ptr %78, ptr %80, align 8, !tbaa !12
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN7BinHeap9linkTreesEP7BinNodeS1_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef %81, ptr noundef %82)
  br label %98

83:                                               ; preds = %67
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = icmp eq ptr %84, null
  br i1 %85, label %86, label %90

86:                                               ; preds = %83
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %class.BinHeap, ptr %88, i32 0, i32 0
  store ptr %87, ptr %89, align 8, !tbaa !9
  br label %94

90:                                               ; preds = %83
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.BinNode, ptr %92, i32 0, i32 2
  store ptr %91, ptr %93, align 8, !tbaa !12
  br label %94

94:                                               ; preds = %90, %86
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN7BinHeap9linkTreesEP7BinNodeS1_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef %95, ptr noundef %96)
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %97, ptr %10, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %94, %75
  br label %99

99:                                               ; preds = %98, %64
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.BinNode, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !12
  store ptr %102, ptr %11, align 8, !tbaa !5
  br label %38, !llvm.loop !17

103:                                              ; preds = %38
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %class.BinHeap, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds %class.BinHeap, ptr %13, i32 0, i32 0
  store ptr %106, ptr %107, align 8, !tbaa !9
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %class.BinHeap, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  %111 = getelementptr inbounds %class.BinHeap, ptr %13, i32 0, i32 1
  store ptr %110, ptr %111, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %112 = getelementptr inbounds %class.BinHeap, ptr %13, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  store ptr %113, ptr %12, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %129, %103
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %133

117:                                              ; preds = %114
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.BinNode, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 8, !tbaa !16
  %121 = getelementptr inbounds %class.BinHeap, ptr %13, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  %123 = getelementptr inbounds %struct.BinNode, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %123, align 8, !tbaa !16
  %125 = icmp slt i32 %120, %124
  br i1 %125, label %126, label %129

126:                                              ; preds = %117
  %127 = load ptr, ptr %12, align 8, !tbaa !5
  %128 = getelementptr inbounds %class.BinHeap, ptr %13, i32 0, i32 1
  store ptr %127, ptr %128, align 8, !tbaa !11
  br label %129

129:                                              ; preds = %126, %117
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.BinNode, ptr %130, i32 0, i32 2
  %132 = load ptr, ptr %131, align 8, !tbaa !12
  store ptr %132, ptr %12, align 8, !tbaa !5
  br label %114, !llvm.loop !19

133:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  store i32 0, ptr %8, align 4
  br label %134

134:                                              ; preds = %133, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %135 = load i32, ptr %8, align 4
  switch i32 %135, label %142 [
    i32 0, label %136
    i32 1, label %136
  ]

136:                                              ; preds = %134, %134
  ret void

137:                                              ; preds = %27
  %138 = load ptr, ptr %6, align 8
  %139 = load i32, ptr %7, align 4
  %140 = insertvalue { ptr, i32 } poison, ptr %138, 0
  %141 = insertvalue { ptr, i32 } %140, i32 %139, 1
  resume { ptr, i32 } %141

142:                                              ; preds = %134
  unreachable
}

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN7BinHeap9linkTreesEP7BinNodeS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) #3 align 2

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

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

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

declare void @_ZN7BinHeapC1Ev(ptr)

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


; 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
define dso_local void @_ZN7BinHeap5mergeEPS_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #5
  invoke void @_ZN7BinHeapC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %4 unwind label %9

4:                                                ; preds = %2
  %5 = tail call noundef ptr @_ZN7BinHeap10mergeRootsEPS_S0_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %0, ptr noundef %1)
  store ptr %5, ptr %3, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %.preheader

.preheader:                                       ; preds = %4
  %.036.in47 = getelementptr inbounds i8, ptr %5, i64 8
  %.03648 = load ptr, ptr %.036.in47, align 8, !tbaa !10
  %.not49 = icmp eq ptr %.03648, null
  br i1 %.not49, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.preheader
  store ptr %5, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %5, ptr %7, align 8, !tbaa !13
  br label %.lr.ph57.preheader

8:                                                ; preds = %4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false)
  br label %.loopexit

9:                                                ; preds = %2
  %10 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 16) #6
  resume { ptr, i32 } %10

.lr.ph:                                           ; preds = %.preheader, %29
  %.03653 = phi ptr [ %.036, %29 ], [ %.03648, %.preheader ]
  %.036.in52 = phi ptr [ %.036.in, %29 ], [ %.036.in47, %.preheader ]
  %.03751 = phi ptr [ %.1, %29 ], [ %5, %.preheader ]
  %.03850 = phi ptr [ %.139, %29 ], [ null, %.preheader ]
  %11 = getelementptr inbounds i8, ptr %.03751, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %.03653, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !14
  %.not44 = icmp eq i32 %12, %14
  br i1 %.not44, label %15, label %29

15:                                               ; preds = %.lr.ph
  %16 = getelementptr inbounds i8, ptr %.03653, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !10
  %.not45 = icmp eq ptr %17, null
  br i1 %.not45, label %22, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %17, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !14
  %21 = icmp eq i32 %20, %12
  br i1 %21, label %29, label %22

22:                                               ; preds = %18, %15
  %23 = load i32, ptr %.03751, align 8, !tbaa !15
  %24 = load i32, ptr %.03653, align 8, !tbaa !15
  %.not46 = icmp sgt i32 %23, %24
  br i1 %.not46, label %26, label %25

25:                                               ; preds = %22
  store ptr %17, ptr %.036.in52, align 8, !tbaa !10
  tail call void @_ZN7BinHeap9linkTreesEP7BinNodeS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %.03653, ptr noundef nonnull %.03751)
  br label %29

26:                                               ; preds = %22
  %27 = icmp eq ptr %.03850, null
  %28 = getelementptr inbounds i8, ptr %.03850, i64 8
  %.sink = select i1 %27, ptr %3, ptr %28
  store ptr %.03653, ptr %.sink, align 8, !tbaa !16
  tail call void @_ZN7BinHeap9linkTreesEP7BinNodeS1_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull %.03751, ptr noundef nonnull %.03653)
  br label %29

29:                                               ; preds = %.lr.ph, %18, %25, %26
  %.139 = phi ptr [ %.03850, %25 ], [ %.03850, %26 ], [ %.03751, %18 ], [ %.03751, %.lr.ph ]
  %.1 = phi ptr [ %.03751, %25 ], [ %.03653, %26 ], [ %.03653, %18 ], [ %.03653, %.lr.ph ]
  %.036.in = getelementptr inbounds i8, ptr %.1, i64 8
  %.036 = load ptr, ptr %.036.in, align 8, !tbaa !10
  %.not = icmp eq ptr %.036, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %29
  %.pre = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %.pre, ptr %0, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %.pre, ptr %30, align 8, !tbaa !13
  %.not4354 = icmp eq ptr %.pre, null
  br i1 %.not4354, label %.loopexit, label %.lr.ph57.preheader

.lr.ph57.preheader:                               ; preds = %._crit_edge.thread, %._crit_edge
  %31 = phi ptr [ %7, %._crit_edge.thread ], [ %30, %._crit_edge ]
  %32 = phi ptr [ %5, %._crit_edge.thread ], [ %.pre, %._crit_edge ]
  br label %.lr.ph57

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %38
  %.055 = phi ptr [ %41, %38 ], [ %32, %.lr.ph57.preheader ]
  %33 = phi ptr [ %39, %38 ], [ %32, %.lr.ph57.preheader ]
  %34 = load i32, ptr %.055, align 8, !tbaa !15
  %35 = load i32, ptr %33, align 8, !tbaa !15
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %.lr.ph57
  store ptr %.055, ptr %31, align 8, !tbaa !13
  br label %38

38:                                               ; preds = %37, %.lr.ph57
  %39 = phi ptr [ %.055, %37 ], [ %33, %.lr.ph57 ]
  %40 = getelementptr inbounds i8, ptr %.055, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !10
  %.not43 = icmp eq ptr %41, null
  br i1 %.not43, label %.loopexit, label %.lr.ph57, !llvm.loop !19

.loopexit:                                        ; preds = %38, %._crit_edge, %8
  ret void
}

; 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 nounwind uwtable
declare dso_local void @_ZN7BinHeap9linkTreesEP7BinNodeS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) local_unnamed_addr #3 align 2

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

declare void @_ZN7BinHeapC1Ev(ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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


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