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

; 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::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 }

@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
@has_edge = external dso_local global [3010 x [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
declare dso_local void @_Z6searchv() #0

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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12stoer_wangerv() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.memset.p0.i64(ptr align 16 @combine, i8 0, i64 12040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1061109567, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %148, %0
  %9 = load i32, ptr %3, align 4, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sub nsw i32 %10, 1
  %12 = icmp slt i32 %9, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %8
  store i32 2, ptr %4, align 4
  br label %151

14:                                               ; preds = %8
  call void @_Z6searchv()
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @cut)
  %16 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %16, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %14
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %151

20:                                               ; preds = %14
  %21 = load i32, ptr @t, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %22
  store i32 1, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %69, %20
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = load i32, ptr @t, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %28
  %30 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  %31 = icmp ult i64 %26, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %24
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %72

33:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %34 = load i32, ptr @t, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38) #5
  %40 = load i32, ptr %39, align 4, !tbaa !5
  store i32 %40, ptr %6, align 4, !tbaa !5
  %41 = load i32, ptr @s, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %42
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [3010 x i32], ptr %43, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %55, label %49

49:                                               ; preds = %33
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %49, %33
  store i32 7, ptr %4, align 4
  br label %66

56:                                               ; preds = %49
  %57 = load i32, ptr @s, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %58
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [3010 x i32], ptr %59, i64 0, i64 %61
  store i32 1, ptr %62, align 4, !tbaa !5
  %63 = load i32, ptr @s, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %64
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 0, ptr %4, align 4
  br label %66

66:                                               ; preds = %56, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %67 = load i32, ptr %4, align 4
  switch i32 %67, label %157 [
    i32 0, label %68
    i32 7, label %69
  ]

68:                                               ; preds = %66
  br label %69

69:                                               ; preds = %68, %66
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %5, align 4, !tbaa !5
  br label %24, !llvm.loop !9

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

73:                                               ; preds = %144, %72
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = icmp sle i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %147

78:                                               ; preds = %73
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %143

84:                                               ; preds = %78
  %85 = load i32, ptr @t, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %86
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [3010 x i32], ptr %87, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr @s, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %93
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [3010 x i32], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %98, %91
  store i32 %99, ptr %97, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %101
  %103 = load i32, ptr @t, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [3010 x i32], ptr %102, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %108
  %110 = load i32, ptr @s, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [3010 x i32], ptr %109, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %113, %106
  store i32 %114, ptr %112, align 4, !tbaa !5
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %116
  %118 = load i32, ptr @t, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [3010 x i32], ptr %117, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %142

123:                                              ; preds = %84
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %125
  %127 = load i32, ptr @s, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [3010 x i32], ptr %126, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %142

132:                                              ; preds = %123
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %134
  %136 = load i32, ptr @s, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [3010 x i32], ptr %135, i64 0, i64 %137
  store i32 1, ptr %138, align 4, !tbaa !5
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %140
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %141, ptr noundef nonnull align 4 dereferenceable(4) @s)
  br label %142

142:                                              ; preds = %132, %123, %84
  br label %143

143:                                              ; preds = %142, %78
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %7, align 4, !tbaa !5
  br label %73, !llvm.loop !11

147:                                              ; preds = %77
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %3, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %3, align 4, !tbaa !5
  br label %8, !llvm.loop !12

151:                                              ; preds = %19, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %152 = load i32, ptr %4, align 4
  switch i32 %152, label %155 [
    i32 2, label %153
  ]

153:                                              ; preds = %151
  %154 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %154, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %155

155:                                              ; preds = %153, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %156 = load i32, ptr %1, align 4
  ret i32 %156

157:                                              ; preds = %66
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; 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::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 }

@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
@has_edge = external dso_local local_unnamed_addr global [3010 x [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 local_unnamed_addr global i32, align 4
@cut = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6searchv() local_unnamed_addr #0

; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 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 #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12stoer_wangerv() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12040) @combine, i8 0, i64 12040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 1061109567, ptr %1, align 4, !tbaa !5
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not2631 = icmp sgt i32 %3, 1
  br i1 %.not2631, label %.lr.ph35, label %._crit_edge36

.lr.ph35:                                         ; preds = %0, %._crit_edge
  %.02032 = phi i32 [ %36, %._crit_edge ], [ 0, %0 ]
  call void @_Z6searchv()
  %4 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) @cut)
  %5 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %5, ptr %1, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %._crit_edge36, label %7

7:                                                ; preds = %.lr.ph35
  %8 = load i32, ptr @t, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %9
  store i32 1, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %9
  %12 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %.not39 = icmp eq i64 %12, 0
  br i1 %.not39, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %29, %7
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %.not28 = icmp slt i32 %13, 1
  br i1 %.not28, label %._crit_edge, label %.lr.ph30

.lr.ph:                                           ; preds = %7, %29
  %indvars.iv = phi i64 [ %indvars.iv.next, %29 ], [ 0, %7 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %14 = load i32, ptr @t, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %15
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv) #5
  %18 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %18, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @s, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = sext i32 %18 to i64
  %22 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %20, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not24 = icmp eq i32 %23, 0
  br i1 %.not24, label %24, label %29

24:                                               ; preds = %.lr.ph
  %25 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %21
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %.not25 = icmp eq i32 %26, 0
  br i1 %.not25, label %27, label %29

27:                                               ; preds = %24
  store i32 1, ptr %22, align 4, !tbaa !5
  %28 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %20
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %29

29:                                               ; preds = %.lr.ph, %24, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = load i32, ptr @t, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %31
  %33 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #5
  %34 = icmp ugt i64 %33, %indvars.iv.next
  br i1 %34, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %65, %.preheader
  %35 = phi i32 [ %13, %.preheader ], [ %66, %65 ]
  %36 = add nuw nsw i32 %.02032, 1
  %37 = add nsw i32 %35, -1
  %.not26 = icmp slt i32 %36, %37
  br i1 %.not26, label %.lr.ph35, label %._crit_edge.._crit_edge36.loopexit_crit_edge, !llvm.loop !11

._crit_edge.._crit_edge36.loopexit_crit_edge:     ; preds = %._crit_edge
  %.pre44.pre = load i32, ptr %1, align 4
  br label %._crit_edge36

.lr.ph30:                                         ; preds = %.preheader, %65
  %38 = phi i32 [ %66, %65 ], [ %13, %.preheader ]
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %65 ], [ 1, %.preheader ]
  %39 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %indvars.iv41
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %65

42:                                               ; preds = %.lr.ph30
  %43 = load i32, ptr @t, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %44, i64 %indvars.iv41
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i32, ptr @s, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %48, i64 %indvars.iv41
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %50, %46
  store i32 %51, ptr %49, align 4, !tbaa !5
  %52 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %indvars.iv41, i64 %44
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = getelementptr inbounds [3010 x [3010 x i32]], ptr @cost, i64 0, i64 %indvars.iv41, i64 %48
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, %53
  store i32 %56, ptr %54, align 4, !tbaa !5
  %57 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %indvars.iv41, i64 %44
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %.not23 = icmp eq i32 %58, 0
  br i1 %.not23, label %65, label %59

59:                                               ; preds = %42
  %60 = getelementptr inbounds [3010 x [3010 x i32]], ptr @has_edge, i64 0, i64 %indvars.iv41, i64 %48
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %65

63:                                               ; preds = %59
  store i32 1, ptr %60, align 4, !tbaa !5
  %64 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %indvars.iv41
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(4) @s)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %.lr.ph30, %63, %59, %42
  %66 = phi i32 [ %38, %.lr.ph30 ], [ %.pre, %63 ], [ %38, %59 ], [ %38, %42 ]
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %67 = sext i32 %66 to i64
  %.not.not = icmp slt i64 %indvars.iv41, %67
  br i1 %.not.not, label %.lr.ph30, label %._crit_edge, !llvm.loop !12

._crit_edge36:                                    ; preds = %.lr.ph35, %._crit_edge.._crit_edge36.loopexit_crit_edge, %0
  %.not26.lcssa = phi i32 [ 1061109567, %0 ], [ %.pre44.pre, %._crit_edge.._crit_edge36.loopexit_crit_edge ], [ 0, %.lr.ph35 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 %.not26.lcssa
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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