; LLVM IR from kazunetakahashi/atcoder :: 201610_12/1210_ARC065 (D)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = 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", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@L = external dso_local global i32, align 4
@V = external dso_local global [200010 x %"class.std::vector"], align 16
@W = external dso_local global [200010 x %"class.std::vector"], align 16
@visited = external dso_local global [200010 x i8], align 16
@visited2 = external dso_local global [200010 x i8], align 16
@ans = external dso_local global [200010 x i32], align 16
@S = external dso_local global %"class.std::set", align 8
@SS = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::stack", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca i32, align 4
  %25 = alloca %"class.std::stack", align 8
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca i32, align 4
  %32 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %33 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %34 = alloca ptr, align 8
  %35 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %36 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 4 dereferenceable(4) @L)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %60, %0
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = load i32, ptr @K, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

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

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @V, i64 0, i64 %55
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @V, i64 0, i64 %58
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %60

60:                                               ; preds = %47
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  br label %42, !llvm.loop !9

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

64:                                               ; preds = %82, %63
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = load i32, ptr @L, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %70, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %6, align 4, !tbaa !5
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %7, align 4, !tbaa !5
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @W, i64 0, i64 %77
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @W, i64 0, i64 %80
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %82

82:                                               ; preds = %69
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !5
  br label %64, !llvm.loop !11

85:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  store i8 0, ptr %8, align 1, !tbaa !12
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visited, ptr noundef getelementptr inbounds (i8, ptr @visited, i64 200010), ptr noundef nonnull align 1 dereferenceable(1) %8)
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  store i8 0, ptr %9, align 1, !tbaa !12
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visited2, ptr noundef getelementptr inbounds (i8, ptr @visited2, i64 200010), ptr noundef nonnull align 1 dereferenceable(1) %9)
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %293, %85
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = load i32, ptr @N, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

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

91:                                               ; preds = %86
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !12, !range !14, !noundef !15
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %98

97:                                               ; preds = %91
  br label %293

98:                                               ; preds = %91
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr %12) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %12, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %99 unwind label %136

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %162, %99
  %101 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
          to label %102 unwind label %136

102:                                              ; preds = %100
  %103 = xor i1 %101, true
  br i1 %103, label %104, label %164

104:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %105 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
          to label %106 unwind label %140

106:                                              ; preds = %104
  %107 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %107, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %12)
          to label %108 unwind label %140

108:                                              ; preds = %106
  %109 = load i32, ptr %15, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !12, !range !14, !noundef !15
  %113 = trunc i8 %112 to i1
  br i1 %113, label %162, label %114

114:                                              ; preds = %108
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %116
  store i8 1, ptr %117, align 1, !tbaa !12
  %118 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @S, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %119 unwind label %140

119:                                              ; preds = %114
  %120 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 0
  %121 = extractvalue { ptr, i8 } %118, 0
  store ptr %121, ptr %120, align 8
  %122 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 1
  %123 = extractvalue { ptr, i8 } %118, 1
  store i8 %123, ptr %122, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %124 = load i32, ptr %15, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @V, i64 0, i64 %125
  store ptr %126, ptr %17, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %127 = load ptr, ptr %17, align 8, !tbaa !16
  %128 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %127) #7
  %129 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %128, ptr %129, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %130 = load ptr, ptr %17, align 8, !tbaa !16
  %131 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %130) #7
  %132 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %131, ptr %132, align 8
  br label %133

133:                                              ; preds = %159, %119
  %134 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %134, label %144, label %135

135:                                              ; preds = %133
  store i32 13, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %161

136:                                              ; preds = %100, %98
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %13, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %14, align 4
  br label %296

140:                                              ; preds = %114, %106, %104
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %13, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %14, align 4
  br label %163

144:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %146 = load i32, ptr %145, align 4, !tbaa !5
  store i32 %146, ptr %20, align 4, !tbaa !5
  %147 = load i32, ptr %20, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !12, !range !14, !noundef !15
  %151 = trunc i8 %150 to i1
  br i1 %151, label %158, label %152

152:                                              ; preds = %144
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %12, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %153 unwind label %154

153:                                              ; preds = %152
  br label %158

154:                                              ; preds = %152
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %13, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %163

158:                                              ; preds = %153, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %159

159:                                              ; preds = %158
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %133

161:                                              ; preds = %135
  br label %162

162:                                              ; preds = %161, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %100, !llvm.loop !18

163:                                              ; preds = %154, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %296

164:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store ptr @S, ptr %21, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %165 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %166 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %165, ptr %166, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %167 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %168 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  br label %169

169:                                              ; preds = %288, %164
  %170 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  br i1 %170, label %172, label %171

171:                                              ; preds = %169
  store i32 15, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %292

172:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %173 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  %174 = load i32, ptr %173, align 4, !tbaa !5
  store i32 %174, ptr %24, align 4, !tbaa !5
  %175 = load i32, ptr %24, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [200010 x i8], ptr @visited2, i64 0, i64 %176
  %178 = load i8, ptr %177, align 1, !tbaa !12, !range !14, !noundef !15
  %179 = trunc i8 %178 to i1
  br i1 %179, label %180, label %181

180:                                              ; preds = %172
  store i32 16, ptr %11, align 4
  br label %285

181:                                              ; preds = %172
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr %25) #7
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
          to label %182 unwind label %220

182:                                              ; preds = %181
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %25, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %183 unwind label %224

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %264, %183
  %185 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
          to label %186 unwind label %224

186:                                              ; preds = %184
  %187 = xor i1 %185, true
  br i1 %187, label %188, label %266

188:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %189 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
          to label %190 unwind label %228

190:                                              ; preds = %188
  %191 = load i32, ptr %189, align 4, !tbaa !5
  store i32 %191, ptr %26, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
          to label %192 unwind label %228

192:                                              ; preds = %190
  %193 = load i32, ptr %26, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [200010 x i8], ptr @visited2, i64 0, i64 %194
  %196 = load i8, ptr %195, align 1, !tbaa !12, !range !14, !noundef !15
  %197 = trunc i8 %196 to i1
  br i1 %197, label %264, label %198

198:                                              ; preds = %192
  %199 = load i32, ptr %26, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [200010 x i8], ptr @visited2, i64 0, i64 %200
  store i8 1, ptr %201, align 1, !tbaa !12
  %202 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @SS, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %203 unwind label %228

203:                                              ; preds = %198
  %204 = getelementptr inbounds { ptr, i8 }, ptr %27, i32 0, i32 0
  %205 = extractvalue { ptr, i8 } %202, 0
  store ptr %205, ptr %204, align 8
  %206 = getelementptr inbounds { ptr, i8 }, ptr %27, i32 0, i32 1
  %207 = extractvalue { ptr, i8 } %202, 1
  store i8 %207, ptr %206, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %208 = load i32, ptr %26, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @W, i64 0, i64 %209
  store ptr %210, ptr %28, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %211 = load ptr, ptr %28, align 8, !tbaa !16
  %212 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %211) #7
  %213 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %212, ptr %213, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %214 = load ptr, ptr %28, align 8, !tbaa !16
  %215 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %214) #7
  %216 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %215, ptr %216, align 8
  br label %217

217:                                              ; preds = %260, %203
  %218 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #7
  br i1 %218, label %232, label %219

219:                                              ; preds = %217
  store i32 19, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %263

220:                                              ; preds = %181
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %13, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %14, align 4
  br label %291

224:                                              ; preds = %184, %182
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %13, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %14, align 4
  br label %290

228:                                              ; preds = %198, %190, %188
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %13, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %14, align 4
  br label %265

232:                                              ; preds = %217
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %233 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  %234 = load i32, ptr %233, align 4, !tbaa !5
  store i32 %234, ptr %31, align 4, !tbaa !5
  %235 = load i32, ptr %31, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [200010 x i8], ptr @visited2, i64 0, i64 %236
  %238 = load i8, ptr %237, align 1, !tbaa !12, !range !14, !noundef !15
  %239 = trunc i8 %238 to i1
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  br i1 %239, label %247, label %240

240:                                              ; preds = %232
  %241 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @S, ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %242 unwind label %251

242:                                              ; preds = %240
  %243 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %32, i32 0, i32 0
  store ptr %241, ptr %243, align 8
  %244 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  %245 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %33, i32 0, i32 0
  store ptr %244, ptr %245, align 8
  %246 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  br label %247

247:                                              ; preds = %242, %232
  %248 = phi i1 [ false, %232 ], [ %246, %242 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br i1 %248, label %249, label %259

249:                                              ; preds = %247
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %25, ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %250 unwind label %255

250:                                              ; preds = %249
  br label %259

251:                                              ; preds = %240
  %252 = landingpad { ptr, i32 }
          cleanup
  %253 = extractvalue { ptr, i32 } %252, 0
  store ptr %253, ptr %13, align 8
  %254 = extractvalue { ptr, i32 } %252, 1
  store i32 %254, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %262

255:                                              ; preds = %249
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %13, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %14, align 4
  br label %262

259:                                              ; preds = %250, %247
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %260

260:                                              ; preds = %259
  %261 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  br label %217

262:                                              ; preds = %255, %251
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %265

263:                                              ; preds = %219
  br label %264

264:                                              ; preds = %263, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %184, !llvm.loop !19

265:                                              ; preds = %262, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %290

266:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  store ptr @SS, ptr %34, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %267 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  %268 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %35, i32 0, i32 0
  store ptr %267, ptr %268, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #7
  %269 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  %270 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %36, i32 0, i32 0
  store ptr %269, ptr %270, align 8
  br label %271

271:                                              ; preds = %282, %266
  %272 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %36) #7
  br i1 %272, label %274, label %273

273:                                              ; preds = %271
  store i32 21, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  br label %284

274:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %275 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #7
  %276 = load i32, ptr %275, align 4, !tbaa !5
  store i32 %276, ptr %37, align 4, !tbaa !5
  %277 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  %278 = trunc i64 %277 to i32
  %279 = load i32, ptr %37, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %280
  store i32 %278, ptr %281, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  br label %282

282:                                              ; preds = %274
  %283 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #7
  br label %271

284:                                              ; preds = %273
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %25) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %25) #7
  store i32 0, ptr %11, align 4
  br label %285

285:                                              ; preds = %284, %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %286 = load i32, ptr %11, align 4
  switch i32 %286, label %328 [
    i32 0, label %287
    i32 16, label %288
  ]

287:                                              ; preds = %285
  br label %288

288:                                              ; preds = %287, %285
  %289 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br label %169

290:                                              ; preds = %265, %224
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %25) #7
  br label %291

291:                                              ; preds = %290, %220
  call void @llvm.lifetime.end.p0(i64 80, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %296

292:                                              ; preds = %171
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %12) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %12) #7
  br label %293

293:                                              ; preds = %292, %97
  %294 = load i32, ptr %10, align 4, !tbaa !5
  %295 = add nsw i32 %294, 1
  store i32 %295, ptr %10, align 4, !tbaa !5
  br label %86, !llvm.loop !20

296:                                              ; preds = %291, %163, %136
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %12) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %323

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

298:                                              ; preds = %318, %297
  %299 = load i32, ptr %38, align 4, !tbaa !5
  %300 = load i32, ptr @N, align 4, !tbaa !5
  %301 = icmp slt i32 %299, %300
  br i1 %301, label %303, label %302

302:                                              ; preds = %298
  store i32 23, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  br label %321

303:                                              ; preds = %298
  %304 = load i32, ptr %38, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %305
  %307 = load i32, ptr %306, align 4, !tbaa !5
  %308 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %307)
  %309 = load i32, ptr %38, align 4, !tbaa !5
  %310 = load i32, ptr @N, align 4, !tbaa !5
  %311 = sub nsw i32 %310, 1
  %312 = icmp slt i32 %309, %311
  br i1 %312, label %313, label %315

313:                                              ; preds = %303
  %314 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %317

315:                                              ; preds = %303
  %316 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %317

317:                                              ; preds = %315, %313
  br label %318

318:                                              ; preds = %317
  %319 = load i32, ptr %38, align 4, !tbaa !5
  %320 = add nsw i32 %319, 1
  store i32 %320, ptr %38, align 4, !tbaa !5
  br label %298, !llvm.loop !21

321:                                              ; preds = %302
  %322 = load i32, ptr %1, align 4
  ret i32 %322

323:                                              ; preds = %296
  %324 = load ptr, ptr %13, align 8
  %325 = load i32, ptr %14, align 4
  %326 = insertvalue { ptr, i32 } poison, ptr %324, 0
  %327 = insertvalue { ptr, i32 } %326, i32 %325, 1
  resume { ptr, i32 } %327

328:                                              ; preds = %285
  unreachable
}

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; 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)) #5 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)) #5 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 ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(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 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 uwtable
declare dso_local ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #4

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 = { "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 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 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!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 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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::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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = 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", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@K = external dso_local global i32, align 4
@L = external dso_local global i32, align 4
@V = external dso_local global [200010 x %"class.std::vector"], align 16
@W = external dso_local global [200010 x %"class.std::vector"], align 16
@visited = external dso_local global [200010 x i8], align 16
@visited2 = external dso_local global [200010 x i8], align 16
@ans = external dso_local local_unnamed_addr global [200010 x i32], align 16
@S = external dso_local global %"class.std::set", align 8
@SS = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = 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 i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::stack", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %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 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %26 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %27 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) @L)
  %28 = load i32, ptr @K, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %.preheader35

.preheader35:                                     ; preds = %.lr.ph, %0
  %30 = load i32, ptr @L, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph38, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01736 = phi i32 [ %43, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %32 = 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)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr %1, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %35 to i64
  %39 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @V, i64 0, i64 %38
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @V, i64 0, i64 %41
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %43 = add nuw nsw i32 %.01736, 1
  %44 = load i32, ptr @K, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %.lr.ph, label %.preheader35, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph38, %.preheader35
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  store i8 0, ptr %5, align 1, !tbaa !11
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visited, ptr noundef nonnull getelementptr inbounds (i8, ptr @visited, i64 200010), 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 1, ptr nonnull %6) #7
  store i8 0, ptr %6, align 1, !tbaa !11
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visited2, ptr noundef nonnull getelementptr inbounds (i8, ptr @visited2, i64 200010), ptr noundef nonnull align 1 dereferenceable(1) %6)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  %46 = load i32, ptr @N, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph57, label %._crit_edge58.thread

._crit_edge58.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %._crit_edge62

.lr.ph38:                                         ; preds = %.preheader35, %.lr.ph38
  %.01837 = phi i32 [ %59, %.lr.ph38 ], [ 0, %.preheader35 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %51 to i64
  %55 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @W, i64 0, i64 %54
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @W, i64 0, i64 %57
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %59 = add nuw nsw i32 %.01837, 1
  %60 = load i32, ptr @L, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %.lr.ph38, label %._crit_edge, !llvm.loop !13

._crit_edge58:                                    ; preds = %178
  %62 = icmp sgt i32 %179, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br i1 %62, label %.lr.ph61, label %._crit_edge62

.lr.ph57:                                         ; preds = %._crit_edge, %178
  %63 = phi i32 [ %179, %178 ], [ %46, %._crit_edge ]
  %storemerge55 = phi i32 [ %181, %178 ], [ 0, %._crit_edge ]
  %64 = sext i32 %storemerge55 to i64
  %65 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !11, !range !14, !noundef !15
  %67 = trunc nuw i8 %66 to i1
  br i1 %67, label %178, label %68

68:                                               ; preds = %.lr.ph57
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %.preheader34 unwind label %86

.preheader34:                                     ; preds = %68
  %69 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %69, label %._crit_edge43, label %.lr.ph42

.lr.ph42:                                         ; preds = %.preheader34, %102
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  store i32 %71, ptr %9, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !11, !range !14, !noundef !15
  %76 = trunc nuw i8 %75 to i1
  br i1 %76, label %102, label %77

77:                                               ; preds = %.lr.ph42
  store i8 1, ptr %74, align 1, !tbaa !11
  %78 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @S, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %79 unwind label %88

79:                                               ; preds = %77
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @V, i64 0, i64 %81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %83 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #7
  store ptr %83, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %84 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #7
  store ptr %84, ptr %11, align 8
  %85 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %85, label %.lr.ph40, label %._crit_edge41

._crit_edge41:                                    ; preds = %99, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %102

86:                                               ; preds = %68
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %183

88:                                               ; preds = %77
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %104

.lr.ph40:                                         ; preds = %79, %99
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %91 = load i32, ptr %90, align 4, !tbaa !5
  store i32 %91, ptr %12, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !11, !range !14, !noundef !15
  %95 = trunc nuw i8 %94 to i1
  br i1 %95, label %99, label %96

96:                                               ; preds = %.lr.ph40
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %99 unwind label %97

97:                                               ; preds = %96
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %104

99:                                               ; preds = %96, %.lr.ph40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %101 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %101, label %.lr.ph40, label %._crit_edge41

102:                                              ; preds = %._crit_edge41, %.lr.ph42
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %103 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %103, label %._crit_edge43, label %.lr.ph42, !llvm.loop !16

104:                                              ; preds = %97, %88
  %.pn31 = phi { ptr, i32 } [ %98, %97 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %183

._crit_edge43:                                    ; preds = %102, %.preheader34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %105 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %105, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %106 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %106, ptr %14, align 8
  %107 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br i1 %107, label %.lr.ph53, label %._crit_edge54

._crit_edge54:                                    ; preds = %173, %._crit_edge43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #7
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  %.pre64 = load i32, ptr @N, align 4, !tbaa !5
  br label %178

.lr.ph53:                                         ; preds = %._crit_edge43, %173
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %15, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200010 x i8], ptr @visited2, i64 0, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !11, !range !14, !noundef !15
  %113 = trunc nuw i8 %112 to i1
  br i1 %113, label %173, label %114

114:                                              ; preds = %.lr.ph53
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %16) #7
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %115 unwind label %133

115:                                              ; preds = %114
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %.preheader unwind label %135

.preheader:                                       ; preds = %115
  %116 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  br i1 %116, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %.preheader, %159
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #7
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  %118 = load i32, ptr %117, align 4, !tbaa !5
  store i32 %118, ptr %17, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  %119 = load i32, ptr %17, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [200010 x i8], ptr @visited2, i64 0, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !11, !range !14, !noundef !15
  %123 = trunc nuw i8 %122 to i1
  br i1 %123, label %159, label %124

124:                                              ; preds = %.lr.ph47
  store i8 1, ptr %121, align 1, !tbaa !11
  %125 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @SS, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %126 unwind label %137

126:                                              ; preds = %124
  %127 = load i32, ptr %17, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @W, i64 0, i64 %128
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %130 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #7
  store ptr %130, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #7
  %131 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #7
  store ptr %131, ptr %19, align 8
  %132 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %132, label %.lr.ph45, label %._crit_edge46

._crit_edge46:                                    ; preds = %155, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  br label %159

133:                                              ; preds = %114
  %134 = landingpad { ptr, i32 }
          cleanup
  br label %177

135:                                              ; preds = %115
  %136 = landingpad { ptr, i32 }
          cleanup
  br label %176

137:                                              ; preds = %124
  %138 = landingpad { ptr, i32 }
          cleanup
  br label %161

.lr.ph45:                                         ; preds = %126, %155
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #7
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %140 = load i32, ptr %139, align 4, !tbaa !5
  store i32 %140, ptr %20, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [200010 x i8], ptr @visited2, i64 0, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !11, !range !14, !noundef !15
  %144 = trunc nuw i8 %143 to i1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #7
  br i1 %144, label %.critedge, label %145

145:                                              ; preds = %.lr.ph45
  %146 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) @S, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %147 unwind label %151

147:                                              ; preds = %145
  store ptr %146, ptr %21, align 8
  %148 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @S) #7
  store ptr %148, ptr %22, align 8
  %149 = 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) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #7
  br i1 %149, label %150, label %155

150:                                              ; preds = %147
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %155 unwind label %153

151:                                              ; preds = %145
  %152 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #7
  br label %158

153:                                              ; preds = %150
  %154 = landingpad { ptr, i32 }
          cleanup
  br label %158

.critedge:                                        ; preds = %.lr.ph45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #7
  br label %155

155:                                              ; preds = %150, %.critedge, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #7
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %157 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %157, label %.lr.ph45, label %._crit_edge46

158:                                              ; preds = %153, %151
  %.pn = phi { ptr, i32 } [ %154, %153 ], [ %152, %151 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  br label %161

159:                                              ; preds = %._crit_edge46, %.lr.ph47
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #7
  %160 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  br i1 %160, label %._crit_edge48, label %.lr.ph47, !llvm.loop !17

161:                                              ; preds = %158, %137
  %.pn.pn = phi { ptr, i32 } [ %.pn, %158 ], [ %138, %137 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #7
  br label %176

._crit_edge48:                                    ; preds = %159, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #7
  %162 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  store ptr %162, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #7
  %163 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  store ptr %163, ptr %24, align 8
  %164 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  br i1 %164, label %.lr.ph50, label %._crit_edge51

._crit_edge51:                                    ; preds = %.lr.ph50, %._crit_edge48
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #7
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %16) #7
  br label %173

.lr.ph50:                                         ; preds = %._crit_edge48, %.lr.ph50
  %165 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @SS) #7
  %168 = trunc i64 %167 to i32
  %169 = sext i32 %166 to i64
  %170 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %169
  store i32 %168, ptr %170, align 4, !tbaa !5
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  %172 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  br i1 %172, label %.lr.ph50, label %._crit_edge51

173:                                              ; preds = %.lr.ph53, %._crit_edge51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %175 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br i1 %175, label %.lr.ph53, label %._crit_edge54

176:                                              ; preds = %161, %135
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %161 ], [ %136, %135 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #7
  br label %177

177:                                              ; preds = %176, %133
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %176 ], [ %134, %133 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br label %183

178:                                              ; preds = %.lr.ph57, %._crit_edge54
  %179 = phi i32 [ %63, %.lr.ph57 ], [ %.pre64, %._crit_edge54 ]
  %180 = phi i32 [ %storemerge55, %.lr.ph57 ], [ %.pre, %._crit_edge54 ]
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %7, align 4, !tbaa !5
  %182 = icmp slt i32 %181, %179
  br i1 %182, label %.lr.ph57, label %._crit_edge58, !llvm.loop !18

183:                                              ; preds = %177, %104, %86
  %.pn31.pn = phi { ptr, i32 } [ %.pn31, %104 ], [ %.pn.pn.pn.pn, %177 ], [ %87, %86 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn31.pn

._crit_edge62:                                    ; preds = %195, %._crit_edge58.thread, %._crit_edge58
  ret i32 0

.lr.ph61:                                         ; preds = %._crit_edge58, %195
  %indvars.iv = phi i64 [ %indvars.iv.next, %195 ], [ 0, %._crit_edge58 ]
  %184 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %indvars.iv
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %185)
  %187 = load i32, ptr @N, align 4, !tbaa !5
  %188 = add nsw i32 %187, -1
  %189 = sext i32 %188 to i64
  %190 = icmp slt i64 %indvars.iv, %189
  br i1 %190, label %191, label %193

191:                                              ; preds = %.lr.ph61
  %192 = 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)
  br label %195

193:                                              ; preds = %.lr.ph61
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %195

195:                                              ; preds = %191, %193
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %196 = load i32, ptr @N, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = icmp slt i64 %indvars.iv.next, %197
  br i1 %198, label %.lr.ph61, label %._crit_edge62, !llvm.loop !19
}

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 #1

; 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 uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; 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 #5 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 #5 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 ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(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 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 uwtable
declare dso_local ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

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

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

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

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 = { "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 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 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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