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

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

@combine = external dso_local global [3010 x i32], align 16
@g = external dso_local global [3010 x [3010 x i32]], align 16
@check = external dso_local global [3010 x i8], 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
@minCut = external dso_local global i32, align 4
@n = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6Searchii(i32 noundef, i32 noundef) #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 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)) #2 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) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12Stoer_Wagnerv() #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
  %8 = 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 %1) #4
  store i32 1061109567, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %142, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %145

14:                                               ; preds = %9
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sub nsw i32 %16, 1
  call void @_Z6Searchii(i32 noundef %15, i32 noundef %17)
  %18 = load i32, ptr @minCut, align 4, !tbaa !5
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %21, label %23

21:                                               ; preds = %14
  %22 = load i32, ptr @minCut, align 4, !tbaa !5
  store i32 %22, ptr %1, align 4, !tbaa !5
  br label %23

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

27:                                               ; preds = %54, %23
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = load i32, ptr @s, 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) #4
  %34 = icmp ult i64 %29, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %57

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

49:                                               ; preds = %36
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [3010 x i8], ptr @check, i64 0, i64 %51
  store i8 1, ptr %52, align 1, !tbaa !9
  br label %53

53:                                               ; preds = %49, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !11

57:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %98, %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = load i32, ptr @t, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %62
  %64 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #4
  %65 = icmp ult i64 %60, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %58
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %101

67:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %68 = load i32, ptr @t, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %69
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %72) #4
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %7, align 4, !tbaa !5
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %97, label %80

80:                                               ; preds = %67
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [3010 x i8], ptr @check, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !9, !range !13, !noundef !14
  %85 = trunc i8 %84 to i1
  br i1 %85, label %97, label %86

86:                                               ; preds = %80
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = load i32, ptr @t, align 4, !tbaa !5
  %89 = icmp ne i32 %87, %88
  br i1 %89, label %90, label %97

90:                                               ; preds = %86
  %91 = load i32, ptr @s, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %92
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %95
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 4 dereferenceable(4) @s)
  br label %97

97:                                               ; preds = %90, %86, %80, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %6, align 4, !tbaa !5
  br label %58, !llvm.loop !15

101:                                              ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %138, %101
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = icmp sle i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %141

107:                                              ; preds = %102
  %108 = load i32, ptr @t, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %109
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [3010 x i32], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr @s, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %116
  %118 = load i32, ptr %8, 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 = add nsw i32 %121, %114
  store i32 %122, ptr %120, align 4, !tbaa !5
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %124
  %126 = load i32, ptr @t, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [3010 x i32], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %131
  %133 = load i32, ptr @s, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [3010 x i32], ptr %132, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = add nsw i32 %136, %129
  store i32 %137, ptr %135, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %107
  %139 = load i32, ptr %8, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %8, align 4, !tbaa !5
  br label %102, !llvm.loop !16

141:                                              ; preds = %106
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %2, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !17

145:                                              ; preds = %13
  %146 = load i32, ptr %1, align 4, !tbaa !5
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret i32 %146
}

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

; 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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

@combine = external dso_local local_unnamed_addr global [3010 x i32], align 16
@g = external dso_local local_unnamed_addr global [3010 x [3010 x i32]], align 16
@check = external dso_local local_unnamed_addr global [3010 x i8], 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
@minCut = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6Searchii(i32 noundef, i32 noundef) 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 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 #2 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2147483648, 1061109568) i32 @_Z12Stoer_Wagnerv() local_unnamed_addr #0 {
  %1 = 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)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 1
  br i1 %3, label %.lr.ph40, label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge, %0
  %.020.lcssa = phi i32 [ 1061109567, %0 ], [ %spec.select, %._crit_edge ]
  ret i32 %.020.lcssa

.lr.ph40:                                         ; preds = %0, %._crit_edge
  %4 = phi i32 [ %34, %._crit_edge ], [ %2, %0 ]
  %.02038 = phi i32 [ %spec.select, %._crit_edge ], [ 1061109567, %0 ]
  %.02237 = phi i32 [ %65, %._crit_edge ], [ 1, %0 ]
  %5 = add nsw i32 %.02237, -1
  call void @_Z6Searchii(i32 noundef %4, i32 noundef %5)
  %6 = load i32, ptr @minCut, align 4, !tbaa !5
  %spec.select = call i32 @llvm.smin.i32(i32 %6, i32 %.02038)
  %7 = load i32, ptr @t, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %8
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3010) @check, i8 0, i64 3010, i1 false)
  %10 = load i32, ptr @s, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %11
  %13 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %.not42 = icmp eq i64 %13, 0
  br i1 %.not42, label %.preheader30, label %.lr.ph

.preheader30:                                     ; preds = %28, %.lr.ph40
  %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 i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %.not43 = icmp eq i64 %17, 0
  br i1 %.not43, label %.preheader, label %.lr.ph33

.lr.ph:                                           ; preds = %.lr.ph40, %28
  %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 0, %.lr.ph40 ]
  %18 = load i32, ptr @s, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %19
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %indvars.iv) #5
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %.not29 = icmp eq i32 %25, 0
  br i1 %.not29, label %26, label %28

26:                                               ; preds = %.lr.ph
  %27 = getelementptr inbounds [3010 x i8], ptr @check, i64 0, i64 %23
  store i8 1, ptr %27, align 1, !tbaa !9
  br label %28

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

.preheader:                                       ; preds = %59, %.preheader30
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %.not34 = icmp slt i32 %34, 1
  br i1 %.not34, label %._crit_edge, label %.lr.ph36

.lr.ph36:                                         ; preds = %.preheader
  %35 = load i32, ptr @t, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = load i32, ptr @s, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = add nuw i32 %34, 1
  %wide.trip.count = zext i32 %39 to i64
  br label %67

.lr.ph33:                                         ; preds = %.preheader30, %59
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %59 ], [ 0, %.preheader30 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %40 = load i32, ptr @t, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %41
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %indvars.iv45) #5
  %44 = load i32, ptr %43, align 4, !tbaa !5
  store i32 %44, ptr %1, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [3010 x i32], ptr @combine, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %.not27 = icmp eq i32 %47, 0
  %.pre51 = load i32, ptr @t, align 4
  br i1 %.not27, label %48, label %59

48:                                               ; preds = %.lr.ph33
  %49 = getelementptr inbounds [3010 x i8], ptr @check, i64 0, i64 %45
  %50 = load i8, ptr %49, align 1, !tbaa !9, !range !13, !noundef !14
  %51 = trunc nuw i8 %50 to i1
  %.not28 = icmp eq i32 %44, %.pre51
  %or.cond = select i1 %51, i1 true, i1 %.not28
  br i1 %or.cond, label %59, label %52

52:                                               ; preds = %48
  %53 = load i32, ptr @s, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %54
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %57
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) @s)
  %.pre = load i32, ptr @t, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %52, %48, %.lr.ph33
  %60 = phi i32 [ %.pre, %52 ], [ %.pre51, %48 ], [ %.pre51, %.lr.ph33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [3010 x %"class.std::vector"], ptr @G, i64 0, i64 %61
  %63 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #5
  %64 = icmp ugt i64 %63, %indvars.iv.next46
  br i1 %64, label %.lr.ph33, label %.preheader, !llvm.loop !15

._crit_edge:                                      ; preds = %67, %.preheader
  %65 = add nuw nsw i32 %.02237, 1
  %66 = icmp slt i32 %65, %34
  br i1 %66, label %.lr.ph40, label %._crit_edge41, !llvm.loop !16

67:                                               ; preds = %.lr.ph36, %67
  %indvars.iv48 = phi i64 [ 1, %.lr.ph36 ], [ %indvars.iv.next49, %67 ]
  %68 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %36, i64 %indvars.iv48
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %38, i64 %indvars.iv48
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, %69
  store i32 %72, ptr %70, align 4, !tbaa !5
  %73 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %indvars.iv48, i64 %36
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = getelementptr inbounds [3010 x [3010 x i32]], ptr @g, i64 0, i64 %indvars.iv48, i64 %38
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %76, %74
  store i32 %77, ptr %75, align 4, !tbaa !5
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %67, !llvm.loop !17
}

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

; 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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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