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

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::set<std::pair<int, int>>>, std::_Select1st<std::pair<const int, std::set<std::pair<int, int>>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::set<std::pair<int, int>>>, std::_Select1st<std::pair<const int, std::set<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 }
%"struct.std::pair.5" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"struct.std::pair.7" = type { i32, %"class.std::set" }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = 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" }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@p = external dso_local global [100100 x %"struct.std::pair"], align 16
@h = external dso_local global %"class.std::map", align 8
@v = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair.5", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair.5", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::pair", align 4
  %28 = alloca i32, align 4
  %29 = alloca %"struct.std::pair", align 4
  %30 = alloca i32, align 4
  %31 = alloca %"struct.std::pair.5", align 8
  %32 = alloca i32, align 4
  %33 = alloca %"struct.std::pair", align 4
  %34 = alloca i32, align 4
  %35 = alloca %"struct.std::pair.5", align 8
  %36 = alloca i32, align 4
  %37 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %38 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %83

45:                                               ; preds = %40
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %47
  %49 = getelementptr inbounds %"struct.std::pair", ptr %48, i32 0, i32 0
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %51
  %53 = getelementptr inbounds %"struct.std::pair", ptr %52, i32 0, i32 1
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %49, ptr noundef %53)
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %56
  %58 = getelementptr inbounds %"struct.std::pair", ptr %57, i32 0, i32 0
  %59 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixERS8_(ptr noundef nonnull align 8 dereferenceable(48) @h, ptr noundef nonnull align 4 dereferenceable(4) %58)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  %60 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %60, ptr %3, align 4
  %61 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %59, ptr noundef nonnull align 4 dereferenceable(8) %3)
  %62 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 0
  %63 = extractvalue { ptr, i8 } %61, 0
  store ptr %63, ptr %62, align 8
  %64 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 1
  %65 = extractvalue { ptr, i8 } %61, 1
  store i8 %65, ptr %64, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %67
  %69 = getelementptr inbounds %"struct.std::pair", ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !9
  %71 = load i32, ptr @k, align 4, !tbaa !5
  %72 = add nsw i32 %70, %71
  store i32 %72, ptr %6, align 4, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @h, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 -1, ptr %8, align 4, !tbaa !5
  %74 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %74, ptr %7, align 4
  %75 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %73, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %76 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 0
  %77 = extractvalue { ptr, i8 } %75, 0
  store ptr %77, ptr %76, align 8
  %78 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 1
  %79 = extractvalue { ptr, i8 } %75, 1
  store i8 %79, ptr %78, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %80

80:                                               ; preds = %45
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %84 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @h) #5
  %85 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  %86 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %87 = getelementptr inbounds %"struct.std::pair.7", ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  store i32 %88, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %89 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @h) #5
  %90 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %12, i32 0, i32 0
  store ptr %89, ptr %90, align 8
  br label %91

91:                                               ; preds = %241, %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %92 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @h) #5
  %93 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEESB_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %244

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %97 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %98 = getelementptr inbounds %"struct.std::pair.7", ptr %97, i32 0, i32 1
  %99 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %98) #5
  %100 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %99, ptr %100, align 8
  br label %101

101:                                              ; preds = %111, %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %102 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %103 = getelementptr inbounds %"struct.std::pair.7", ptr %102, i32 0, i32 1
  %104 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %103) #5
  %105 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %104, ptr %105, align 8
  %106 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br i1 %106, label %108, label %107

107:                                              ; preds = %101
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %117

108:                                              ; preds = %101
  %109 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 4 dereferenceable(8) %109)
          to label %110 unwind label %113

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  br label %101, !llvm.loop !25

113:                                              ; preds = %108
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %18, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %243

117:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %118 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %119 = trunc i64 %118 to i32
  store i32 %119, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %225, %117
  %121 = load i32, ptr %21, align 4, !tbaa !5
  %122 = load i32, ptr %20, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %229

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %126 = load i32, ptr %21, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %127) #5
  %129 = getelementptr inbounds %"struct.std::pair", ptr %128, i32 0, i32 0
  %130 = load i32, ptr %129, align 4, !tbaa !9
  store i32 %130, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %131 = load i32, ptr %21, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %132) #5
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !26
  store i32 %135, ptr %23, align 4, !tbaa !5
  %136 = load i32, ptr %22, align 4, !tbaa !5
  %137 = icmp eq i32 %136, -1
  br i1 %137, label %138, label %179

138:                                              ; preds = %125
  %139 = load i32, ptr %23, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %140
  %142 = getelementptr inbounds %"struct.std::pair", ptr %141, i32 0, i32 1
  %143 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixERS8_(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %142)
          to label %144 unwind label %162

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 1, ptr %25, align 4, !tbaa !5
  %145 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %146 unwind label %166

146:                                              ; preds = %144
  store i64 %145, ptr %24, align 4
  %147 = invoke noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %143, ptr noundef nonnull align 4 dereferenceable(8) %24)
          to label %148 unwind label %166

148:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %149 = load i32, ptr %23, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %150
  %152 = getelementptr inbounds %"struct.std::pair", ptr %151, i32 0, i32 1
  %153 = load i32, ptr %152, align 4, !tbaa !26
  %154 = load i32, ptr @k, align 4, !tbaa !5
  %155 = add nsw i32 %153, %154
  store i32 %155, ptr %26, align 4, !tbaa !5
  %156 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %157 unwind label %170

157:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 -1, ptr %28, align 4, !tbaa !5
  %158 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %159 unwind label %174

159:                                              ; preds = %157
  store i64 %158, ptr %27, align 4
  %160 = invoke noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %156, ptr noundef nonnull align 4 dereferenceable(8) %27)
          to label %161 unwind label %174

161:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %224

162:                                              ; preds = %179, %138
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %18, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %19, align 4
  br label %228

166:                                              ; preds = %146, %144
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %18, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %228

170:                                              ; preds = %148
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %18, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %19, align 4
  br label %178

174:                                              ; preds = %159, %157
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %18, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %178

178:                                              ; preds = %174, %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %228

179:                                              ; preds = %125
  %180 = load i32, ptr %23, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %181
  %183 = getelementptr inbounds %"struct.std::pair", ptr %182, i32 0, i32 1
  %184 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixERS8_(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %183)
          to label %185 unwind label %162

185:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store i32 1, ptr %30, align 4, !tbaa !5
  %186 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %187 unwind label %211

187:                                              ; preds = %185
  store i64 %186, ptr %29, align 4
  %188 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %184, ptr noundef nonnull align 4 dereferenceable(8) %29)
          to label %189 unwind label %211

189:                                              ; preds = %187
  %190 = getelementptr inbounds { ptr, i8 }, ptr %31, i32 0, i32 0
  %191 = extractvalue { ptr, i8 } %188, 0
  store ptr %191, ptr %190, align 8
  %192 = getelementptr inbounds { ptr, i8 }, ptr %31, i32 0, i32 1
  %193 = extractvalue { ptr, i8 } %188, 1
  store i8 %193, ptr %192, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %194 = load i32, ptr %23, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %195
  %197 = getelementptr inbounds %"struct.std::pair", ptr %196, i32 0, i32 1
  %198 = load i32, ptr %197, align 4, !tbaa !26
  %199 = load i32, ptr @k, align 4, !tbaa !5
  %200 = add nsw i32 %198, %199
  store i32 %200, ptr %32, align 4, !tbaa !5
  %201 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %202 unwind label %215

202:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  store i32 -1, ptr %34, align 4, !tbaa !5
  %203 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %204 unwind label %219

204:                                              ; preds = %202
  store i64 %203, ptr %33, align 4
  %205 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %201, ptr noundef nonnull align 4 dereferenceable(8) %33)
          to label %206 unwind label %219

206:                                              ; preds = %204
  %207 = getelementptr inbounds { ptr, i8 }, ptr %35, i32 0, i32 0
  %208 = extractvalue { ptr, i8 } %205, 0
  store ptr %208, ptr %207, align 8
  %209 = getelementptr inbounds { ptr, i8 }, ptr %35, i32 0, i32 1
  %210 = extractvalue { ptr, i8 } %205, 1
  store i8 %210, ptr %209, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %224

211:                                              ; preds = %187, %185
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %18, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %228

215:                                              ; preds = %189
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %18, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %19, align 4
  br label %223

219:                                              ; preds = %204, %202
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %18, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  br label %223

223:                                              ; preds = %219, %215
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %228

224:                                              ; preds = %206, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %225

225:                                              ; preds = %224
  %226 = load i32, ptr %21, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %21, align 4, !tbaa !5
  br label %120, !llvm.loop !27

228:                                              ; preds = %223, %211, %178, %166, %162
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %243

229:                                              ; preds = %124
  %230 = call noundef zeroext i1 @_ZNKSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) @v) #5
  br i1 %230, label %231, label %232

231:                                              ; preds = %229
  store i32 7, ptr %14, align 4
  br label %238

232:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  %233 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @v) #5
  %234 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %37, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  %235 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %37) #5
  %236 = getelementptr inbounds %"struct.std::pair.7", ptr %235, i32 0, i32 0
  %237 = load i32, ptr %236, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  store i32 %237, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #5
  store i32 0, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  store i32 0, ptr %14, align 4
  br label %238

238:                                              ; preds = %232, %231
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  %239 = load i32, ptr %14, align 4
  switch i32 %239, label %251 [
    i32 0, label %240
    i32 7, label %241
  ]

240:                                              ; preds = %238
  br label %241

241:                                              ; preds = %240, %238
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br label %91, !llvm.loop !28

243:                                              ; preds = %228, %113
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %246

244:                                              ; preds = %95
  store i32 0, ptr %1, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %245 = load i32, ptr %1, align 4
  ret i32 %245

246:                                              ; preds = %243
  %247 = load ptr, ptr %18, align 8
  %248 = load i32, ptr %19, align 4
  %249 = insertvalue { ptr, i32 } poison, ptr %247, 0
  %250 = insertvalue { ptr, i32 } %249, i32 %248, 1
  resume { ptr, i32 } %250

251:                                              ; preds = %238
  unreachable
}

declare i32 @__isoc99_scanf(ptr 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: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixERS8_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIKiSt3setIS_IiiESt4lessIS2_ESaIS2_EEE", !6, i64 0, !15, i64 8}
!15 = !{!"_ZTSSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt8_Rb_treeISt4pairIiiES1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !18, i64 0, !20, i64 8}
!18 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessISt4pairIiiEEE", !19, i64 0}
!19 = !{!"_ZTSSt4lessISt4pairIiiEE"}
!20 = !{!"_ZTSSt15_Rb_tree_header", !21, i64 0, !24, i64 32}
!21 = !{!"_ZTSSt18_Rb_tree_node_base", !22, i64 0, !23, i64 8, !23, i64 16, !23, i64 24}
!22 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !12}
!26 = !{!10, !6, i64 4}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !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"

%"struct.std::pair" = type { i32, i32 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::set<std::pair<int, int>>>, std::_Select1st<std::pair<const int, std::set<std::pair<int, int>>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::set<std::pair<int, int>>>, std::_Select1st<std::pair<const int, std::set<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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@p = external dso_local global [100100 x %"struct.std::pair"], align 16
@h = external dso_local global %"class.std::map", align 8
@v = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %.not26 = icmp slt i32 %26, 1
  br i1 %.not26, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %27 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @h) #5
  store ptr %27, ptr %7, align 8
  %28 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %29 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @h) #5
  store ptr %29, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %30 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @h) #5
  store ptr %30, ptr %9, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %31, label %.lr.ph36, label %._crit_edge37

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge27 = phi i32 [ %52, %.lr.ph ], [ 1, %0 ]
  %32 = sext i32 %storemerge27 to i64
  %33 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %32
  %34 = getelementptr inbounds i8, ptr %33, i64 4
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %33, ptr noundef nonnull %34)
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixERS8_(ptr noundef nonnull align 8 dereferenceable(48) @h, ptr noundef nonnull align 4 dereferenceable(4) %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  %40 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__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) %1)
  store i64 %40, ptr %2, align 8
  %41 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %39, ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %43
  %45 = load i32, ptr %44, align 8, !tbaa !9
  %46 = load i32, ptr @k, align 4, !tbaa !5
  %47 = add nsw i32 %46, %45
  store i32 %47, ptr %4, align 4, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @h, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store i32 -1, ptr %6, align 4, !tbaa !5
  %49 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %49, ptr %5, align 8
  %50 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %48, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %1, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %51, %53
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge37:                                    ; preds = %141, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  ret i32 0

.lr.ph36:                                         ; preds = %._crit_edge, %141
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %54 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %55) #5
  store ptr %56, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %57 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %58) #5
  store ptr %59, ptr %12, align 8
  %60 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br i1 %60, label %.lr.ph29, label %._crit_edge30

._crit_edge30:                                    ; preds = %65, %.lr.ph36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  %61 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %62 = trunc i64 %61 to i32
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph33.preheader, label %._crit_edge34

.lr.ph33.preheader:                               ; preds = %._crit_edge30
  %wide.trip.count = and i64 %61, 2147483647
  br label %.lr.ph33

.lr.ph29:                                         ; preds = %.lr.ph36, %65
  %64 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(8) %64)
          to label %65 unwind label %71

65:                                               ; preds = %.lr.ph29
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %67 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %68) #5
  store ptr %69, ptr %12, align 8
  %70 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br i1 %70, label %.lr.ph29, label %._crit_edge30, !llvm.loop !13

71:                                               ; preds = %.lr.ph29
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %145

._crit_edge34:                                    ; preds = %136, %._crit_edge30
  %73 = call noundef zeroext i1 @_ZNKSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) @v) #5
  br i1 %73, label %141, label %138

.lr.ph33:                                         ; preds = %.lr.ph33.preheader, %136
  %indvars.iv = phi i64 [ 0, %.lr.ph33.preheader ], [ %indvars.iv.next, %136 ]
  %74 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv) #5
  %75 = load i32, ptr %74, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %76 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv) #5
  %77 = getelementptr inbounds i8, ptr %76, i64 4
  %78 = load i32, ptr %77, align 4, !tbaa !14
  store i32 %78, ptr %13, align 4, !tbaa !5
  %79 = icmp eq i32 %75, -1
  %80 = sext i32 %78 to i64
  %81 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %80, i32 1
  br i1 %79, label %82, label %110

82:                                               ; preds = %.lr.ph33
  %83 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixERS8_(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %81)
          to label %84 unwind label %101

84:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #5
  store i32 1, ptr %15, align 4, !tbaa !5
  %85 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %86 unwind label %103

86:                                               ; preds = %84
  store i64 %85, ptr %14, align 8
  %87 = invoke noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %83, ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %88 unwind label %103

88:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #5
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %90, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = load i32, ptr @k, align 4, !tbaa !5
  %94 = add nsw i32 %93, %92
  store i32 %94, ptr %16, align 4, !tbaa !5
  %95 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %96 unwind label %105

96:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #5
  store i32 -1, ptr %18, align 4, !tbaa !5
  %97 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %98 unwind label %107

98:                                               ; preds = %96
  store i64 %97, ptr %17, align 8
  %99 = invoke noundef i64 @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %95, ptr noundef nonnull align 4 dereferenceable(8) %17)
          to label %100 unwind label %107

100:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #5
  br label %136

101:                                              ; preds = %110, %82
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %137

103:                                              ; preds = %86, %84
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %137

105:                                              ; preds = %88
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %109

107:                                              ; preds = %98, %96
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  br label %109

109:                                              ; preds = %107, %105
  %.pn21 = phi { ptr, i32 } [ %108, %107 ], [ %106, %105 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #5
  br label %137

110:                                              ; preds = %.lr.ph33
  %111 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixERS8_(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %81)
          to label %112 unwind label %101

112:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #5
  store i32 1, ptr %20, align 4, !tbaa !5
  %113 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %114 unwind label %129

114:                                              ; preds = %112
  store i64 %113, ptr %19, align 8
  %115 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %111, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %116 unwind label %129

116:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #5
  %117 = load i32, ptr %13, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100100 x %"struct.std::pair"], ptr @p, i64 0, i64 %118, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !14
  %121 = load i32, ptr @k, align 4, !tbaa !5
  %122 = add nsw i32 %121, %120
  store i32 %122, ptr %21, align 4, !tbaa !5
  %123 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @v, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %124 unwind label %131

124:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #5
  store i32 -1, ptr %23, align 4, !tbaa !5
  %125 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %126 unwind label %133

126:                                              ; preds = %124
  store i64 %125, ptr %22, align 8
  %127 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %123, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %128 unwind label %133

128:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #5
  br label %136

129:                                              ; preds = %114, %112
  %130 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  br label %137

131:                                              ; preds = %116
  %132 = landingpad { ptr, i32 }
          cleanup
  br label %135

133:                                              ; preds = %126, %124
  %134 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #5
  br label %135

135:                                              ; preds = %133, %131
  %.pn = phi { ptr, i32 } [ %134, %133 ], [ %132, %131 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #5
  br label %137

136:                                              ; preds = %128, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge34, label %.lr.ph33, !llvm.loop !15

137:                                              ; preds = %135, %129, %109, %103, %101
  %.pn21.pn = phi { ptr, i32 } [ %.pn21, %109 ], [ %104, %103 ], [ %102, %101 ], [ %.pn, %135 ], [ %130, %129 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  br label %145

138:                                              ; preds = %._crit_edge34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #5
  %139 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @v) #5
  store ptr %139, ptr %24, align 8
  %140 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #5
  br label %141

141:                                              ; preds = %._crit_edge34, %138
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %143 = call ptr @_ZNSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @h) #5
  store ptr %143, ptr %9, align 8
  %144 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIS0_IiiESt4lessIS3_ESaIS3_EEEESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %144, label %.lr.ph36, label %._crit_edge37, !llvm.loop !16

145:                                              ; preds = %137, %71
  %.pn24 = phi { ptr, i32 } [ %72, %71 ], [ %.pn21.pn, %137 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  resume { ptr, i32 } %.pn24
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__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 #3

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

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt3mapIiSt3setISt4pairIiiESt4lessIS2_ESaIS2_EES3_IiESaIS1_IKiS6_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !6, i64 4}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass