; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2017-18/Jan 2018/Plat (lifeguards _simpler)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"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::allocator.0" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@dp = external dso_local global [100005 x [101 x i32]], align 16
@up = external dso_local global [100005 x [101 x i32]], align 16
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator.0", align 1
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %30 unwind label %36

30:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %31 unwind label %40

31:                                               ; preds = %30
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @N, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %32 = load i32, ptr @K, align 4, !tbaa !5
  %33 = load i32, ptr @N, align 4, !tbaa !5
  %34 = icmp eq i32 %32, %33
  br i1 %34, label %35, label %45

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @exit(i32 noundef 0) #8
  unreachable

36:                                               ; preds = %0
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %4, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %5, align 4
  br label %44

40:                                               ; preds = %30
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %4, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  br label %44

44:                                               ; preds = %40, %36
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %330

45:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  %46 = load i32, ptr @N, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  call void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %47, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %48 unwind label %70

48:                                               ; preds = %45
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  invoke void @_ZN5input2reISt4pairIiiEEEvRSt6vectorIT_SaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %49 unwind label %74

49:                                               ; preds = %48
  %50 = invoke ptr @_ZSt5beginISt6vectorISt4pairIiiESaIS2_EEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %51 unwind label %74

51:                                               ; preds = %49
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %50, ptr %52, align 8
  %53 = invoke ptr @_ZSt3endISt6vectorISt4pairIiiESaIS2_EEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %54 unwind label %74

54:                                               ; preds = %51
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %53, ptr %55, align 8
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %57, ptr %59)
          to label %60 unwind label %74

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store ptr %7, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %61 = load ptr, ptr %12, align 8, !tbaa !9
  %62 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #7
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %64 = load ptr, ptr %12, align 8, !tbaa !9
  %65 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #7
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %65, ptr %66, align 8
  br label %67

67:                                               ; preds = %98, %60
  %68 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br i1 %68, label %78, label %69

69:                                               ; preds = %67
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %104

70:                                               ; preds = %45
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %4, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %5, align 4
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  br label %329

74:                                               ; preds = %54, %51, %49, %48
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %4, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %5, align 4
  br label %328

78:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %79 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  store ptr %79, ptr %16, align 8, !tbaa !9
  %80 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  %81 = trunc i64 %80 to i32
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %92

83:                                               ; preds = %78
  %84 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  %85 = getelementptr inbounds %"struct.std::pair", ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = load ptr, ptr %16, align 8, !tbaa !9
  %88 = getelementptr inbounds %"struct.std::pair", ptr %87, i32 0, i32 1
  %89 = load i32, ptr %88, align 4, !tbaa !11
  %90 = icmp sge i32 %86, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  store i32 3, ptr %15, align 4
  br label %95

92:                                               ; preds = %83, %78
  %93 = load ptr, ptr %16, align 8, !tbaa !9
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(8) %93)
          to label %94 unwind label %100

94:                                               ; preds = %92
  store i32 0, ptr %15, align 4
  br label %95

95:                                               ; preds = %94, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %96 = load i32, ptr %15, align 4
  switch i32 %96, label %335 [
    i32 0, label %97
    i32 3, label %98
  ]

97:                                               ; preds = %95
  br label %98

98:                                               ; preds = %97, %95
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br label %67

100:                                              ; preds = %92
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %4, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %327

104:                                              ; preds = %69
  %105 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %106 = trunc i64 %105 to i32
  %107 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  %108 = trunc i64 %107 to i32
  %109 = sub nsw i32 %106, %108
  %110 = load i32, ptr @K, align 4, !tbaa !5
  %111 = sub nsw i32 %110, %109
  store i32 %111, ptr @K, align 4, !tbaa !5
  call void @_ZSt4swapISt4pairIiiESaIS1_EEvRSt6vectorIT_T0_ES7_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  %112 = invoke noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) @K, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %113 unwind label %120

113:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %311, %113
  %115 = load i32, ptr %20, align 4, !tbaa !5
  %116 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %117 = trunc i64 %116 to i32
  %118 = icmp slt i32 %115, %117
  br i1 %118, label %124, label %119

119:                                              ; preds = %114
  store i32 4, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %319

120:                                              ; preds = %104
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %4, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %327

124:                                              ; preds = %114
  br label %125

125:                                              ; preds = %137, %124
  %126 = load i32, ptr %19, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %127) #7
  %129 = getelementptr inbounds %"struct.std::pair", ptr %128, i32 0, i32 1
  %130 = load i32, ptr %129, align 4, !tbaa !11
  %131 = load i32, ptr %20, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %132) #7
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 4, !tbaa !13
  %136 = icmp slt i32 %130, %135
  br i1 %136, label %137, label %140

137:                                              ; preds = %125
  %138 = load i32, ptr %19, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %19, align 4, !tbaa !5
  br label %125, !llvm.loop !14

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

141:                                              ; preds = %289, %140
  %142 = load i32, ptr %21, align 4, !tbaa !5
  %143 = load i32, ptr @K, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  %145 = icmp slt i32 %142, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %141
  store i32 9, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %293

147:                                              ; preds = %141
  %148 = load i32, ptr %21, align 4, !tbaa !5
  %149 = load i32, ptr %20, align 4, !tbaa !5
  %150 = icmp sgt i32 %148, %149
  br i1 %150, label %151, label %158

151:                                              ; preds = %147
  %152 = load i32, ptr %20, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %153
  %155 = load i32, ptr %21, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [101 x i32], ptr %154, i64 0, i64 %156
  store i32 -1000000007, ptr %157, align 4, !tbaa !5
  br label %248

158:                                              ; preds = %147
  %159 = load i32, ptr %19, align 4, !tbaa !5
  %160 = load i32, ptr %20, align 4, !tbaa !5
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %162, label %202

162:                                              ; preds = %158
  %163 = load i32, ptr %20, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %164
  %166 = load i32, ptr %21, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [101 x i32], ptr %165, i64 0, i64 %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %169 = load i32, ptr %19, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %172 = load i32, ptr %21, align 4, !tbaa !5
  %173 = load i32, ptr %20, align 4, !tbaa !5
  %174 = load i32, ptr %19, align 4, !tbaa !5
  %175 = sub nsw i32 %173, %174
  %176 = sub nsw i32 %175, 1
  %177 = sub nsw i32 %172, %176
  store i32 %177, ptr %24, align 4, !tbaa !5
  %178 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %179 unwind label %198

179:                                              ; preds = %162
  %180 = load i32, ptr %178, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [101 x i32], ptr %171, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = load i32, ptr %20, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %185) #7
  %187 = getelementptr inbounds %"struct.std::pair", ptr %186, i32 0, i32 1
  %188 = load i32, ptr %187, align 4, !tbaa !11
  %189 = add nsw i32 %183, %188
  %190 = load i32, ptr %19, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %191) #7
  %193 = getelementptr inbounds %"struct.std::pair", ptr %192, i32 0, i32 1
  %194 = load i32, ptr %193, align 4, !tbaa !11
  %195 = sub nsw i32 %189, %194
  store i32 %195, ptr %22, align 4, !tbaa !5
  %196 = invoke noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %168, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %197 unwind label %198

197:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %202

198:                                              ; preds = %179, %162
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %4, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %292

202:                                              ; preds = %197, %158
  %203 = load i32, ptr %20, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %204
  %206 = load i32, ptr %21, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [101 x i32], ptr %205, i64 0, i64 %207
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %209 = load i32, ptr %19, align 4, !tbaa !5
  %210 = icmp ne i32 %209, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  br i1 %210, label %211, label %227

211:                                              ; preds = %202
  %212 = load i32, ptr %19, align 4, !tbaa !5
  %213 = sub nsw i32 %212, 1
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %214
  store i32 0, ptr %26, align 4, !tbaa !5
  %216 = load i32, ptr %21, align 4, !tbaa !5
  %217 = load i32, ptr %20, align 4, !tbaa !5
  %218 = load i32, ptr %19, align 4, !tbaa !5
  %219 = sub nsw i32 %217, %218
  %220 = sub nsw i32 %216, %219
  store i32 %220, ptr %27, align 4, !tbaa !5
  %221 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %222 unwind label %244

222:                                              ; preds = %211
  %223 = load i32, ptr %221, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [101 x i32], ptr %215, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  br label %228

227:                                              ; preds = %202
  br label %228

228:                                              ; preds = %227, %222
  %229 = phi i32 [ %226, %222 ], [ 0, %227 ]
  %230 = load i32, ptr %20, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %231) #7
  %233 = getelementptr inbounds %"struct.std::pair", ptr %232, i32 0, i32 1
  %234 = load i32, ptr %233, align 4, !tbaa !11
  %235 = add nsw i32 %229, %234
  %236 = load i32, ptr %20, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %237) #7
  %239 = getelementptr inbounds %"struct.std::pair", ptr %238, i32 0, i32 0
  %240 = load i32, ptr %239, align 4, !tbaa !13
  %241 = sub nsw i32 %235, %240
  store i32 %241, ptr %25, align 4, !tbaa !5
  %242 = invoke noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %208, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %243 unwind label %244

243:                                              ; preds = %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %248

244:                                              ; preds = %228, %211
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %4, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %292

248:                                              ; preds = %243, %151
  %249 = load i32, ptr %20, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %250
  %252 = load i32, ptr %21, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [101 x i32], ptr %251, i64 0, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !5
  %256 = load i32, ptr %20, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %257
  %259 = load i32, ptr %21, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [101 x i32], ptr %258, i64 0, i64 %260
  store i32 %255, ptr %261, align 4, !tbaa !5
  %262 = load i32, ptr %20, align 4, !tbaa !5
  %263 = icmp ne i32 %262, 0
  br i1 %263, label %264, label %288

264:                                              ; preds = %248
  %265 = load i32, ptr %21, align 4, !tbaa !5
  %266 = icmp ne i32 %265, 0
  br i1 %266, label %267, label %288

267:                                              ; preds = %264
  %268 = load i32, ptr %20, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %269
  %271 = load i32, ptr %21, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [101 x i32], ptr %270, i64 0, i64 %272
  %274 = load i32, ptr %20, align 4, !tbaa !5
  %275 = sub nsw i32 %274, 1
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %276
  %278 = load i32, ptr %21, align 4, !tbaa !5
  %279 = sub nsw i32 %278, 1
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [101 x i32], ptr %277, i64 0, i64 %280
  %282 = invoke noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %273, ptr noundef nonnull align 4 dereferenceable(4) %281)
          to label %283 unwind label %284

283:                                              ; preds = %267
  br label %288

284:                                              ; preds = %267
  %285 = landingpad { ptr, i32 }
          cleanup
  %286 = extractvalue { ptr, i32 } %285, 0
  store ptr %286, ptr %4, align 8
  %287 = extractvalue { ptr, i32 } %285, 1
  store i32 %287, ptr %5, align 4
  br label %292

288:                                              ; preds = %283, %264, %248
  br label %289

289:                                              ; preds = %288
  %290 = load i32, ptr %21, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %21, align 4, !tbaa !5
  br label %141, !llvm.loop !16

292:                                              ; preds = %284, %244, %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %318

293:                                              ; preds = %146
  %294 = load i32, ptr %20, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %295
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %297 = load i32, ptr @K, align 4, !tbaa !5
  %298 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %299 = trunc i64 %298 to i32
  %300 = sub nsw i32 %299, 1
  %301 = load i32, ptr %20, align 4, !tbaa !5
  %302 = sub nsw i32 %300, %301
  %303 = sub nsw i32 %297, %302
  store i32 %303, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !5
  %304 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %305 unwind label %314

305:                                              ; preds = %293
  %306 = load i32, ptr %304, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [101 x i32], ptr %296, i64 0, i64 %307
  %309 = invoke noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %308)
          to label %310 unwind label %314

310:                                              ; preds = %305
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %311

311:                                              ; preds = %310
  %312 = load i32, ptr %20, align 4, !tbaa !5
  %313 = add nsw i32 %312, 1
  store i32 %313, ptr %20, align 4, !tbaa !5
  br label %114, !llvm.loop !17

314:                                              ; preds = %305, %293
  %315 = landingpad { ptr, i32 }
          cleanup
  %316 = extractvalue { ptr, i32 } %315, 0
  store ptr %316, ptr %4, align 8
  %317 = extractvalue { ptr, i32 } %315, 1
  store i32 %317, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %318

318:                                              ; preds = %314, %292
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %326

319:                                              ; preds = %119
  invoke void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %320 unwind label %322

320:                                              ; preds = %319
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  %321 = load i32, ptr %1, align 4
  ret i32 %321

322:                                              ; preds = %319
  %323 = landingpad { ptr, i32 }
          cleanup
  %324 = extractvalue { ptr, i32 } %323, 0
  store ptr %324, ptr %4, align 8
  %325 = extractvalue { ptr, i32 } %323, 1
  store i32 %325, ptr %5, align 4
  br label %326

326:                                              ; preds = %322, %318
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %327

327:                                              ; preds = %326, %120, %100
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  br label %328

328:                                              ; preds = %327, %74
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %329

329:                                              ; preds = %328, %70
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  br label %330

330:                                              ; preds = %329, %44
  %331 = load ptr, ptr %4, align 8
  %332 = load i32, ptr %5, align 4
  %333 = insertvalue { ptr, i32 } poison, ptr %331, 0
  %334 = insertvalue { ptr, i32 } %333, i32 %332, 1
  resume { ptr, i32 } %334

335:                                              ; preds = %95
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #5

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt4pairIiiESaIS1_EEvRSt6vectorIT_T0_ES7_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

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

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


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"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::allocator.0" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@dp = external dso_local global [100005 x [101 x i32]], align 16
@up = external dso_local global [100005 x [101 x i32]], align 16
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator.0", align 1
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, 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 i32, align 4
  %18 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %19 unwind label %25

19:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %20 unwind label %27

20:                                               ; preds = %19
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @N, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %21 = load i32, ptr @K, align 4, !tbaa !5
  %22 = load i32, ptr @N, align 4, !tbaa !5
  %23 = icmp eq i32 %21, %22
  br i1 %23, label %24, label %30

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @exit(i32 noundef 0) #8
  unreachable

25:                                               ; preds = %0
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %29

27:                                               ; preds = %19
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  br label %29

29:                                               ; preds = %27, %25
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %26, %25 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  br label %192

30:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %31 = sext i32 %22 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %31, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %32 unwind label %50

32:                                               ; preds = %30
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  invoke void @_ZN5input2reISt4pairIiiEEEvRSt6vectorIT_SaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %33 unwind label %52

33:                                               ; preds = %32
  %34 = call ptr @_ZSt5beginISt6vectorISt4pairIiiESaIS2_EEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %35 = call ptr @_ZSt3endISt6vectorISt4pairIiiESaIS2_EEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24) %4)
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %34, ptr %35)
          to label %36 unwind label %52

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %37 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  store ptr %37, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %38 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  store ptr %38, ptr %8, align 8
  %39 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %39, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %64, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %40 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %41 = trunc i64 %40 to i32
  %42 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %43 = trunc i64 %42 to i32
  %.neg = sub i32 %43, %41
  %44 = load i32, ptr @K, align 4, !tbaa !5
  %45 = add i32 %.neg, %44
  store i32 %45, ptr @K, align 4, !tbaa !5
  call void @_ZSt4swapISt4pairIiiESaIS1_EEvRSt6vectorIT_T0_ES7_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  %46 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) @K, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  %47 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %48 = trunc i64 %47 to i32
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.preheader79, label %._crit_edge90

50:                                               ; preds = %30
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  br label %191

52:                                               ; preds = %33, %32
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %190

.lr.ph:                                           ; preds = %36, %64
  %54 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %55 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %56 = and i64 %55, 4294967295
  %.not63 = icmp eq i64 %56, 0
  br i1 %.not63, label %63, label %57

57:                                               ; preds = %.lr.ph
  %58 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %59 = getelementptr inbounds i8, ptr %58, i64 4
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %54, i64 4
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %.not64 = icmp slt i32 %60, %62
  br i1 %.not64, label %63, label %64

63:                                               ; preds = %57, %.lr.ph
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(8) %54)
          to label %64 unwind label %67

64:                                               ; preds = %63, %57
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %66 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %66, label %.lr.ph, label %._crit_edge

67:                                               ; preds = %63
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %189

.preheader79:                                     ; preds = %._crit_edge, %._crit_edge86
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %._crit_edge86 ], [ 0, %._crit_edge ]
  %.050.neg89 = phi i32 [ %133, %._crit_edge86 ], [ 0, %._crit_edge ]
  %.05187 = phi i64 [ %indvars.iv, %._crit_edge86 ], [ 0, %._crit_edge ]
  %sext = shl i64 %.05187, 32
  %69 = ashr exact i64 %sext, 32
  br label %70

._crit_edge90:                                    ; preds = %._crit_edge86, %._crit_edge
  invoke void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %186 unwind label %187

70:                                               ; preds = %70, %.preheader79
  %indvars.iv = phi i64 [ %indvars.iv.next, %70 ], [ %69, %.preheader79 ]
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #7
  %72 = getelementptr inbounds i8, ptr %71, i64 4
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv99) #7
  %75 = load i32, ptr %74, align 4, !tbaa !11
  %76 = icmp slt i32 %73, %75
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  br i1 %76, label %70, label %.preheader, !llvm.loop !12

.preheader:                                       ; preds = %70
  %77 = load i32, ptr @K, align 4, !tbaa !5
  %.not82 = icmp slt i32 %77, 0
  br i1 %.not82, label %._crit_edge86, label %78

78:                                               ; preds = %.preheader
  %79 = trunc nsw i64 %indvars.iv to i32
  %sext107 = shl i64 %indvars.iv, 32
  %80 = ashr exact i64 %sext107, 32
  %81 = icmp slt i64 %80, %indvars.iv99
  %.neg91 = add i32 %79, 1
  %.neg73 = add i32 %.neg91, %.050.neg89
  %.not61 = icmp eq i64 %indvars.iv, 0
  %82 = shl i64 %indvars.iv, 32
  %sext108 = add i64 %82, -4294967296
  %83 = ashr exact i64 %sext108, 32
  %.neg62 = add i32 %.050.neg89, %79
  %.not = icmp eq i64 %indvars.iv99, 0
  %84 = add nsw i64 %indvars.iv99, -1
  br i1 %81, label %85, label %101

85:                                               ; preds = %78
  %86 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv99, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  store i32 %.neg73, ptr %13, align 4, !tbaa !5
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv99) #7
  %93 = getelementptr inbounds i8, ptr %92, i64 4
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = add nsw i32 %94, %91
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #7
  %97 = getelementptr inbounds i8, ptr %96, i64 4
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = sub i32 %95, %98
  store i32 %99, ptr %11, align 4, !tbaa !5
  %100 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %86, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %101

101:                                              ; preds = %85, %78
  %102 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv99, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  br i1 %.not61, label %109, label %103

103:                                              ; preds = %101
  store i32 0, ptr %15, align 4, !tbaa !5
  store i32 %.neg62, ptr %16, align 4, !tbaa !5
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %83, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %101, %103
  %110 = phi i32 [ %108, %103 ], [ 0, %101 ]
  %111 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv99) #7
  %112 = getelementptr inbounds i8, ptr %111, i64 4
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = add nsw i32 %113, %110
  %115 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv99) #7
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = sub i32 %114, %116
  store i32 %117, ptr %14, align 4, !tbaa !5
  %118 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %102, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  %.pre = load i32, ptr %102, align 4, !tbaa !5
  %119 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %indvars.iv99, i64 0
  store i32 %.pre, ptr %119, align 4, !tbaa !5
  %.pre104 = load i32, ptr @K, align 4, !tbaa !5
  %.not.not.peel = icmp sgt i32 %.pre104, 0
  br i1 %.not.not.peel, label %.peel.next, label %._crit_edge86

._crit_edge86:                                    ; preds = %183, %109, %.preheader
  %.lcssa81 = phi i32 [ %77, %.preheader ], [ %.pre104, %109 ], [ %184, %183 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #7
  %120 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %121 = trunc i64 %120 to i32
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %122 = trunc nuw nsw i64 %indvars.iv.next100 to i32
  %.neg78 = add i32 %.lcssa81, %122
  %123 = sub i32 %.neg78, %121
  store i32 %123, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv99, i64 %126
  %128 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %127)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #7
  %129 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %sext109 = shl i64 %129, 32
  %130 = ashr exact i64 %sext109, 32
  %131 = icmp slt i64 %indvars.iv.next100, %130
  %132 = trunc i64 %indvars.iv99 to i32
  %133 = xor i32 %132, -1
  br i1 %131, label %.preheader79, label %._crit_edge90, !llvm.loop !14

.peel.next:                                       ; preds = %109, %183
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %183 ], [ 1, %109 ]
  %134 = icmp ugt i64 %indvars.iv95, %indvars.iv99
  br i1 %134, label %135, label %137

135:                                              ; preds = %.peel.next
  %136 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv99, i64 %indvars.iv95
  store i32 -1000000007, ptr %136, align 4, !tbaa !5
  br label %176

137:                                              ; preds = %.peel.next
  br i1 %81, label %138, label %156

138:                                              ; preds = %137
  %139 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv99, i64 %indvars.iv95
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %140 = trunc nuw nsw i64 %indvars.iv95 to i32
  %141 = add i32 %.neg73, %140
  store i32 %141, ptr %13, align 4, !tbaa !5
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv99) #7
  %148 = getelementptr inbounds i8, ptr %147, i64 4
  %149 = load i32, ptr %148, align 4, !tbaa !9
  %150 = add nsw i32 %149, %146
  %151 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #7
  %152 = getelementptr inbounds i8, ptr %151, i64 4
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = sub i32 %150, %153
  store i32 %154, ptr %11, align 4, !tbaa !5
  %155 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %139, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %156

156:                                              ; preds = %138, %137
  %157 = getelementptr inbounds [100005 x [101 x i32]], ptr @dp, i64 0, i64 %indvars.iv99, i64 %indvars.iv95
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  br i1 %.not61, label %166, label %158

158:                                              ; preds = %156
  store i32 0, ptr %15, align 4, !tbaa !5
  %159 = trunc nuw nsw i64 %indvars.iv95 to i32
  %160 = add i32 %.neg62, %159
  store i32 %160, ptr %16, align 4, !tbaa !5
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %83, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %156, %158
  %167 = phi i32 [ %165, %158 ], [ 0, %156 ]
  %168 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv99) #7
  %169 = getelementptr inbounds i8, ptr %168, i64 4
  %170 = load i32, ptr %169, align 4, !tbaa !9
  %171 = add nsw i32 %170, %167
  %172 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv99) #7
  %173 = load i32, ptr %172, align 4, !tbaa !11
  %174 = sub i32 %171, %173
  store i32 %174, ptr %14, align 4, !tbaa !5
  %175 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %157, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  %.pre106 = load i32, ptr %157, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %166, %135
  %177 = phi i32 [ %.pre106, %166 ], [ -1000000007, %135 ]
  %178 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %indvars.iv99, i64 %indvars.iv95
  store i32 %177, ptr %178, align 4, !tbaa !5
  br i1 %.not, label %183, label %179

179:                                              ; preds = %176
  %180 = add nsw i64 %indvars.iv95, -1
  %181 = getelementptr inbounds [100005 x [101 x i32]], ptr @up, i64 0, i64 %84, i64 %180
  %182 = call noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %178, ptr noundef nonnull align 4 dereferenceable(4) %181)
  br label %183

183:                                              ; preds = %176, %179
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %184 = load i32, ptr @K, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %.not.not = icmp slt i64 %indvars.iv95, %185
  br i1 %.not.not, label %.peel.next, label %._crit_edge86, !llvm.loop !15

186:                                              ; preds = %._crit_edge90
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  ret i32 0

187:                                              ; preds = %._crit_edge90
  %188 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %189

189:                                              ; preds = %187, %67
  %.pn65 = phi { ptr, i32 } [ %68, %67 ], [ %188, %187 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %190

190:                                              ; preds = %189, %52
  %.pn65.pn = phi { ptr, i32 } [ %.pn65, %189 ], [ %53, %52 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %191

191:                                              ; preds = %190, %50
  %.pn65.pn.pn = phi { ptr, i32 } [ %.pn65.pn, %190 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %192

192:                                              ; preds = %191, %29
  %.pn65.pn.pn.pn = phi { ptr, i32 } [ %.pn65.pn.pn, %191 ], [ %.pn, %29 ]
  resume { ptr, i32 } %.pn65.pn.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIiiEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @_ZSt5beginISt6vectorISt4pairIiiESaIS2_EEEDTcldtfp_5beginEERT_(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @_ZSt3endISt6vectorISt4pairIiiESaIS2_EEEDTcldtfp_3endEERT_(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt4pairIiiESaIS1_EEvRSt6vectorIT_T0_ES7_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5ckmaxIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIiiEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

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

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass