; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Indeed Prime (graph)

; 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<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@e = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@g = external dso_local global [10001 x %"class.std::vector"], align 16
@s = external dso_local global [10001 x %"class.std::vector"], align 16
@d = external dso_local global [10001 x [1011 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, 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: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs2iii(i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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 %"struct.std::pair", align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @e, ptr noundef @k)
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %23)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %41, %0
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %44

31:                                               ; preds = %26
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @g, i64 0, i64 %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %36 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %36, ptr %6, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %35, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @g, i64 0, i64 %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %40 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %40, ptr %7, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %41

41:                                               ; preds = %31
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !9

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

45:                                               ; preds = %60, %44
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = load i32, ptr @e, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @s, i64 0, i64 %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %55 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %55, ptr %9, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @s, i64 0, i64 %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %59 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %59, ptr %10, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %60

60:                                               ; preds = %50
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %8, align 4, !tbaa !5
  br label %45, !llvm.loop !11

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

64:                                               ; preds = %86, %63
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = load i32, ptr @k, align 4, !tbaa !5
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %89

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

70:                                               ; preds = %82, %69
  %71 = load i32, ptr %13, align 4, !tbaa !5
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = icmp sle i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %85

75:                                               ; preds = %70
  %76 = load i32, ptr %13, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %77
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1011 x i32], ptr %78, i64 0, i64 %80
  store i32 1000000000, ptr %81, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %75
  %83 = load i32, ptr %13, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %13, align 4, !tbaa !5
  br label %70, !llvm.loop !12

85:                                               ; preds = %74
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %11, align 4, !tbaa !5
  br label %64, !llvm.loop !13

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

90:                                               ; preds = %107, %89
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = icmp sle i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %110

95:                                               ; preds = %90
  %96 = load i32, ptr %14, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @g, i64 0, i64 %97
  %99 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #7
  %100 = icmp ule i64 %99, 1
  br i1 %100, label %101, label %106

101:                                              ; preds = %95
  %102 = load i32, ptr %14, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %103
  %105 = getelementptr inbounds [1011 x i32], ptr %104, i64 0, i64 0
  store i32 0, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %101, %95
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %14, align 4, !tbaa !5
  br label %90, !llvm.loop !14

110:                                              ; preds = %94
  call void @_Z3dfsiii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  call void @_Z4dfs2iii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %187, %110
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = load i32, ptr @k, align 4, !tbaa !5
  %114 = icmp sle i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 17, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %190

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

117:                                              ; preds = %183, %116
  %118 = load i32, ptr %16, align 4, !tbaa !5
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = icmp sle i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 20, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %186

122:                                              ; preds = %117
  %123 = load i32, ptr %16, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %124
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1011 x i32], ptr %125, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr %16, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %132
  %134 = load i32, ptr %15, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1011 x i32], ptr %133, i64 0, i64 %135
  store i32 %130, ptr %136, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %137 = load i32, ptr %16, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @s, i64 0, i64 %138
  %140 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %139) #7
  %141 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %140, ptr %141, align 8
  br label %142

142:                                              ; preds = %179, %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %143 = load i32, ptr %16, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @s, i64 0, i64 %144
  %146 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %145) #7
  %147 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  %148 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br i1 %148, label %150, label %149

149:                                              ; preds = %142
  store i32 23, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %182

150:                                              ; preds = %142
  %151 = load i32, ptr %16, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %152
  %154 = load i32, ptr %15, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1011 x i32], ptr %153, i64 0, i64 %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %157 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %158 = getelementptr inbounds %"struct.std::pair", ptr %157, i32 0, i32 0
  %159 = load i32, ptr %158, align 4, !tbaa !15
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %160
  %162 = load i32, ptr %15, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [1011 x i32], ptr %161, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %168 = getelementptr inbounds %"struct.std::pair", ptr %167, i32 0, i32 1
  %169 = load i32, ptr %168, align 4, !tbaa !17
  %170 = add nsw i32 %166, %169
  store i32 %170, ptr %19, align 4, !tbaa !5
  %171 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %156, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = load i32, ptr %16, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %174
  %176 = load i32, ptr %15, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1011 x i32], ptr %175, i64 0, i64 %177
  store i32 %172, ptr %178, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %179

179:                                              ; preds = %150
  %180 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef 0) #7
  %181 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %180, ptr %181, align 8
  br label %142, !llvm.loop !18

182:                                              ; preds = %149
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %16, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %16, align 4, !tbaa !5
  br label %117, !llvm.loop !19

186:                                              ; preds = %121
  call void @_Z3dfsiii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  call void @_Z4dfs2iii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %15, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %15, align 4, !tbaa !5
  br label %111, !llvm.loop !20

190:                                              ; preds = %115
  %191 = load i32, ptr @n, align 4, !tbaa !5
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %191)
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %192, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %209, %190
  %195 = load i32, ptr %21, align 4, !tbaa !5
  %196 = load i32, ptr @n, align 4, !tbaa !5
  %197 = icmp sle i32 %195, %196
  br i1 %197, label %199, label %198

198:                                              ; preds = %194
  store i32 26, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %212

199:                                              ; preds = %194
  %200 = load i32, ptr %21, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %201
  %203 = load i32, ptr @k, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [1011 x i32], ptr %202, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %206)
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %207, ptr noundef @.str.4)
  br label %209

209:                                              ; preds = %199
  %210 = load i32, ptr %21, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %21, align 4, !tbaa !5
  br label %194, !llvm.loop !21

212:                                              ; preds = %198
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %213 = load i32, ptr %1, align 4
  ret i32 %213
}

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !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<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@e = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@g = external dso_local global [10001 x %"class.std::vector"], align 16
@s = external dso_local global [10001 x %"class.std::vector"], align 16
@d = external dso_local global [10001 x [1011 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

; 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 #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs2iii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @e, ptr noundef nonnull @k)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %12)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 1
  br i1 %16, label %.lr.ph, label %.preheader48

.preheader48:                                     ; preds = %.lr.ph, %0
  %.pre96 = phi i32 [ %15, %0 ], [ %29, %.lr.ph ]
  %17 = load i32, ptr @e, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph51, label %.preheader47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03949 = phi i32 [ %28, %.lr.ph ], [ 1, %0 ]
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @g, i64 0, i64 %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %23 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %23, ptr %4, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @g, i64 0, i64 %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %27 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %27, ptr %5, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %28 = add nuw nsw i32 %.03949, 1
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %.lr.ph, label %.preheader48, !llvm.loop !9

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

.preheader47:                                     ; preds = %.preheader47.loopexit, %.preheader48
  %.pre = phi i32 [ %.pre.pre, %.preheader47.loopexit ], [ %.pre96, %.preheader48 ]
  %31 = load i32, ptr @k, align 4, !tbaa !5
  %.not55 = icmp slt i32 %31, 0
  br i1 %.not55, label %.preheader45, label %.preheader46.lr.ph

.preheader46.lr.ph:                               ; preds = %.preheader47
  %.not4452 = icmp slt i32 %.pre, 1
  br i1 %.not4452, label %._crit_edge60, label %.preheader46.preheader

.preheader46.preheader:                           ; preds = %.preheader46.lr.ph
  %32 = add nuw i32 %31, 1
  %wide.trip.count81 = zext i32 %32 to i64
  %33 = zext nneg i32 %.pre to i64
  %xtraiter = and i64 %33, 3
  %34 = icmp ult i32 %.pre, 4
  %unroll_iter = and i64 %33, 2147483644
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader46

.lr.ph51:                                         ; preds = %.preheader48, %.lr.ph51
  %.03850 = phi i32 [ %44, %.lr.ph51 ], [ 0, %.preheader48 ]
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @s, i64 0, i64 %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %39 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %39, ptr %6, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @s, i64 0, i64 %41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %43 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %43, ptr %7, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  %44 = add nuw nsw i32 %.03850, 1
  %45 = load i32, ptr @e, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %.lr.ph51, label %.preheader47.loopexit, !llvm.loop !11

.preheader46:                                     ; preds = %.preheader46.preheader, %._crit_edge
  %indvars.iv78 = phi i64 [ 0, %.preheader46.preheader ], [ %indvars.iv.next79, %._crit_edge ]
  br i1 %34, label %._crit_edge.unr-lcssa, label %.preheader46.new

.preheader45:                                     ; preds = %._crit_edge, %.preheader47
  %.not4057 = icmp slt i32 %.pre, 1
  br i1 %.not4057, label %._crit_edge60, label %.lr.ph59

._crit_edge.unr-lcssa:                            ; preds = %.preheader46.new, %.preheader46
  %indvars.iv.unr = phi i64 [ 1, %.preheader46 ], [ %indvars.iv.next.3, %.preheader46.new ]
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.unr-lcssa ]
  %47 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv.epil, i64 %indvars.iv78
  store i32 1000000000, ptr %47, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !12

._crit_edge:                                      ; preds = %.epil.preheader, %._crit_edge.unr-lcssa
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
  br i1 %exitcond82.not, label %.preheader45, label %.preheader46, !llvm.loop !14

.preheader46.new:                                 ; preds = %.preheader46, %.preheader46.new
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader46.new ], [ 1, %.preheader46 ]
  %niter = phi i64 [ %niter.next.3, %.preheader46.new ], [ 0, %.preheader46 ]
  %48 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv, i64 %indvars.iv78
  store i32 1000000000, ptr %48, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv.next, i64 %indvars.iv78
  store i32 1000000000, ptr %49, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %50 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv.next.1, i64 %indvars.iv78
  store i32 1000000000, ptr %50, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %51 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv.next.2, i64 %indvars.iv78
  store i32 1000000000, ptr %51, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.preheader46.new, !llvm.loop !15

._crit_edge60:                                    ; preds = %58, %.preheader46.lr.ph, %.preheader45
  call void @_Z3dfsiii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  call void @_Z4dfs2iii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  %52 = load i32, ptr @k, align 4, !tbaa !5
  %.not4168 = icmp slt i32 %52, 1
  br i1 %.not4168, label %._crit_edge70, label %.preheader

.lr.ph59:                                         ; preds = %.preheader45, %58
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %58 ], [ 1, %.preheader45 ]
  %53 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv83
  %54 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %53) #8
  %55 = icmp ult i64 %54, 2
  br i1 %55, label %56, label %58

56:                                               ; preds = %.lr.ph59
  %57 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv83
  store i32 0, ptr %57, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %.lr.ph59, %56
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %.not40.not = icmp slt i64 %indvars.iv83, %60
  br i1 %.not40.not, label %.lr.ph59, label %._crit_edge60, !llvm.loop !16

.preheader:                                       ; preds = %._crit_edge60, %._crit_edge67
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %._crit_edge67 ], [ 1, %._crit_edge60 ]
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %.not4364 = icmp slt i32 %61, 1
  br i1 %.not4364, label %._crit_edge67, label %.lr.ph66

.lr.ph66:                                         ; preds = %.preheader
  %62 = add nsw i64 %indvars.iv89, -1
  br label %69

._crit_edge70:                                    ; preds = %._crit_edge67, %._crit_edge60
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %63)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %.not4271 = icmp slt i32 %66, 1
  br i1 %.not4271, label %._crit_edge75, label %.lr.ph74

._crit_edge67:                                    ; preds = %._crit_edge63, %.preheader
  call void @_Z3dfsiii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  call void @_Z4dfs2iii(i32 noundef 1, i32 noundef -1, i32 noundef 0)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %67 = load i32, ptr @k, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %.not41.not = icmp slt i64 %indvars.iv89, %68
  br i1 %.not41.not, label %.preheader, label %._crit_edge70, !llvm.loop !17

69:                                               ; preds = %.lr.ph66, %._crit_edge63
  %indvars.iv86 = phi i64 [ 1, %.lr.ph66 ], [ %indvars.iv.next87, %._crit_edge63 ]
  %70 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv86, i64 %62
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv86, i64 %indvars.iv89
  store i32 %71, ptr %72, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %73 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @s, i64 0, i64 %indvars.iv86
  %74 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #8
  store ptr %74, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %75 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #8
  store ptr %75, ptr %9, align 8
  %76 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br i1 %76, label %.lr.ph62, label %._crit_edge63

._crit_edge63:                                    ; preds = %.lr.ph62, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %.not43.not = icmp slt i64 %indvars.iv86, %78
  br i1 %.not43.not, label %69, label %._crit_edge67, !llvm.loop !18

.lr.ph62:                                         ; preds = %69, %.lr.ph62
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %79 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %80 = load i32, ptr %79, align 4, !tbaa !19
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %81, i64 %62
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %85 = getelementptr inbounds i8, ptr %84, i64 4
  %86 = load i32, ptr %85, align 4, !tbaa !21
  %87 = add nsw i32 %86, %83
  store i32 %87, ptr %10, align 4, !tbaa !5
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %72, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %89 = load i32, ptr %88, align 4, !tbaa !5
  store i32 %89, ptr %72, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  %90 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %91 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #8
  store ptr %91, ptr %9, align 8
  %92 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br i1 %92, label %.lr.ph62, label %._crit_edge63, !llvm.loop !22

._crit_edge75:                                    ; preds = %.lr.ph74, %._crit_edge70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.lr.ph74:                                         ; preds = %._crit_edge70, %.lr.ph74
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.lr.ph74 ], [ 1, %._crit_edge70 ]
  %93 = load i32, ptr @k, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10001 x [1011 x i32]], ptr @d, i64 0, i64 %indvars.iv92, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %96)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef nonnull @.str.4)
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %.not42.not = icmp slt i64 %indvars.iv92, %100
  br i1 %.not42.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !23
}

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #7

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!21 = !{!20, !6, i64 4}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


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