; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/345 Division 1/Problem C (C)

; 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::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.18" }
%"struct.std::pair.18" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@g = external dso_local global %"class.std::vector", align 8
@minrow = external dso_local global [1001000 x i32], align 16
@mincol = external dso_local global [1001000 x i32], align 16
@r = external dso_local global [1001000 x %"class.std::map"], align 16
@c = external dso_local global [1001000 x %"class.std::map"], align 16
@groups = external dso_local global [1001000 x %"class.std::vector.3"], align 16
@visited = external dso_local global [1001000 x i32], align 16
@sorted = external dso_local global %"class.std::vector.8", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

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

; 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 i32 @_Z3getii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca %"struct.std::pair.18", align 4
  %7 = alloca { i64, i32 }, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.18", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair.18", align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair.18", align 4
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %39)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %80, %0
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %83

45:                                               ; preds = %40
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %47) #8
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %51)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %52

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

56:                                               ; preds = %52
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %79

57:                                               ; preds = %52
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %59) #8
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #8
  %64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.8, ptr noundef %63)
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = call noundef i32 @_Z3getii(i32 noundef %65, i32 noundef %66)
  call void @_Z6createi(i32 noundef %67)
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #8
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %69) #8
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %72) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %74 = 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) %4)
  store i64 %74, ptr %6, align 4
  %75 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %73, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store { i64, i32 } %75, ptr %7, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 8 %7, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @sorted, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #8
  br label %76

76:                                               ; preds = %57
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %4, align 4, !tbaa !5
  br label %52, !llvm.loop !9

79:                                               ; preds = %56
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %2, align 4, !tbaa !5
  br label %40, !llvm.loop !11

83:                                               ; preds = %44
  %84 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #8
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  %86 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #8
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %86, ptr %87, align 8
  %88 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  %90 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %89, ptr %91)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %147, %83
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %150

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %143, %97
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = load i32, ptr @m, align 4, !tbaa !5
  %101 = icmp sle i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %146

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %105) #8
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %106, i64 noundef %108) #8
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr %12, align 4, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %112
  %114 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %113, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %115 = icmp ne i64 %114, 0
  br i1 %115, label %123, label %116

116:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %117 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i64 %117, ptr %13, align 4
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %119
  %121 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %120, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %122 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %121, ptr noundef nonnull align 4 dereferenceable(8) %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %142

123:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %125
  %127 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %126, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %128 = getelementptr inbounds %"struct.std::pair.18", ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 4, !tbaa !12
  store i32 %129, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %131
  %133 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %132, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %134 = getelementptr inbounds %"struct.std::pair.18", ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !14
  store i32 %135, ptr %15, align 4, !tbaa !5
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = call noundef i32 @_Z3getii(i32 noundef %136, i32 noundef %137)
  %139 = load i32, ptr %14, align 4, !tbaa !5
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = call noundef i32 @_Z3getii(i32 noundef %139, i32 noundef %140)
  call void @_Z5mergeii(i32 noundef %138, i32 noundef %141)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %142

142:                                              ; preds = %123, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %11, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %11, align 4, !tbaa !5
  br label %98, !llvm.loop !15

146:                                              ; preds = %102
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %10, align 4, !tbaa !5
  br label %92, !llvm.loop !16

150:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %206, %150
  %152 = load i32, ptr %16, align 4, !tbaa !5
  %153 = load i32, ptr @m, align 4, !tbaa !5
  %154 = icmp sle i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %209

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %202, %156
  %158 = load i32, ptr %17, align 4, !tbaa !5
  %159 = load i32, ptr @n, align 4, !tbaa !5
  %160 = icmp sle i32 %158, %159
  br i1 %160, label %162, label %161

161:                                              ; preds = %157
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %205

162:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %163 = load i32, ptr %17, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %164) #8
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %165, i64 noundef %167) #8
  %169 = load i32, ptr %168, align 4, !tbaa !5
  store i32 %169, ptr %18, align 4, !tbaa !5
  %170 = load i32, ptr %16, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %171
  %173 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %172, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %174 = icmp ne i64 %173, 0
  br i1 %174, label %182, label %175

175:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %176 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %16)
  store i64 %176, ptr %19, align 4
  %177 = load i32, ptr %16, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %178
  %180 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %179, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %181 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %180, ptr noundef nonnull align 4 dereferenceable(8) %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %201

182:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %183 = load i32, ptr %16, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %184
  %186 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %185, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %187 = getelementptr inbounds %"struct.std::pair.18", ptr %186, i32 0, i32 0
  %188 = load i32, ptr %187, align 4, !tbaa !12
  store i32 %188, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %189 = load i32, ptr %16, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %190
  %192 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %191, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %193 = getelementptr inbounds %"struct.std::pair.18", ptr %192, i32 0, i32 1
  %194 = load i32, ptr %193, align 4, !tbaa !14
  store i32 %194, ptr %21, align 4, !tbaa !5
  %195 = load i32, ptr %17, align 4, !tbaa !5
  %196 = load i32, ptr %16, align 4, !tbaa !5
  %197 = call noundef i32 @_Z3getii(i32 noundef %195, i32 noundef %196)
  %198 = load i32, ptr %20, align 4, !tbaa !5
  %199 = load i32, ptr %21, align 4, !tbaa !5
  %200 = call noundef i32 @_Z3getii(i32 noundef %198, i32 noundef %199)
  call void @_Z5mergeii(i32 noundef %197, i32 noundef %200)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %201

201:                                              ; preds = %182, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %17, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %17, align 4, !tbaa !5
  br label %157, !llvm.loop !17

205:                                              ; preds = %161
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %16, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %16, align 4, !tbaa !5
  br label %151, !llvm.loop !18

209:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 1, ptr %22, align 4, !tbaa !5
  br label %210

210:                                              ; preds = %234, %209
  %211 = load i32, ptr %22, align 4, !tbaa !5
  %212 = load i32, ptr @n, align 4, !tbaa !5
  %213 = icmp sle i32 %211, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %210
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %237

215:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %230, %215
  %217 = load i32, ptr %23, align 4, !tbaa !5
  %218 = load i32, ptr @m, align 4, !tbaa !5
  %219 = icmp sle i32 %217, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %216
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %233

221:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %222 = load i32, ptr %22, align 4, !tbaa !5
  %223 = load i32, ptr %23, align 4, !tbaa !5
  %224 = call noundef i32 @_Z3getii(i32 noundef %222, i32 noundef %223)
  %225 = call noundef i32 @_Z4findi(i32 noundef %224)
  store i32 %225, ptr %24, align 4, !tbaa !5
  %226 = load i32, ptr %24, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %227
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %229 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %23)
  store i64 %229, ptr %25, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %228, ptr noundef nonnull align 4 dereferenceable(8) %25)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %230

230:                                              ; preds = %221
  %231 = load i32, ptr %23, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %23, align 4, !tbaa !5
  br label %216, !llvm.loop !19

233:                                              ; preds = %220
  br label %234

234:                                              ; preds = %233
  %235 = load i32, ptr %22, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %22, align 4, !tbaa !5
  br label %210, !llvm.loop !20

237:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %238 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #8
  %239 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %238, ptr %239, align 8
  br label %240

240:                                              ; preds = %358, %237
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %241 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #8
  %242 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %241, ptr %242, align 8
  %243 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br i1 %243, label %245, label %244

244:                                              ; preds = %240
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %360

245:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %246 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  %247 = getelementptr inbounds %"struct.std::pair", ptr %246, i32 0, i32 1
  %248 = getelementptr inbounds %"struct.std::pair.18", ptr %247, i32 0, i32 0
  %249 = load i32, ptr %248, align 4, !tbaa !21
  store i32 %249, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %250 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  %251 = getelementptr inbounds %"struct.std::pair", ptr %250, i32 0, i32 1
  %252 = getelementptr inbounds %"struct.std::pair.18", ptr %251, i32 0, i32 1
  %253 = load i32, ptr %252, align 4, !tbaa !23
  store i32 %253, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %254 = load i32, ptr %28, align 4, !tbaa !5
  %255 = load i32, ptr %29, align 4, !tbaa !5
  %256 = call noundef i32 @_Z3getii(i32 noundef %254, i32 noundef %255)
  %257 = call noundef i32 @_Z4findi(i32 noundef %256)
  store i32 %257, ptr %30, align 4, !tbaa !5
  %258 = load i32, ptr %30, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [1001000 x i32], ptr @visited, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %263, label %264

263:                                              ; preds = %245
  store i32 28, ptr %3, align 4
  br label %355

264:                                              ; preds = %245
  %265 = load i32, ptr %30, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [1001000 x i32], ptr @visited, i64 0, i64 %266
  store i32 1, ptr %267, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  store i32 0, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  store i32 0, ptr %32, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %304, %264
  %269 = load i32, ptr %32, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = load i32, ptr %30, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %272
  %274 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %273) #8
  %275 = icmp ult i64 %270, %274
  br i1 %275, label %277, label %276

276:                                              ; preds = %268
  store i32 29, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %307

277:                                              ; preds = %268
  %278 = load i32, ptr %30, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %279
  %281 = load i32, ptr %32, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %280, i64 noundef %282) #8
  %284 = getelementptr inbounds %"struct.std::pair.18", ptr %283, i32 0, i32 0
  %285 = load i32, ptr %284, align 4, !tbaa !12
  store i32 %285, ptr %28, align 4, !tbaa !5
  %286 = load i32, ptr %30, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %287
  %289 = load i32, ptr %32, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %288, i64 noundef %290) #8
  %292 = getelementptr inbounds %"struct.std::pair.18", ptr %291, i32 0, i32 1
  %293 = load i32, ptr %292, align 4, !tbaa !14
  store i32 %293, ptr %29, align 4, !tbaa !5
  %294 = load i32, ptr %28, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [1001000 x i32], ptr @minrow, i64 0, i64 %295
  %297 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %296)
  %298 = load i32, ptr %297, align 4, !tbaa !5
  store i32 %298, ptr %31, align 4, !tbaa !5
  %299 = load i32, ptr %29, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [1001000 x i32], ptr @mincol, i64 0, i64 %300
  %302 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %301)
  %303 = load i32, ptr %302, align 4, !tbaa !5
  store i32 %303, ptr %31, align 4, !tbaa !5
  br label %304

304:                                              ; preds = %277
  %305 = load i32, ptr %32, align 4, !tbaa !5
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %32, align 4, !tbaa !5
  br label %268, !llvm.loop !24

307:                                              ; preds = %276
  %308 = load i32, ptr %31, align 4, !tbaa !5
  %309 = add nsw i32 %308, 1
  store i32 %309, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %310

310:                                              ; preds = %351, %307
  %311 = load i32, ptr %33, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = load i32, ptr %30, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %314
  %316 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %315) #8
  %317 = icmp ult i64 %312, %316
  br i1 %317, label %319, label %318

318:                                              ; preds = %310
  store i32 32, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %354

319:                                              ; preds = %310
  %320 = load i32, ptr %30, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %321
  %323 = load i32, ptr %33, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %322, i64 noundef %324) #8
  %326 = getelementptr inbounds %"struct.std::pair.18", ptr %325, i32 0, i32 0
  %327 = load i32, ptr %326, align 4, !tbaa !12
  store i32 %327, ptr %28, align 4, !tbaa !5
  %328 = load i32, ptr %30, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %329
  %331 = load i32, ptr %33, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %330, i64 noundef %332) #8
  %334 = getelementptr inbounds %"struct.std::pair.18", ptr %333, i32 0, i32 1
  %335 = load i32, ptr %334, align 4, !tbaa !14
  store i32 %335, ptr %29, align 4, !tbaa !5
  %336 = load i32, ptr %31, align 4, !tbaa !5
  %337 = load i32, ptr %28, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %338) #8
  %340 = load i32, ptr %29, align 4, !tbaa !5
  %341 = sext i32 %340 to i64
  %342 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %339, i64 noundef %341) #8
  store i32 %336, ptr %342, align 4, !tbaa !5
  %343 = load i32, ptr %31, align 4, !tbaa !5
  %344 = load i32, ptr %28, align 4, !tbaa !5
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds [1001000 x i32], ptr @minrow, i64 0, i64 %345
  store i32 %343, ptr %346, align 4, !tbaa !5
  %347 = load i32, ptr %31, align 4, !tbaa !5
  %348 = load i32, ptr %29, align 4, !tbaa !5
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [1001000 x i32], ptr @mincol, i64 0, i64 %349
  store i32 %347, ptr %350, align 4, !tbaa !5
  br label %351

351:                                              ; preds = %319
  %352 = load i32, ptr %33, align 4, !tbaa !5
  %353 = add nsw i32 %352, 1
  store i32 %353, ptr %33, align 4, !tbaa !5
  br label %310, !llvm.loop !25

354:                                              ; preds = %318
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  store i32 0, ptr %3, align 4
  br label %355

355:                                              ; preds = %354, %263
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  %356 = load i32, ptr %3, align 4
  switch i32 %356, label %390 [
    i32 0, label %357
    i32 28, label %358
  ]

357:                                              ; preds = %355
  br label %358

358:                                              ; preds = %357, %355
  %359 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  br label %240, !llvm.loop !26

360:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  store i32 1, ptr %34, align 4, !tbaa !5
  br label %361

361:                                              ; preds = %386, %360
  %362 = load i32, ptr %34, align 4, !tbaa !5
  %363 = load i32, ptr @n, align 4, !tbaa !5
  %364 = icmp sle i32 %362, %363
  br i1 %364, label %366, label %365

365:                                              ; preds = %361
  store i32 35, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %389

366:                                              ; preds = %361
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  store i32 1, ptr %35, align 4, !tbaa !5
  br label %367

367:                                              ; preds = %381, %366
  %368 = load i32, ptr %35, align 4, !tbaa !5
  %369 = load i32, ptr @m, align 4, !tbaa !5
  %370 = icmp sle i32 %368, %369
  br i1 %370, label %372, label %371

371:                                              ; preds = %367
  store i32 38, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %384

372:                                              ; preds = %367
  %373 = load i32, ptr %34, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %374) #8
  %376 = load i32, ptr %35, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %375, i64 noundef %377) #8
  %379 = load i32, ptr %378, align 4, !tbaa !5
  %380 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %379)
  br label %381

381:                                              ; preds = %372
  %382 = load i32, ptr %35, align 4, !tbaa !5
  %383 = add nsw i32 %382, 1
  store i32 %383, ptr %35, align 4, !tbaa !5
  br label %367, !llvm.loop !27

384:                                              ; preds = %371
  %385 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  br label %386

386:                                              ; preds = %384
  %387 = load i32, ptr %34, align 4, !tbaa !5
  %388 = add nsw i32 %387, 1
  store i32 %388, ptr %34, align 4, !tbaa !5
  br label %361, !llvm.loop !28

389:                                              ; preds = %365
  ret i32 0

390:                                              ; preds = %355
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), 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: 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) #5

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 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)) #7

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

declare i32 @printf(ptr noundef, ...) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { 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 #8 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::pair<int, int>>, std::_Select1st<std::pair<const int, std::pair<int, int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.18" }
%"struct.std::pair.18" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@g = external dso_local global %"class.std::vector", align 8
@minrow = external dso_local global [1001000 x i32], align 16
@mincol = external dso_local global [1001000 x i32], align 16
@r = external dso_local global [1001000 x %"class.std::map"], align 16
@c = external dso_local global [1001000 x %"class.std::map"], align 16
@groups = external dso_local global [1001000 x %"class.std::vector.3"], align 16
@visited = external dso_local local_unnamed_addr global [1001000 x i32], align 16
@sorted = external dso_local global %"class.std::vector.8", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

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

; 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 i32 @_Z3getii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair.18", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair.18", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair.18", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair.18", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca i32, align 4
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  %22 = sext i32 %21 to i64
  tail call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 1, ptr %1, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %.not64 = icmp slt i32 %23, 1
  br i1 %.not64, label %._crit_edge68, label %.lr.ph67

.lr.ph67:                                         ; preds = %0
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  br label %28

._crit_edge68:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %24 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #7
  %25 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %24, ptr %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %.not4573 = icmp slt i32 %26, 1
  %.pre136 = load i32, ptr @m, align 4, !tbaa !5
  %27 = icmp slt i32 %.pre136, 1
  %or.cond = select i1 %.not4573, i1 true, i1 %27
  br i1 %or.cond, label %._crit_edge76, label %.lr.ph75.split

28:                                               ; preds = %.lr.ph67, %._crit_edge
  %storemerge65 = phi i32 [ 1, %.lr.ph67 ], [ %36, %._crit_edge ]
  %29 = sext i32 %storemerge65 to i64
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %29) #7
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %33)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %.not6263 = icmp slt i32 %34, 1
  br i1 %.not6263, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %1, align 4, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %35, %37
  br i1 %.not.not, label %28, label %._crit_edge68, !llvm.loop !9

.lr.ph:                                           ; preds = %28, %.lr.ph
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %39) #7
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %42) #7
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %43)
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = call noundef i32 @_Z3getii(i32 noundef %45, i32 noundef %46)
  call void @_Z6createi(i32 noundef %47)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %49) #7
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %54 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %54, ptr %4, align 8
  %55 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(8) %4)
  %.fca.0.extract = extractvalue { i64, i32 } %55, 0
  %.fca.1.extract = extractvalue { i64, i32 } %55, 1
  store i64 %.fca.0.extract, ptr %3, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @sorted, ptr noundef nonnull align 4 dereferenceable(12) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %2, align 4, !tbaa !5
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %.not62.not = icmp slt i32 %56, %58
  br i1 %.not62.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge76:                                    ; preds = %._crit_edge72, %._crit_edge68
  %59 = phi i32 [ %26, %._crit_edge68 ], [ %65, %._crit_edge72 ]
  %60 = phi i32 [ %.pre136, %._crit_edge68 ], [ %67, %._crit_edge72 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 1, ptr %9, align 4, !tbaa !5
  %.not4783 = icmp slt i32 %60, 1
  %61 = icmp slt i32 %59, 1
  %or.cond156 = or i1 %.not4783, %61
  br i1 %or.cond156, label %._crit_edge86, label %.lr.ph85.split

.lr.ph75.split:                                   ; preds = %._crit_edge68, %._crit_edge72
  %62 = phi i32 [ %65, %._crit_edge72 ], [ %26, %._crit_edge68 ]
  %63 = phi i32 [ %68, %._crit_edge72 ], [ 1, %._crit_edge68 ]
  %64 = phi i32 [ %67, %._crit_edge72 ], [ %.pre136, %._crit_edge68 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  %.not5969 = icmp slt i32 %64, 1
  br i1 %.not5969, label %._crit_edge72, label %.lr.ph71

._crit_edge72.loopexit:                           ; preds = %103
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  %.pre135 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %.lr.ph75.split
  %65 = phi i32 [ %.pre135, %._crit_edge72.loopexit ], [ %62, %.lr.ph75.split ]
  %66 = phi i32 [ %.pre, %._crit_edge72.loopexit ], [ %63, %.lr.ph75.split ]
  %67 = phi i32 [ %106, %._crit_edge72.loopexit ], [ %64, %.lr.ph75.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %68 = add nsw i32 %66, 1
  store i32 %68, ptr %5, align 4, !tbaa !5
  %.not45.not = icmp slt i32 %66, %65
  br i1 %.not45.not, label %.lr.ph75.split, label %._crit_edge76, !llvm.loop !12

.lr.ph71:                                         ; preds = %.lr.ph75.split, %103
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %70) #7
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %73) #7
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %7, align 4, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %77
  %79 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %78, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %.not60 = icmp eq i64 %79, 0
  br i1 %.not60, label %80, label %87

80:                                               ; preds = %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %81 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %81, ptr %8, align 8
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %83
  %85 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %84, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %86 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %85, ptr noundef nonnull align 4 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %103

87:                                               ; preds = %.lr.ph71
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %89
  %91 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %90, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @r, i64 0, i64 %94
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %95, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %97 = getelementptr inbounds i8, ptr %96, i64 4
  %98 = load i32, ptr %97, align 4, !tbaa !16
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = call noundef i32 @_Z3getii(i32 noundef %99, i32 noundef %100)
  %102 = call noundef i32 @_Z3getii(i32 noundef %92, i32 noundef %98)
  call void @_Z5mergeii(i32 noundef %101, i32 noundef %102)
  br label %103

103:                                              ; preds = %87, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %6, align 4, !tbaa !5
  %106 = load i32, ptr @m, align 4, !tbaa !5
  %.not59.not = icmp slt i32 %104, %106
  br i1 %.not59.not, label %.lr.ph71, label %._crit_edge72.loopexit, !llvm.loop !17

._crit_edge86:                                    ; preds = %._crit_edge82, %._crit_edge76
  %107 = phi i32 [ %60, %._crit_edge76 ], [ %113, %._crit_edge82 ]
  %108 = phi i32 [ %59, %._crit_edge76 ], [ %115, %._crit_edge82 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  %.not4994 = icmp slt i32 %108, 1
  %109 = icmp slt i32 %107, 1
  %or.cond157 = or i1 %.not4994, %109
  br i1 %or.cond157, label %._crit_edge97, label %.lr.ph96.split

.lr.ph85.split:                                   ; preds = %._crit_edge76, %._crit_edge82
  %110 = phi i32 [ %113, %._crit_edge82 ], [ %60, %._crit_edge76 ]
  %111 = phi i32 [ %116, %._crit_edge82 ], [ 1, %._crit_edge76 ]
  %112 = phi i32 [ %115, %._crit_edge82 ], [ %59, %._crit_edge76 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  %.not5678 = icmp slt i32 %112, 1
  br i1 %.not5678, label %._crit_edge82, label %.lr.ph81

._crit_edge82.loopexit:                           ; preds = %150
  %.pre137 = load i32, ptr %9, align 4, !tbaa !5
  %.pre138 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %._crit_edge82.loopexit, %.lr.ph85.split
  %113 = phi i32 [ %.pre138, %._crit_edge82.loopexit ], [ %110, %.lr.ph85.split ]
  %114 = phi i32 [ %.pre137, %._crit_edge82.loopexit ], [ %111, %.lr.ph85.split ]
  %115 = phi i32 [ %153, %._crit_edge82.loopexit ], [ %112, %.lr.ph85.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %116 = add nsw i32 %114, 1
  store i32 %116, ptr %9, align 4, !tbaa !5
  %.not47.not = icmp slt i32 %114, %113
  br i1 %.not47.not, label %.lr.ph85.split, label %._crit_edge86, !llvm.loop !18

.lr.ph81:                                         ; preds = %.lr.ph85.split, %150
  %storemerge5579 = phi i32 [ %152, %150 ], [ 1, %.lr.ph85.split ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %117 = sext i32 %storemerge5579 to i64
  %118 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %117) #7
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %118, i64 noundef %120) #7
  %122 = load i32, ptr %121, align 4, !tbaa !5
  store i32 %122, ptr %11, align 4, !tbaa !5
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %124
  %126 = call noundef i64 @_ZNKSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %125, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %.not57 = icmp eq i64 %126, 0
  br i1 %.not57, label %127, label %134

127:                                              ; preds = %.lr.ph81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %128 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %128, ptr %12, align 8
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %130
  %132 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %131, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %133 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %132, ptr noundef nonnull align 4 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %150

134:                                              ; preds = %.lr.ph81
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %136
  %138 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %137, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %139 = load i32, ptr %138, align 4, !tbaa !14
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1001000 x %"class.std::map"], ptr @c, i64 0, i64 %141
  %143 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt3mapIiSt4pairIiiESt4lessIiESaIS0_IKiS1_EEEixERS4_(ptr noundef nonnull align 8 dereferenceable(48) %142, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %144 = getelementptr inbounds i8, ptr %143, i64 4
  %145 = load i32, ptr %144, align 4, !tbaa !16
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = call noundef i32 @_Z3getii(i32 noundef %146, i32 noundef %147)
  %149 = call noundef i32 @_Z3getii(i32 noundef %139, i32 noundef %145)
  call void @_Z5mergeii(i32 noundef %148, i32 noundef %149)
  br label %150

150:                                              ; preds = %134, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  %151 = load i32, ptr %10, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %10, align 4, !tbaa !5
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %.not56.not = icmp slt i32 %151, %153
  br i1 %.not56.not, label %.lr.ph81, label %._crit_edge82.loopexit, !llvm.loop !19

._crit_edge97:                                    ; preds = %._crit_edge93, %._crit_edge86
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %154 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #7
  store ptr %154, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %155 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #7
  store ptr %155, ptr %17, align 8
  %156 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  br i1 %156, label %.lr.ph109, label %._crit_edge110

.lr.ph96.split:                                   ; preds = %._crit_edge86, %._crit_edge93
  %157 = phi i32 [ %160, %._crit_edge93 ], [ %108, %._crit_edge86 ]
  %158 = phi i32 [ %163, %._crit_edge93 ], [ 1, %._crit_edge86 ]
  %159 = phi i32 [ %162, %._crit_edge93 ], [ %107, %._crit_edge86 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  %.not5489 = icmp slt i32 %159, 1
  br i1 %.not5489, label %._crit_edge93, label %.lr.ph92

._crit_edge93.loopexit:                           ; preds = %.lr.ph92
  %.pre139 = load i32, ptr %13, align 4, !tbaa !5
  %.pre140 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge93

._crit_edge93:                                    ; preds = %._crit_edge93.loopexit, %.lr.ph96.split
  %160 = phi i32 [ %.pre140, %._crit_edge93.loopexit ], [ %157, %.lr.ph96.split ]
  %161 = phi i32 [ %.pre139, %._crit_edge93.loopexit ], [ %158, %.lr.ph96.split ]
  %162 = phi i32 [ %172, %._crit_edge93.loopexit ], [ %159, %.lr.ph96.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  %163 = add nsw i32 %161, 1
  store i32 %163, ptr %13, align 4, !tbaa !5
  %.not49.not = icmp slt i32 %161, %160
  br i1 %.not49.not, label %.lr.ph96.split, label %._crit_edge97, !llvm.loop !20

.lr.ph92:                                         ; preds = %.lr.ph96.split, %.lr.ph92
  %storemerge5390 = phi i32 [ %171, %.lr.ph92 ], [ 1, %.lr.ph96.split ]
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = call noundef i32 @_Z3getii(i32 noundef %164, i32 noundef %storemerge5390)
  %166 = call noundef i32 @_Z4findi(i32 noundef %165)
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %167
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %169 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  store i64 %169, ptr %15, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %168, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  %170 = load i32, ptr %14, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %14, align 4, !tbaa !5
  %172 = load i32, ptr @m, align 4, !tbaa !5
  %.not54.not = icmp slt i32 %170, %172
  br i1 %.not54.not, label %.lr.ph92, label %._crit_edge93.loopexit, !llvm.loop !21

._crit_edge110:                                   ; preds = %221, %._crit_edge97
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  %173 = load i32, ptr @n, align 4, !tbaa !5
  %.not50115 = icmp slt i32 %173, 1
  br i1 %.not50115, label %._crit_edge117, label %.preheader

.lr.ph109:                                        ; preds = %._crit_edge97, %221
  %174 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %175 = getelementptr inbounds i8, ptr %174, i64 4
  %176 = load i32, ptr %175, align 4, !tbaa !22
  %177 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %178 = getelementptr inbounds i8, ptr %177, i64 8
  %179 = load i32, ptr %178, align 4, !tbaa !24
  %180 = call noundef i32 @_Z3getii(i32 noundef %176, i32 noundef %179)
  %181 = call noundef i32 @_Z4findi(i32 noundef %180)
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [1001000 x i32], ptr @visited, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %.not52 = icmp eq i32 %184, 0
  br i1 %.not52, label %185, label %221

185:                                              ; preds = %.lr.ph109
  store i32 1, ptr %183, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  %186 = getelementptr inbounds [1001000 x %"class.std::vector.3"], ptr @groups, i64 0, i64 %182
  %187 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %186) #7
  %.not = icmp eq i64 %187, 0
  br i1 %.not, label %._crit_edge103, label %.lr.ph102

._crit_edge103:                                   ; preds = %.lr.ph102, %185
  %188 = load i32, ptr %18, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %18, align 4, !tbaa !5
  %190 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %186) #7
  %.not118 = icmp eq i64 %190, 0
  br i1 %.not118, label %._crit_edge107, label %.lr.ph106

.lr.ph102:                                        ; preds = %185, %.lr.ph102
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph102 ], [ 0, %185 ]
  %191 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %186, i64 noundef %indvars.iv) #7
  %192 = load i32, ptr %191, align 4, !tbaa !14
  %193 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %186, i64 noundef %indvars.iv) #7
  %194 = getelementptr inbounds i8, ptr %193, i64 4
  %195 = load i32, ptr %194, align 4, !tbaa !16
  %196 = sext i32 %192 to i64
  %197 = getelementptr inbounds [1001000 x i32], ptr @minrow, i64 0, i64 %196
  %198 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %197)
  %199 = load i32, ptr %198, align 4, !tbaa !5
  store i32 %199, ptr %18, align 4, !tbaa !5
  %200 = sext i32 %195 to i64
  %201 = getelementptr inbounds [1001000 x i32], ptr @mincol, i64 0, i64 %200
  %202 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %201)
  %203 = load i32, ptr %202, align 4, !tbaa !5
  store i32 %203, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %204 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %186) #7
  %205 = icmp ugt i64 %204, %indvars.iv.next
  br i1 %205, label %.lr.ph102, label %._crit_edge103, !llvm.loop !25

._crit_edge107:                                   ; preds = %.lr.ph106, %._crit_edge103
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #7
  br label %221

.lr.ph106:                                        ; preds = %._crit_edge103, %.lr.ph106
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %.lr.ph106 ], [ 0, %._crit_edge103 ]
  %206 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %186, i64 noundef %indvars.iv126) #7
  %207 = load i32, ptr %206, align 4, !tbaa !14
  %208 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %186, i64 noundef %indvars.iv126) #7
  %209 = getelementptr inbounds i8, ptr %208, i64 4
  %210 = load i32, ptr %209, align 4, !tbaa !16
  %211 = load i32, ptr %18, align 4, !tbaa !5
  %212 = sext i32 %207 to i64
  %213 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %212) #7
  %214 = sext i32 %210 to i64
  %215 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %213, i64 noundef %214) #7
  store i32 %211, ptr %215, align 4, !tbaa !5
  %216 = load i32, ptr %18, align 4, !tbaa !5
  %217 = getelementptr inbounds [1001000 x i32], ptr @minrow, i64 0, i64 %212
  store i32 %216, ptr %217, align 4, !tbaa !5
  %218 = getelementptr inbounds [1001000 x i32], ptr @mincol, i64 0, i64 %214
  store i32 %216, ptr %218, align 4, !tbaa !5
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %219 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %186) #7
  %220 = icmp ugt i64 %219, %indvars.iv.next127
  br i1 %220, label %.lr.ph106, label %._crit_edge107, !llvm.loop !26

221:                                              ; preds = %.lr.ph109, %._crit_edge107
  %222 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %223 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @sorted) #7
  store ptr %223, ptr %17, align 8
  %224 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  br i1 %224, label %.lr.ph109, label %._crit_edge110, !llvm.loop !27

.preheader:                                       ; preds = %._crit_edge110, %._crit_edge114
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %._crit_edge114 ], [ 1, %._crit_edge110 ]
  %225 = load i32, ptr @m, align 4, !tbaa !5
  %.not51111 = icmp slt i32 %225, 1
  br i1 %.not51111, label %._crit_edge114, label %.lr.ph113

._crit_edge117:                                   ; preds = %._crit_edge114, %._crit_edge110
  ret i32 0

._crit_edge114:                                   ; preds = %.lr.ph113, %.preheader
  %226 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %227 = load i32, ptr @n, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %.not50.not = icmp slt i64 %indvars.iv132, %228
  br i1 %.not50.not, label %.preheader, label %._crit_edge117, !llvm.loop !28

.lr.ph113:                                        ; preds = %.preheader, %.lr.ph113
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %.lr.ph113 ], [ 1, %.preheader ]
  %229 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %indvars.iv132) #7
  %230 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %229, i64 noundef %indvars.iv129) #7
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %231)
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %233 = load i32, ptr @m, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %.not51.not = icmp slt i64 %indvars.iv129, %234
  br i1 %.not51.not, label %.lr.ph113, label %._crit_edge114, !llvm.loop !29
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), 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_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr, ptr) local_unnamed_addr #5

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_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 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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 = { nofree nounwind "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = !{!15, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !13}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !13}
!21 = distinct !{!21, !10}
!22 = !{!23, !6, i64 4}
!23 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !15, i64 4}
!24 = !{!23, !6, i64 8}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}


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