; LLVM IR from tangjz/acm-icpc :: hdu (5682)

; 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@leaf = external dso_local global [50000 x i32], align 16
@val = external dso_local global [50000 x i32], align 16
@deg = external dso_local global [50000 x i32], align 16
@pos = external dso_local global [50000 x i32], align 16
@que = external dso_local global [50001 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@pL = external dso_local global i32, align 4
@pR = external dso_local global i32, align 4
@pM = external dso_local global i32, align 4
@S = external dso_local global i32, align 4
@e = external dso_local global [50001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checki(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 ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %19

19:                                               ; preds = %231, %0
  %20 = load i32, ptr @t, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @t, align 4, !tbaa !5
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %234

23:                                               ; preds = %19
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %34, %23
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %32
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %33) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  br label %34

34:                                               ; preds = %30
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !9

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

38:                                               ; preds = %55, %37
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5, ptr noundef %6)
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %6, align 4, !tbaa !5
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %50
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %53
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %55

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

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

59:                                               ; preds = %77, %58
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = load i32, ptr @m, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %80

64:                                               ; preds = %59
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr @leaf, i64 %66
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr @val, i64 %69
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %67, ptr noundef %70)
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %75, -1
  store i32 %76, ptr %74, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %64
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %59, !llvm.loop !12

80:                                               ; preds = %63
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = mul i64 %82, 4
  call void @llvm.memset.p0.i64(ptr align 16 @deg, i8 0, i64 %83, i1 false)
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = mul i64 %85, 4
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 %86, i1 false)
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %87, ptr @S, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %88 = load i32, ptr @S, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %89
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %90) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %111, %80
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = load i32, ptr @m, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %114

96:                                               ; preds = %91
  %97 = load i32, ptr @S, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %98
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %101
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef nonnull align 4 dereferenceable(4) %102)
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [50000 x i32], ptr @deg, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %108, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %96
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %9, align 4, !tbaa !5
  br label %91, !llvm.loop !13

114:                                              ; preds = %95
  %115 = load i32, ptr @S, align 4, !tbaa !5
  %116 = load i32, ptr @R, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr @R, align 4, !tbaa !5
  %118 = sext i32 %116 to i64
  %119 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %118
  store i32 %115, ptr %119, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %210, %114
  %121 = load i32, ptr @L, align 4, !tbaa !5
  %122 = load i32, ptr @R, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %124, label %213

124:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %125 = load i32, ptr @L, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  store i32 %128, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %130
  %132 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %131) #7
  %133 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  br label %134

134:                                              ; preds = %207, %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %136
  %138 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %137) #7
  %139 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %138, ptr %139, align 8
  %140 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br i1 %140, label %142, label %141

141:                                              ; preds = %134
  store i32 19, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %209

142:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %144 = load i32, ptr %143, align 4, !tbaa !5
  store i32 %144, ptr %14, align 4, !tbaa !5
  %145 = load i32, ptr %14, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = icmp sge i32 %148, 0
  br i1 %149, label %150, label %151

150:                                              ; preds = %142
  store i32 21, ptr %13, align 4
  br label %204

151:                                              ; preds = %142
  %152 = load i32, ptr %14, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [50000 x i32], ptr @deg, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = add nsw i32 %155, -1
  store i32 %156, ptr %154, align 4, !tbaa !5
  %157 = load i32, ptr %14, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [50000 x i32], ptr @deg, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %203, label %162

162:                                              ; preds = %151
  %163 = load i32, ptr @R, align 4, !tbaa !5
  %164 = load i32, ptr %14, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %165
  store i32 %163, ptr %166, align 4, !tbaa !5
  %167 = load i32, ptr %14, align 4, !tbaa !5
  %168 = load i32, ptr @R, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr @R, align 4, !tbaa !5
  %170 = sext i32 %168 to i64
  %171 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %170
  store i32 %167, ptr %171, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %172 = load i32, ptr %14, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %173
  %175 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %174) #7
  %176 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %175, ptr %176, align 8
  br label %177

177:                                              ; preds = %200, %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %178 = load i32, ptr %14, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %179
  %181 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %180) #7
  %182 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %181, ptr %182, align 8
  %183 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br i1 %183, label %185, label %184

184:                                              ; preds = %177
  store i32 22, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %202

185:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %187 = load i32, ptr %186, align 4, !tbaa !5
  store i32 %187, ptr %17, align 4, !tbaa !5
  %188 = load i32, ptr %17, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = icmp eq i32 %191, -1
  br i1 %192, label %193, label %199

193:                                              ; preds = %185
  %194 = load i32, ptr %17, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [50000 x i32], ptr @deg, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %196, align 4, !tbaa !5
  br label %199

199:                                              ; preds = %193, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %200

200:                                              ; preds = %199
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br label %177, !llvm.loop !14

202:                                              ; preds = %184
  br label %203

203:                                              ; preds = %202, %151
  store i32 0, ptr %13, align 4
  br label %204

204:                                              ; preds = %203, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %205 = load i32, ptr %13, align 4
  switch i32 %205, label %235 [
    i32 0, label %206
    i32 21, label %207
  ]

206:                                              ; preds = %204
  br label %207

207:                                              ; preds = %206, %204
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br label %134, !llvm.loop !15

209:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %210

210:                                              ; preds = %209
  %211 = load i32, ptr @L, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr @L, align 4, !tbaa !5
  br label %120, !llvm.loop !16

213:                                              ; preds = %120
  store i32 0, ptr @pL, align 4, !tbaa !5
  store i32 1000000000, ptr @pR, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %230, %213
  %215 = load i32, ptr @pL, align 4, !tbaa !5
  %216 = load i32, ptr @pR, align 4, !tbaa !5
  %217 = icmp slt i32 %215, %216
  br i1 %217, label %218, label %231

218:                                              ; preds = %214
  %219 = load i32, ptr @pL, align 4, !tbaa !5
  %220 = load i32, ptr @pR, align 4, !tbaa !5
  %221 = add nsw i32 %219, %220
  %222 = ashr i32 %221, 1
  store i32 %222, ptr @pM, align 4, !tbaa !5
  %223 = load i32, ptr @pM, align 4, !tbaa !5
  %224 = call noundef zeroext i1 @_Z5checki(i32 noundef %223)
  br i1 %224, label %225, label %227

225:                                              ; preds = %218
  %226 = load i32, ptr @pM, align 4, !tbaa !5
  store i32 %226, ptr @pR, align 4, !tbaa !5
  br label %230

227:                                              ; preds = %218
  %228 = load i32, ptr @pM, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr @pL, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %227, %225
  br label %214, !llvm.loop !17

231:                                              ; preds = %214
  %232 = load i32, ptr @pL, align 4, !tbaa !5
  %233 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %232)
  br label %19, !llvm.loop !18

234:                                              ; preds = %19
  ret i32 0

235:                                              ; preds = %204
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

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

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

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

declare i32 @printf(ptr noundef, ...) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress norecurse 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@leaf = external dso_local global [50000 x i32], align 16
@val = external dso_local global [50000 x i32], align 16
@deg = external dso_local local_unnamed_addr global [50000 x i32], align 16
@pos = external dso_local local_unnamed_addr global [50000 x i32], align 16
@que = external dso_local local_unnamed_addr global [50001 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@pL = external dso_local local_unnamed_addr global i32, align 4
@pR = external dso_local local_unnamed_addr global i32, align 4
@pM = external dso_local local_unnamed_addr global i32, align 4
@S = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local global [50001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checki(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 ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %.not57 = icmp eq i32 %10, 0
  br i1 %.not57, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %0, %._crit_edge56
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph59
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  br label %._crit_edge36

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %15 = icmp sgt i32 %17, 1
  br i1 %15, label %.lr.ph35, label %._crit_edge36

.lr.ph:                                           ; preds = %.lr.ph59, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph59 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %16 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge36:                                    ; preds = %.lr.ph35, %._crit_edge.thread, %._crit_edge
  %20 = phi i32 [ %17, %._crit_edge ], [ %13, %._crit_edge.thread ], [ %34, %.lr.ph35 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph39, label %._crit_edge40

.lr.ph35:                                         ; preds = %._crit_edge, %.lr.ph35
  %.02533 = phi i32 [ %33, %.lr.ph35 ], [ 1, %._crit_edge ]
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %25 to i64
  %29 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %28
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %31
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %33 = add nuw nsw i32 %.02533, 1
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %.lr.ph35, label %._crit_edge36, !llvm.loop !11

._crit_edge40.loopexit:                           ; preds = %.lr.ph39
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge40

._crit_edge40:                                    ; preds = %._crit_edge40.loopexit, %._crit_edge36
  %36 = phi i32 [ %.pre, %._crit_edge40.loopexit ], [ %20, %._crit_edge36 ]
  %37 = sext i32 %36 to i64
  %38 = shl nsw i64 %37, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @deg, i8 0, i64 %38, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @pos, i8 -1, i64 %38, i1 false)
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  store i32 %36, ptr @S, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %39 = load i32, ptr @S, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %40
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %41) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph43, label %._crit_edge44

.lr.ph39:                                         ; preds = %._crit_edge36, %.lr.ph39
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph39 ], [ 0, %._crit_edge36 ]
  %44 = getelementptr inbounds i32, ptr @leaf, i64 %indvars.iv64
  %45 = getelementptr inbounds i32, ptr @val, i64 %indvars.iv64
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %44, ptr noundef nonnull %45)
  %47 = load i32, ptr %44, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %44, align 4, !tbaa !5
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next65, %50
  br i1 %51, label %.lr.ph39, label %._crit_edge40.loopexit, !llvm.loop !12

._crit_edge44:                                    ; preds = %.lr.ph43, %._crit_edge40
  %52 = load i32, ptr @S, align 4, !tbaa !5
  %53 = load i32, ptr @R, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr @R, align 4, !tbaa !5
  %55 = sext i32 %53 to i64
  %56 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %55
  store i32 %52, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr @L, align 4, !tbaa !5
  %.not61 = icmp sgt i32 %57, %53
  br i1 %.not61, label %.lr.ph55.preheader, label %.lr.ph52

.lr.ph43:                                         ; preds = %._crit_edge40, %.lr.ph43
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.lr.ph43 ], [ 0, %._crit_edge40 ]
  %58 = load i32, ptr @S, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %59
  %61 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %indvars.iv67
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 4 dereferenceable(4) %61)
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [50000 x i32], ptr @deg, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %64, align 4, !tbaa !5
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next68, %68
  br i1 %69, label %.lr.ph43, label %._crit_edge44, !llvm.loop !13

.lr.ph52:                                         ; preds = %._crit_edge44, %._crit_edge50
  %70 = phi i32 [ %80, %._crit_edge50 ], [ %57, %._crit_edge44 ]
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %74
  %76 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  store ptr %76, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %77 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  store ptr %77, ptr %6, align 8
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %78, label %.lr.ph49, label %._crit_edge50

._crit_edge50:                                    ; preds = %116, %.lr.ph52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %79 = load i32, ptr @L, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr @L, align 4, !tbaa !5
  %81 = load i32, ptr @R, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %.lr.ph52, label %.lr.ph55.preheader, !llvm.loop !14

.lr.ph49:                                         ; preds = %.lr.ph52, %116
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, -1
  br i1 %88, label %116, label %89

89:                                               ; preds = %.lr.ph49
  %90 = getelementptr inbounds [50000 x i32], ptr @deg, i64 0, i64 %85
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %90, align 4, !tbaa !5
  %.not31 = icmp eq i32 %92, 0
  br i1 %.not31, label %93, label %116

93:                                               ; preds = %89
  %94 = load i32, ptr @R, align 4, !tbaa !5
  store i32 %94, ptr %86, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr @R, align 4, !tbaa !5
  %96 = sext i32 %94 to i64
  %97 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %96
  store i32 %84, ptr %97, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %98 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %85
  %99 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #7
  store ptr %99, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %100 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #7
  store ptr %100, ptr %8, align 8
  %101 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %101, label %.lr.ph46, label %._crit_edge47

._crit_edge47:                                    ; preds = %112, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %116

.lr.ph46:                                         ; preds = %93, %112
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = icmp eq i32 %106, -1
  br i1 %107, label %108, label %112

108:                                              ; preds = %.lr.ph46
  %109 = getelementptr inbounds [50000 x i32], ptr @deg, i64 0, i64 %104
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %109, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %108, %.lr.ph46
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %114 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #7
  store ptr %114, ptr %8, align 8
  %115 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %115, label %.lr.ph46, label %._crit_edge47, !llvm.loop !15

116:                                              ; preds = %89, %._crit_edge47, %.lr.ph49
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %118 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  store ptr %118, ptr %6, align 8
  %119 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %119, label %.lr.ph49, label %._crit_edge50, !llvm.loop !16

.lr.ph55.preheader:                               ; preds = %._crit_edge50, %._crit_edge44
  store i32 0, ptr @pL, align 4, !tbaa !5
  store i32 1000000000, ptr @pR, align 4, !tbaa !5
  br label %.lr.ph55

.lr.ph55:                                         ; preds = %.lr.ph55.preheader, %129
  %120 = phi i32 [ %130, %129 ], [ 1000000000, %.lr.ph55.preheader ]
  %121 = phi i32 [ %131, %129 ], [ 0, %.lr.ph55.preheader ]
  %122 = add nsw i32 %120, %121
  %123 = ashr i32 %122, 1
  store i32 %123, ptr @pM, align 4, !tbaa !5
  %124 = call noundef zeroext i1 @_Z5checki(i32 noundef %123)
  %125 = load i32, ptr @pM, align 4, !tbaa !5
  br i1 %124, label %126, label %127

126:                                              ; preds = %.lr.ph55
  store i32 %125, ptr @pR, align 4, !tbaa !5
  %.pre70 = load i32, ptr @pL, align 4, !tbaa !5
  br label %129

127:                                              ; preds = %.lr.ph55
  %128 = add nsw i32 %125, 1
  store i32 %128, ptr @pL, align 4, !tbaa !5
  %.pre71 = load i32, ptr @pR, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %127, %126
  %130 = phi i32 [ %.pre71, %127 ], [ %125, %126 ]
  %131 = phi i32 [ %128, %127 ], [ %.pre70, %126 ]
  %132 = icmp slt i32 %131, %130
  br i1 %132, label %.lr.ph55, label %._crit_edge56, !llvm.loop !17

._crit_edge56:                                    ; preds = %129
  %133 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %131)
  %134 = load i32, ptr @t, align 4, !tbaa !5
  %135 = add nsw i32 %134, -1
  store i32 %135, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %134, 0
  br i1 %.not, label %._crit_edge60, label %.lr.ph59, !llvm.loop !18

._crit_edge60:                                    ; preds = %._crit_edge56, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

; 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 #6 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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


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