; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/1224_xmas_2015 (B)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::random_device" = type { %union.anon }
%union.anon = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }

@choten = external dso_local global [200010 x i32], align 16
@p = external dso_local global [200010 x i32], align 16
@q = external dso_local global [200010 x i32], align 16
@X = external dso_local global [200010 x %"class.std::set"], align 16
@visited = external dso_local global [200010 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i8, align 1
  %13 = alloca %"class.std::random_device", align 8
  %14 = alloca %"class.std::mersenne_twister_engine", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %28 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr @choten, i64 %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  store i32 %35, ptr %4, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @choten, ptr noundef %33, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %104, %0
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %43
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %44)
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200010 x i32], ptr @q, i64 0, i64 %47
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %52, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200010 x i32], ptr @q, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %57, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %65, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [200010 x i32], ptr @q, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %73, align 4, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %80
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [200010 x i32], ptr @q, i64 0, i64 %83
  %85 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %81, ptr noundef nonnull align 4 dereferenceable(4) %84)
  %86 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %87 = extractvalue { ptr, i8 } %85, 0
  store ptr %87, ptr %86, align 8
  %88 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %89 = extractvalue { ptr, i8 } %85, 1
  store i8 %89, ptr %88, align 8
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [200010 x i32], ptr @q, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %94
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %97
  %99 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %95, ptr noundef nonnull align 4 dereferenceable(4) %98)
  %100 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 0
  %101 = extractvalue { ptr, i8 } %99, 0
  store ptr %101, ptr %100, align 8
  %102 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 1
  %103 = extractvalue { ptr, i8 } %99, 1
  store i8 %103, ptr %102, align 8
  br label %104

104:                                              ; preds = %41
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !9

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

108:                                              ; preds = %123, %107
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 5, ptr %9, align 4
  br label %126

113:                                              ; preds = %108
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = icmp eq i32 %117, 0
  br i1 %118, label %119, label %122

119:                                              ; preds = %113
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %126

122:                                              ; preds = %113
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %8, align 4, !tbaa !5
  br label %108, !llvm.loop !11

126:                                              ; preds = %119, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %127 = load i32, ptr %9, align 4
  switch i32 %127, label %346 [
    i32 5, label %128
  ]

128:                                              ; preds = %126
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %145, %128
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = load i32, ptr %2, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %148

136:                                              ; preds = %131
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %138
  %140 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %139, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %141 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %142 = extractvalue { ptr, i8 } %140, 0
  store ptr %142, ptr %141, align 8
  %143 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %144 = extractvalue { ptr, i8 } %140, 1
  store i8 %144, ptr %143, align 8
  br label %145

145:                                              ; preds = %136
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %10, align 4, !tbaa !5
  br label %131, !llvm.loop !12

148:                                              ; preds = %135
  %149 = load i32, ptr %2, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i8, ptr @visited, i64 %150
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  store i8 0, ptr %12, align 1, !tbaa !13
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visited, ptr noundef %151, ptr noundef nonnull align 1 dereferenceable(1) %12)
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 5000, ptr %13) #6
  call void @_ZNSt13random_deviceC2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %13)
  call void @llvm.lifetime.start.p0(i64 5000, ptr %14) #6
  %152 = invoke noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000) %13)
          to label %153 unwind label %161

153:                                              ; preds = %148
  %154 = zext i32 %152 to i64
  invoke void @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEC2Em(ptr noundef nonnull align 8 dereferenceable(5000) %14, i64 noundef %154)
          to label %155 unwind label %161

155:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %179, %155
  %157 = load i32, ptr %19, align 4, !tbaa !5
  %158 = load i32, ptr %2, align 4, !tbaa !5
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %165, label %160

160:                                              ; preds = %156
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %182

161:                                              ; preds = %153, %148
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %15, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %16, align 4
  br label %351

165:                                              ; preds = %156
  %166 = load i32, ptr %19, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = load i32, ptr %18, align 4, !tbaa !5
  %171 = icmp sgt i32 %169, %170
  br i1 %171, label %172, label %178

