; LLVM IR from lzyrapx/Competitive-Programming :: 百度之星/百度之星2017-资格赛/02（pairing堆优化+SW）.ll (Z6searchv)

; 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.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.__gnu_pbds::priority_queue" = type { ptr, %"class.__gnu_pbds::detail::pairing_heap" }
%"class.__gnu_pbds::detail::pairing_heap" = type { %"class.__gnu_pbds::detail::left_child_next_sibling_heap" }
%"class.__gnu_pbds::detail::left_child_next_sibling_heap" = type { ptr, i64 }
%"struct.std::pair" = type { i32, i32 }

@id = external dso_local global [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], align 16
@n = external dso_local global i32, align 4
@combine = external dso_local global [3010 x i32], align 16
@cost = external dso_local global [3010 x [3010 x i32]], align 16
@done = external dso_local global [3010 x i32], align 16
@wet = external dso_local global [3010 x i32], align 16
@G = external dso_local global [3010 x %"class.std::vector"], align 16
@s = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@cut = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6searchv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.__gnu_pbds::priority_queue", align 8
  %2 = alloca i32, align 4
  %3 = alloca %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_", align 8
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_", align 8
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %1) #7
  call void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.memset.p0.i64(ptr align 16 @done, i8 0, i64 12040, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @wet, i8 0, i64 12040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %26, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %33

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  invoke void @_ZN10__gnu_pbds6detail55left_child_next_sibling_heap_node_point_const_iterator_INS0_34left_child_next_sibling_heap_node_ISt4pairIiiENS_9null_typeESaIcEEES6_EC2EPS7_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef null)
          to label %22 unwind label %29

22:                                               ; preds = %21
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], ptr @id, i64 0, i64 %24
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %3, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %26

26:                                               ; preds = %22
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !12

29:                                               ; preds = %21
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %4, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %170

33:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %58, %33
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %61

39:                                               ; preds = %34
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %57, label %45

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %46 = getelementptr inbounds i8, ptr %1, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  %47 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %48 unwind label %53

48:                                               ; preds = %45
  store i64 %47, ptr %8, align 4
  invoke void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE4pushERKS3_(ptr dead_on_unwind writable sret(%"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_") align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %49 unwind label %53

49:                                               ; preds = %48
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], ptr @id, i64 0, i64 %51
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %52, ptr align 8 %7, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %57

53:                                               ; preds = %48, %45
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %4, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %170

57:                                               ; preds = %49, %39
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %6, align 4, !tbaa !5
  br label %34, !llvm.loop !14

61:                                               ; preds = %38
  store i32 -1, ptr @t, align 4, !tbaa !5
  store i32 -1, ptr @s, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %167, %61
  %63 = getelementptr inbounds i8, ptr %1, i64 8
  %64 = invoke noundef zeroext i1 @_ZNK10__gnu_pbds6detail28left_child_next_sibling_heapISt4pairIiiESt4lessIS3_ENS_9null_typeESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %63)
          to label %65 unwind label %94

65:                                               ; preds = %62
  %66 = xor i1 %64, true
  br i1 %66, label %67, label %169

67:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %68 = getelementptr inbounds i8, ptr %1, i64 8
  %69 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3topEv(ptr noundef nonnull align 8 dereferenceable(16) %68)
          to label %70 unwind label %98

70:                                               ; preds = %67
  %71 = getelementptr inbounds %"struct.std::pair", ptr %69, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !15
  store i32 %72, ptr %10, align 4, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %1, i64 8
  %74 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNK10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3topEv(ptr noundef nonnull align 8 dereferenceable(16) %73)
          to label %75 unwind label %98

75:                                               ; preds = %70
  %76 = getelementptr inbounds %"struct.std::pair", ptr %74, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !17
  store i32 %77, ptr @cut, align 4, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %1, i64 8
  invoke void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %78)
          to label %79 unwind label %98

79:                                               ; preds = %75
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [3010 x i32], ptr @done, i64 0, i64 %81
  store i32 1, ptr %82, align 4, !tbaa !5
  %83 = load i32, ptr @t, align 4, !tbaa !5
  store i32 %83, ptr @s, align 4, !tbaa !5
  %84 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %84, ptr @t, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %163, %79
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %89
  %91 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %90) #7
  %92 = icmp ult i64 %87, %91
  br i1 %92, label %102, label %93

93:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %167

94:                                               ; preds = %62
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %4, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %5, align 4
  br label %170

98:                                               ; preds = %75, %70, %67
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %4, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %5, align 4
  br label %168

102:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %104
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %107) #7
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %12, align 4, !tbaa !5
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [3010 x i32], ptr @done, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %115, label %162

115:                                              ; preds = %102
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %162

121:                                              ; preds = %115
  %122 = getelementptr inbounds i8, ptr %1, i64 8
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], ptr @id, i64 0, i64 %124
  invoke void @_ZN10__gnu_pbds6detail55left_child_next_sibling_heap_node_point_const_iterator_INS0_34left_child_next_sibling_heap_node_ISt4pairIiiENS_9null_typeESaIcEEES6_EC2ERKS8_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %125)
          to label %126 unwind label %154

126:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [3010 x i32], ptr @wet, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %132
  %134 = load i32, ptr %12, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [3010 x i32], ptr %133, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %130, %137
  store i32 %138, ptr %15, align 4, !tbaa !5
  %139 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %140 unwind label %158

140:                                              ; preds = %126
  store i64 %139, ptr %14, align 4
  invoke void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE6modifyENS0_55left_child_next_sibling_heap_node_point_const_iterator_INS0_34left_child_next_sibling_heap_node_IS3_NS_9null_typeES6_EES6_EERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %122, ptr noundef %13, ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %141 unwind label %158

141:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %143
  %145 = load i32, ptr %12, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [3010 x i32], ptr %144, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [3010 x i32], ptr @wet, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = add nsw i32 %152, %148
  store i32 %153, ptr %151, align 4, !tbaa !5
  br label %162

154:                                              ; preds = %121
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %4, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %5, align 4
  br label %166

158:                                              ; preds = %140, %126
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %4, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %166

162:                                              ; preds = %141, %115, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %11, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %11, align 4, !tbaa !5
  br label %85, !llvm.loop !18

166:                                              ; preds = %158, %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %168

167:                                              ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %62, !llvm.loop !19

168:                                              ; preds = %166, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %170

169:                                              ; preds = %65
  call void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #7
  ret void

170:                                              ; preds = %168, %94, %53, %29
  call void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %1) #7
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %4, align 8
  %173 = load i32, ptr %5, align 4
  %174 = insertvalue { ptr, i32 } poison, ptr %172, 0
  %175 = insertvalue { ptr, i32 } %174, i32 %173, 1
  resume { ptr, i32 } %175
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE4pushERKS3_(ptr dead_on_unwind noalias writable sret(%"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK10__gnu_pbds6detail28left_child_next_sibling_heapISt4pairIiiESt4lessIS3_ENS_9null_typeESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3topEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #6 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #6 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 8, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !6, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 0}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


; 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.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.__gnu_pbds::priority_queue" = type { ptr, %"class.__gnu_pbds::detail::pairing_heap" }
%"class.__gnu_pbds::detail::pairing_heap" = type { %"class.__gnu_pbds::detail::left_child_next_sibling_heap" }
%"class.__gnu_pbds::detail::left_child_next_sibling_heap" = type { ptr, i64 }
%"struct.std::pair" = type { i32, i32 }

@id = external dso_local global [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@combine = external dso_local local_unnamed_addr global [3010 x i32], align 16
@cost = external dso_local local_unnamed_addr global [3010 x [3010 x i32]], align 16
@done = external dso_local local_unnamed_addr global [3010 x i32], align 16
@wet = external dso_local local_unnamed_addr global [3010 x i32], align 16
@G = external dso_local global [3010 x %"class.std::vector"], align 16
@s = external dso_local local_unnamed_addr global i32, align 4
@t = external dso_local local_unnamed_addr global i32, align 4
@cut = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6searchv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.__gnu_pbds::priority_queue", align 8
  %2 = alloca %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_", align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12040) @done, i8 0, i64 12040, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12040) @wet, i8 0, i64 12040, i1 false)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not24 = icmp slt i32 %11, 1
  br i1 %.not24, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  br label %._crit_edge30

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  %.not1926 = icmp slt i32 %15, 1
  br i1 %.not1926, label %._crit_edge30, label %.lr.ph29

.lr.ph29:                                         ; preds = %._crit_edge
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  br label %19

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @_ZN10__gnu_pbds6detail55left_child_next_sibling_heap_node_point_const_iterator_INS0_34left_child_next_sibling_heap_node_ISt4pairIiiENS_9null_typeESaIcEEES6_EC2EPS7_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef null)
  %13 = getelementptr inbounds [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], ptr @id, i64 0, i64 %indvars.iv
  %14 = load i64, ptr %2, align 8, !tbaa !9
  store i64 %14, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %.not.not = icmp slt i64 %indvars.iv, %16
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge30:                                    ; preds = %34, %._crit_edge.thread, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  store i32 -1, ptr @t, align 4, !tbaa !5
  store i32 -1, ptr @s, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %1, i64 8
  %18 = call noundef zeroext i1 @_ZNK10__gnu_pbds6detail28left_child_next_sibling_heapISt4pairIiiESt4lessIS3_ENS_9null_typeESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  br i1 %18, label %._crit_edge36, label %.lr.ph35

19:                                               ; preds = %.lr.ph29, %34
  %20 = phi i32 [ %15, %.lr.ph29 ], [ %35, %34 ]
  %storemerge27 = phi i32 [ 1, %.lr.ph29 ], [ %37, %34 ]
  %21 = sext i32 %storemerge27 to i64
  %22 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not21 = icmp eq i32 %23, 0
  br i1 %.not21, label %24, label %34

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %25 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %26 unwind label %32

26:                                               ; preds = %24
  store i64 %25, ptr %5, align 8
  invoke void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE4pushERKS3_(ptr dead_on_unwind nonnull writable sret(%"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_") align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %27 unwind label %32

27:                                               ; preds = %26
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], ptr @id, i64 0, i64 %29
  %31 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %31, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %34

32:                                               ; preds = %26, %24
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %86

34:                                               ; preds = %19, %27
  %35 = phi i32 [ %20, %19 ], [ %.pre, %27 ]
  %36 = phi i32 [ %storemerge27, %19 ], [ %28, %27 ]
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !5
  %.not19.not = icmp slt i32 %36, %35
  br i1 %.not19.not, label %19, label %._crit_edge30, !llvm.loop !13

.loopexit:                                        ; preds = %83, %44
  %38 = call noundef zeroext i1 @_ZNK10__gnu_pbds6detail28left_child_next_sibling_heapISt4pairIiiESt4lessIS3_ENS_9null_typeESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  br i1 %38, label %._crit_edge36, label %.lr.ph35, !llvm.loop !14

.lr.ph35:                                         ; preds = %._crit_edge30, %.loopexit
  %39 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3topEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3topEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  %43 = load i32, ptr %42, align 4, !tbaa !17
  store i32 %43, ptr @cut, align 4, !tbaa !5
  invoke void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3popEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %44 unwind label %50

44:                                               ; preds = %.lr.ph35
  %45 = sext i32 %41 to i64
  %46 = getelementptr inbounds [3010 x i32], ptr @done, i64 0, i64 %45
  store i32 1, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr @t, align 4, !tbaa !5
  store i32 %47, ptr @s, align 4, !tbaa !5
  store i32 %41, ptr @t, align 4, !tbaa !5
  %48 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %45
  %49 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #6
  %.not = icmp eq i64 %49, 0
  br i1 %.not, label %.loopexit, label %.lr.ph33

50:                                               ; preds = %.lr.ph35
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %86

.lr.ph33:                                         ; preds = %44, %83
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %83 ], [ 0, %44 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %indvars.iv38) #6
  %53 = load i32, ptr %52, align 4, !tbaa !5
  store i32 %53, ptr %7, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [3010 x i32], ptr @done, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %83

58:                                               ; preds = %.lr.ph33
  %59 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %54
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %83

62:                                               ; preds = %58
  %63 = getelementptr inbounds [3010 x %"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_"], ptr @id, i64 0, i64 %54
  call void @_ZN10__gnu_pbds6detail55left_child_next_sibling_heap_node_point_const_iterator_INS0_34left_child_next_sibling_heap_node_ISt4pairIiiENS_9null_typeESaIcEEES6_EC2ERKS8_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [3010 x i32], ptr @wet, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %45, i64 %65
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, %67
  store i32 %70, ptr %10, align 4, !tbaa !5
  %71 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %72 unwind label %81

72:                                               ; preds = %62
  store i64 %71, ptr %9, align 8
  invoke void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE6modifyENS0_55left_child_next_sibling_heap_node_point_const_iterator_INS0_34left_child_next_sibling_heap_node_IS3_NS_9null_typeES6_EES6_EERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %73 unwind label %81

73:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %45, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = getelementptr inbounds [3010 x i32], ptr @wet, i64 0, i64 %75
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %79, %77
  store i32 %80, ptr %78, align 4, !tbaa !5
  br label %83

81:                                               ; preds = %72, %62
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %86

83:                                               ; preds = %73, %58, %.lr.ph33
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %84 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #6
  %85 = icmp ugt i64 %84, %indvars.iv.next39
  br i1 %85, label %.lr.ph33, label %.loopexit, !llvm.loop !18

._crit_edge36:                                    ; preds = %.loopexit, %._crit_edge30
  call void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  ret void

86:                                               ; preds = %50, %81, %32
  %.pn22 = phi { ptr, i32 } [ %33, %32 ], [ %82, %81 ], [ %51, %50 ]
  call void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn22
}

; 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 uwtable
declare dso_local void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

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: inlinehint mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE4pushERKS3_(ptr dead_on_unwind noalias writable sret(%"class.__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK10__gnu_pbds6detail28left_child_next_sibling_heapISt4pairIiiESt4lessIS3_ENS_9null_typeESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNK10__gnu_pbds6detail12pairing_heapISt4pairIiiESt4lessIS3_ESaIcEE3topEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10__gnu_pbds14priority_queueISt4pairIiiESt4lessIS2_ENS_16pairing_heap_tagESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !6, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 0}
!18 = distinct !{!18, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass