; LLVM IR from eyangch/competitive-programming :: Codeforces/1726 (d)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@G = external dso_local global [200005 x %"class.std::vector"], align 16
@E = external dso_local global [200005 x %"struct.std::pair"], align 16
@ans = external dso_local global [200005 x i64], align 16
@D = external dso_local global [200005 x i64], align 16
@vis = external dso_local global [200005 x i8], align 16
@altv = external dso_local global [200005 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 uwtable
declare dso_local void @_Z3dfsxx(i64 noundef, i64 noundef) #0

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6sanityv() #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt10accumulateIPbiET0_T_S2_S1_(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #6 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair", align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %24 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  %29 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %31

31:                                               ; preds = %195, %0
  %32 = load i64, ptr @T, align 8, !tbaa !8
  %33 = add nsw i64 %32, -1
  store i64 %33, ptr @T, align 8, !tbaa !8
  %34 = icmp ne i64 %32, 0
  br i1 %34, label %35, label %197

35:                                               ; preds = %31
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %38 = load i64, ptr @M, align 8, !tbaa !8
  %39 = getelementptr inbounds i64, ptr @ans, i64 %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @ans, ptr noundef %39, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %48, %35
  %41 = load i64, ptr %3, align 8, !tbaa !8
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %51

45:                                               ; preds = %40
  %46 = load i64, ptr %3, align 8, !tbaa !8
  %47 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %46
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #8
  br label %48

48:                                               ; preds = %45
  %49 = load i64, ptr %3, align 8, !tbaa !8
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %3, align 8, !tbaa !8
  br label %40, !llvm.loop !13

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %71, %51
  %53 = load i64, ptr %4, align 8, !tbaa !8
  %54 = load i64, ptr @M, align 8, !tbaa !8
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %74

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %58, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %60 = load i64, ptr %5, align 8, !tbaa !8
  %61 = add nsw i64 %60, -1
  store i64 %61, ptr %5, align 8, !tbaa !8
  %62 = load i64, ptr %6, align 8, !tbaa !8
  %63 = add nsw i64 %62, -1
  store i64 %63, ptr %6, align 8, !tbaa !8
  %64 = load i64, ptr %5, align 8, !tbaa !8
  %65 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %64
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %65, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %66
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #8
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %68 = load i64, ptr %4, align 8, !tbaa !8
  %69 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %68
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %69, ptr noundef nonnull align 8 dereferenceable(16) %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %71

71:                                               ; preds = %57
  %72 = load i64, ptr %4, align 8, !tbaa !8
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %4, align 8, !tbaa !8
  br label %52, !llvm.loop !15

74:                                               ; preds = %56
  %75 = load i64, ptr @N, align 8, !tbaa !8
  %76 = getelementptr inbounds i8, ptr @vis, i64 %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef @vis, ptr noundef %76, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @_Z3dfsxx(i64 noundef 0, i64 noundef 0)
  %77 = load i64, ptr @M, align 8, !tbaa !8
  %78 = load i64, ptr @N, align 8, !tbaa !8
  %79 = add nsw i64 %78, 2
  %80 = icmp eq i64 %77, %79
  br i1 %80, label %81, label %181

81:                                               ; preds = %74
  %82 = load i64, ptr @N, align 8, !tbaa !8
  %83 = getelementptr inbounds i8, ptr @altv, i64 %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef @altv, ptr noundef %83, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 0, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %84

84:                                               ; preds = %107, %81
  %85 = load i64, ptr %13, align 8, !tbaa !8
  %86 = load i64, ptr @M, align 8, !tbaa !8
  %87 = icmp slt i64 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %110

89:                                               ; preds = %84
  %90 = load i64, ptr %13, align 8, !tbaa !8
  %91 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = icmp ne i64 %92, 0
  br i1 %93, label %106, label %94

94:                                               ; preds = %89
  %95 = load i64, ptr %13, align 8, !tbaa !8
  %96 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %95
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 1
  %98 = load i64, ptr %97, align 8, !tbaa !16
  %99 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %98
  store i8 1, ptr %99, align 1, !tbaa !18
  %100 = load i64, ptr %13, align 8, !tbaa !8
  %101 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %100
  %102 = getelementptr inbounds %"struct.std::pair", ptr %101, i32 0, i32 0
  %103 = load i64, ptr %102, align 16, !tbaa !20
  %104 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %103
  store i8 1, ptr %104, align 1, !tbaa !18
  %105 = load i64, ptr %13, align 8, !tbaa !8
  store i64 %105, ptr %12, align 8, !tbaa !8
  br label %106

106:                                              ; preds = %94, %89
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %13, align 8, !tbaa !8
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %13, align 8, !tbaa !8
  br label %84, !llvm.loop !21

110:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %111 = load i64, ptr @N, align 8, !tbaa !8
  %112 = getelementptr inbounds i8, ptr @altv, i64 %111
  %113 = call noundef i32 @_ZSt10accumulateIPbiET0_T_S2_S1_(ptr noundef @altv, ptr noundef %112, i32 noundef 0)
  %114 = sext i32 %113 to i64
  store i64 %114, ptr %14, align 8, !tbaa !8
  %115 = load i64, ptr %14, align 8, !tbaa !8
  %116 = icmp eq i64 %115, 3
  br i1 %116, label %117, label %180

117:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %118 = load i64, ptr %12, align 8, !tbaa !8
  %119 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %118
  %120 = getelementptr inbounds %"struct.std::pair", ptr %119, i32 0, i32 0
  %121 = load i64, ptr %120, align 16, !tbaa !20
  store i64 %121, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %122 = load i64, ptr %12, align 8, !tbaa !8
  %123 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %122
  %124 = getelementptr inbounds %"struct.std::pair", ptr %123, i32 0, i32 1
  %125 = load i64, ptr %124, align 8, !tbaa !16
  store i64 %125, ptr %16, align 8, !tbaa !8
  %126 = load i64, ptr %15, align 8, !tbaa !8
  %127 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !8
  %129 = load i64, ptr %16, align 8, !tbaa !8
  %130 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !8
  %132 = icmp slt i64 %128, %131
  br i1 %132, label %133, label %134

133:                                              ; preds = %117
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  br label %134

134:                                              ; preds = %133, %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %135 = load i64, ptr %15, align 8, !tbaa !8
  %136 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %135
  store ptr %136, ptr %17, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %137 = load ptr, ptr %17, align 8, !tbaa !22
  %138 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %137) #8
  %139 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %138, ptr %139, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %140 = load ptr, ptr %17, align 8, !tbaa !22
  %141 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %140) #8
  %142 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %141, ptr %142, align 8
  br label %143

143:                                              ; preds = %174, %134
  %144 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  br i1 %144, label %146, label %145

145:                                              ; preds = %143
  store i32 13, ptr %20, align 4
  br label %176

146:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #8
  %147 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %147, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %148 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %149 = load i64, ptr %148, align 8, !tbaa !20
  store i64 %149, ptr %22, align 8, !tbaa !8
  %150 = load i64, ptr %22, align 8, !tbaa !8
  %151 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !8
  %153 = load i64, ptr %15, align 8, !tbaa !8
  %154 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = icmp slt i64 %152, %155
  br i1 %156, label %157, label %167

157:                                              ; preds = %146
  %158 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %159 = load i64, ptr %158, align 8, !tbaa !16
  %160 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !8
  %162 = icmp ne i64 %161, 0
  br i1 %162, label %163, label %167

163:                                              ; preds = %157
  %164 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %165 = load i64, ptr %164, align 8, !tbaa !16
  %166 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %165
  store i64 0, ptr %166, align 8, !tbaa !8
  store i32 13, ptr %20, align 4
  br label %168

167:                                              ; preds = %157, %146
  store i32 0, ptr %20, align 4
  br label %168

168:                                              ; preds = %167, %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  %169 = load i32, ptr %20, align 4
  switch i32 %169, label %171 [
    i32 0, label %170
  ]

170:                                              ; preds = %168
  store i32 0, ptr %20, align 4
  br label %171

171:                                              ; preds = %170, %168
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #8
  %172 = load i32, ptr %20, align 4
  switch i32 %172, label %176 [
    i32 0, label %173
  ]

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  br label %143

176:                                              ; preds = %171, %145
  call void @llvm.lifetime.end.p0(i64 8, 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
  br label %177

177:                                              ; preds = %176
  %178 = load i64, ptr %12, align 8, !tbaa !8
  %179 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %178
  store i64 1, ptr %179, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %180

180:                                              ; preds = %177, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %181

181:                                              ; preds = %180, %74
  call void @_Z6sanityv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  store i64 0, ptr %23, align 8, !tbaa !8
  br label %182

182:                                              ; preds = %192, %181
  %183 = load i64, ptr %23, align 8, !tbaa !8
  %184 = load i64, ptr @M, align 8, !tbaa !8
  %185 = icmp slt i64 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  store i32 15, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %195

187:                                              ; preds = %182
  %188 = load i64, ptr %23, align 8, !tbaa !8
  %189 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %188
  %190 = load i64, ptr %189, align 8, !tbaa !8
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %190)
  br label %192

192:                                              ; preds = %187
  %193 = load i64, ptr %23, align 8, !tbaa !8
  %194 = add nsw i64 %193, 1
  store i64 %194, ptr %23, align 8, !tbaa !8
  br label %182, !llvm.loop !24

195:                                              ; preds = %186
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  br label %31, !llvm.loop !25

197:                                              ; preds = %31
  %198 = load i32, ptr %1, align 4
  ret i32 %198
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #7

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

; 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 @_ZNSt6vectorISt4pairIxxESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_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 #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { "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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !9, i64 8}
!17 = !{!"_ZTSSt4pairIxxE", !9, i64 0, !9, i64 8}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = !{!17, !9, i64 0}
!21 = distinct !{!21, !14}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !10, i64 0}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


; 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::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@G = external dso_local global [200005 x %"class.std::vector"], align 16
@E = external dso_local global [200005 x %"struct.std::pair"], align 16
@ans = external dso_local global [200005 x i64], align 16
@D = external dso_local local_unnamed_addr global [200005 x i64], align 16
@vis = external dso_local global [200005 x i8], align 16
@altv = external dso_local global [200005 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 uwtable
declare dso_local void @_Z3dfsxx(i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6sanityv() local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt10accumulateIPbiET0_T_S2_S1_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %21 = load i64, ptr @T, align 8, !tbaa !8
  %22 = add nsw i64 %21, -1
  store i64 %22, ptr @T, align 8, !tbaa !8
  %.not44 = icmp eq i64 %21, 0
  br i1 %.not44, label %._crit_edge47, label %.lr.ph46

.lr.ph46:                                         ; preds = %0, %._crit_edge43
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %25 = load i64, ptr @M, align 8, !tbaa !8
  %26 = getelementptr inbounds i64, ptr @ans, i64 %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !11
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @ans, ptr noundef nonnull %26, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %27 = load i64, ptr @N, align 8, !tbaa !8
  %28 = icmp sgt i64 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph46
  %29 = phi i64 [ %27, %.lr.ph46 ], [ %34, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  %30 = load i64, ptr @M, align 8, !tbaa !8
  %31 = icmp sgt i64 %30, 0
  br i1 %31, label %.lr.ph31, label %._crit_edge32

.lr.ph:                                           ; preds = %.lr.ph46, %.lr.ph
  %.02329 = phi i64 [ %33, %.lr.ph ], [ 0, %.lr.ph46 ]
  %32 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %.02329
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #7
  %33 = add nuw nsw i64 %.02329, 1
  %34 = load i64, ptr @N, align 8, !tbaa !8
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge32.loopexit:                           ; preds = %.lr.ph31
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit, %._crit_edge
  %36 = phi i64 [ %.pre, %._crit_edge32.loopexit ], [ %29, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %37 = getelementptr inbounds i8, ptr @vis, i64 %36
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef nonnull @vis, ptr noundef nonnull %37, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @_Z3dfsxx(i64 noundef 0, i64 noundef 0)
  %38 = load i64, ptr @M, align 8, !tbaa !8
  %39 = load i64, ptr @N, align 8, !tbaa !8
  %40 = add nsw i64 %39, 2
  %41 = icmp eq i64 %38, %40
  br i1 %41, label %58, label %129

.lr.ph31:                                         ; preds = %._crit_edge, %.lr.ph31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %44 = load i64, ptr %3, align 8, !tbaa !8
  %45 = add nsw i64 %44, -1
  store i64 %45, ptr %3, align 8, !tbaa !8
  %46 = load i64, ptr %4, align 8, !tbaa !8
  %47 = add nsw i64 %46, -1
  store i64 %47, ptr %4, align 8, !tbaa !8
  %48 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %45
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  %49 = load i64, ptr %4, align 8, !tbaa !8
  %50 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %49
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %51 = load i64, ptr %2, align 8, !tbaa !8
  %52 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %51
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %52, ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %54 = load i64, ptr %2, align 8, !tbaa !8
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %2, align 8, !tbaa !8
  %56 = load i64, ptr @M, align 8, !tbaa !8
  %57 = icmp slt i64 %55, %56
  br i1 %57, label %.lr.ph31, label %._crit_edge32.loopexit, !llvm.loop !15

58:                                               ; preds = %._crit_edge32
  %59 = getelementptr inbounds i8, ptr @altv, i64 %39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef nonnull @altv, ptr noundef nonnull %59, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %60 = load i64, ptr @M, align 8, !tbaa !8
  %61 = icmp sgt i64 %60, 0
  br i1 %61, label %.lr.ph36.preheader, label %._crit_edge37

.lr.ph36.preheader:                               ; preds = %58
  %xtraiter = and i64 %60, 1
  %62 = icmp eq i64 %60, 1
  br i1 %62, label %._crit_edge37.loopexit.unr-lcssa, label %.lr.ph36.preheader.new

.lr.ph36.preheader.new:                           ; preds = %.lr.ph36.preheader
  %unroll_iter = and i64 %60, 9223372036854775806
  br label %.lr.ph36

._crit_edge37.loopexit.unr-lcssa:                 ; preds = %95, %.lr.ph36.preheader
  %.1.lcssa.ph = phi i64 [ poison, %.lr.ph36.preheader ], [ %.1.1, %95 ]
  %.02434.unr = phi i64 [ 0, %.lr.ph36.preheader ], [ %.1.1, %95 ]
  %.02533.unr = phi i64 [ 0, %.lr.ph36.preheader ], [ %96, %95 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge37, label %.lr.ph36.epil

.lr.ph36.epil:                                    ; preds = %._crit_edge37.loopexit.unr-lcssa
  %63 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %.02533.unr
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %.not28.epil = icmp eq i64 %64, 0
  br i1 %.not28.epil, label %65, label %._crit_edge37

65:                                               ; preds = %.lr.ph36.epil
  %66 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %.02533.unr
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load i64, ptr %67, align 8, !tbaa !16
  %69 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %68
  store i8 1, ptr %69, align 1, !tbaa !18
  %70 = load i64, ptr %66, align 16, !tbaa !20
  %71 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %70
  store i8 1, ptr %71, align 1, !tbaa !18
  br label %._crit_edge37

._crit_edge37:                                    ; preds = %._crit_edge37.loopexit.unr-lcssa, %65, %.lr.ph36.epil, %58
  %.024.lcssa = phi i64 [ 0, %58 ], [ %.1.lcssa.ph, %._crit_edge37.loopexit.unr-lcssa ], [ %.02434.unr, %.lr.ph36.epil ], [ %.02533.unr, %65 ]
  %72 = load i64, ptr @N, align 8, !tbaa !8
  %73 = getelementptr inbounds i8, ptr @altv, i64 %72
  %74 = call noundef i32 @_ZSt10accumulateIPbiET0_T_S2_S1_(ptr noundef nonnull @altv, ptr noundef nonnull %73, i32 noundef 0)
  %75 = icmp eq i32 %74, 3
  br i1 %75, label %97, label %129

.lr.ph36:                                         ; preds = %95, %.lr.ph36.preheader.new
  %.02434 = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %.1.1, %95 ]
  %.02533 = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %96, %95 ]
  %niter = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %niter.next.1, %95 ]
  %76 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %.02533
  %77 = load i64, ptr %76, align 16, !tbaa !8
  %.not28 = icmp eq i64 %77, 0
  br i1 %.not28, label %78, label %.lr.ph36.1

78:                                               ; preds = %.lr.ph36
  %79 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %.02533
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = load i64, ptr %80, align 8, !tbaa !16
  %82 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %81
  store i8 1, ptr %82, align 1, !tbaa !18
  %83 = load i64, ptr %79, align 16, !tbaa !20
  %84 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %83
  store i8 1, ptr %84, align 1, !tbaa !18
  br label %.lr.ph36.1

.lr.ph36.1:                                       ; preds = %.lr.ph36, %78
  %.1 = phi i64 [ %.02434, %.lr.ph36 ], [ %.02533, %78 ]
  %85 = or disjoint i64 %.02533, 1
  %86 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %.not28.1 = icmp eq i64 %87, 0
  br i1 %.not28.1, label %88, label %95

88:                                               ; preds = %.lr.ph36.1
  %89 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %85
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = load i64, ptr %90, align 8, !tbaa !16
  %92 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %91
  store i8 1, ptr %92, align 1, !tbaa !18
  %93 = load i64, ptr %89, align 16, !tbaa !20
  %94 = getelementptr inbounds [200005 x i8], ptr @altv, i64 0, i64 %93
  store i8 1, ptr %94, align 1, !tbaa !18
  br label %95

95:                                               ; preds = %88, %.lr.ph36.1
  %.1.1 = phi i64 [ %.1, %.lr.ph36.1 ], [ %85, %88 ]
  %96 = add nuw nsw i64 %.02533, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge37.loopexit.unr-lcssa, label %.lr.ph36, !llvm.loop !21

97:                                               ; preds = %._crit_edge37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %98 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @E, i64 0, i64 %.024.lcssa
  %99 = load i64, ptr %98, align 16, !tbaa !20
  store i64 %99, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %100 = getelementptr inbounds i8, ptr %98, i64 8
  %101 = load i64, ptr %100, align 8, !tbaa !16
  store i64 %101, ptr %11, align 8, !tbaa !8
  %102 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %99
  %103 = load i64, ptr %102, align 8, !tbaa !8
  %104 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %101
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = icmp slt i64 %103, %105
  br i1 %106, label %107, label %108

107:                                              ; preds = %97
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %.pre48 = load i64, ptr %10, align 8, !tbaa !8
  br label %108

108:                                              ; preds = %107, %97
  %109 = phi i64 [ %.pre48, %107 ], [ %99, %97 ]
  %110 = getelementptr inbounds [200005 x %"class.std::vector"], ptr @G, i64 0, i64 %109
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %111 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %110) #7
  store ptr %111, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %112 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %110) #7
  store ptr %112, ptr %13, align 8
  %113 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %113, label %.lr.ph39, label %.loopexit

.lr.ph39:                                         ; preds = %108, %125
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %.sroa.0.0.copyload = load i64, ptr %114, align 8
  %115 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %.sroa.0.0.copyload
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = load i64, ptr %10, align 8, !tbaa !8
  %118 = getelementptr inbounds [200005 x i64], ptr @D, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = icmp slt i64 %116, %119
  br i1 %120, label %121, label %125

121:                                              ; preds = %.lr.ph39
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %114, i64 8
  %.sroa.4.0.copyload = load i64, ptr %.sroa.4.0..sroa_idx, align 8
  %122 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %.sroa.4.0.copyload
  %123 = load i64, ptr %122, align 8, !tbaa !8
  %.not27 = icmp eq i64 %123, 0
  br i1 %.not27, label %125, label %.critedge

.critedge:                                        ; preds = %121
  %124 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %.sroa.4.0.copyload
  store i64 0, ptr %124, align 8, !tbaa !8
  br label %.loopexit

125:                                              ; preds = %121, %.lr.ph39
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %127 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %127, label %.lr.ph39, label %.loopexit

.loopexit:                                        ; preds = %125, %108, %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %128 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %.024.lcssa
  store i64 1, ptr %128, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %129

129:                                              ; preds = %._crit_edge37, %.loopexit, %._crit_edge32
  call void @_Z6sanityv()
  %130 = load i64, ptr @M, align 8, !tbaa !8
  %131 = icmp sgt i64 %130, 0
  br i1 %131, label %.lr.ph42, label %._crit_edge43

._crit_edge43:                                    ; preds = %.lr.ph42, %129
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %133 = load i64, ptr @T, align 8, !tbaa !8
  %134 = add nsw i64 %133, -1
  store i64 %134, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %133, 0
  br i1 %.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !22

.lr.ph42:                                         ; preds = %129, %.lr.ph42
  %.040 = phi i64 [ %138, %.lr.ph42 ], [ 0, %129 ]
  %135 = getelementptr inbounds [200005 x i64], ptr @ans, i64 0, i64 %.040
  %136 = load i64, ptr %135, align 8, !tbaa !8
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %136)
  %138 = add nuw nsw i64 %.040, 1
  %139 = load i64, ptr @M, align 8, !tbaa !8
  %140 = icmp slt i64 %138, %139
  br i1 %140, label %.lr.ph42, label %._crit_edge43, !llvm.loop !23

._crit_edge47:                                    ; preds = %._crit_edge43, %0
  ret i32 0
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #6

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_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 #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

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

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

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


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