172:                                              ; preds = %165
  %173 = load i32, ptr %19, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  store i32 %176, ptr %18, align 4, !tbaa !5
  %177 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %177, ptr %17, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %172, %165
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %19, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %19, align 4, !tbaa !5
  br label %156, !llvm.loop !15

182:                                              ; preds = %160
  %183 = load i32, ptr %17, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %184
  store i8 1, ptr %185, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %186 = load i32, ptr %17, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %187
  %189 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %188) #6
  %190 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %189, ptr %190, align 8
  br label %191

191:                                              ; preds = %245, %182
  %192 = load i32, ptr %20, align 4, !tbaa !5
  %193 = load i32, ptr %2, align 4, !tbaa !5
  %194 = icmp slt i32 %192, %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  br i1 %194, label %195, label %202

195:                                              ; preds = %191
  %196 = load i32, ptr %17, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %197
  %199 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %198) #6
  %200 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %199, ptr %200, align 8
  %201 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  br label %202

202:                                              ; preds = %195, %191
  %203 = phi i1 [ false, %191 ], [ %201, %195 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br i1 %203, label %204, label %246

204:                                              ; preds = %202
  %205 = load i32, ptr %20, align 4, !tbaa !5
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = icmp eq i32 %205, %207
  br i1 %208, label %209, label %214

209:                                              ; preds = %204
  %210 = load i32, ptr %20, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %20, align 4, !tbaa !5
  %212 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 0) #6
  %213 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %212, ptr %213, align 8
  br label %245

214:                                              ; preds = %204
  %215 = load i32, ptr %20, align 4, !tbaa !5
  %216 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = icmp slt i32 %215, %217
  br i1 %218, label %219, label %241

219:                                              ; preds = %214
  %220 = load i32, ptr %17, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  %222 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %221)
          to label %223 unwind label %237

223:                                              ; preds = %219
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %222, ptr noundef @.str.3)
          to label %225 unwind label %237

225:                                              ; preds = %223
  %226 = load i32, ptr %20, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %224, i32 noundef %227)
          to label %229 unwind label %237

229:                                              ; preds = %225
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %228, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %231 unwind label %237

231:                                              ; preds = %229
  %232 = load i32, ptr %20, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %233
  store i8 1, ptr %234, align 1, !tbaa !13
  %235 = load i32, ptr %20, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %20, align 4, !tbaa !5
  br label %244

237:                                              ; preds = %261, %257, %255, %251, %229, %225, %223, %219
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %15, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %16, align 4
  br label %350

241:                                              ; preds = %214
  %242 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 0) #6
  %243 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %242, ptr %243, align 8
  br label %244

244:                                              ; preds = %241, %231
  br label %245

245:                                              ; preds = %244, %209
  br label %191, !llvm.loop !16

246:                                              ; preds = %202
  br label %247

247:                                              ; preds = %263, %246
  %248 = load i32, ptr %20, align 4, !tbaa !5
  %249 = load i32, ptr %2, align 4, !tbaa !5
  %250 = icmp slt i32 %248, %249
  br i1 %250, label %251, label %269

251:                                              ; preds = %247
  %252 = load i32, ptr %17, align 4, !tbaa !5
  %253 = add nsw i32 %252, 1
  %254 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %253)
          to label %255 unwind label %237

255:                                              ; preds = %251
  %256 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %254, ptr noundef @.str.3)
          to label %257 unwind label %237

257:                                              ; preds = %255
  %258 = load i32, ptr %20, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  %260 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %256, i32 noundef %259)
          to label %261 unwind label %237

261:                                              ; preds = %257
  %262 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %260, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %263 unwind label %237

263:                                              ; preds = %261
  %264 = load i32, ptr %20, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %265
  store i8 1, ptr %266, align 1, !tbaa !13
  %267 = load i32, ptr %20, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %20, align 4, !tbaa !5
  br label %247, !llvm.loop !17

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

270:                                              ; preds = %342, %269
  %271 = load i32, ptr %25, align 4, !tbaa !5
  %272 = load i32, ptr %2, align 4, !tbaa !5
  %273 = icmp slt i32 %271, %272
  br i1 %273, label %275, label %274

274:                                              ; preds = %270
  store i32 18, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %345

275:                                              ; preds = %270
  %276 = load i32, ptr %25, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %277
  %279 = load i8, ptr %278, align 1, !tbaa !13, !range !18, !noundef !19
  %280 = trunc i8 %279 to i1
  br i1 %280, label %341, label %281

281:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %282 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv(ptr noundef nonnull align 8 dereferenceable(5000) %14)
          to label %283 unwind label %316

283:                                              ; preds = %281
  %284 = load i32, ptr %2, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = urem i64 %282, %285
  %287 = trunc i64 %286 to i32
  store i32 %287, ptr %26, align 4, !tbaa !5
  br label %288

288:                                              ; preds = %311, %283
  %289 = load i32, ptr %26, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %290
  %292 = load i8, ptr %291, align 1, !tbaa !13, !range !18, !noundef !19
  %293 = trunc i8 %292 to i1
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  br i1 %293, label %307, label %294

294:                                              ; preds = %288
  %295 = load i32, ptr %25, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %296
  %298 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %297, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %299 unwind label %320

299:                                              ; preds = %294
  %300 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %298, ptr %300, align 8
  %301 = load i32, ptr %25, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %302
  %304 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %303) #6
  %305 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %304, ptr %305, align 8
  %306 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28) #6
  br label %307

307:                                              ; preds = %299, %288
  %308 = phi i1 [ false, %288 ], [ %306, %299 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br i1 %308, label %309, label %324

309:                                              ; preds = %307
  %310 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv(ptr noundef nonnull align 8 dereferenceable(5000) %14)
          to label %311 unwind label %316

311:                                              ; preds = %309
  %312 = load i32, ptr %2, align 4, !tbaa !5
  %313 = sext i32 %312 to i64
  %314 = urem i64 %310, %313
  %315 = trunc i64 %314 to i32
  store i32 %315, ptr %26, align 4, !tbaa !5
  br label %288, !llvm.loop !20

316:                                              ; preds = %334, %330, %328, %324, %309, %281
  %317 = landingpad { ptr, i32 }
          cleanup
  %318 = extractvalue { ptr, i32 } %317, 0
  store ptr %318, ptr %15, align 8
  %319 = extractvalue { ptr, i32 } %317, 1
  store i32 %319, ptr %16, align 4
  br label %340

320:                                              ; preds = %294
  %321 = landingpad { ptr, i32 }
          cleanup
  %322 = extractvalue { ptr, i32 } %321, 0
  store ptr %322, ptr %15, align 8
  %323 = extractvalue { ptr, i32 } %321, 1
  store i32 %323, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %340

324:                                              ; preds = %307
  %325 = load i32, ptr %25, align 4, !tbaa !5
  %326 = add nsw i32 %325, 1
  %327 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %326)
          to label %328 unwind label %316

328:                                              ; preds = %324
  %329 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %327, ptr noundef @.str.3)
          to label %330 unwind label %316

330:                                              ; preds = %328
  %331 = load i32, ptr %26, align 4, !tbaa !5
  %332 = add nsw i32 %331, 1
  %333 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %329, i32 noundef %332)
          to label %334 unwind label %316

334:                                              ; preds = %330
  %335 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %333, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %336 unwind label %316

336:                                              ; preds = %334
  %337 = load i32, ptr %25, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %338
  store i8 1, ptr %339, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %341

340:                                              ; preds = %320, %316
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %350

341:                                              ; preds = %336, %275
  br label %342

342:                                              ; preds = %341
  %343 = load i32, ptr %25, align 4, !tbaa !5
  %344 = add nsw i32 %343, 1
  store i32 %344, ptr %25, align 4, !tbaa !5
  br label %270, !llvm.loop !21

345:                                              ; preds = %274
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr %14) #6
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %13) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr %13) #6
  store i32 0, ptr %9, align 4
  br label %346

346:                                              ; preds = %345, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %347 = load i32, ptr %9, align 4
  switch i32 %347, label %357 [
    i32 0, label %348
    i32 1, label %348
  ]

348:                                              ; preds = %346, %346
  %349 = load i32, ptr %1, align 4
  ret i32 %349

350:                                              ; preds = %340, %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %351

351:                                              ; preds = %350, %161
  call void @llvm.lifetime.end.p0(i64 5000, ptr %14) #6
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %13) #6
  call void @llvm.lifetime.end.p0(i64 5000, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %352

352:                                              ; preds = %351
  %353 = load ptr, ptr %15, align 8
  %354 = load i32, ptr %16, align 4
  %355 = insertvalue { ptr, i32 } poison, ptr %353, 0
  %356 = insertvalue { ptr, i32 } %355, i32 %354, 1
  resume { ptr, i32 } %356

357:                                              ; preds = %346
  unreachable
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000)) #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEC2Em(ptr noundef nonnull align 8 dereferenceable(5000), i64 noundef) unnamed_addr #4 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv(ptr noundef nonnull align 8 dereferenceable(5000)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000)) unnamed_addr #5 align 2

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::random_device" = type { %union.anon }
%union.anon = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@choten = external dso_local global [200010 x i32], align 16
@p = external dso_local global [200010 x i32], align 16
@q = external dso_local global [200010 x i32], align 16
@X = external dso_local global [200010 x %"class.std::set"], align 16
@visited = external dso_local global [200010 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca %"class.std::random_device", align 8
  %7 = alloca %"class.std::mersenne_twister_engine", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i32, ptr @choten, i64 %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %18 = add nsw i32 %15, -1
  store i32 %18, ptr %3, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @choten, ptr noundef nonnull %17, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %.preheader89

.preheader89:                                     ; preds = %.lr.ph, %0
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %.not94 = icmp sgt i32 %21, 0
  br i1 %.not94, label %.lr.ph96.preheader, label %.critedge79

.lr.ph96.preheader:                               ; preds = %.preheader89
  %wide.trip.count = zext nneg i32 %21 to i64
  br label %.lr.ph96

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %22 = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %indvars.iv
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %24 = getelementptr inbounds [200010 x i32], ptr @q, i64 0, i64 %indvars.iv
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %26 = load i32, ptr %22, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr %22, align 4, !tbaa !5
  %28 = load i32, ptr %24, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %24, align 4, !tbaa !5
  %30 = sext i32 %27 to i64
  %31 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %31, align 4, !tbaa !5
  %34 = sext i32 %29 to i64
  %35 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr %35, align 4, !tbaa !5
  %38 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %30
  %39 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %38, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %40 = load i32, ptr %24, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %41
  %43 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %42, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph, label %.preheader89, !llvm.loop !9

47:                                               ; preds = %.lr.ph96
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count
  br i1 %exitcond.not, label %.critedge79, label %.lr.ph96, !llvm.loop !11

.lr.ph96:                                         ; preds = %.lr.ph96.preheader, %47
  %indvars.iv123 = phi i64 [ 0, %.lr.ph96.preheader ], [ %indvars.iv.next124, %47 ]
  %48 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %indvars.iv123
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %47

51:                                               ; preds = %.lr.ph96
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %203

.critedge79:                                      ; preds = %47, %.preheader89
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph98, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph98, %.critedge79
  %.lcssa = phi i32 [ %56, %.critedge79 ], [ %66, %.lr.ph98 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %58 = sext i32 %.lcssa to i64
  %59 = getelementptr inbounds i8, ptr @visited, i64 %58
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  store i8 0, ptr %5, align 1, !tbaa !12
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visited, ptr noundef nonnull %59, ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %6) #7
  call void @_ZNSt13random_deviceC2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %6)
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %7) #7
  %60 = invoke noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000) %6)
          to label %68 unwind label %84

.lr.ph98:                                         ; preds = %.critedge79, %.lr.ph98
  %storemerge97 = phi i32 [ %65, %.lr.ph98 ], [ 0, %.critedge79 ]
  %61 = sext i32 %storemerge97 to i64
  %62 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %61
  %63 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %62, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %.lr.ph98, label %._crit_edge, !llvm.loop !14

68:                                               ; preds = %._crit_edge
  %69 = zext i32 %60 to i64
  invoke void @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEC2Em(ptr noundef nonnull align 8 dereferenceable(5000) %7, i64 noundef %69)
          to label %.preheader88 unwind label %84

.preheader88:                                     ; preds = %68
  %70 = load i32, ptr %1, align 4, !tbaa !5
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph102.preheader, label %._crit_edge103

.lr.ph102.preheader:                              ; preds = %.preheader88
  %wide.trip.count129 = zext nneg i32 %70 to i64
  %xtraiter = and i64 %wide.trip.count129, 3
  %72 = icmp ult i32 %70, 4
  br i1 %72, label %._crit_edge103.loopexit.unr-lcssa, label %.lr.ph102.preheader.new

.lr.ph102.preheader.new:                          ; preds = %.lr.ph102.preheader
  %unroll_iter = and i64 %wide.trip.count129, 2147483644
  br label %.lr.ph102

._crit_edge103.loopexit.unr-lcssa:                ; preds = %.lr.ph102, %.lr.ph102.preheader
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph102.preheader ], [ %spec.select.3, %.lr.ph102 ]
  %indvars.iv126.unr = phi i64 [ 0, %.lr.ph102.preheader ], [ %indvars.iv.next127.3, %.lr.ph102 ]
  %.059100.unr = phi i32 [ 0, %.lr.ph102.preheader ], [ %spec.select80.3, %.lr.ph102 ]
  %.06199.unr = phi i32 [ 0, %.lr.ph102.preheader ], [ %spec.select.3, %.lr.ph102 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge103, label %.lr.ph102.epil

.lr.ph102.epil:                                   ; preds = %._crit_edge103.loopexit.unr-lcssa, %.lr.ph102.epil
  %indvars.iv126.epil = phi i64 [ %indvars.iv.next127.epil, %.lr.ph102.epil ], [ %indvars.iv126.unr, %._crit_edge103.loopexit.unr-lcssa ]
  %.059100.epil = phi i32 [ %spec.select80.epil, %.lr.ph102.epil ], [ %.059100.unr, %._crit_edge103.loopexit.unr-lcssa ]
  %.06199.epil = phi i32 [ %spec.select.epil, %.lr.ph102.epil ], [ %.06199.unr, %._crit_edge103.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph102.epil ], [ 0, %._crit_edge103.loopexit.unr-lcssa ]
  %73 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %indvars.iv126.epil
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, %.059100.epil
  %76 = trunc nuw nsw i64 %indvars.iv126.epil to i32
  %spec.select.epil = select i1 %75, i32 %76, i32 %.06199.epil
  %spec.select80.epil = call i32 @llvm.smax.i32(i32 %74, i32 %.059100.epil)
  %indvars.iv.next127.epil = add nuw nsw i64 %indvars.iv126.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge103, label %.lr.ph102.epil, !llvm.loop !15

._crit_edge103:                                   ; preds = %._crit_edge103.loopexit.unr-lcssa, %.lr.ph102.epil, %.preheader88
  %.061.lcssa = phi i32 [ 0, %.preheader88 ], [ %spec.select.lcssa.ph, %._crit_edge103.loopexit.unr-lcssa ], [ %spec.select.epil, %.lr.ph102.epil ]
  %77 = sext i32 %.061.lcssa to i64
  %78 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %77
  store i8 1, ptr %78, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %79 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %77
  %80 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %79) #7
  store ptr %80, ptr %8, align 8
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  br i1 %82, label %.lr.ph107, label %.critedge

.lr.ph107:                                        ; preds = %._crit_edge103
  %83 = add nsw i32 %.061.lcssa, 1
  br label %102

84:                                               ; preds = %68, %._crit_edge
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %205

.lr.ph102:                                        ; preds = %.lr.ph102, %.lr.ph102.preheader.new
  %indvars.iv126 = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %indvars.iv.next127.3, %.lr.ph102 ]
  %.059100 = phi i32 [ 0, %.lr.ph102.preheader.new ], [ %spec.select80.3, %.lr.ph102 ]
  %.06199 = phi i32 [ 0, %.lr.ph102.preheader.new ], [ %spec.select.3, %.lr.ph102 ]
  %niter = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %niter.next.3, %.lr.ph102 ]
  %86 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %indvars.iv126
  %87 = load i32, ptr %86, align 16, !tbaa !5
  %88 = icmp sgt i32 %87, %.059100
  %89 = trunc nuw nsw i64 %indvars.iv126 to i32
  %spec.select = select i1 %88, i32 %89, i32 %.06199
  %spec.select80 = call i32 @llvm.smax.i32(i32 %87, i32 %.059100)
  %indvars.iv.next127 = or disjoint i64 %indvars.iv126, 1
  %90 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %indvars.iv.next127
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp sgt i32 %91, %spec.select80
  %93 = trunc nuw nsw i64 %indvars.iv.next127 to i32
  %spec.select.1 = select i1 %92, i32 %93, i32 %spec.select
  %spec.select80.1 = call i32 @llvm.smax.i32(i32 %91, i32 %spec.select80)
  %indvars.iv.next127.1 = or disjoint i64 %indvars.iv126, 2
  %94 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %indvars.iv.next127.1
  %95 = load i32, ptr %94, align 8, !tbaa !5
  %96 = icmp sgt i32 %95, %spec.select80.1
  %97 = trunc nuw nsw i64 %indvars.iv.next127.1 to i32
  %spec.select.2 = select i1 %96, i32 %97, i32 %spec.select.1
  %spec.select80.2 = call i32 @llvm.smax.i32(i32 %95, i32 %spec.select80.1)
  %indvars.iv.next127.2 = or disjoint i64 %indvars.iv126, 3
  %98 = getelementptr inbounds [200010 x i32], ptr @choten, i64 0, i64 %indvars.iv.next127.2
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp sgt i32 %99, %spec.select80.2
  %101 = trunc nuw nsw i64 %indvars.iv.next127.2 to i32
  %spec.select.3 = select i1 %100, i32 %101, i32 %spec.select.2
  %spec.select80.3 = call i32 @llvm.smax.i32(i32 %99, i32 %spec.select80.2)
  %indvars.iv.next127.3 = add nuw nsw i64 %indvars.iv126, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge103.loopexit.unr-lcssa, label %.lr.ph102, !llvm.loop !17

102:                                              ; preds = %.lr.ph107, %130
  %.057105 = phi i32 [ 0, %.lr.ph107 ], [ %.1, %130 ]
  %103 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %79) #7
  store ptr %103, ptr %9, align 8
  %104 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br i1 %104, label %105, label %.loopexit87.loopexit

105:                                              ; preds = %102
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = icmp eq i32 %.057105, %107
  br i1 %108, label %109, label %112

109:                                              ; preds = %105
  %110 = add nsw i32 %.057105, 1
  %111 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #7
  br label %130

112:                                              ; preds = %105
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = icmp slt i32 %.057105, %114
  br i1 %115, label %116, label %128

116:                                              ; preds = %112
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %83)
          to label %118 unwind label %.loopexit.split-lp83

118:                                              ; preds = %116
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef nonnull @.str.3)
          to label %120 unwind label %.loopexit.split-lp83

120:                                              ; preds = %118
  %121 = add nsw i32 %.057105, 1
  %122 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %119, i32 noundef %121)
          to label %123 unwind label %.loopexit.split-lp83

123:                                              ; preds = %120
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %125 unwind label %.loopexit.split-lp83

125:                                              ; preds = %123
  %126 = sext i32 %.057105 to i64
  %127 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %126
  store i8 1, ptr %127, align 1, !tbaa !12
  br label %130

.loopexit82:                                      ; preds = %140, %142, %144, %147
  %lpad.loopexit84 = landingpad { ptr, i32 }
          cleanup
  br label %204

.loopexit.split-lp83:                             ; preds = %116, %118, %120, %123
  %lpad.loopexit.split-lp85 = landingpad { ptr, i32 }
          cleanup
  br label %204

128:                                              ; preds = %112
  %129 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #7
  br label %130

130:                                              ; preds = %125, %128, %109
  %.1 = phi i32 [ %110, %109 ], [ %121, %125 ], [ %.057105, %128 ]
  %131 = load i32, ptr %1, align 4, !tbaa !5
  %132 = icmp slt i32 %.1, %131
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  br i1 %132, label %102, label %.critedge, !llvm.loop !18

.critedge:                                        ; preds = %130, %._crit_edge103
  %133 = phi i32 [ %81, %._crit_edge103 ], [ %131, %130 ]
  %.057.lcssa = phi i32 [ 0, %._crit_edge103 ], [ %.1, %130 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %.loopexit87

.loopexit87.loopexit:                             ; preds = %102
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %.loopexit87

.loopexit87:                                      ; preds = %.loopexit87.loopexit, %.critedge
  %134 = phi i32 [ %133, %.critedge ], [ %.pre, %.loopexit87.loopexit ]
  %.05792 = phi i32 [ %.057.lcssa, %.critedge ], [ %.057105, %.loopexit87.loopexit ]
  %135 = icmp slt i32 %.05792, %134
  br i1 %135, label %.lr.ph111, label %.preheader

.lr.ph111:                                        ; preds = %.loopexit87
  %136 = add nsw i32 %.061.lcssa, 1
  %137 = sext i32 %.05792 to i64
  br label %140

.preheader:                                       ; preds = %149, %.loopexit87
  %138 = phi i32 [ %134, %.loopexit87 ], [ %151, %149 ]
  %139 = icmp sgt i32 %138, 0
  br i1 %139, label %.lr.ph117, label %._crit_edge118

140:                                              ; preds = %.lr.ph111, %149
  %indvars.iv131 = phi i64 [ %137, %.lr.ph111 ], [ %indvars.iv.next132, %149 ]
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %136)
          to label %142 unwind label %.loopexit82

142:                                              ; preds = %140
  %143 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef nonnull @.str.3)
          to label %144 unwind label %.loopexit82

144:                                              ; preds = %142
  %indvars.iv.next132 = add nsw i64 %indvars.iv131, 1
  %145 = trunc nsw i64 %indvars.iv.next132 to i32
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %143, i32 noundef %145)
          to label %147 unwind label %.loopexit82

147:                                              ; preds = %144
  %148 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %149 unwind label %.loopexit82

149:                                              ; preds = %147
  %150 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %indvars.iv131
  store i8 1, ptr %150, align 1, !tbaa !12
  %151 = load i32, ptr %1, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = icmp slt i64 %indvars.iv.next132, %152
  br i1 %153, label %140, label %.preheader, !llvm.loop !19

._crit_edge118:                                   ; preds = %199, %.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %7) #7
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %6) #7
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %6) #7
  br label %203

.lr.ph117:                                        ; preds = %.preheader, %199
  %154 = phi i32 [ %200, %199 ], [ %138, %.preheader ]
  %indvars.iv134 = phi i64 [ %indvars.iv.next135.pre-phi, %199 ], [ 0, %.preheader ]
  %155 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %indvars.iv134
  %156 = load i8, ptr %155, align 1, !tbaa !12, !range !20, !noundef !21
  %157 = trunc nuw i8 %156 to i1
  br i1 %157, label %.lr.ph117._crit_edge, label %158

.lr.ph117._crit_edge:                             ; preds = %.lr.ph117
  %.pre138 = add nuw nsw i64 %indvars.iv134, 1
  br label %199

158:                                              ; preds = %.lr.ph117
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %159 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv(ptr noundef nonnull align 8 dereferenceable(5000) %7)
          to label %160 unwind label %.loopexit.split-lp

160:                                              ; preds = %158
  %161 = load i32, ptr %1, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = urem i64 %159, %162
  %storemerge73112 = trunc i64 %163 to i32
  store i32 %storemerge73112, ptr %10, align 4, !tbaa !5
  %sext113 = shl i64 %163, 32
  %164 = ashr exact i64 %sext113, 32
  %165 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %164
  %166 = load i8, ptr %165, align 1, !tbaa !12, !range !20, !noundef !21
  %167 = trunc nuw i8 %166 to i1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  br i1 %167, label %.critedge2, label %.lr.ph115

.lr.ph115:                                        ; preds = %160
  %168 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %indvars.iv134
  br label %169

169:                                              ; preds = %.lr.ph115, %176
  %170 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %168, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %171 unwind label %184

171:                                              ; preds = %169
  store ptr %170, ptr %11, align 8
  %172 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %168) #7
  store ptr %172, ptr %12, align 8
  %173 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br i1 %173, label %174, label %.loopexit

174:                                              ; preds = %171
  %175 = invoke noundef i64 @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv(ptr noundef nonnull align 8 dereferenceable(5000) %7)
          to label %176 unwind label %.loopexit81

176:                                              ; preds = %174
  %177 = load i32, ptr %1, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = urem i64 %175, %178
  %storemerge73 = trunc i64 %179 to i32
  store i32 %storemerge73, ptr %10, align 4, !tbaa !5
  %sext = shl i64 %179, 32
  %180 = ashr exact i64 %sext, 32
  %181 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %180
  %182 = load i8, ptr %181, align 1, !tbaa !12, !range !20, !noundef !21
  %183 = trunc nuw i8 %182 to i1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  br i1 %183, label %.critedge2, label %169, !llvm.loop !22

.loopexit81:                                      ; preds = %174
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %198

.loopexit.split-lp:                               ; preds = %158, %.loopexit, %189, %191, %195
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %198

184:                                              ; preds = %169
  %185 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %198

.critedge2:                                       ; preds = %176, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %.loopexit

.loopexit:                                        ; preds = %171, %.critedge2
  %186 = add nuw nsw i64 %indvars.iv134, 1
  %187 = trunc nuw nsw i64 %186 to i32
  %188 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %187)
          to label %189 unwind label %.loopexit.split-lp

189:                                              ; preds = %.loopexit
  %190 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %188, ptr noundef nonnull @.str.3)
          to label %191 unwind label %.loopexit.split-lp

191:                                              ; preds = %189
  %192 = load i32, ptr %10, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  %194 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %190, i32 noundef %193)
          to label %195 unwind label %.loopexit.split-lp

195:                                              ; preds = %191
  %196 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %194, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %197 unwind label %.loopexit.split-lp

197:                                              ; preds = %195
  store i8 1, ptr %155, align 1, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %.pre137 = load i32, ptr %1, align 4, !tbaa !5
  br label %199

198:                                              ; preds = %.loopexit81, %.loopexit.split-lp, %184
  %.pn = phi { ptr, i32 } [ %185, %184 ], [ %lpad.loopexit, %.loopexit81 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %204

199:                                              ; preds = %.lr.ph117._crit_edge, %197
  %indvars.iv.next135.pre-phi = phi i64 [ %.pre138, %.lr.ph117._crit_edge ], [ %186, %197 ]
  %200 = phi i32 [ %154, %.lr.ph117._crit_edge ], [ %.pre137, %197 ]
  %201 = sext i32 %200 to i64
  %202 = icmp slt i64 %indvars.iv.next135.pre-phi, %201
  br i1 %202, label %.lr.ph117, label %._crit_edge118, !llvm.loop !23

203:                                              ; preds = %51, %._crit_edge118
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

204:                                              ; preds = %.loopexit82, %.loopexit.split-lp83, %198
  %.pn75 = phi { ptr, i32 } [ %.pn, %198 ], [ %lpad.loopexit84, %.loopexit82 ], [ %lpad.loopexit.split-lp85, %.loopexit.split-lp83 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %205

205:                                              ; preds = %204, %84
  %.pn75.pn = phi { ptr, i32 } [ %.pn75, %204 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %7) #7
  call void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000) %6) #7
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn75.pn
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNSt13random_deviceclEv(ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEC2Em(ptr noundef nonnull align 8 dereferenceable(5000), i64 noundef) unnamed_addr #4 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv(ptr noundef nonnull align 8 dereferenceable(5000)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13random_deviceD2Ev(ptr noundef nonnull align 8 dereferenceable(5000)) unnamed_addr #5 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

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

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

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


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