; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2010-11 (lostcows)

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::queue.6" = type { %"class.std::deque.7" }
%"class.std::deque.7" = type { %"class.std::_Deque_base.8" }
%"class.std::_Deque_base.8" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.9", %"struct.std::_Deque_iterator.9" }
%"struct.std::_Deque_iterator.9" = type { ptr, ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.10" = type { ptr }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@nex = external dso_local global [201 x [201 x i32]], align 16
@dist = external dso_local global [201 x [201 x %"struct.std::pair"]], align 16
@DIST = external dso_local global [201 x %"struct.std::pair"], align 16
@radj = external dso_local global [201 x [201 x %"class.std::vector"]], align 16
@q = external dso_local global %"class.std::queue", align 8
@Q = external dso_local global %"class.std::queue.6", align 8
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL3MOD = external hidden constant i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 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 i32, 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 %"struct.std::pair", align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca i32, align 4
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca %"class.std::vector", align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca ptr, align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %37 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %38 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %39 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %40 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %41 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %42 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %43 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %44 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %45 = alloca i32, align 4
  %46 = alloca %"struct.std::pair", align 4
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca i32, align 4
  %50 = alloca ptr, align 8
  %51 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %52 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %53 = alloca ptr, align 8
  %54 = alloca %"struct.std::pair", align 4
  %55 = 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.8, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %56 unwind label %64

56:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %57 unwind label %68

57:                                               ; preds = %56
  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 @_ZN2io2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @N, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %99, %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr @N, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  %62 = icmp slt i32 %59, %61
  br i1 %62, label %73, label %63

63:                                               ; preds = %58
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %102

64:                                               ; preds = %0
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %4, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %5, align 4
  br label %72

68:                                               ; preds = %56
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %4, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  br label %72

72:                                               ; preds = %68, %64
  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 %508

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

74:                                               ; preds = %88, %73
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = load i32, ptr @N, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = icmp slt i32 %75, %77
  br i1 %78, label %80, label %79

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

80:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS3_S4_EEEbE4typeELb1EEERKiS8_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD)
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %82
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [201 x %"struct.std::pair"], ptr %83, i64 0, i64 %85
  %87 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %86, ptr noundef nonnull align 4 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %88

88:                                               ; preds = %80
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %8, align 4, !tbaa !5
  br label %74, !llvm.loop !9

91:                                               ; preds = %79
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %93
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [201 x %"struct.std::pair"], ptr %94, i64 0, i64 %96
  %98 = getelementptr inbounds %"struct.std::pair", ptr %97, i32 0, i32 0
  store i32 0, ptr %98, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %99

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

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

103:                                              ; preds = %134, %102
  %104 = load i32, ptr %11, align 4, !tbaa !5
  %105 = load i32, ptr @M, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  %107 = icmp slt i32 %104, %106
  br i1 %107, label %109, label %108

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

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

110:                                              ; preds = %130, %109
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = load i32, ptr @N, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = icmp slt i32 %111, %113
  br i1 %114, label %116, label %115

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

116:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @_ZN2io2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %13)
  %117 = load i32, ptr %13, align 4, !tbaa !5
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %119
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [201 x i32], ptr %120, i64 0, i64 %122
  store i32 %117, ptr %123, align 4, !tbaa !5
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %125
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [201 x %"class.std::vector"], ptr %126, i64 0, i64 %128
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %129, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %130

130:                                              ; preds = %116
  %131 = load i32, ptr %12, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %12, align 4, !tbaa !5
  br label %110, !llvm.loop !14

133:                                              ; preds = %115
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %11, align 4, !tbaa !5
  br label %103, !llvm.loop !15

137:                                              ; preds = %108
  br label %138

138:                                              ; preds = %231, %137
  %139 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %140 = trunc i64 %139 to i32
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %232

142:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %143 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %143, i64 8, i1 false)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %228, %142
  %145 = load i32, ptr %15, align 4, !tbaa !5
  %146 = load i32, ptr @M, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  %148 = icmp slt i32 %145, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %144
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %231

150:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %151 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %152 = load i32, ptr %151, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %153
  %155 = load i32, ptr %15, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [201 x %"class.std::vector"], ptr %154, i64 0, i64 %156
  store ptr %157, ptr %16, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %158 = load ptr, ptr %16, align 8, !tbaa !16
  %159 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %158) #7
  %160 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %159, ptr %160, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %161 = load ptr, ptr %16, align 8, !tbaa !16
  %162 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %161) #7
  %163 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %162, ptr %163, align 8
  br label %164

164:                                              ; preds = %225, %150
  %165 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %165, label %167, label %166

166:                                              ; preds = %164
  store i32 19, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %227

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %168 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  store ptr %168, ptr %19, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %169 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %170 = load i32, ptr %169, align 4, !tbaa !18
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %171
  %173 = load i32, ptr %15, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [201 x %"class.std::vector"], ptr %172, i64 0, i64 %174
  store ptr %175, ptr %20, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %176 = load ptr, ptr %20, align 8, !tbaa !16
  %177 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %176) #7
  %178 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %177, ptr %178, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %179 = load ptr, ptr %20, align 8, !tbaa !16
  %180 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %179) #7
  %181 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %180, ptr %181, align 8
  br label %182

182:                                              ; preds = %222, %167
  %183 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br i1 %183, label %185, label %184

184:                                              ; preds = %182
  store i32 21, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %224

185:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  store ptr %186, ptr %23, align 8, !tbaa !16
  %187 = load ptr, ptr %19, align 8, !tbaa !16
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %189
  %191 = load ptr, ptr %23, align 8, !tbaa !16
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [201 x %"struct.std::pair"], ptr %190, i64 0, i64 %193
  %195 = getelementptr inbounds %"struct.std::pair", ptr %194, i32 0, i32 0
  %196 = load i32, ptr %195, align 8, !tbaa !11
  %197 = icmp eq i32 %196, 1000000007
  br i1 %197, label %198, label %221

198:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %199 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %200 = load i32, ptr %199, align 4, !tbaa !11
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %201
  %203 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %204 = load i32, ptr %203, align 4, !tbaa !18
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [201 x %"struct.std::pair"], ptr %202, i64 0, i64 %205
  %207 = getelementptr inbounds %"struct.std::pair", ptr %206, i32 0, i32 0
  %208 = load i32, ptr %207, align 8, !tbaa !11
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %25, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %210 = load ptr, ptr %19, align 8, !tbaa !16
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %212
  %214 = load ptr, ptr %23, align 8, !tbaa !16
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [201 x %"struct.std::pair"], ptr %213, i64 0, i64 %216
  %218 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %217, ptr noundef nonnull align 4 dereferenceable(8) %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %219 = load ptr, ptr %19, align 8, !tbaa !16
  %220 = load ptr, ptr %23, align 8, !tbaa !16
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(4) %219, ptr noundef nonnull align 4 dereferenceable(4) %220)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(8) %26)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %221

221:                                              ; preds = %198, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %222

222:                                              ; preds = %221
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br label %182

224:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %225

225:                                              ; preds = %224
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %164

227:                                              ; preds = %166
  br label %228

228:                                              ; preds = %227
  %229 = load i32, ptr %15, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %15, align 4, !tbaa !5
  br label %144, !llvm.loop !19

231:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %138, !llvm.loop !20

232:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 1, ptr %28, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %241, %232
  %234 = load i32, ptr %28, align 4, !tbaa !5
  %235 = load i32, ptr @N, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  %237 = icmp slt i32 %234, %236
  br i1 %237, label %239, label %238

238:                                              ; preds = %233
  store i32 23, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %248

239:                                              ; preds = %233
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %240 unwind label %244

240:                                              ; preds = %239
  br label %241

241:                                              ; preds = %240
  %242 = load i32, ptr %28, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %28, align 4, !tbaa !5
  br label %233, !llvm.loop !21

244:                                              ; preds = %239
  %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 %28) #7
  br label %507

248:                                              ; preds = %238
  br label %249

249:                                              ; preds = %355, %248
  %250 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %251 = trunc i64 %250 to i32
  %252 = icmp sgt i32 %251, 1
  br i1 %252, label %253, label %371

253:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %254 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %255 = trunc i64 %254 to i32
  %256 = sub nsw i32 %255, 2
  %257 = sext i32 %256 to i64
  %258 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %257) #7
  %259 = load i32, ptr %258, align 4, !tbaa !5
  store i32 %259, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %260 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %261 = trunc i64 %260 to i32
  %262 = sub nsw i32 %261, 1
  %263 = sext i32 %262 to i64
  %264 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %263) #7
  %265 = load i32, ptr %264, align 4, !tbaa !5
  store i32 %265, ptr %30, align 4, !tbaa !5
  br label %266

266:                                              ; preds = %312, %253
  %267 = load i32, ptr %29, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %268
  %270 = load i32, ptr %30, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [201 x %"struct.std::pair"], ptr %269, i64 0, i64 %271
  %273 = getelementptr inbounds %"struct.std::pair", ptr %272, i32 0, i32 0
  %274 = load i32, ptr %273, align 8, !tbaa !11
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %276, label %327

276:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %277 = load i32, ptr %29, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %278
  %280 = load i32, ptr %30, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [201 x %"struct.std::pair"], ptr %279, i64 0, i64 %281
  %283 = getelementptr inbounds %"struct.std::pair", ptr %282, i32 0, i32 1
  %284 = load i32, ptr %283, align 4, !tbaa !18
  store i32 %284, ptr %31, align 4, !tbaa !5
  invoke void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %285 unwind label %295

285:                                              ; preds = %276
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  store ptr %27, ptr %32, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %286 = load ptr, ptr %32, align 8, !tbaa !16
  %287 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %286) #7
  %288 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %33, i32 0, i32 0
  store ptr %287, ptr %288, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %289 = load ptr, ptr %32, align 8, !tbaa !16
  %290 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %289) #7
  %291 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %290, ptr %291, align 8
  br label %292

292:                                              ; preds = %310, %285
  %293 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %34) #7
  br i1 %293, label %299, label %294

294:                                              ; preds = %292
  store i32 30, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %312

295:                                              ; preds = %276
  %296 = landingpad { ptr, i32 }
          cleanup
  %297 = extractvalue { ptr, i32 } %296, 0
  store ptr %297, ptr %4, align 8
  %298 = extractvalue { ptr, i32 } %296, 1
  store i32 %298, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %370

299:                                              ; preds = %292
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %300 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  store ptr %300, ptr %35, align 8, !tbaa !16
  %301 = load ptr, ptr %35, align 8, !tbaa !16
  %302 = load i32, ptr %301, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %303
  %305 = load i32, ptr %31, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [201 x i32], ptr %304, i64 0, i64 %306
  %308 = load i32, ptr %307, align 4, !tbaa !5
  %309 = load ptr, ptr %35, align 8, !tbaa !16
  store i32 %308, ptr %309, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  br label %310

310:                                              ; preds = %299
  %311 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  br label %292

312:                                              ; preds = %294
  %313 = load i32, ptr %29, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %314
  %316 = load i32, ptr %31, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [201 x i32], ptr %315, i64 0, i64 %317
  %319 = load i32, ptr %318, align 4, !tbaa !5
  store i32 %319, ptr %29, align 4, !tbaa !5
  %320 = load i32, ptr %30, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %321
  %323 = load i32, ptr %31, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [201 x i32], ptr %322, i64 0, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !5
  store i32 %326, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %266, !llvm.loop !22

327:                                              ; preds = %266
  %328 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %329 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  store ptr %328, ptr %329, align 8
  %330 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %331 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %37, i32 0, i32 0
  store ptr %330, ptr %331, align 8
  %332 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  %333 = load ptr, ptr %332, align 8
  %334 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %37, i32 0, i32 0
  %335 = load ptr, ptr %334, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %333, ptr %335)
          to label %336 unwind label %357

336:                                              ; preds = %327
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %337 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %338 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %40, i32 0, i32 0
  store ptr %337, ptr %338, align 8
  %339 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %340 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %41, i32 0, i32 0
  store ptr %339, ptr %340, align 8
  %341 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %40, i32 0, i32 0
  %342 = load ptr, ptr %341, align 8
  %343 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %41, i32 0, i32 0
  %344 = load ptr, ptr %343, align 8
  %345 = invoke ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %342, ptr %344)
          to label %346 unwind label %361

346:                                              ; preds = %336
  %347 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %39, i32 0, i32 0
  store ptr %345, ptr %347, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %39) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  %348 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %349 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %43, i32 0, i32 0
  store ptr %348, ptr %349, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %43) #7
  %350 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %38, i32 0, i32 0
  %351 = load ptr, ptr %350, align 8
  %352 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.10", ptr %42, i32 0, i32 0
  %353 = load ptr, ptr %352, align 8
  %354 = invoke ptr @_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EES6_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr %351, ptr %353)
          to label %355 unwind label %365

355:                                              ; preds = %346
  %356 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %44, i32 0, i32 0
  store ptr %354, ptr %356, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %249, !llvm.loop !23

357:                                              ; preds = %327
  %358 = landingpad { ptr, i32 }
          cleanup
  %359 = extractvalue { ptr, i32 } %358, 0
  store ptr %359, ptr %4, align 8
  %360 = extractvalue { ptr, i32 } %358, 1
  store i32 %360, ptr %5, align 4
  br label %370

361:                                              ; preds = %336
  %362 = landingpad { ptr, i32 }
          cleanup
  %363 = extractvalue { ptr, i32 } %362, 0
  store ptr %363, ptr %4, align 8
  %364 = extractvalue { ptr, i32 } %362, 1
  store i32 %364, ptr %5, align 4
  br label %369

365:                                              ; preds = %346
  %366 = landingpad { ptr, i32 }
          cleanup
  %367 = extractvalue { ptr, i32 } %366, 0
  store ptr %367, ptr %4, align 8
  %368 = extractvalue { ptr, i32 } %366, 1
  store i32 %368, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  br label %369

369:                                              ; preds = %365, %361
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  br label %370

370:                                              ; preds = %369, %357, %295
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %507

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

372:                                              ; preds = %384, %371
  %373 = load i32, ptr %45, align 4, !tbaa !5
  %374 = load i32, ptr @N, align 4, !tbaa !5
  %375 = add nsw i32 %374, 1
  %376 = icmp slt i32 %373, %375
  br i1 %376, label %378, label %377

377:                                              ; preds = %372
  store i32 32, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #7
  br label %391

378:                                              ; preds = %372
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #7
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS3_S4_EEEbE4typeELb1EEERKiS8_(ptr noundef nonnull align 4 dereferenceable(8) %46, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD)
          to label %379 unwind label %387

379:                                              ; preds = %378
  %380 = load i32, ptr %45, align 4, !tbaa !5
  %381 = sext i32 %380 to i64
  %382 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %381
  %383 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %382, ptr noundef nonnull align 4 dereferenceable(8) %46) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  br label %384

384:                                              ; preds = %379
  %385 = load i32, ptr %45, align 4, !tbaa !5
  %386 = add nsw i32 %385, 1
  store i32 %386, ptr %45, align 4, !tbaa !5
  br label %372, !llvm.loop !24

387:                                              ; preds = %378
  %388 = landingpad { ptr, i32 }
          cleanup
  %389 = extractvalue { ptr, i32 } %388, 0
  store ptr %389, ptr %4, align 8
  %390 = extractvalue { ptr, i32 } %388, 1
  store i32 %390, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #7
  br label %507

391:                                              ; preds = %377
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #7
  store i32 1, ptr %47, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %47)
          to label %392 unwind label %409

392:                                              ; preds = %391
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #7
  store i32 0, ptr getelementptr inbounds ([201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 1), align 8, !tbaa !11
  br label %393

393:                                              ; preds = %477, %392
  %394 = invoke noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
          to label %395 unwind label %413

395:                                              ; preds = %393
  %396 = trunc i64 %394 to i32
  %397 = icmp ne i32 %396, 0
  br i1 %397, label %398, label %479

398:                                              ; preds = %395
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #7
  %399 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
          to label %400 unwind label %417

400:                                              ; preds = %398
  %401 = load i32, ptr %399, align 4, !tbaa !5
  store i32 %401, ptr %48, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
          to label %402 unwind label %417

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

403:                                              ; preds = %474, %402
  %404 = load i32, ptr %49, align 4, !tbaa !5
  %405 = load i32, ptr @M, align 4, !tbaa !5
  %406 = add nsw i32 %405, 1
  %407 = icmp slt i32 %404, %406
  br i1 %407, label %421, label %408

408:                                              ; preds = %403
  store i32 37, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #7
  br label %477

409:                                              ; preds = %391
  %410 = landingpad { ptr, i32 }
          cleanup
  %411 = extractvalue { ptr, i32 } %410, 0
  store ptr %411, ptr %4, align 8
  %412 = extractvalue { ptr, i32 } %410, 1
  store i32 %412, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #7
  br label %507

413:                                              ; preds = %484, %393
  %414 = landingpad { ptr, i32 }
          cleanup
  %415 = extractvalue { ptr, i32 } %414, 0
  store ptr %415, ptr %4, align 8
  %416 = extractvalue { ptr, i32 } %414, 1
  store i32 %416, ptr %5, align 4
  br label %507

417:                                              ; preds = %400, %398
  %418 = landingpad { ptr, i32 }
          cleanup
  %419 = extractvalue { ptr, i32 } %418, 0
  store ptr %419, ptr %4, align 8
  %420 = extractvalue { ptr, i32 } %418, 1
  store i32 %420, ptr %5, align 4
  br label %478

421:                                              ; preds = %403
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #7
  %422 = load i32, ptr %48, align 4, !tbaa !5
  %423 = sext i32 %422 to i64
  %424 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %423
  %425 = load i32, ptr %49, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [201 x %"class.std::vector"], ptr %424, i64 0, i64 %426
  store ptr %427, ptr %50, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #7
  %428 = load ptr, ptr %50, align 8, !tbaa !16
  %429 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %428) #7
  %430 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %51, i32 0, i32 0
  store ptr %429, ptr %430, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #7
  %431 = load ptr, ptr %50, align 8, !tbaa !16
  %432 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %431) #7
  %433 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %52, i32 0, i32 0
  store ptr %432, ptr %433, align 8
  br label %434

434:                                              ; preds = %470, %421
  %435 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull align 8 dereferenceable(8) %52) #7
  br i1 %435, label %437, label %436

436:                                              ; preds = %434
  store i32 40, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #7
  br label %473

437:                                              ; preds = %434
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #7
  %438 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %51) #7
  store ptr %438, ptr %53, align 8, !tbaa !16
  %439 = load ptr, ptr %53, align 8, !tbaa !16
  %440 = load i32, ptr %439, align 4, !tbaa !5
  %441 = sext i32 %440 to i64
  %442 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %441
  %443 = getelementptr inbounds %"struct.std::pair", ptr %442, i32 0, i32 0
  %444 = load i32, ptr %443, align 8, !tbaa !11
  %445 = icmp eq i32 %444, 1000000007
  br i1 %445, label %446, label %469

446:                                              ; preds = %437
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #7
  %447 = load i32, ptr %48, align 4, !tbaa !5
  %448 = sext i32 %447 to i64
  %449 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %448
  %450 = getelementptr inbounds %"struct.std::pair", ptr %449, i32 0, i32 0
  %451 = load i32, ptr %450, align 8, !tbaa !11
  %452 = add nsw i32 %451, 1
  store i32 %452, ptr %55, align 4, !tbaa !5
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %54, ptr noundef nonnull align 4 dereferenceable(4) %55, ptr noundef nonnull align 4 dereferenceable(4) %49)
          to label %453 unwind label %461

453:                                              ; preds = %446
  %454 = load ptr, ptr %53, align 8, !tbaa !16
  %455 = load i32, ptr %454, align 4, !tbaa !5
  %456 = sext i32 %455 to i64
  %457 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %456
  %458 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %457, ptr noundef nonnull align 4 dereferenceable(8) %54) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #7
  %459 = load ptr, ptr %53, align 8, !tbaa !16
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %459)
          to label %460 unwind label %465

460:                                              ; preds = %453
  br label %469

461:                                              ; preds = %446
  %462 = landingpad { ptr, i32 }
          cleanup
  %463 = extractvalue { ptr, i32 } %462, 0
  store ptr %463, ptr %4, align 8
  %464 = extractvalue { ptr, i32 } %462, 1
  store i32 %464, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #7
  br label %472

465:                                              ; preds = %453
  %466 = landingpad { ptr, i32 }
          cleanup
  %467 = extractvalue { ptr, i32 } %466, 0
  store ptr %467, ptr %4, align 8
  %468 = extractvalue { ptr, i32 } %466, 1
  store i32 %468, ptr %5, align 4
  br label %472

469:                                              ; preds = %460, %437
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #7
  br label %470

470:                                              ; preds = %469
  %471 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %51) #7
  br label %434

472:                                              ; preds = %465, %461
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #7
  br label %478

473:                                              ; preds = %436
  br label %474

474:                                              ; preds = %473
  %475 = load i32, ptr %49, align 4, !tbaa !5
  %476 = add nsw i32 %475, 1
  store i32 %476, ptr %49, align 4, !tbaa !5
  br label %403, !llvm.loop !25

477:                                              ; preds = %408
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  br label %393, !llvm.loop !26

478:                                              ; preds = %472, %417
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  br label %507

479:                                              ; preds = %395
  br label %480

480:                                              ; preds = %490, %479
  %481 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef 0) #7
  %482 = load i32, ptr %481, align 4, !tbaa !5
  %483 = icmp ne i32 %482, 1
  br i1 %483, label %484, label %505

484:                                              ; preds = %480
  %485 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef 0) #7
  %486 = load i32, ptr %485, align 4, !tbaa !5
  %487 = sext i32 %486 to i64
  %488 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %487
  %489 = getelementptr inbounds %"struct.std::pair", ptr %488, i32 0, i32 1
  invoke void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %489)
          to label %490 unwind label %413

490:                                              ; preds = %484
  %491 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef 0) #7
  %492 = load i32, ptr %491, align 4, !tbaa !5
  %493 = sext i32 %492 to i64
  %494 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %493
  %495 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef 0) #7
  %496 = load i32, ptr %495, align 4, !tbaa !5
  %497 = sext i32 %496 to i64
  %498 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %497
  %499 = getelementptr inbounds %"struct.std::pair", ptr %498, i32 0, i32 1
  %500 = load i32, ptr %499, align 4, !tbaa !18
  %501 = sext i32 %500 to i64
  %502 = getelementptr inbounds [201 x i32], ptr %494, i64 0, i64 %501
  %503 = load i32, ptr %502, align 4, !tbaa !5
  %504 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef 0) #7
  store i32 %503, ptr %504, align 4, !tbaa !5
  br label %480, !llvm.loop !27

505:                                              ; preds = %480
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  %506 = load i32, ptr %1, align 4
  ret i32 %506

507:                                              ; preds = %478, %413, %409, %387, %370, %244
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #7
  br label %508

508:                                              ; preds = %507, %72
  %509 = load ptr, ptr %4, align 8
  %510 = load i32, ptr %5, align 4
  %511 = insertvalue { ptr, i32 } poison, ptr %509, 0
  %512 = insertvalue { ptr, i32 } %511, i32 %510, 1
  resume { ptr, i32 } %512
}

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr, ptr) #6

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #0 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

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!12, !6, i64 4}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !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"

%"struct.std::pair" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::queue.6" = type { %"class.std::deque.7" }
%"class.std::deque.7" = type { %"class.std::_Deque_base.8" }
%"class.std::_Deque_base.8" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.9", %"struct.std::_Deque_iterator.9" }
%"struct.std::_Deque_iterator.9" = type { ptr, ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.10" = type { ptr }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@nex = external dso_local local_unnamed_addr global [201 x [201 x i32]], align 16
@dist = external dso_local global [201 x [201 x %"struct.std::pair"]], align 16
@DIST = external dso_local global [201 x %"struct.std::pair"], align 16
@radj = external dso_local global [201 x [201 x %"class.std::vector"]], align 16
@q = external dso_local global %"class.std::queue", align 8
@Q = external dso_local global %"class.std::queue.6", align 8
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZL3MOD = external hidden constant i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 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 %"struct.std::pair", align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator.10", align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"struct.std::pair", align 4
  %31 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.8, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %32 unwind label %40

32:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %33 unwind label %42

33:                                               ; preds = %32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  call void @_ZN2io2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @N, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %.not87 = icmp slt i32 %34, 1
  br i1 %.not87, label %._crit_edge88, label %.preheader84

.preheader84:                                     ; preds = %33, %._crit_edge
  %35 = phi i32 [ %49, %._crit_edge ], [ 1, %33 ]
  %36 = phi i32 [ %50, %._crit_edge ], [ %34, %33 ]
  %.not8185 = icmp slt i32 %36, 1
  br i1 %.not8185, label %._crit_edge, label %.lr.ph

._crit_edge88:                                    ; preds = %._crit_edge, %33
  %37 = phi i32 [ %34, %33 ], [ %50, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %38 = load i32, ptr @M, align 4, !tbaa !5
  %.not5993 = icmp slt i32 %38, 1
  %39 = icmp slt i32 %37, 1
  %or.cond = or i1 %.not5993, %39
  br i1 %or.cond, label %.preheader83, label %.lr.ph96.split

40:                                               ; preds = %0
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %44

42:                                               ; preds = %32
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  br label %44

44:                                               ; preds = %42, %40
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %41, %40 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  br label %262

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader84
  %45 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %35, %.preheader84 ]
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %46, i64 %46
  store i32 0, ptr %47, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %.not.not = icmp slt i32 %48, %50
  br i1 %.not.not, label %.preheader84, label %._crit_edge88, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader84, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader84 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS3_S4_EEEbE4typeELb1EEERKiS8_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD)
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %52, i64 %indvars.iv
  %54 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %53, ptr noundef nonnull align 4 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = load i32, ptr @N, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %.not81.not = icmp slt i64 %indvars.iv, %56
  br i1 %.not81.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !13

.preheader83:                                     ; preds = %._crit_edge92, %._crit_edge88
  %57 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %58 = and i64 %57, 4294967295
  %.not60108 = icmp eq i64 %58, 0
  br i1 %.not60108, label %._crit_edge110, label %.lr.ph109

.lr.ph96.split:                                   ; preds = %._crit_edge88, %._crit_edge92
  %59 = phi i32 [ %61, %._crit_edge92 ], [ %38, %._crit_edge88 ]
  %60 = phi i32 [ %62, %._crit_edge92 ], [ %37, %._crit_edge88 ]
  %indvars.iv144 = phi i64 [ %indvars.iv.next145, %._crit_edge92 ], [ 1, %._crit_edge88 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  %.not8089 = icmp slt i32 %60, 1
  br i1 %.not8089, label %._crit_edge92, label %.lr.ph91

._crit_edge92.loopexit:                           ; preds = %.lr.ph91
  %.pre150 = load i32, ptr @M, align 4, !tbaa !5
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %._crit_edge92.loopexit, %.lr.ph96.split
  %61 = phi i32 [ %.pre150, %._crit_edge92.loopexit ], [ %59, %.lr.ph96.split ]
  %62 = phi i32 [ %72, %._crit_edge92.loopexit ], [ %60, %.lr.ph96.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
  %63 = sext i32 %61 to i64
  %.not59.not = icmp slt i64 %indvars.iv144, %63
  br i1 %.not59.not, label %.lr.ph96.split, label %.preheader83, !llvm.loop !14

.lr.ph91:                                         ; preds = %.lr.ph96.split, %.lr.ph91
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @_ZN2io2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %7)
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %66, i64 %indvars.iv144
  store i32 %64, ptr %67, align 4, !tbaa !5
  %68 = sext i32 %64 to i64
  %69 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %68, i64 %indvars.iv144
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr @N, align 4, !tbaa !5
  %.not80.not = icmp slt i32 %70, %72
  br i1 %.not80.not, label %.lr.ph91, label %._crit_edge92.loopexit, !llvm.loop !16

.lr.ph109:                                        ; preds = %.preheader83, %._crit_edge107
  %73 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %.sroa.033.0.copyload = load i32, ptr %73, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %73, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  %74 = load i32, ptr @M, align 4, !tbaa !5
  %.not78103 = icmp slt i32 %74, 1
  br i1 %.not78103, label %._crit_edge107, label %.lr.ph106

.lr.ph106:                                        ; preds = %.lr.ph109
  %75 = sext i32 %.sroa.033.0.copyload to i64
  %76 = sext i32 %.sroa.5.0.copyload to i64
  %77 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %75, i64 %76
  br label %80

._crit_edge107:                                   ; preds = %._crit_edge102, %.lr.ph109
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %78 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %79 = and i64 %78, 4294967295
  %.not60 = icmp eq i64 %79, 0
  br i1 %.not60, label %._crit_edge110, label %.lr.ph109, !llvm.loop !17

80:                                               ; preds = %.lr.ph106, %._crit_edge102
  %storemerge77104 = phi i32 [ 1, %.lr.ph106 ], [ %87, %._crit_edge102 ]
  %81 = sext i32 %storemerge77104 to i64
  %82 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %75, i64 %81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %83 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #6
  store ptr %83, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %84 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #6
  store ptr %84, ptr %10, align 8
  %85 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %85, label %.lr.ph101, label %._crit_edge102

._crit_edge102:                                   ; preds = %._crit_edge99, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr @M, align 4, !tbaa !5
  %.not78.not = icmp slt i32 %86, %88
  br i1 %.not78.not, label %80, label %._crit_edge107, !llvm.loop !18

.lr.ph101:                                        ; preds = %80, %._crit_edge99
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %76, i64 %91
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %93 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #6
  store ptr %93, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %94 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #6
  store ptr %94, ptr %12, align 8
  %95 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br i1 %95, label %.lr.ph98, label %._crit_edge99

._crit_edge99:                                    ; preds = %115, %.lr.ph101
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %97 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %97, label %.lr.ph101, label %._crit_edge102

.lr.ph98:                                         ; preds = %.lr.ph101, %115
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %99 = load i32, ptr %89, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = load i32, ptr %98, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %100, i64 %102
  %104 = load i32, ptr %103, align 8, !tbaa !9
  %105 = icmp eq i32 %104, 1000000007
  br i1 %105, label %106, label %115

106:                                              ; preds = %.lr.ph98
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  %107 = load i32, ptr %77, align 8, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %14, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %109 = load i32, ptr %89, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = load i32, ptr %98, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %110, i64 %112
  %114 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %113, ptr noundef nonnull align 4 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %89, ptr noundef nonnull align 4 dereferenceable(4) %98)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) @q, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %115

115:                                              ; preds = %106, %.lr.ph98
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %117 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br i1 %117, label %.lr.ph98, label %._crit_edge99

._crit_edge110:                                   ; preds = %._crit_edge107, %.preheader83
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  %118 = load i32, ptr @N, align 4, !tbaa !5
  %.not62111 = icmp slt i32 %118, 1
  br i1 %.not62111, label %._crit_edge114, label %.lr.ph113

._crit_edge114:                                   ; preds = %122, %._crit_edge110
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  %119 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %120 = trunc i64 %119 to i32
  %121 = icmp sgt i32 %120, 1
  br i1 %121, label %.lr.ph123, label %.preheader82

.lr.ph113:                                        ; preds = %._crit_edge110, %122
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %122 unwind label %126

122:                                              ; preds = %.lr.ph113
  %123 = load i32, ptr %17, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %17, align 4, !tbaa !5
  %125 = load i32, ptr @N, align 4, !tbaa !5
  %.not62.not = icmp slt i32 %123, %125
  br i1 %.not62.not, label %.lr.ph113, label %._crit_edge114, !llvm.loop !19

126:                                              ; preds = %.lr.ph113
  %127 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  br label %261

.preheader82:                                     ; preds = %184, %._crit_edge114
  %128 = load i32, ptr @N, align 4, !tbaa !5
  %.not63124 = icmp slt i32 %128, 1
  br i1 %.not63124, label %._crit_edge127, label %.lr.ph126

.lr.ph123:                                        ; preds = %._crit_edge114, %184
  %129 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %130 = shl i64 %129, 32
  %sext = add i64 %130, -8589934592
  %131 = ashr exact i64 %sext, 32
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %131) #6
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %135 = shl i64 %134, 32
  %sext68 = add i64 %135, -4294967296
  %136 = ashr exact i64 %sext68, 32
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %136) #6
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %133 to i64
  %140 = sext i32 %138 to i64
  %141 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %139, i64 %140
  %142 = load i32, ptr %141, align 8, !tbaa !9
  %.not69118 = icmp eq i32 %142, 0
  br i1 %.not69118, label %._crit_edge121, label %.lr.ph120

.lr.ph120:                                        ; preds = %.lr.ph123, %._crit_edge117
  %143 = phi ptr [ %160, %._crit_edge117 ], [ %141, %.lr.ph123 ]
  %144 = phi i64 [ %159, %._crit_edge117 ], [ %140, %.lr.ph123 ]
  %145 = phi i64 [ %158, %._crit_edge117 ], [ %139, %.lr.ph123 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #6
  %146 = getelementptr inbounds i8, ptr %143, i64 4
  %147 = load i32, ptr %146, align 4, !tbaa !20
  store i32 %147, ptr %18, align 4, !tbaa !5
  invoke void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %148 unwind label %162

148:                                              ; preds = %.lr.ph120
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #6
  %149 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  store ptr %149, ptr %19, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #6
  %150 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  store ptr %150, ptr %20, align 8
  %151 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  br i1 %151, label %.lr.ph116, label %._crit_edge117

._crit_edge117:                                   ; preds = %.lr.ph116, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #6
  %152 = load i32, ptr %18, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %145, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %144, i64 %153
  %157 = load i32, ptr %156, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #6
  %158 = sext i32 %155 to i64
  %159 = sext i32 %157 to i64
  %160 = getelementptr inbounds [201 x [201 x %"struct.std::pair"]], ptr @dist, i64 0, i64 %158, i64 %159
  %161 = load i32, ptr %160, align 8, !tbaa !9
  %.not69 = icmp eq i32 %161, 0
  br i1 %.not69, label %._crit_edge121, label %.lr.ph120, !llvm.loop !21

162:                                              ; preds = %.lr.ph120
  %163 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #6
  br label %261

.lr.ph116:                                        ; preds = %148, %.lr.ph116
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = load i32, ptr %18, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %166, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  store i32 %170, ptr %164, align 4, !tbaa !5
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %172 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  br i1 %172, label %.lr.ph116, label %._crit_edge117

._crit_edge121:                                   ; preds = %._crit_edge117, %.lr.ph123
  %173 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %174 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %173, ptr %174)
          to label %175 unwind label %188

175:                                              ; preds = %._crit_edge121
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #6
  %176 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %177 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %178 = invoke ptr @_ZSt6uniqueIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEET_S7_S7_(ptr %176, ptr %177)
          to label %179 unwind label %190

179:                                              ; preds = %175
  store ptr %178, ptr %22, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #6
  %180 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  store ptr %180, ptr %24, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #6
  %181 = load ptr, ptr %21, align 8
  %182 = load ptr, ptr %23, align 8
  %183 = invoke ptr @_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EES6_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr %181, ptr %182)
          to label %184 unwind label %192

184:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #6
  %185 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %186 = trunc i64 %185 to i32
  %187 = icmp sgt i32 %186, 1
  br i1 %187, label %.lr.ph123, label %.preheader82, !llvm.loop !22

188:                                              ; preds = %._crit_edge121
  %189 = landingpad { ptr, i32 }
          cleanup
  br label %261

190:                                              ; preds = %175
  %191 = landingpad { ptr, i32 }
          cleanup
  br label %194

192:                                              ; preds = %179
  %193 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #6
  br label %194

194:                                              ; preds = %192, %190
  %.pn70 = phi { ptr, i32 } [ %193, %192 ], [ %191, %190 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #6
  br label %261

._crit_edge127:                                   ; preds = %.lr.ph126, %.preheader82
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #6
  store i32 1, ptr %26, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %199 unwind label %211

.lr.ph126:                                        ; preds = %.preheader82, %.lr.ph126
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.lr.ph126 ], [ 1, %.preheader82 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #6
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS3_S4_EEEbE4typeELb1EEERKiS8_(ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3MOD)
  %195 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %indvars.iv147
  %196 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %195, ptr noundef nonnull align 4 dereferenceable(8) %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #6
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %197 = load i32, ptr @N, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %.not63.not = icmp slt i64 %indvars.iv147, %198
  br i1 %.not63.not, label %.lr.ph126, label %._crit_edge127, !llvm.loop !23

199:                                              ; preds = %._crit_edge127
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #6
  store i32 0, ptr getelementptr inbounds (i8, ptr @DIST, i64 8), align 8, !tbaa !9
  %200 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %201 = and i64 %200, 4294967295
  %.not64136 = icmp eq i64 %201, 0
  br i1 %.not64136, label %.preheader, label %.lr.ph138

.preheader:                                       ; preds = %._crit_edge135, %199
  %202 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #6
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %.not65139 = icmp eq i32 %203, 1
  br i1 %.not65139, label %._crit_edge141, label %.lr.ph140

.lr.ph138:                                        ; preds = %199, %._crit_edge135
  %204 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %205 = load i32, ptr %204, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %27) #6
  store i32 1, ptr %27, align 4, !tbaa !5
  %206 = load i32, ptr @M, align 4, !tbaa !5
  %.not67131 = icmp slt i32 %206, 1
  br i1 %.not67131, label %._crit_edge135, label %.lr.ph134

.lr.ph134:                                        ; preds = %.lr.ph138
  %207 = sext i32 %205 to i64
  %208 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %207
  br label %215

._crit_edge135:                                   ; preds = %._crit_edge130, %.lr.ph138
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #6
  %209 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @Q)
  %210 = and i64 %209, 4294967295
  %.not64 = icmp eq i64 %210, 0
  br i1 %.not64, label %.preheader, label %.lr.ph138, !llvm.loop !24

211:                                              ; preds = %._crit_edge127
  %212 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #6
  br label %261

213:                                              ; preds = %.lr.ph140
  %214 = landingpad { ptr, i32 }
          cleanup
  br label %261

215:                                              ; preds = %.lr.ph134, %._crit_edge130
  %storemerge66132 = phi i32 [ 1, %.lr.ph134 ], [ %222, %._crit_edge130 ]
  %216 = sext i32 %storemerge66132 to i64
  %217 = getelementptr inbounds [201 x [201 x %"class.std::vector"]], ptr @radj, i64 0, i64 %207, i64 %216
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #6
  %218 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %217) #6
  store ptr %218, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %29) #6
  %219 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %217) #6
  store ptr %219, ptr %29, align 8
  %220 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29) #6
  br i1 %220, label %.lr.ph129, label %._crit_edge130

._crit_edge130:                                   ; preds = %239, %215
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #6
  %221 = load i32, ptr %27, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %27, align 4, !tbaa !5
  %223 = load i32, ptr @M, align 4, !tbaa !5
  %.not67.not = icmp slt i32 %221, %223
  br i1 %.not67.not, label %215, label %._crit_edge135, !llvm.loop !25

.lr.ph129:                                        ; preds = %215, %239
  %224 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #6
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %226
  %228 = load i32, ptr %227, align 8, !tbaa !9
  %229 = icmp eq i32 %228, 1000000007
  br i1 %229, label %230, label %239

230:                                              ; preds = %.lr.ph129
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %31) #6
  %231 = load i32, ptr %208, align 8, !tbaa !9
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %31, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %233 = load i32, ptr %224, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %234
  %236 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %235, ptr noundef nonnull align 4 dereferenceable(8) %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #6
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @Q, ptr noundef nonnull align 4 dereferenceable(4) %224)
          to label %239 unwind label %237

237:                                              ; preds = %230
  %238 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #6
  br label %261

239:                                              ; preds = %230, %.lr.ph129
  %240 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #6
  %241 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29) #6
  br i1 %241, label %.lr.ph129, label %._crit_edge130

.lr.ph140:                                        ; preds = %.preheader, %246
  %242 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #6
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %244, i32 1
  invoke void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %245)
          to label %246 unwind label %213

246:                                              ; preds = %.lr.ph140
  %247 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #6
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #6
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [201 x %"struct.std::pair"], ptr @DIST, i64 0, i64 %252, i32 1
  %254 = load i32, ptr %253, align 4, !tbaa !20
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [201 x [201 x i32]], ptr @nex, i64 0, i64 %249, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #6
  store i32 %257, ptr %258, align 4, !tbaa !5
  %259 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #6
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %.not65 = icmp eq i32 %260, 1
  br i1 %.not65, label %._crit_edge141, label %.lr.ph140, !llvm.loop !26

._crit_edge141:                                   ; preds = %246, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #6
  ret i32 0

261:                                              ; preds = %162, %188, %194, %237, %213, %211, %126
  %.pn74 = phi { ptr, i32 } [ %127, %126 ], [ %238, %237 ], [ %214, %213 ], [ %212, %211 ], [ %163, %162 ], [ %.pn70, %194 ], [ %189, %188 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #6
  br label %262

262:                                              ; preds = %261, %44
  %.pn74.pn = phi { ptr, i32 } [ %.pn74, %261 ], [ %.pn, %44 ]
  resume { ptr, i32 } %.pn74.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 #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2reIiJiEEEvRT_DpRT0_(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 void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS3_S4_EEEbE4typeELb1EEERKiS8_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(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_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 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

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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { 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 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!10, !6, i64 4}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


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