; LLVM IR from kazunetakahashi/atcoder :: 2018/0128_ARC090 (E)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" = type { 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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.5", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.5" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.6" = type { i64 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@S = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@V = external dso_local global [100010 x %"class.std::vector"], align 16
@D = external dso_local global [100010 x i64], align 16
@cnt = external dso_local global [100010 x i64], align 16
@revD = external dso_local global [100010 x i64], align 16
@revcnt = external dso_local global [100010 x i64], align 16
@visited = external dso_local global [100010 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 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 i64, align 8
  %6 = alloca %"class.std::tuple", align 8
  %7 = alloca %"class.std::tuple", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::priority_queue", align 8
  %10 = alloca %"class.std::tuple", align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.std::tuple", align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca %"class.std::tuple", align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i8, align 1
  %26 = alloca %"class.std::vector", align 8
  %27 = alloca i32, align 4
  %28 = alloca %"class.std::tuple", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca ptr, align 8
  %32 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %33 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %34 = alloca i32, align 4
  %35 = alloca %"class.std::tuple", align 8
  %36 = alloca i32, align 4
  %37 = alloca ptr, align 8
  %38 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %39 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %40 = alloca %"class.std::tuple", align 8
  %41 = alloca i64, align 8
  %42 = alloca i64, align 8
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca %"class.std::tuple", align 8
  %46 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %47 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %48 = alloca i32, align 4
  %49 = alloca i8, align 1
  %50 = alloca ptr, align 8
  %51 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %52 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %53 = alloca %"class.std::tuple", align 8
  %54 = alloca i32, align 4
  %55 = alloca ptr, align 8
  %56 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %57 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %58 = alloca %"class.std::tuple", align 8
  %59 = alloca i64, align 8
  %60 = alloca i64, align 8
  %61 = alloca i64, align 8
  %62 = alloca i64, align 8
  %63 = alloca i32, align 4
  %64 = alloca i64, align 8
  %65 = alloca i32, align 4
  %66 = alloca ptr, align 8
  %67 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %68 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %69 = alloca %"class.std::tuple", align 8
  %70 = alloca i64, align 8
  %71 = alloca i32, align 4
  %72 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %73 = 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)
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @S)
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %75, ptr noundef nonnull align 4 dereferenceable(4) @T)
  %77 = load i32, ptr @S, align 4, !tbaa !5
  %78 = add nsw i32 %77, -1
  store i32 %78, ptr @S, align 4, !tbaa !5
  %79 = load i32, ptr @T, align 4, !tbaa !5
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr @T, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %100, %0
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = load i32, ptr @M, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %103

86:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %87 = 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)
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %87, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %89 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %88, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = add nsw i32 %90, -1
  store i32 %91, ptr %3, align 4, !tbaa !5
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = add nsw i32 %92, -1
  store i32 %93, ptr %4, align 4, !tbaa !5
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %95
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #8
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %4) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #8
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %98
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %3) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %100

100:                                              ; preds = %86
  %101 = load i32, ptr %2, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %2, align 4, !tbaa !5
  br label %81, !llvm.loop !9

103:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 -1, ptr %8, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @D, ptr noundef getelementptr inbounds (i64, ptr @D, i64 100010), ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @_ZNSt5tupleIJxiEEC2IiRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) @S) #8
  invoke void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %104 unwind label %141

104:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  br label %105

105:                                              ; preds = %184, %104
  %106 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %9)
          to label %107 unwind label %145

107:                                              ; preds = %105
  %108 = xor i1 %106, true
  br i1 %108, label %109, label %187

109:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %110 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %9)
          to label %111 unwind label %149

111:                                              ; preds = %109
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %110) #8
  %113 = load i64, ptr %112, align 8, !tbaa !11
  store i64 %113, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %114 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %9)
          to label %115 unwind label %153

115:                                              ; preds = %111
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %114) #8
  %117 = load i32, ptr %116, align 4, !tbaa !5
  store i32 %117, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %9)
          to label %118 unwind label %153

118:                                              ; preds = %115
  %119 = load i32, ptr %15, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !11
  %123 = icmp eq i64 %122, -1
  br i1 %123, label %124, label %184

124:                                              ; preds = %118
  %125 = load i64, ptr %14, align 8, !tbaa !11
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %127
  store i64 %125, ptr %128, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %129 = load i32, ptr %15, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %130
  store ptr %131, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %132 = load ptr, ptr %16, align 8, !tbaa !13
  %133 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #8
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %135 = load ptr, ptr %16, align 8, !tbaa !13
  %136 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %135) #8
  %137 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %136, ptr %137, align 8
  br label %138

138:                                              ; preds = %181, %124
  %139 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br i1 %139, label %157, label %140

140:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %183

141:                                              ; preds = %103
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %12, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  br label %592

145:                                              ; preds = %105
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %12, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %13, align 4
  br label %592

149:                                              ; preds = %109
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %12, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %13, align 4
  br label %186

153:                                              ; preds = %115, %111
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %12, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %13, align 4
  br label %185

157:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #8
  %158 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %158, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %19) #8
  %160 = load i64, ptr %159, align 8, !tbaa !11
  store i64 %160, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %19) #8
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  store i64 %163, ptr %21, align 8, !tbaa !11
  %164 = load i64, ptr %21, align 8, !tbaa !11
  %165 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %164
  %166 = load i64, ptr %165, align 8, !tbaa !11
  %167 = icmp eq i64 %166, -1
  br i1 %167, label %168, label %180

168:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %169 = load i32, ptr %15, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !11
  %173 = load i64, ptr %20, align 8, !tbaa !11
  %174 = add nsw i64 %172, %173
  store i64 %174, ptr %23, align 8, !tbaa !11
  call void @_ZNSt5tupleIJxiEEC2IxRxTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  invoke void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %9, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %175 unwind label %176

175:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #8
  br label %180

176:                                              ; preds = %168
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %12, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %185

180:                                              ; preds = %175, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #8
  br label %181

181:                                              ; preds = %180
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  br label %138

183:                                              ; preds = %140
  br label %184

184:                                              ; preds = %183, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %105, !llvm.loop !15

185:                                              ; preds = %176, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %186

186:                                              ; preds = %185, %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %592

187:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !5
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @cnt, ptr noundef getelementptr inbounds (i64, ptr @cnt, i64 100010), ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %188 unwind label %198

188:                                              ; preds = %187
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #8
  store i8 0, ptr %25, align 1, !tbaa !16
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visited, ptr noundef getelementptr inbounds (i8, ptr @visited, i64 100010), ptr noundef nonnull align 1 dereferenceable(1) %25)
          to label %189 unwind label %202

189:                                              ; preds = %188
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #8
  %190 = load i32, ptr @S, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %191
  store i64 1, ptr %192, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %211, %189
  %194 = load i32, ptr %27, align 4, !tbaa !5
  %195 = load i32, ptr @N, align 4, !tbaa !5
  %196 = icmp slt i32 %194, %195
  br i1 %196, label %206, label %197

197:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %218

198:                                              ; preds = %187
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %12, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %592

202:                                              ; preds = %188
  %203 = landingpad { ptr, i32 }
          cleanup
  %204 = extractvalue { ptr, i32 } %203, 0
  store ptr %204, ptr %12, align 8
  %205 = extractvalue { ptr, i32 } %203, 1
  store i32 %205, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #8
  br label %592

206:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #8
  %207 = load i32, ptr %27, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %208
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %209, ptr noundef nonnull align 4 dereferenceable(4) %27) #8
  invoke void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %210 unwind label %214

210:                                              ; preds = %206
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %27, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %27, align 4, !tbaa !5
  br label %193, !llvm.loop !18

214:                                              ; preds = %206
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %12, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %591

218:                                              ; preds = %197
  %219 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %220 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %219, ptr %220, align 8
  %221 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %222 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %221, ptr %222, align 8
  %223 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8
  %225 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %224, ptr %226)
          to label %227 unwind label %237

227:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  store ptr %26, ptr %31, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %228 = load ptr, ptr %31, align 8, !tbaa !13
  %229 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %228) #8
  %230 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %32, i32 0, i32 0
  store ptr %229, ptr %230, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %231 = load ptr, ptr %31, align 8, !tbaa !13
  %232 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %231) #8
  %233 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %33, i32 0, i32 0
  store ptr %232, ptr %233, align 8
  br label %234

234:                                              ; preds = %301, %227
  %235 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(8) %33) #8
  br i1 %235, label %241, label %236

236:                                              ; preds = %234
  store i32 12, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  br label %303

237:                                              ; preds = %350, %218
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %12, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %13, align 4
  br label %591

241:                                              ; preds = %234
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #8
  %242 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %242, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %243 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %35) #8
  %244 = load i32, ptr %243, align 4, !tbaa !5
  store i32 %244, ptr %36, align 4, !tbaa !5
  %245 = load i32, ptr %36, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [100010 x i8], ptr @visited, i64 0, i64 %246
  %248 = load i8, ptr %247, align 1, !tbaa !16, !range !19, !noundef !20
  %249 = trunc i8 %248 to i1
  br i1 %249, label %300, label %250

250:                                              ; preds = %241
  %251 = load i32, ptr %36, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [100010 x i8], ptr @visited, i64 0, i64 %252
  store i8 1, ptr %253, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %254 = load i32, ptr %36, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %255
  store ptr %256, ptr %37, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  %257 = load ptr, ptr %37, align 8, !tbaa !13
  %258 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %257) #8
  %259 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %38, i32 0, i32 0
  store ptr %258, ptr %259, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %260 = load ptr, ptr %37, align 8, !tbaa !13
  %261 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %260) #8
  %262 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %39, i32 0, i32 0
  store ptr %261, ptr %262, align 8
  br label %263

263:                                              ; preds = %297, %250
  %264 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %39) #8
  br i1 %264, label %266, label %265

265:                                              ; preds = %263
  store i32 14, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br label %299

266:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 16, ptr %40) #8
  %267 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 8 %267, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %268 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %40) #8
  %269 = load i64, ptr %268, align 8, !tbaa !11
  store i64 %269, ptr %41, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %270 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %40) #8
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  store i64 %272, ptr %42, align 8, !tbaa !11
  %273 = load i64, ptr %42, align 8, !tbaa !11
  %274 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %273
  %275 = load i64, ptr %274, align 8, !tbaa !11
  %276 = load i32, ptr %36, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %277
  %279 = load i64, ptr %278, align 8, !tbaa !11
  %280 = load i64, ptr %41, align 8, !tbaa !11
  %281 = add nsw i64 %279, %280
  %282 = icmp eq i64 %275, %281
  br i1 %282, label %283, label %296

283:                                              ; preds = %266
  %284 = load i32, ptr %36, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %285
  %287 = load i64, ptr %286, align 8, !tbaa !11
  %288 = load i64, ptr %42, align 8, !tbaa !11
  %289 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %288
  %290 = load i64, ptr %289, align 8, !tbaa !11
  %291 = add nsw i64 %290, %287
  store i64 %291, ptr %289, align 8, !tbaa !11
  %292 = load i64, ptr %42, align 8, !tbaa !11
  %293 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %292
  %294 = load i64, ptr %293, align 8, !tbaa !11
  %295 = srem i64 %294, 1000000007
  store i64 %295, ptr %293, align 8, !tbaa !11
  br label %296

296:                                              ; preds = %283, %266
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %40) #8
  br label %297

297:                                              ; preds = %296
  %298 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  br label %263

299:                                              ; preds = %265
  br label %300

300:                                              ; preds = %299, %241
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #8
  br label %301

301:                                              ; preds = %300
  %302 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #8
  br label %234

303:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  store i32 0, ptr %43, align 4, !tbaa !5
  br label %304

304:                                              ; preds = %322, %303
  %305 = load i32, ptr %43, align 4, !tbaa !5
  %306 = load i32, ptr @N, align 4, !tbaa !5
  %307 = icmp slt i32 %305, %306
  br i1 %307, label %309, label %308

308:                                              ; preds = %304
  store i32 16, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  br label %325

309:                                              ; preds = %304
  %310 = load i32, ptr @T, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %311
  %313 = load i64, ptr %312, align 8, !tbaa !11
  %314 = load i32, ptr %43, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %315
  %317 = load i64, ptr %316, align 8, !tbaa !11
  %318 = sub nsw i64 %313, %317
  %319 = load i32, ptr %43, align 4, !tbaa !5
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %320
  store i64 %318, ptr %321, align 8, !tbaa !11
  br label %322

322:                                              ; preds = %309
  %323 = load i32, ptr %43, align 4, !tbaa !5
  %324 = add nsw i32 %323, 1
  store i32 %324, ptr %43, align 4, !tbaa !5
  br label %304, !llvm.loop !21

325:                                              ; preds = %308
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  store i32 0, ptr %44, align 4, !tbaa !5
  br label %326

326:                                              ; preds = %347, %325
  %327 = load i32, ptr %44, align 4, !tbaa !5
  %328 = load i32, ptr @N, align 4, !tbaa !5
  %329 = icmp slt i32 %327, %328
  br i1 %329, label %331, label %330

330:                                              ; preds = %326
  store i32 19, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  br label %350

331:                                              ; preds = %326
  %332 = load i32, ptr %44, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %333
  %335 = load i64, ptr %334, align 8, !tbaa !11
  %336 = icmp sge i64 %335, 0
  br i1 %336, label %337, label %346

337:                                              ; preds = %331
  call void @llvm.lifetime.start.p0(i64 16, ptr %45) #8
  %338 = load i32, ptr %44, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %339
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(8) %340, ptr noundef nonnull align 4 dereferenceable(4) %44) #8
  invoke void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(16) %45)
          to label %341 unwind label %342

341:                                              ; preds = %337
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #8
  br label %346

342:                                              ; preds = %337
  %343 = landingpad { ptr, i32 }
          cleanup
  %344 = extractvalue { ptr, i32 } %343, 0
  store ptr %344, ptr %12, align 8
  %345 = extractvalue { ptr, i32 } %343, 1
  store i32 %345, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  br label %591

346:                                              ; preds = %341, %331
  br label %347

347:                                              ; preds = %346
  %348 = load i32, ptr %44, align 4, !tbaa !5
  %349 = add nsw i32 %348, 1
  store i32 %349, ptr %44, align 4, !tbaa !5
  br label %326, !llvm.loop !22

350:                                              ; preds = %330
  %351 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %352 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %46, i32 0, i32 0
  store ptr %351, ptr %352, align 8
  %353 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %354 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %47, i32 0, i32 0
  store ptr %353, ptr %354, align 8
  %355 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %46, i32 0, i32 0
  %356 = load ptr, ptr %355, align 8
  %357 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %47, i32 0, i32 0
  %358 = load ptr, ptr %357, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %356, ptr %358)
          to label %359 unwind label %237

359:                                              ; preds = %350
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #8
  store i32 0, ptr %48, align 4, !tbaa !5
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @revcnt, ptr noundef getelementptr inbounds (i64, ptr @revcnt, i64 100010), ptr noundef nonnull align 4 dereferenceable(4) %48)
          to label %360 unwind label %374

360:                                              ; preds = %359
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %49) #8
  store i8 0, ptr %49, align 1, !tbaa !16
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visited, ptr noundef getelementptr inbounds (i8, ptr @visited, i64 100010), ptr noundef nonnull align 1 dereferenceable(1) %49)
          to label %361 unwind label %378

361:                                              ; preds = %360
  call void @llvm.lifetime.end.p0(i64 1, ptr %49) #8
  %362 = load i32, ptr @T, align 4, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %363
  store i64 1, ptr %364, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #8
  store ptr %26, ptr %50, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #8
  %365 = load ptr, ptr %50, align 8, !tbaa !13
  %366 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %365) #8
  %367 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %51, i32 0, i32 0
  store ptr %366, ptr %367, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #8
  %368 = load ptr, ptr %50, align 8, !tbaa !13
  %369 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %368) #8
  %370 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %52, i32 0, i32 0
  store ptr %369, ptr %370, align 8
  br label %371

371:                                              ; preds = %442, %361
  %372 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull align 8 dereferenceable(8) %52) #8
  br i1 %372, label %382, label %373

373:                                              ; preds = %371
  store i32 22, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  br label %444

374:                                              ; preds = %359
  %375 = landingpad { ptr, i32 }
          cleanup
  %376 = extractvalue { ptr, i32 } %375, 0
  store ptr %376, ptr %12, align 8
  %377 = extractvalue { ptr, i32 } %375, 1
  store i32 %377, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #8
  br label %591

378:                                              ; preds = %360
  %379 = landingpad { ptr, i32 }
          cleanup
  %380 = extractvalue { ptr, i32 } %379, 0
  store ptr %380, ptr %12, align 8
  %381 = extractvalue { ptr, i32 } %379, 1
  store i32 %381, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %49) #8
  br label %591

382:                                              ; preds = %371
  call void @llvm.lifetime.start.p0(i64 16, ptr %53) #8
  %383 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %51) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %53, ptr align 8 %383, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #8
  %384 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %53) #8
  %385 = load i32, ptr %384, align 4, !tbaa !5
  store i32 %385, ptr %54, align 4, !tbaa !5
  %386 = load i32, ptr %54, align 4, !tbaa !5
  %387 = sext i32 %386 to i64
  %388 = getelementptr inbounds [100010 x i8], ptr @visited, i64 0, i64 %387
  %389 = load i8, ptr %388, align 1, !tbaa !16, !range !19, !noundef !20
  %390 = trunc i8 %389 to i1
  br i1 %390, label %441, label %391

391:                                              ; preds = %382
  %392 = load i32, ptr %54, align 4, !tbaa !5
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds [100010 x i8], ptr @visited, i64 0, i64 %393
  store i8 1, ptr %394, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #8
  %395 = load i32, ptr %54, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %396
  store ptr %397, ptr %55, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #8
  %398 = load ptr, ptr %55, align 8, !tbaa !13
  %399 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %398) #8
  %400 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %56, i32 0, i32 0
  store ptr %399, ptr %400, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #8
  %401 = load ptr, ptr %55, align 8, !tbaa !13
  %402 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %401) #8
  %403 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %57, i32 0, i32 0
  store ptr %402, ptr %403, align 8
  br label %404

404:                                              ; preds = %438, %391
  %405 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 8 dereferenceable(8) %57) #8
  br i1 %405, label %407, label %406

406:                                              ; preds = %404
  store i32 24, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #8
  br label %440

407:                                              ; preds = %404
  call void @llvm.lifetime.start.p0(i64 16, ptr %58) #8
  %408 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %56) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %58, ptr align 8 %408, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #8
  %409 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %58) #8
  %410 = load i64, ptr %409, align 8, !tbaa !11
  store i64 %410, ptr %59, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #8
  %411 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %58) #8
  %412 = load i32, ptr %411, align 4, !tbaa !5
  %413 = sext i32 %412 to i64
  store i64 %413, ptr %60, align 8, !tbaa !11
  %414 = load i64, ptr %60, align 8, !tbaa !11
  %415 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %414
  %416 = load i64, ptr %415, align 8, !tbaa !11
  %417 = load i32, ptr %54, align 4, !tbaa !5
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %418
  %420 = load i64, ptr %419, align 8, !tbaa !11
  %421 = load i64, ptr %59, align 8, !tbaa !11
  %422 = add nsw i64 %420, %421
  %423 = icmp eq i64 %416, %422
  br i1 %423, label %424, label %437

424:                                              ; preds = %407
  %425 = load i32, ptr %54, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %426
  %428 = load i64, ptr %427, align 8, !tbaa !11
  %429 = load i64, ptr %60, align 8, !tbaa !11
  %430 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %429
  %431 = load i64, ptr %430, align 8, !tbaa !11
  %432 = add nsw i64 %431, %428
  store i64 %432, ptr %430, align 8, !tbaa !11
  %433 = load i64, ptr %60, align 8, !tbaa !11
  %434 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %433
  %435 = load i64, ptr %434, align 8, !tbaa !11
  %436 = srem i64 %435, 1000000007
  store i64 %436, ptr %434, align 8, !tbaa !11
  br label %437

437:                                              ; preds = %424, %407
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %58) #8
  br label %438

438:                                              ; preds = %437
  %439 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %56) #8
  br label %404

440:                                              ; preds = %406
  br label %441

441:                                              ; preds = %440, %382
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %53) #8
  br label %442

442:                                              ; preds = %441
  %443 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %51) #8
  br label %371

444:                                              ; preds = %373
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #8
  %445 = load i32, ptr @T, align 4, !tbaa !5
  %446 = sext i32 %445 to i64
  %447 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %446
  %448 = load i64, ptr %447, align 8, !tbaa !11
  %449 = load i32, ptr @T, align 4, !tbaa !5
  %450 = sext i32 %449 to i64
  %451 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %450
  %452 = load i64, ptr %451, align 8, !tbaa !11
  %453 = mul nsw i64 %448, %452
  %454 = srem i64 %453, 1000000007
  store i64 %454, ptr %61, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %62) #8
  %455 = load i32, ptr @T, align 4, !tbaa !5
  %456 = sext i32 %455 to i64
  %457 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %456
  %458 = load i64, ptr %457, align 8, !tbaa !11
  store i64 %458, ptr %62, align 8, !tbaa !11
  %459 = load i64, ptr %62, align 8, !tbaa !11
  %460 = srem i64 %459, 2
  %461 = icmp eq i64 %460, 0
  br i1 %461, label %462, label %501

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

463:                                              ; preds = %497, %462
  %464 = load i32, ptr %63, align 4, !tbaa !5
  %465 = load i32, ptr @N, align 4, !tbaa !5
  %466 = icmp slt i32 %464, %465
  br i1 %466, label %468, label %467

467:                                              ; preds = %463
  store i32 26, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #8
  br label %500

468:                                              ; preds = %463
  %469 = load i32, ptr %63, align 4, !tbaa !5
  %470 = sext i32 %469 to i64
  %471 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %470
  %472 = load i64, ptr %471, align 8, !tbaa !11
  %473 = load i64, ptr %62, align 8, !tbaa !11
  %474 = sdiv i64 %473, 2
  %475 = icmp eq i64 %472, %474
  br i1 %475, label %476, label %496

476:                                              ; preds = %468
  call void @llvm.lifetime.start.p0(i64 8, ptr %64) #8
  %477 = load i32, ptr %63, align 4, !tbaa !5
  %478 = sext i32 %477 to i64
  %479 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %478
  %480 = load i64, ptr %479, align 8, !tbaa !11
  %481 = load i32, ptr %63, align 4, !tbaa !5
  %482 = sext i32 %481 to i64
  %483 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %482
  %484 = load i64, ptr %483, align 8, !tbaa !11
  %485 = mul nsw i64 %480, %484
  %486 = srem i64 %485, 1000000007
  store i64 %486, ptr %64, align 8, !tbaa !11
  %487 = load i64, ptr %64, align 8, !tbaa !11
  %488 = load i64, ptr %64, align 8, !tbaa !11
  %489 = mul nsw i64 %487, %488
  %490 = srem i64 %489, 1000000007
  %491 = sub nsw i64 1000000007, %490
  %492 = load i64, ptr %61, align 8, !tbaa !11
  %493 = add nsw i64 %492, %491
  store i64 %493, ptr %61, align 8, !tbaa !11
  %494 = load i64, ptr %61, align 8, !tbaa !11
  %495 = srem i64 %494, 1000000007
  store i64 %495, ptr %61, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #8
  br label %496

496:                                              ; preds = %476, %468
  br label %497

497:                                              ; preds = %496
  %498 = load i32, ptr %63, align 4, !tbaa !5
  %499 = add nsw i32 %498, 1
  store i32 %499, ptr %63, align 4, !tbaa !5
  br label %463, !llvm.loop !23

500:                                              ; preds = %467
  br label %501

501:                                              ; preds = %500, %444
  call void @llvm.lifetime.start.p0(i64 4, ptr %65) #8
  store i32 0, ptr %65, align 4, !tbaa !5
  br label %502

502:                                              ; preds = %577, %501
  %503 = load i32, ptr %65, align 4, !tbaa !5
  %504 = load i32, ptr @N, align 4, !tbaa !5
  %505 = icmp slt i32 %503, %504
  br i1 %505, label %507, label %506

506:                                              ; preds = %502
  store i32 29, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %65) #8
  br label %580

507:                                              ; preds = %502
  call void @llvm.lifetime.start.p0(i64 8, ptr %66) #8
  %508 = load i32, ptr %65, align 4, !tbaa !5
  %509 = sext i32 %508 to i64
  %510 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %509
  store ptr %510, ptr %66, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #8
  %511 = load ptr, ptr %66, align 8, !tbaa !13
  %512 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %511) #8
  %513 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %67, i32 0, i32 0
  store ptr %512, ptr %513, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #8
  %514 = load ptr, ptr %66, align 8, !tbaa !13
  %515 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %514) #8
  %516 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %68, i32 0, i32 0
  store ptr %515, ptr %516, align 8
  br label %517

517:                                              ; preds = %574, %507
  %518 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(8) %68) #8
  br i1 %518, label %520, label %519

519:                                              ; preds = %517
  store i32 32, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %66) #8
  br label %576

520:                                              ; preds = %517
  call void @llvm.lifetime.start.p0(i64 16, ptr %69) #8
  %521 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %67) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %69, ptr align 8 %521, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %70) #8
  %522 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %69) #8
  %523 = load i64, ptr %522, align 8, !tbaa !11
  store i64 %523, ptr %70, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %71) #8
  %524 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %69) #8
  %525 = load i32, ptr %524, align 4, !tbaa !5
  store i32 %525, ptr %71, align 4, !tbaa !5
  %526 = load i32, ptr %65, align 4, !tbaa !5
  %527 = sext i32 %526 to i64
  %528 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %527
  %529 = load i64, ptr %528, align 8, !tbaa !11
  %530 = mul nsw i64 2, %529
  %531 = load i64, ptr %62, align 8, !tbaa !11
  %532 = icmp slt i64 %530, %531
  br i1 %532, label %533, label %573

533:                                              ; preds = %520
  %534 = load i64, ptr %62, align 8, !tbaa !11
  %535 = load i32, ptr %71, align 4, !tbaa !5
  %536 = sext i32 %535 to i64
  %537 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %536
  %538 = load i64, ptr %537, align 8, !tbaa !11
  %539 = mul nsw i64 2, %538
  %540 = icmp slt i64 %534, %539
  br i1 %540, label %541, label %573

541:                                              ; preds = %533
  %542 = load i32, ptr %71, align 4, !tbaa !5
  %543 = sext i32 %542 to i64
  %544 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %543
  %545 = load i64, ptr %544, align 8, !tbaa !11
  %546 = load i32, ptr %65, align 4, !tbaa !5
  %547 = sext i32 %546 to i64
  %548 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %547
  %549 = load i64, ptr %548, align 8, !tbaa !11
  %550 = sub nsw i64 %545, %549
  %551 = load i64, ptr %70, align 8, !tbaa !11
  %552 = icmp eq i64 %550, %551
  br i1 %552, label %553, label %573

553:                                              ; preds = %541
  call void @llvm.lifetime.start.p0(i64 8, ptr %72) #8
  %554 = load i32, ptr %65, align 4, !tbaa !5
  %555 = sext i32 %554 to i64
  %556 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %555
  %557 = load i64, ptr %556, align 8, !tbaa !11
  %558 = load i32, ptr %71, align 4, !tbaa !5
  %559 = sext i32 %558 to i64
  %560 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %559
  %561 = load i64, ptr %560, align 8, !tbaa !11
  %562 = mul nsw i64 %557, %561
  %563 = srem i64 %562, 1000000007
  store i64 %563, ptr %72, align 8, !tbaa !11
  %564 = load i64, ptr %72, align 8, !tbaa !11
  %565 = load i64, ptr %72, align 8, !tbaa !11
  %566 = mul nsw i64 %564, %565
  %567 = srem i64 %566, 1000000007
  %568 = sub nsw i64 1000000007, %567
  %569 = load i64, ptr %61, align 8, !tbaa !11
  %570 = add nsw i64 %569, %568
  store i64 %570, ptr %61, align 8, !tbaa !11
  %571 = load i64, ptr %61, align 8, !tbaa !11
  %572 = srem i64 %571, 1000000007
  store i64 %572, ptr %61, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %72) #8
  br label %573

573:                                              ; preds = %553, %541, %533, %520
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %70) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %69) #8
  br label %574

574:                                              ; preds = %573
  %575 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %67) #8
  br label %517

576:                                              ; preds = %519
  br label %577

577:                                              ; preds = %576
  %578 = load i32, ptr %65, align 4, !tbaa !5
  %579 = add nsw i32 %578, 1
  store i32 %579, ptr %65, align 4, !tbaa !5
  br label %502, !llvm.loop !24

580:                                              ; preds = %506
  %581 = load i64, ptr %61, align 8, !tbaa !11
  %582 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %581)
          to label %583 unwind label %587

583:                                              ; preds = %580
  %584 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %582, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %585 unwind label %587

585:                                              ; preds = %583
  call void @llvm.lifetime.end.p0(i64 8, ptr %62) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  %586 = load i32, ptr %1, align 4
  ret i32 %586

587:                                              ; preds = %583, %580
  %588 = landingpad { ptr, i32 }
          cleanup
  %589 = extractvalue { ptr, i32 } %588, 0
  store ptr %589, ptr %12, align 8
  %590 = extractvalue { ptr, i32 } %588, 1
  store i32 %590, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %62) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #8
  br label %591

591:                                              ; preds = %587, %378, %374, %342, %237, %214
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  br label %592

592:                                              ; preds = %591, %202, %198, %186, %145, %141
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  br label %593

593:                                              ; preds = %592
  %594 = load ptr, ptr %12, align 8
  %595 = load i32, ptr %13, align 4
  %596 = insertvalue { ptr, i32 } poison, ptr %594, 0
  %597 = insertvalue { ptr, i32 } %596, i32 %595, 1
  resume { ptr, i32 } %597
}

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #0 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

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

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

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

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

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

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<long long, int>, std::allocator<std::tuple<long long, int>>>::_Vector_impl_data" = type { 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::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.5", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.5" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.6" = type { i64 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@S = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@V = external dso_local global [100010 x %"class.std::vector"], align 16
@D = external dso_local global [100010 x i64], align 16
@cnt = external dso_local global [100010 x i64], align 16
@revD = external dso_local global [100010 x i64], align 16
@revcnt = external dso_local global [100010 x i64], align 16
@visited = external dso_local global [100010 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::tuple", align 8
  %5 = alloca %"class.std::tuple", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::priority_queue", align 8
  %8 = alloca %"class.std::tuple", 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 %"class.std::tuple", align 8
  %13 = alloca i64, align 8
  %14 = alloca %"class.std::tuple", align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::tuple", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.std::tuple", align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.std::tuple", align 8
  %27 = alloca i32, align 4
  %28 = alloca %"class.std::tuple", align 8
  %29 = alloca i32, align 4
  %30 = alloca i8, align 1
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %33 = alloca %"class.std::tuple", align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %"class.std::tuple", align 8
  %37 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %38 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %39 = alloca %"class.std::tuple", align 8
  %40 = 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)
  %41 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %42 = 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) @S)
  %43 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 4 dereferenceable(4) @T)
  %44 = load i32, ptr @S, align 4, !tbaa !5
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr @S, align 4, !tbaa !5
  %46 = load i32, ptr @T, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr @T, align 4, !tbaa !5
  %48 = load i32, ptr @M, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 -1, ptr %6, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @D, ptr noundef nonnull getelementptr inbounds (i8, ptr @D, i64 800080), ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @_ZNSt5tupleIJxiEEC2IiRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) @S) #8
  invoke void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %7, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %65 unwind label %83

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.095 = phi i32 [ %62, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %50 = 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)
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %1, align 4, !tbaa !5
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %54 to i64
  %58 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %57
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %2) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %60
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %1) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %62 = add nuw nsw i32 %.095, 1
  %63 = load i32, ptr @M, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %.lr.ph, label %._crit_edge, !llvm.loop !9

65:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  %66 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  br i1 %66, label %._crit_edge101, label %.lr.ph100

.lr.ph100:                                        ; preds = %65, %105
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %67) #8
  %69 = load i64, ptr %68, align 8, !tbaa !11
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16) %70) #8
  %72 = load i32, ptr %71, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
          to label %73 unwind label %85

73:                                               ; preds = %.lr.ph100
  %74 = sext i32 %72 to i64
  %75 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = icmp eq i64 %76, -1
  br i1 %77, label %78, label %105

78:                                               ; preds = %73
  store i64 %69, ptr %75, align 8, !tbaa !11
  %79 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %80 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %79) #8
  store ptr %80, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  %81 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %79) #8
  store ptr %81, ptr %11, align 8
  %82 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br i1 %82, label %.lr.ph97, label %._crit_edge98

._crit_edge98:                                    ; preds = %102, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %105

83:                                               ; preds = %._crit_edge
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  br label %334

85:                                               ; preds = %.lr.ph100
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %334

.lr.ph97:                                         ; preds = %78, %102
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #8
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %87, i64 16, i1 false)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  %89 = load i64, ptr %88, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %12) #8
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  store i64 %92, ptr %13, align 8, !tbaa !11
  %93 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !11
  %95 = icmp eq i64 %94, -1
  br i1 %95, label %96, label %102

96:                                               ; preds = %.lr.ph97
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  %97 = load i64, ptr %75, align 8, !tbaa !11
  %98 = add nsw i64 %97, %89
  store i64 %98, ptr %15, align 8, !tbaa !11
  call void @_ZNSt5tupleIJxiEEC2IxRxTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %13) #8
  invoke void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %7, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %99 unwind label %100

99:                                               ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  br label %102

100:                                              ; preds = %96
  %101 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  br label %334

102:                                              ; preds = %99, %.lr.ph97
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #8
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %104 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br i1 %104, label %.lr.ph97, label %._crit_edge98

105:                                              ; preds = %._crit_edge98, %73
  %106 = call noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  br i1 %106, label %._crit_edge101, label %.lr.ph100, !llvm.loop !13

._crit_edge101:                                   ; preds = %105, %65
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #8
  store i32 0, ptr %16, align 4, !tbaa !5
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @cnt, ptr noundef nonnull getelementptr inbounds (i8, ptr @cnt, i64 800080), ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %107 unwind label %116

107:                                              ; preds = %._crit_edge101
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #8
  store i8 0, ptr %17, align 1, !tbaa !14
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visited, ptr noundef nonnull getelementptr inbounds (i8, ptr @visited, i64 100010), ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %108 unwind label %118

108:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #8
  %109 = load i32, ptr @S, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %110
  store i64 1, ptr %111, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #8
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #8
  store i32 0, ptr %19, align 4, !tbaa !5
  %112 = load i32, ptr @N, align 4, !tbaa !5
  %113 = icmp sgt i32 %112, 0
  br i1 %113, label %.lr.ph104, label %._crit_edge105

._crit_edge105:                                   ; preds = %122, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #8
  %114 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %115 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %114, ptr %115)
          to label %129 unwind label %146

116:                                              ; preds = %._crit_edge101
  %117 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  br label %334

118:                                              ; preds = %107
  %119 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #8
  br label %334

.lr.ph104:                                        ; preds = %108, %122
  %storemerge102 = phi i32 [ %124, %122 ], [ 0, %108 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #8
  %120 = sext i32 %storemerge102 to i64
  %121 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %120
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %121, ptr noundef nonnull align 4 dereferenceable(4) %19) #8
  invoke void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %122 unwind label %127

122:                                              ; preds = %.lr.ph104
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #8
  %123 = load i32, ptr %19, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %19, align 4, !tbaa !5
  %125 = load i32, ptr @N, align 4, !tbaa !5
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %.lr.ph104, label %._crit_edge105, !llvm.loop !16

127:                                              ; preds = %.lr.ph104
  %128 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #8
  br label %333

129:                                              ; preds = %._crit_edge105
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #8
  %130 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  store ptr %130, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #8
  %131 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  store ptr %131, ptr %22, align 8
  %132 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #8
  br i1 %132, label %.lr.ph110, label %._crit_edge111

._crit_edge111:                                   ; preds = %183, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #8
  %133 = load i32, ptr @N, align 4, !tbaa !5
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.lr.ph114, label %._crit_edge115

.lr.ph114:                                        ; preds = %._crit_edge111
  %135 = load i32, ptr @T, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !11
  %wide.trip.count = zext nneg i32 %133 to i64
  %min.iters.check = icmp ult i32 %133, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph114
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph114 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph114
  %n.vec = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %138, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %139 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %index
  %140 = getelementptr inbounds i8, ptr %139, i64 16
  %wide.load = load <2 x i64>, ptr %139, align 16, !tbaa !11
  %wide.load152 = load <2 x i64>, ptr %140, align 16, !tbaa !11
  %141 = sub nsw <2 x i64> %broadcast.splat, %wide.load
  %142 = sub nsw <2 x i64> %broadcast.splat, %wide.load152
  %143 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %index
  %144 = getelementptr inbounds i8, ptr %143, i64 16
  store <2 x i64> %141, ptr %143, align 16, !tbaa !11
  store <2 x i64> %142, ptr %144, align 16, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %145 = icmp eq i64 %index.next, %n.vec
  br i1 %145, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge115, label %scalar.ph.preheader

146:                                              ; preds = %._crit_edge119, %._crit_edge105
  %147 = landingpad { ptr, i32 }
          cleanup
  br label %333

.lr.ph110:                                        ; preds = %129, %183
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #8
  %148 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %148, i64 16, i1 false)
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %23) #8
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [100010 x i8], ptr @visited, i64 0, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !14, !range !20, !noundef !21
  %154 = trunc nuw i8 %153 to i1
  br i1 %154, label %183, label %155

155:                                              ; preds = %.lr.ph110
  store i8 1, ptr %152, align 1, !tbaa !14
  %156 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %151
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #8
  %157 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #8
  store ptr %157, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #8
  %158 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #8
  store ptr %158, ptr %25, align 8
  %159 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #8
  br i1 %159, label %.lr.ph107, label %._crit_edge108

.lr.ph107:                                        ; preds = %155
  %160 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %151
  %161 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %151
  br label %162

._crit_edge108:                                   ; preds = %180, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #8
  br label %183

162:                                              ; preds = %.lr.ph107, %180
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %26) #8
  %163 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %163, i64 16, i1 false)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %26) #8
  %165 = load i64, ptr %164, align 8, !tbaa !11
  %166 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %26) #8
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %168
  %170 = load i64, ptr %169, align 8, !tbaa !11
  %171 = load i64, ptr %160, align 8, !tbaa !11
  %172 = add nsw i64 %171, %165
  %173 = icmp eq i64 %170, %172
  br i1 %173, label %174, label %180

174:                                              ; preds = %162
  %175 = load i64, ptr %161, align 8, !tbaa !11
  %176 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %168
  %177 = load i64, ptr %176, align 8, !tbaa !11
  %178 = add nsw i64 %177, %175
  %179 = srem i64 %178, 1000000007
  store i64 %179, ptr %176, align 8, !tbaa !11
  br label %180

180:                                              ; preds = %174, %162
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %26) #8
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #8
  %182 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #8
  br i1 %182, label %162, label %._crit_edge108

183:                                              ; preds = %._crit_edge108, %.lr.ph110
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #8
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  %185 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #8
  br i1 %185, label %.lr.ph110, label %._crit_edge111

._crit_edge115:                                   ; preds = %scalar.ph, %middle.block, %._crit_edge111
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %27) #8
  store i32 0, ptr %27, align 4, !tbaa !5
  %186 = load i32, ptr @N, align 4, !tbaa !5
  %187 = icmp sgt i32 %186, 0
  br i1 %187, label %.lr.ph118, label %._crit_edge119

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %188 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %indvars.iv
  %189 = load i64, ptr %188, align 8, !tbaa !11
  %190 = sub nsw i64 %138, %189
  %191 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %indvars.iv
  store i64 %190, ptr %191, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge115, label %scalar.ph, !llvm.loop !22

._crit_edge119:                                   ; preds = %203, %._crit_edge115
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #8
  %192 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  %193 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %192, ptr %193)
          to label %208 unwind label %146

.lr.ph118:                                        ; preds = %._crit_edge115, %203
  %194 = phi i32 [ %204, %203 ], [ %186, %._crit_edge115 ]
  %storemerge87116 = phi i32 [ %206, %203 ], [ 0, %._crit_edge115 ]
  %195 = sext i32 %storemerge87116 to i64
  %196 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %195
  %197 = load i64, ptr %196, align 8, !tbaa !11
  %198 = icmp sgt i64 %197, -1
  br i1 %198, label %199, label %203

199:                                              ; preds = %.lr.ph118
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %28) #8
  call void @_ZNSt5tupleIJxiEEC2IRxRiTnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS5_T0_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %196, ptr noundef nonnull align 4 dereferenceable(4) %27) #8
  invoke void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %200 unwind label %201

200:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #8
  %.pre = load i32, ptr %27, align 4, !tbaa !5
  %.pre149 = load i32, ptr @N, align 4, !tbaa !5
  br label %203

201:                                              ; preds = %199
  %202 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #8
  br label %333

203:                                              ; preds = %.lr.ph118, %200
  %204 = phi i32 [ %194, %.lr.ph118 ], [ %.pre149, %200 ]
  %205 = phi i32 [ %storemerge87116, %.lr.ph118 ], [ %.pre, %200 ]
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %27, align 4, !tbaa !5
  %207 = icmp slt i32 %206, %204
  br i1 %207, label %.lr.ph118, label %._crit_edge119, !llvm.loop !23

208:                                              ; preds = %._crit_edge119
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #8
  store i32 0, ptr %29, align 4, !tbaa !5
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @revcnt, ptr noundef nonnull getelementptr inbounds (i8, ptr @revcnt, i64 800080), ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %209 unwind label %229

209:                                              ; preds = %208
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %30) #8
  store i8 0, ptr %30, align 1, !tbaa !14
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visited, ptr noundef nonnull getelementptr inbounds (i8, ptr @visited, i64 100010), ptr noundef nonnull align 1 dereferenceable(1) %30)
          to label %210 unwind label %231

210:                                              ; preds = %209
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %30) #8
  %211 = load i32, ptr @T, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %212
  store i64 1, ptr %213, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #8
  %214 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  store ptr %214, ptr %31, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %32) #8
  %215 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  store ptr %215, ptr %32, align 8
  %216 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32) #8
  br i1 %216, label %.lr.ph124, label %._crit_edge125

._crit_edge125:                                   ; preds = %268, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #8
  %217 = load i32, ptr @T, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %218
  %220 = load i64, ptr %219, align 8, !tbaa !11
  %221 = mul nsw i64 %220, %220
  %222 = urem i64 %221, 1000000007
  %223 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %218
  %224 = load i64, ptr %223, align 8, !tbaa !11
  %225 = and i64 %224, 1
  %226 = icmp eq i64 %225, 0
  %.pre150 = load i32, ptr @N, align 4, !tbaa !5
  br i1 %226, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %._crit_edge125
  %227 = icmp sgt i32 %.pre150, 0
  br i1 %227, label %.lr.ph128, label %._crit_edge138

.lr.ph128:                                        ; preds = %.preheader
  %228 = ashr exact i64 %224, 1
  %wide.trip.count144 = zext nneg i32 %.pre150 to i64
  br label %271

229:                                              ; preds = %208
  %230 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  br label %333

231:                                              ; preds = %209
  %232 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %30) #8
  br label %333

.lr.ph124:                                        ; preds = %210, %268
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %33) #8
  %233 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(16) %233, i64 16, i1 false)
  %234 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %33) #8
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100010 x i8], ptr @visited, i64 0, i64 %236
  %238 = load i8, ptr %237, align 1, !tbaa !14, !range !20, !noundef !21
  %239 = trunc nuw i8 %238 to i1
  br i1 %239, label %268, label %240

240:                                              ; preds = %.lr.ph124
  store i8 1, ptr %237, align 1, !tbaa !14
  %241 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %236
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %34) #8
  %242 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %241) #8
  store ptr %242, ptr %34, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %35) #8
  %243 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %241) #8
  store ptr %243, ptr %35, align 8
  %244 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #8
  br i1 %244, label %.lr.ph121, label %._crit_edge122

.lr.ph121:                                        ; preds = %240
  %245 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %236
  %246 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %236
  br label %247

._crit_edge122:                                   ; preds = %265, %240
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %34) #8
  br label %268

247:                                              ; preds = %.lr.ph121, %265
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %36) #8
  %248 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(16) %248, i64 16, i1 false)
  %249 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %36) #8
  %250 = load i64, ptr %249, align 8, !tbaa !11
  %251 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %36) #8
  %252 = load i32, ptr %251, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [100010 x i64], ptr @revD, i64 0, i64 %253
  %255 = load i64, ptr %254, align 8, !tbaa !11
  %256 = load i64, ptr %245, align 8, !tbaa !11
  %257 = add nsw i64 %256, %250
  %258 = icmp eq i64 %255, %257
  br i1 %258, label %259, label %265

259:                                              ; preds = %247
  %260 = load i64, ptr %246, align 8, !tbaa !11
  %261 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %253
  %262 = load i64, ptr %261, align 8, !tbaa !11
  %263 = add nsw i64 %262, %260
  %264 = srem i64 %263, 1000000007
  store i64 %264, ptr %261, align 8, !tbaa !11
  br label %265

265:                                              ; preds = %259, %247
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %36) #8
  %266 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #8
  %267 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #8
  br i1 %267, label %247, label %._crit_edge122

268:                                              ; preds = %._crit_edge122, %.lr.ph124
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %33) #8
  %269 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #8
  %270 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32) #8
  br i1 %270, label %.lr.ph124, label %._crit_edge125

271:                                              ; preds = %.lr.ph128, %286
  %indvars.iv141 = phi i64 [ 0, %.lr.ph128 ], [ %indvars.iv.next142, %286 ]
  %.082126 = phi i64 [ %222, %.lr.ph128 ], [ %.183, %286 ]
  %272 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %indvars.iv141
  %273 = load i64, ptr %272, align 8, !tbaa !11
  %274 = icmp eq i64 %273, %228
  br i1 %274, label %275, label %286

275:                                              ; preds = %271
  %276 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %indvars.iv141
  %277 = load i64, ptr %276, align 8, !tbaa !11
  %278 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %indvars.iv141
  %279 = load i64, ptr %278, align 8, !tbaa !11
  %280 = mul nsw i64 %279, %277
  %281 = srem i64 %280, 1000000007
  %282 = mul nsw i64 %281, %281
  %283 = urem i64 %282, 1000000007
  %reass.sub88 = add nuw nsw i64 %.082126, 1000000007
  %284 = sub nuw nsw i64 %reass.sub88, %283
  %285 = urem i64 %284, 1000000007
  br label %286

286:                                              ; preds = %271, %275
  %.183 = phi i64 [ %285, %275 ], [ %.082126, %271 ]
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
  br i1 %exitcond145.not, label %.loopexit, label %271, !llvm.loop !24

.loopexit:                                        ; preds = %286, %._crit_edge125
  %.284 = phi i64 [ %222, %._crit_edge125 ], [ %.183, %286 ]
  %287 = icmp sgt i32 %.pre150, 0
  br i1 %287, label %.lr.ph137, label %._crit_edge138

._crit_edge138:                                   ; preds = %._crit_edge132, %.preheader, %.loopexit
  %.3.lcssa = phi i64 [ %.284, %.loopexit ], [ %222, %.preheader ], [ %.4.lcssa, %._crit_edge132 ]
  %288 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.3.lcssa)
          to label %328 unwind label %331

.lr.ph137:                                        ; preds = %.loopexit, %._crit_edge132
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %._crit_edge132 ], [ 0, %.loopexit ]
  %.3134 = phi i64 [ %.4.lcssa, %._crit_edge132 ], [ %.284, %.loopexit ]
  %289 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @V, i64 0, i64 %indvars.iv146
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %37) #8
  %290 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %289) #8
  store ptr %290, ptr %37, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %38) #8
  %291 = call ptr @_ZNSt6vectorISt5tupleIJxiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %289) #8
  store ptr %291, ptr %38, align 8
  %292 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  br i1 %292, label %.lr.ph131, label %._crit_edge132

.lr.ph131:                                        ; preds = %.lr.ph137
  %293 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %indvars.iv146
  %294 = getelementptr inbounds [100010 x i64], ptr @cnt, i64 0, i64 %indvars.iv146
  br label %298

._crit_edge132:                                   ; preds = %325, %.lr.ph137
  %.4.lcssa = phi i64 [ %.3134, %.lr.ph137 ], [ %.5, %325 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %37) #8
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %295 = load i32, ptr @N, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = icmp slt i64 %indvars.iv.next147, %296
  br i1 %297, label %.lr.ph137, label %._crit_edge138, !llvm.loop !25

298:                                              ; preds = %.lr.ph131, %325
  %.4129 = phi i64 [ %.3134, %.lr.ph131 ], [ %.5, %325 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %39) #8
  %299 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %37) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(16) %299, i64 16, i1 false)
  %300 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %39) #8
  %301 = load i64, ptr %300, align 8, !tbaa !11
  %302 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %39) #8
  %303 = load i64, ptr %293, align 8, !tbaa !11
  %304 = shl nsw i64 %303, 1
  %305 = icmp slt i64 %304, %224
  br i1 %305, label %306, label %325

306:                                              ; preds = %298
  %307 = load i32, ptr %302, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [100010 x i64], ptr @D, i64 0, i64 %308
  %310 = load i64, ptr %309, align 8, !tbaa !11
  %311 = shl nsw i64 %310, 1
  %312 = icmp slt i64 %224, %311
  %313 = sub nsw i64 %310, %303
  %314 = icmp eq i64 %313, %301
  %or.cond = select i1 %312, i1 %314, i1 false
  br i1 %or.cond, label %315, label %325

315:                                              ; preds = %306
  %316 = load i64, ptr %294, align 8, !tbaa !11
  %317 = getelementptr inbounds [100010 x i64], ptr @revcnt, i64 0, i64 %308
  %318 = load i64, ptr %317, align 8, !tbaa !11
  %319 = mul nsw i64 %318, %316
  %320 = srem i64 %319, 1000000007
  %321 = mul nsw i64 %320, %320
  %322 = urem i64 %321, 1000000007
  %reass.sub = add nuw nsw i64 %.4129, 1000000007
  %323 = sub nuw nsw i64 %reass.sub, %322
  %324 = urem i64 %323, 1000000007
  br label %325

325:                                              ; preds = %315, %306, %298
  %.5 = phi i64 [ %324, %315 ], [ %.4129, %306 ], [ %.4129, %298 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %39) #8
  %326 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %37) #8
  %327 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJxiEESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  br i1 %327, label %298, label %._crit_edge132

328:                                              ; preds = %._crit_edge138
  %329 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %288, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %330 unwind label %331

330:                                              ; preds = %328
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  ret i32 0

331:                                              ; preds = %328, %._crit_edge138
  %332 = landingpad { ptr, i32 }
          cleanup
  br label %333

333:                                              ; preds = %331, %231, %229, %201, %146, %127
  %.pn = phi { ptr, i32 } [ %128, %127 ], [ %202, %201 ], [ %332, %331 ], [ %232, %231 ], [ %230, %229 ], [ %147, %146 ]
  call void @_ZNSt6vectorISt5tupleIJxiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #8
  br label %334

334:                                              ; preds = %85, %100, %333, %118, %116, %83
  %.pn90.pn = phi { ptr, i32 } [ %.pn, %333 ], [ %119, %118 ], [ %117, %116 ], [ %84, %83 ], [ %101, %100 ], [ %86, %85 ]
  call void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  resume { ptr, i32 } %.pn90.pn
}

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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #0 align 2

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt5tupleIJxiEESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERKS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJxiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

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

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

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

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

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

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

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

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

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


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