; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/346 Division 2/Problem F (F)

; 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::basic_ostream" = type { ptr, %"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"struct.std::pair.3" = type { i64, %"struct.std::pair.5" }
%"struct.std::pair.5" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::set.7" = type { %"class.std::_Rb_tree.8" }
%"class.std::_Rb_tree.8" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.13" = type <{ %"struct.std::_Rb_tree_const_iterator.15", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator.15" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i64, align 8
@mxsz = external dso_local global i32, align 4
@pts = external dso_local global %"class.std::vector", align 8
@sz = external dso_local global [1002001 x i32], align 16
@active = external dso_local global [1002001 x i32], align 16
@taken = external dso_local global [1002001 x i32], align 16
@to_get = external dso_local global i64, align 8
@dx = external dso_local global [4 x i32], align 16
@dy = external dso_local global [4 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3getii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6createi(i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5mergeii(i32 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4goodii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair.3", align 8
  %7 = alloca %"struct.std::pair.5", align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.std::set.7", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair.13", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %"struct.std::_Rb_tree_const_iterator.15", align 8
  %29 = alloca %"struct.std::pair.5", align 4
  %30 = alloca %"struct.std::_Rb_tree_const_iterator.15", align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %33 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %34 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %35 = getelementptr i8, ptr %34, i64 -24
  %36 = load i64, ptr %35, align 8
  %37 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %36
  %38 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %37, ptr noundef null)
  %39 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %40 = getelementptr i8, ptr %39, i64 -24
  %41 = load i64, ptr %40, align 8
  %42 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %41
  %43 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %42, ptr noundef null)
  %44 = 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)
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(8) @k)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %47

47:                                               ; preds = %70, %0
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = load i32, ptr @n, align 4, !tbaa !8
  %50 = icmp sle i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %73

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

53:                                               ; preds = %66, %52
  %54 = load i32, ptr %5, align 4, !tbaa !8
  %55 = load i32, ptr @m, align 4, !tbaa !8
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %69

58:                                               ; preds = %53
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %60 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %60, ptr %7, align 4
  %61 = call { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %62 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  %63 = extractvalue { i64, i64 } %61, 0
  store i64 %63, ptr %62, align 8
  %64 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  %65 = extractvalue { i64, i64 } %61, 1
  store i64 %65, ptr %64, align 8
  call void @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @pts, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  br label %66

66:                                               ; preds = %58
  %67 = load i32, ptr %5, align 4, !tbaa !8
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %5, align 4, !tbaa !8
  br label %53, !llvm.loop !11

69:                                               ; preds = %57
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %3, align 4, !tbaa !8
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %3, align 4, !tbaa !8
  br label %47, !llvm.loop !13

73:                                               ; preds = %51
  %74 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  %76 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %77 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %79, ptr %81)
  %82 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %83 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %82, ptr %83, align 8
  %84 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8
  %88 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %87, ptr %89)
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #7
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %90

90:                                               ; preds = %375, %73
  %91 = load i32, ptr %13, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = call noundef i64 @_ZNKSt6vectorISt4pairIxS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %94 = icmp ult i64 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %90
  store i32 8, ptr %4, align 4
  br label %379

96:                                               ; preds = %90
  %97 = load i32, ptr %13, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %98) #7
  %100 = getelementptr inbounds %"struct.std::pair.3", ptr %99, i32 0, i32 0
  %101 = load i64, ptr %100, align 8, !tbaa !14
  store i64 %101, ptr %2, align 8, !tbaa !18
  %102 = load i64, ptr %2, align 8, !tbaa !18
  %103 = icmp eq i64 %102, 0
  br i1 %103, label %104, label %105

104:                                              ; preds = %96
  store i32 8, ptr %4, align 4
  br label %379

105:                                              ; preds = %96
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  store i32 0, ptr @mxsz, align 4, !tbaa !8
  br label %106

106:                                              ; preds = %205, %105
  %107 = load i32, ptr %13, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  %109 = call noundef i64 @_ZNKSt6vectorISt4pairIxS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %110 = icmp ult i64 %108, %109
  br i1 %110, label %111, label %119

111:                                              ; preds = %106
  %112 = load i32, ptr %13, align 4, !tbaa !8
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %113) #7
  %115 = getelementptr inbounds %"struct.std::pair.3", ptr %114, i32 0, i32 0
  %116 = load i64, ptr %115, align 8, !tbaa !14
  %117 = load i64, ptr %2, align 8, !tbaa !18
  %118 = icmp eq i64 %116, %117
  br label %119

119:                                              ; preds = %111, %106
  %120 = phi i1 [ false, %106 ], [ %118, %111 ]
  br i1 %120, label %121, label %210

121:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %122 = load i32, ptr %13, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %123) #7
  %125 = getelementptr inbounds %"struct.std::pair.3", ptr %124, i32 0, i32 1
  %126 = getelementptr inbounds %"struct.std::pair.5", ptr %125, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !19
  store i32 %127, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %128 = load i32, ptr %13, align 4, !tbaa !8
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %129) #7
  %131 = getelementptr inbounds %"struct.std::pair.3", ptr %130, i32 0, i32 1
  %132 = getelementptr inbounds %"struct.std::pair.5", ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !20
  store i32 %133, ptr %15, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %134 = load i32, ptr %14, align 4, !tbaa !8
  %135 = load i32, ptr %15, align 4, !tbaa !8
  %136 = call noundef i32 @_Z3getii(i32 noundef %134, i32 noundef %135)
  store i32 %136, ptr %16, align 4, !tbaa !8
  %137 = load i32, ptr %16, align 4, !tbaa !8
  invoke void @_Z6createi(i32 noundef %137)
          to label %138 unwind label %153

138:                                              ; preds = %121
  %139 = load i32, ptr %13, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %140) #7
  %142 = getelementptr inbounds %"struct.std::pair.3", ptr %141, i32 0, i32 1
  %143 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(8) %142)
          to label %144 unwind label %153

144:                                              ; preds = %138
  %145 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %146 = extractvalue { ptr, i8 } %143, 0
  store ptr %146, ptr %145, align 8
  %147 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %148 = extractvalue { ptr, i8 } %143, 1
  store i8 %148, ptr %147, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !8
  br label %149

149:                                              ; preds = %195, %144
  %150 = load i32, ptr %20, align 4, !tbaa !8
  %151 = icmp slt i32 %150, 4
  br i1 %151, label %157, label %152

152:                                              ; preds = %149
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %198

153:                                              ; preds = %201, %198, %138, %121
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %17, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %18, align 4
  br label %209

157:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %158 = load i32, ptr %14, align 4, !tbaa !8
  %159 = load i32, ptr %20, align 4, !tbaa !8
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !8
  %163 = add nsw i32 %158, %162
  store i32 %163, ptr %21, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %164 = load i32, ptr %15, align 4, !tbaa !8
  %165 = load i32, ptr %20, align 4, !tbaa !8
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !8
  %169 = add nsw i32 %164, %168
  store i32 %169, ptr %22, align 4, !tbaa !8
  %170 = load i32, ptr %21, align 4, !tbaa !8
  %171 = load i32, ptr %22, align 4, !tbaa !8
  %172 = call noundef zeroext i1 @_Z4goodii(i32 noundef %170, i32 noundef %171)
  br i1 %172, label %174, label %173

173:                                              ; preds = %157
  store i32 15, ptr %4, align 4
  br label %192

174:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %175 = load i32, ptr %21, align 4, !tbaa !8
  %176 = load i32, ptr %22, align 4, !tbaa !8
  %177 = call noundef i32 @_Z3getii(i32 noundef %175, i32 noundef %176)
  store i32 %177, ptr %23, align 4, !tbaa !8
  %178 = load i32, ptr %23, align 4, !tbaa !8
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [1002001 x i32], ptr @active, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !8
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %183, label %191

183:                                              ; preds = %174
  %184 = load i32, ptr %16, align 4, !tbaa !8
  %185 = load i32, ptr %23, align 4, !tbaa !8
  invoke void @_Z5mergeii(i32 noundef %184, i32 noundef %185)
          to label %186 unwind label %187

186:                                              ; preds = %183
  br label %191

187:                                              ; preds = %183
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %17, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %209

191:                                              ; preds = %186, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  store i32 0, ptr %4, align 4
  br label %192

192:                                              ; preds = %191, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  %193 = load i32, ptr %4, align 4
  switch i32 %193, label %397 [
    i32 0, label %194
    i32 15, label %195
  ]

194:                                              ; preds = %192
  br label %195

195:                                              ; preds = %194, %192
  %196 = load i32, ptr %20, align 4, !tbaa !8
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %20, align 4, !tbaa !8
  br label %149, !llvm.loop !21

198:                                              ; preds = %152
  %199 = load i32, ptr %16, align 4, !tbaa !8
  %200 = invoke noundef i32 @_Z4findi(i32 noundef %199)
          to label %201 unwind label %153

201:                                              ; preds = %198
  %202 = sext i32 %200 to i64
  %203 = getelementptr inbounds [1002001 x i32], ptr @sz, i64 0, i64 %202
  %204 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mxsz, ptr noundef nonnull align 4 dereferenceable(4) %203)
          to label %205 unwind label %153

205:                                              ; preds = %201
  %206 = load i32, ptr %204, align 4, !tbaa !8
  store i32 %206, ptr @mxsz, align 4, !tbaa !8
  %207 = load i32, ptr %13, align 4, !tbaa !8
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %106, !llvm.loop !22

209:                                              ; preds = %187, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %381

210:                                              ; preds = %119
  %211 = load i32, ptr %13, align 4, !tbaa !8
  %212 = add nsw i32 %211, -1
  store i32 %212, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %213 = load i64, ptr %2, align 8, !tbaa !18
  %214 = load i32, ptr %13, align 4, !tbaa !8
  %215 = sext i32 %214 to i64
  %216 = mul nsw i64 1, %215
  %217 = add nsw i64 %216, 1
  %218 = mul nsw i64 %213, %217
  store i64 %218, ptr %24, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %219 = load i64, ptr %24, align 8, !tbaa !18
  %220 = load i64, ptr @k, align 8, !tbaa !18
  %221 = sub nsw i64 %219, %220
  store i64 %221, ptr %25, align 8, !tbaa !18
  %222 = load i64, ptr %25, align 8, !tbaa !18
  %223 = icmp sge i64 %222, 0
  br i1 %223, label %224, label %371

224:                                              ; preds = %210
  %225 = load i64, ptr %25, align 8, !tbaa !18
  %226 = load i64, ptr %2, align 8, !tbaa !18
  %227 = srem i64 %225, %226
  %228 = icmp eq i64 %227, 0
  br i1 %228, label %229, label %371

229:                                              ; preds = %224
  %230 = load i64, ptr %25, align 8, !tbaa !18
  %231 = load i64, ptr %2, align 8, !tbaa !18
  %232 = sdiv i64 %230, %231
  %233 = load i32, ptr %13, align 4, !tbaa !8
  %234 = add nsw i32 %233, 1
  %235 = sext i32 %234 to i64
  %236 = icmp slt i64 %232, %235
  br i1 %236, label %237, label %371

237:                                              ; preds = %229
  %238 = load i32, ptr @mxsz, align 4, !tbaa !8
  %239 = sext i32 %238 to i64
  %240 = load i32, ptr %13, align 4, !tbaa !8
  %241 = add nsw i32 %240, 1
  %242 = sext i32 %241 to i64
  %243 = load i64, ptr %25, align 8, !tbaa !18
  %244 = load i64, ptr %2, align 8, !tbaa !18
  %245 = sdiv i64 %243, %244
  %246 = sub nsw i64 %242, %245
  %247 = icmp sge i64 %239, %246
  br i1 %247, label %248, label %371

248:                                              ; preds = %237
  %249 = load i32, ptr %13, align 4, !tbaa !8
  %250 = add nsw i32 %249, 1
  %251 = sext i32 %250 to i64
  %252 = load i64, ptr %25, align 8, !tbaa !18
  %253 = load i64, ptr %2, align 8, !tbaa !18
  %254 = sdiv i64 %252, %253
  %255 = sub nsw i64 %251, %254
  store i64 %255, ptr @to_get, align 8, !tbaa !18
  %256 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %257 unwind label %263

257:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 1, ptr %26, align 4, !tbaa !8
  br label %258

258:                                              ; preds = %319, %257
  %259 = load i32, ptr %26, align 4, !tbaa !8
  %260 = load i32, ptr @n, align 4, !tbaa !8
  %261 = icmp sle i32 %259, %260
  br i1 %261, label %267, label %262

262:                                              ; preds = %258
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %322

263:                                              ; preds = %248
  %264 = landingpad { ptr, i32 }
          cleanup
  %265 = extractvalue { ptr, i32 } %264, 0
  store ptr %265, ptr %17, align 8
  %266 = extractvalue { ptr, i32 } %264, 1
  store i32 %266, ptr %18, align 4
  br label %378

267:                                              ; preds = %258
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 1, ptr %27, align 4, !tbaa !8
  br label %268

268:                                              ; preds = %313, %267
  %269 = load i32, ptr %27, align 4, !tbaa !8
  %270 = load i32, ptr @m, align 4, !tbaa !8
  %271 = icmp sle i32 %269, %270
  br i1 %271, label %273, label %272

272:                                              ; preds = %268
  store i32 19, ptr %4, align 4
  br label %316

273:                                              ; preds = %268
  %274 = load i32, ptr %26, align 4, !tbaa !8
  %275 = load i32, ptr %27, align 4, !tbaa !8
  %276 = call noundef i32 @_Z3getii(i32 noundef %274, i32 noundef %275)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %277 = invoke noundef i32 @_Z4findi(i32 noundef %276)
          to label %278 unwind label %304

278:                                              ; preds = %273
  %279 = sext i32 %277 to i64
  %280 = getelementptr inbounds [1002001 x i32], ptr @sz, i64 0, i64 %279
  %281 = load i32, ptr %280, align 4, !tbaa !8
  %282 = sext i32 %281 to i64
  %283 = load i64, ptr @to_get, align 8, !tbaa !18
  %284 = icmp sge i64 %282, %283
  br i1 %284, label %285, label %294

285:                                              ; preds = %278
  %286 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %287 unwind label %308

287:                                              ; preds = %285
  store i64 %286, ptr %29, align 4
  %288 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(8) %29)
          to label %289 unwind label %308

289:                                              ; preds = %287
  %290 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator.15", ptr %28, i32 0, i32 0
  store ptr %288, ptr %290, align 8
  %291 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  %292 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator.15", ptr %30, i32 0, i32 0
  store ptr %291, ptr %292, align 8
  %293 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %30) #7
  br label %294

294:                                              ; preds = %289, %278
  %295 = phi i1 [ false, %278 ], [ %293, %289 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br i1 %295, label %296, label %312

296:                                              ; preds = %294
  %297 = load i32, ptr %26, align 4, !tbaa !8
  %298 = load i32, ptr %27, align 4, !tbaa !8
  invoke void @_Z3dfsii(i32 noundef %297, i32 noundef %298)
          to label %299 unwind label %304

299:                                              ; preds = %296
  %300 = load i32, ptr @m, align 4, !tbaa !8
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %27, align 4, !tbaa !8
  %302 = load i32, ptr @n, align 4, !tbaa !8
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr %26, align 4, !tbaa !8
  store i32 19, ptr %4, align 4
  br label %316

304:                                              ; preds = %296, %273
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %17, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %18, align 4
  br label %317

308:                                              ; preds = %287, %285
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %17, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %317

312:                                              ; preds = %294
  br label %313

313:                                              ; preds = %312
  %314 = load i32, ptr %27, align 4, !tbaa !8
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %27, align 4, !tbaa !8
  br label %268, !llvm.loop !23

316:                                              ; preds = %299, %272
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %318

317:                                              ; preds = %308, %304
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %378

318:                                              ; preds = %316
  br label %319

319:                                              ; preds = %318
  %320 = load i32, ptr %26, align 4, !tbaa !8
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %26, align 4, !tbaa !8
  br label %258, !llvm.loop !24

322:                                              ; preds = %262
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 1, ptr %31, align 4, !tbaa !8
  br label %323

323:                                              ; preds = %362, %322
  %324 = load i32, ptr %31, align 4, !tbaa !8
  %325 = load i32, ptr @n, align 4, !tbaa !8
  %326 = icmp sle i32 %324, %325
  br i1 %326, label %328, label %327

327:                                              ; preds = %323
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %370

328:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  store i32 1, ptr %32, align 4, !tbaa !8
  br label %329

329:                                              ; preds = %356, %328
  %330 = load i32, ptr %32, align 4, !tbaa !8
  %331 = load i32, ptr @m, align 4, !tbaa !8
  %332 = icmp sle i32 %330, %331
  br i1 %332, label %334, label %333

333:                                              ; preds = %329
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %359

334:                                              ; preds = %329
  %335 = load i32, ptr %31, align 4, !tbaa !8
  %336 = load i32, ptr %32, align 4, !tbaa !8
  %337 = call noundef i32 @_Z3getii(i32 noundef %335, i32 noundef %336)
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [1002001 x i32], ptr @taken, i64 0, i64 %338
  %340 = load i32, ptr %339, align 4, !tbaa !8
  %341 = icmp ne i32 %340, 0
  br i1 %341, label %342, label %352

342:                                              ; preds = %334
  %343 = load i64, ptr %2, align 8, !tbaa !18
  %344 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %343)
          to label %345 unwind label %348

345:                                              ; preds = %342
  %346 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %344, ptr noundef @.str.3)
          to label %347 unwind label %348

347:                                              ; preds = %345
  br label %355

348:                                              ; preds = %352, %345, %342
  %349 = landingpad { ptr, i32 }
          cleanup
  %350 = extractvalue { ptr, i32 } %349, 0
  store ptr %350, ptr %17, align 8
  %351 = extractvalue { ptr, i32 } %349, 1
  store i32 %351, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %369

352:                                              ; preds = %334
  %353 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %354 unwind label %348

354:                                              ; preds = %352
  br label %355

355:                                              ; preds = %354, %347
  br label %356

356:                                              ; preds = %355
  %357 = load i32, ptr %32, align 4, !tbaa !8
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %32, align 4, !tbaa !8
  br label %329, !llvm.loop !25

359:                                              ; preds = %333
  %360 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.5)
          to label %361 unwind label %365

361:                                              ; preds = %359
  br label %362

362:                                              ; preds = %361
  %363 = load i32, ptr %31, align 4, !tbaa !8
  %364 = add nsw i32 %363, 1
  store i32 %364, ptr %31, align 4, !tbaa !8
  br label %323, !llvm.loop !26

365:                                              ; preds = %359
  %366 = landingpad { ptr, i32 }
          cleanup
  %367 = extractvalue { ptr, i32 } %366, 0
  store ptr %367, ptr %17, align 8
  %368 = extractvalue { ptr, i32 } %366, 1
  store i32 %368, ptr %18, align 4
  br label %369

369:                                              ; preds = %365, %348
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %378

370:                                              ; preds = %327
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %372

371:                                              ; preds = %237, %229, %224, %210
  store i32 0, ptr %4, align 4
  br label %372

372:                                              ; preds = %371, %370
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  %373 = load i32, ptr %4, align 4
  switch i32 %373, label %379 [
    i32 0, label %374
  ]

374:                                              ; preds = %372
  br label %375

375:                                              ; preds = %374
  %376 = load i32, ptr %13, align 4, !tbaa !8
  %377 = add nsw i32 %376, 1
  store i32 %377, ptr %13, align 4, !tbaa !8
  br label %90, !llvm.loop !27

378:                                              ; preds = %369, %317, %263
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %381

379:                                              ; preds = %372, %104, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %380 = load i32, ptr %4, align 4
  switch i32 %380, label %389 [
    i32 8, label %382
  ]

381:                                              ; preds = %378, %209
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %391

382:                                              ; preds = %379
  %383 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
          to label %384 unwind label %385

384:                                              ; preds = %382
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %389

385:                                              ; preds = %382
  %386 = landingpad { ptr, i32 }
          cleanup
  %387 = extractvalue { ptr, i32 } %386, 0
  store ptr %387, ptr %17, align 8
  %388 = extractvalue { ptr, i32 } %386, 1
  store i32 %388, ptr %18, align 4
  br label %391

389:                                              ; preds = %384, %379
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %390 = load i32, ptr %1, align 4
  ret i32 %390

391:                                              ; preds = %385, %381
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %392

392:                                              ; preds = %391
  %393 = load ptr, ptr %17, align 8
  %394 = load i32, ptr %18, align 4
  %395 = insertvalue { ptr, i32 } poison, ptr %393, 0
  %396 = insertvalue { ptr, i32 } %395, i32 %394, 1
  resume { ptr, i32 } %396

397:                                              ; preds = %192
  unreachable
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #1

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #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) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTSSt4pairIxS_IiiEE", !16, i64 0, !17, i64 8}
!16 = !{!"long long", !10, i64 0}
!17 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!18 = !{!16, !16, i64 0}
!19 = !{!15, !9, i64 8}
!20 = !{!15, !9, i64 12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


; 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::basic_ostream" = type { ptr, %"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<int, int>>, std::allocator<std::pair<long long, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"struct.std::pair.3" = type { i64, %"struct.std::pair.5" }
%"struct.std::pair.5" = type { i32, i32 }
%"class.std::set.7" = type { %"class.std::_Rb_tree.8" }
%"class.std::_Rb_tree.8" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_const_iterator.15" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i64, align 8
@mxsz = external dso_local global i32, align 4
@pts = external dso_local global %"class.std::vector", align 8
@sz = external dso_local global [1002001 x i32], align 16
@active = external dso_local local_unnamed_addr global [1002001 x i32], align 16
@taken = external dso_local local_unnamed_addr global [1002001 x i32], align 16
@to_get = external dso_local local_unnamed_addr global i64, align 8
@dx = external dso_local local_unnamed_addr global [4 x i32], align 16
@dy = external dso_local local_unnamed_addr global [4 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3getii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6createi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5mergeii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4goodii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair.3", align 8
  %5 = alloca %"struct.std::pair.5", align 8
  %6 = alloca %"class.std::set.7", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_Rb_tree_const_iterator.15", align 8
  %10 = alloca %"struct.std::pair.5", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator.15", align 8
  %12 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %20
  %22 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = 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)
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) @k)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 1, ptr %2, align 4, !tbaa !8
  %26 = load i32, ptr @n, align 4, !tbaa !8
  %.not110 = icmp slt i32 %26, 1
  br i1 %.not110, label %._crit_edge113, label %.lr.ph112

.lr.ph112:                                        ; preds = %0
  %27 = getelementptr inbounds i8, ptr %4, i64 8
  %28 = load i32, ptr @m, align 4, !tbaa !8
  %29 = icmp slt i32 %28, 1
  br i1 %29, label %._crit_edge113, label %.lr.ph112.split

._crit_edge113:                                   ; preds = %._crit_edge, %.lr.ph112, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %30 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %31 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %30, ptr %31)
  %32 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %33 = call ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %32, ptr %33)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #7
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  %34 = call noundef i64 @_ZNKSt6vectorISt4pairIxS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %.not = icmp eq i64 %34, 0
  br i1 %.not, label %.critedge101, label %.lr.ph125

.lr.ph112.split:                                  ; preds = %.lr.ph112, %._crit_edge
  %35 = phi i32 [ %38, %._crit_edge ], [ %26, %.lr.ph112 ]
  %36 = phi i32 [ %41, %._crit_edge ], [ 1, %.lr.ph112 ]
  %37 = phi i32 [ %40, %._crit_edge ], [ %28, %.lr.ph112 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 1, ptr %3, align 4, !tbaa !8
  %.not98109 = icmp slt i32 %37, 1
  br i1 %.not98109, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  %.pre151 = load i32, ptr @n, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph112.split
  %38 = phi i32 [ %.pre151, %._crit_edge.loopexit ], [ %35, %.lr.ph112.split ]
  %39 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %36, %.lr.ph112.split ]
  %40 = phi i32 [ %49, %._crit_edge.loopexit ], [ %37, %.lr.ph112.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %41 = add nsw i32 %39, 1
  store i32 %41, ptr %2, align 4, !tbaa !8
  %.not.not = icmp slt i32 %39, %38
  br i1 %.not.not, label %.lr.ph112.split, label %._crit_edge113, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph112.split, %.lr.ph
  %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) %1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %43 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %43, ptr %5, align 8
  %44 = call { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %45 = extractvalue { i64, i64 } %44, 0
  store i64 %45, ptr %4, align 8
  %46 = extractvalue { i64, i64 } %44, 1
  store i64 %46, ptr %27, align 8
  call void @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @pts, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %47 = load i32, ptr %3, align 4, !tbaa !8
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %3, align 4, !tbaa !8
  %49 = load i32, ptr @m, align 4, !tbaa !8
  %.not98.not = icmp slt i32 %47, %49
  br i1 %.not98.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !14

.lr.ph125:                                        ; preds = %._crit_edge113, %210
  %50 = phi i64 [ %211, %210 ], [ 0, %._crit_edge113 ]
  %.058123 = phi i32 [ %.159.lcssa, %210 ], [ 0, %._crit_edge113 ]
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %50) #7
  %52 = load i64, ptr %51, align 8, !tbaa !15
  store i64 %52, ptr %1, align 8, !tbaa !19
  %53 = icmp eq i64 %52, 0
  br i1 %53, label %.critedge101, label %54

54:                                               ; preds = %.lr.ph125
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  store i32 0, ptr @mxsz, align 4, !tbaa !8
  %55 = sext i32 %.058123 to i64
  %56 = call noundef i64 @_ZNKSt6vectorISt4pairIxS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %57 = icmp ugt i64 %56, %55
  br i1 %57, label %.lr.ph118, label %.critedge

.lr.ph118:                                        ; preds = %54, %124
  %indvars.iv = phi i64 [ %indvars.iv.next, %124 ], [ %55, %54 ]
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %indvars.iv) #7
  %59 = load i64, ptr %58, align 8, !tbaa !15
  %60 = load i64, ptr %1, align 8, !tbaa !19
  %61 = icmp eq i64 %59, %60
  br i1 %61, label %62, label %.critedge.loopexit

62:                                               ; preds = %.lr.ph118
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %indvars.iv) #7
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load i32, ptr %64, align 8, !tbaa !20
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %indvars.iv) #7
  %67 = getelementptr inbounds i8, ptr %66, i64 12
  %68 = load i32, ptr %67, align 4, !tbaa !21
  %69 = call noundef i32 @_Z3getii(i32 noundef %65, i32 noundef %68)
  invoke void @_Z6createi(i32 noundef %69)
          to label %70 unwind label %79

70:                                               ; preds = %62
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %indvars.iv) #7
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(8) %72)
          to label %.preheader103.preheader unwind label %79

.preheader103.preheader:                          ; preds = %70
  %74 = load i32, ptr @dx, align 16, !tbaa !8
  %75 = add nsw i32 %74, %65
  %76 = load i32, ptr @dy, align 16, !tbaa !8
  %77 = add nsw i32 %76, %68
  %78 = call noundef zeroext i1 @_Z4goodii(i32 noundef %75, i32 noundef %77)
  br i1 %78, label %81, label %.preheader103.1

79:                                               ; preds = %122, %70, %62
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %217

81:                                               ; preds = %.preheader103.preheader
  %82 = call noundef i32 @_Z3getii(i32 noundef %75, i32 noundef %77)
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1002001 x i32], ptr @active, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %.not91 = icmp eq i32 %85, 0
  br i1 %.not91, label %.preheader103.1, label %86

86:                                               ; preds = %81
  invoke void @_Z5mergeii(i32 noundef %69, i32 noundef %82)
          to label %.preheader103.1 unwind label %87

87:                                               ; preds = %121, %110, %99, %86
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %217

.preheader103.1:                                  ; preds = %81, %86, %.preheader103.preheader
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !8
  %90 = add nsw i32 %89, %65
  %91 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !8
  %92 = add nsw i32 %91, %68
  %93 = call noundef zeroext i1 @_Z4goodii(i32 noundef %90, i32 noundef %92)
  br i1 %93, label %94, label %.preheader103.2

94:                                               ; preds = %.preheader103.1
  %95 = call noundef i32 @_Z3getii(i32 noundef %90, i32 noundef %92)
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1002001 x i32], ptr @active, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !8
  %.not91.1 = icmp eq i32 %98, 0
  br i1 %.not91.1, label %.preheader103.2, label %99

99:                                               ; preds = %94
  invoke void @_Z5mergeii(i32 noundef %69, i32 noundef %95)
          to label %.preheader103.2 unwind label %87

.preheader103.2:                                  ; preds = %99, %94, %.preheader103.1
  %100 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !8
  %101 = add nsw i32 %100, %65
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !8
  %103 = add nsw i32 %102, %68
  %104 = call noundef zeroext i1 @_Z4goodii(i32 noundef %101, i32 noundef %103)
  br i1 %104, label %105, label %.preheader103.3

105:                                              ; preds = %.preheader103.2
  %106 = call noundef i32 @_Z3getii(i32 noundef %101, i32 noundef %103)
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1002001 x i32], ptr @active, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %.not91.2 = icmp eq i32 %109, 0
  br i1 %.not91.2, label %.preheader103.3, label %110

110:                                              ; preds = %105
  invoke void @_Z5mergeii(i32 noundef %69, i32 noundef %106)
          to label %.preheader103.3 unwind label %87

.preheader103.3:                                  ; preds = %110, %105, %.preheader103.2
  %111 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !8
  %112 = add nsw i32 %111, %65
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !8
  %114 = add nsw i32 %113, %68
  %115 = call noundef zeroext i1 @_Z4goodii(i32 noundef %112, i32 noundef %114)
  br i1 %115, label %116, label %122

116:                                              ; preds = %.preheader103.3
  %117 = call noundef i32 @_Z3getii(i32 noundef %112, i32 noundef %114)
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1002001 x i32], ptr @active, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %.not91.3 = icmp eq i32 %120, 0
  br i1 %.not91.3, label %122, label %121

121:                                              ; preds = %116
  invoke void @_Z5mergeii(i32 noundef %69, i32 noundef %117)
          to label %122 unwind label %87

122:                                              ; preds = %121, %116, %.preheader103.3
  %123 = invoke noundef i32 @_Z4findi(i32 noundef %69)
          to label %124 unwind label %79

124:                                              ; preds = %122
  %125 = sext i32 %123 to i64
  %126 = getelementptr inbounds [1002001 x i32], ptr @sz, i64 0, i64 %125
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mxsz, ptr noundef nonnull align 4 dereferenceable(4) %126)
  %128 = load i32, ptr %127, align 4, !tbaa !8
  store i32 %128, ptr @mxsz, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %129 = call noundef i64 @_ZNKSt6vectorISt4pairIxS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %130 = icmp ugt i64 %129, %indvars.iv.next
  br i1 %130, label %.lr.ph118, label %.critedge.loopexit, !llvm.loop !22

.critedge.loopexit:                               ; preds = %124, %.lr.ph118
  %.lcssa.ph = phi i64 [ %indvars.iv, %.lr.ph118 ], [ %indvars.iv.next, %124 ]
  %.159.lcssa.ph = trunc i64 %.lcssa.ph to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %54
  %.159.lcssa = phi i32 [ %.058123, %54 ], [ %.159.lcssa.ph, %.critedge.loopexit ]
  %.lcssa = phi i64 [ %55, %54 ], [ %.lcssa.ph, %.critedge.loopexit ]
  %131 = load i64, ptr %1, align 8, !tbaa !19
  %132 = mul nsw i64 %131, %.lcssa
  %133 = load i64, ptr @k, align 8, !tbaa !19
  %134 = sub nsw i64 %132, %133
  %135 = icmp sgt i64 %134, -1
  br i1 %135, label %136, label %210

136:                                              ; preds = %.critedge
  %137 = srem i64 %134, %131
  %138 = sdiv i64 %134, %131
  %139 = icmp eq i64 %137, 0
  %140 = icmp slt i64 %138, %.lcssa
  %or.cond = and i1 %139, %140
  br i1 %or.cond, label %141, label %210

141:                                              ; preds = %136
  %142 = load i32, ptr @mxsz, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = sub nsw i64 %.lcssa, %138
  %.not78 = icmp sgt i64 %144, %143
  br i1 %.not78, label %210, label %145

145:                                              ; preds = %141
  store i64 %144, ptr @to_get, align 8, !tbaa !19
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %147 unwind label %152

147:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 1, ptr %7, align 4, !tbaa !8
  %148 = load i32, ptr @n, align 4, !tbaa !8
  %.not80131 = icmp slt i32 %148, 1
  br i1 %.not80131, label %._crit_edge134.thread, label %.lr.ph133

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

.lr.ph133:                                        ; preds = %147
  %149 = load i32, ptr @m, align 4, !tbaa !8
  %150 = icmp slt i32 %149, 1
  br i1 %150, label %._crit_edge134, label %.lr.ph133.split

._crit_edge134:                                   ; preds = %.loopexit, %.lr.ph133, %.loopexit.thread
  %151 = phi i32 [ %176, %.loopexit.thread ], [ %148, %.lr.ph133 ], [ %183, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %.not81141 = icmp slt i32 %151, 1
  br i1 %.not81141, label %.critedge100, label %.preheader

152:                                              ; preds = %145
  %153 = landingpad { ptr, i32 }
          cleanup
  br label %217

.lr.ph133.split:                                  ; preds = %.lr.ph133, %.loopexit
  %154 = phi i32 [ %183, %.loopexit ], [ %148, %.lr.ph133 ]
  %155 = phi i32 [ %186, %.loopexit ], [ 1, %.lr.ph133 ]
  %156 = phi i32 [ %185, %.loopexit ], [ %149, %.lr.ph133 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 1, ptr %8, align 4, !tbaa !8
  %.not86127 = icmp slt i32 %156, 1
  br i1 %.not86127, label %.loopexit, label %.lr.ph130

.lr.ph130:                                        ; preds = %.lr.ph133.split, %179
  %storemerge85128 = phi i32 [ %181, %179 ], [ 1, %.lr.ph133.split ]
  %157 = load i32, ptr %7, align 4, !tbaa !8
  %158 = call noundef i32 @_Z3getii(i32 noundef %157, i32 noundef %storemerge85128)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %159 = invoke noundef i32 @_Z4findi(i32 noundef %158)
          to label %160 unwind label %.loopexit102

160:                                              ; preds = %.lr.ph130
  %161 = sext i32 %159 to i64
  %162 = getelementptr inbounds [1002001 x i32], ptr @sz, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !8
  %164 = sext i32 %163 to i64
  %165 = load i64, ptr @to_get, align 8, !tbaa !19
  %.not87 = icmp sgt i64 %165, %164
  br i1 %.not87, label %.critedge3, label %166

166:                                              ; preds = %160
  %167 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %168 unwind label %177

168:                                              ; preds = %166
  store i64 %167, ptr %10, align 8
  %169 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %170 unwind label %177

170:                                              ; preds = %168
  store ptr %169, ptr %9, align 8
  %171 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  store ptr %171, ptr %11, align 8
  %172 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br i1 %172, label %173, label %179

173:                                              ; preds = %170
  %174 = load i32, ptr %7, align 4, !tbaa !8
  %175 = load i32, ptr %8, align 4, !tbaa !8
  invoke void @_Z3dfsii(i32 noundef %174, i32 noundef %175)
          to label %.loopexit.thread unwind label %.loopexit.split-lp

.loopexit.thread:                                 ; preds = %173
  %176 = load i32, ptr @n, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %._crit_edge134

.loopexit102:                                     ; preds = %.lr.ph130
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %187

.loopexit.split-lp:                               ; preds = %173
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %187

177:                                              ; preds = %168, %166
  %178 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %187

.critedge3:                                       ; preds = %160
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %179

179:                                              ; preds = %170, %.critedge3
  %180 = load i32, ptr %8, align 4, !tbaa !8
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %8, align 4, !tbaa !8
  %182 = load i32, ptr @m, align 4, !tbaa !8
  %.not86.not = icmp slt i32 %180, %182
  br i1 %.not86.not, label %.lr.ph130, label %.loopexit.loopexit, !llvm.loop !23

.loopexit.loopexit:                               ; preds = %179
  %.pre152 = load i32, ptr %7, align 4, !tbaa !8
  %.pre153 = load i32, ptr @n, align 4, !tbaa !8
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph133.split
  %183 = phi i32 [ %.pre153, %.loopexit.loopexit ], [ %154, %.lr.ph133.split ]
  %184 = phi i32 [ %.pre152, %.loopexit.loopexit ], [ %155, %.lr.ph133.split ]
  %185 = phi i32 [ %182, %.loopexit.loopexit ], [ %156, %.lr.ph133.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %186 = add nsw i32 %184, 1
  store i32 %186, ptr %7, align 4, !tbaa !8
  %.not80.not = icmp slt i32 %184, %183
  br i1 %.not80.not, label %.lr.ph133.split, label %._crit_edge134, !llvm.loop !24

187:                                              ; preds = %.loopexit102, %.loopexit.split-lp, %177
  %.pn88 = phi { ptr, i32 } [ %178, %177 ], [ %lpad.loopexit, %.loopexit102 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %217

.preheader:                                       ; preds = %._crit_edge134, %205
  %.054142 = phi i32 [ %206, %205 ], [ 1, %._crit_edge134 ]
  %188 = load i32, ptr @m, align 4, !tbaa !8
  %.not82137 = icmp slt i32 %188, 1
  br i1 %.not82137, label %._crit_edge140, label %.lr.ph139

._crit_edge140:                                   ; preds = %202, %.preheader
  %189 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.5)
          to label %205 unwind label %208

.lr.ph139:                                        ; preds = %.preheader, %202
  %.0138 = phi i32 [ %203, %202 ], [ 1, %.preheader ]
  %190 = call noundef i32 @_Z3getii(i32 noundef %.054142, i32 noundef %.0138)
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [1002001 x i32], ptr @taken, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !8
  %.not83 = icmp eq i32 %193, 0
  br i1 %.not83, label %.invoke, label %194

194:                                              ; preds = %.lr.ph139
  %195 = load i64, ptr %1, align 8, !tbaa !19
  %196 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %195)
          to label %.invoke unwind label %197

197:                                              ; preds = %.invoke, %194
  %198 = landingpad { ptr, i32 }
          cleanup
  br label %217

.invoke:                                          ; preds = %194, %.lr.ph139
  %199 = phi ptr [ @_ZSt4cout, %.lr.ph139 ], [ %196, %194 ]
  %200 = phi ptr [ @.str.4, %.lr.ph139 ], [ @.str.3, %194 ]
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %199, ptr noundef nonnull %200)
          to label %202 unwind label %197

202:                                              ; preds = %.invoke
  %203 = add nuw nsw i32 %.0138, 1
  %204 = load i32, ptr @m, align 4, !tbaa !8
  %.not82.not = icmp slt i32 %.0138, %204
  br i1 %.not82.not, label %.lr.ph139, label %._crit_edge140, !llvm.loop !25

205:                                              ; preds = %._crit_edge140
  %206 = add nuw nsw i32 %.054142, 1
  %207 = load i32, ptr @n, align 4, !tbaa !8
  %.not81.not = icmp slt i32 %.054142, %207
  br i1 %.not81.not, label %.preheader, label %.critedge100, !llvm.loop !26

208:                                              ; preds = %._crit_edge140
  %209 = landingpad { ptr, i32 }
          cleanup
  br label %217

210:                                              ; preds = %141, %136, %.critedge
  %211 = sext i32 %.159.lcssa to i64
  %212 = call noundef i64 @_ZNKSt6vectorISt4pairIxS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #7
  %213 = icmp ugt i64 %212, %211
  br i1 %213, label %.lr.ph125, label %.critedge101, !llvm.loop !27

.critedge101:                                     ; preds = %.lr.ph125, %210, %._crit_edge113
  %214 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
          to label %.critedge100 unwind label %215

215:                                              ; preds = %.critedge101
  %216 = landingpad { ptr, i32 }
          cleanup
  br label %217

.critedge100:                                     ; preds = %205, %._crit_edge134.thread, %._crit_edge134, %.critedge101
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

217:                                              ; preds = %87, %79, %197, %208, %187, %152, %215
  %.pn95 = phi { ptr, i32 } [ %216, %215 ], [ %88, %87 ], [ %80, %79 ], [ %.pn88, %187 ], [ %153, %152 ], [ %198, %197 ], [ %209, %208 ]
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn95
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) 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 #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTSSt4pairIxS_IiiEE", !17, i64 0, !18, i64 8}
!17 = !{!"long long", !10, i64 0}
!18 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!19 = !{!17, !17, i64 0}
!20 = !{!16, !9, i64 8}
!21 = !{!16, !9, i64 12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12, !13}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


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