; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2018.02 (snowboots)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.0" = type { i32, i32 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::greater" = type { i8 }
%"struct.std::pair.2" = type { %"struct.std::pair.0", i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::set", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair.0", align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::greater", align 1
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.0", align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %26 = alloca %"struct.std::pair.0", align 4
  %27 = alloca i32, align 4
  %28 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %34 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %35 = alloca %"struct.std::pair.0", align 4
  %36 = alloca i32, align 4
  %37 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %38 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %39 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %40 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %41 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %42 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %43 = getelementptr i8, ptr %42, i64 -24
  %44 = load i64, ptr %43, align 8
  %45 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %44
  %46 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %45, ptr noundef null)
  %47 = load ptr, ptr @stdin, align 8, !tbaa !8
  %48 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %47)
  %49 = load ptr, ptr @stdout, align 8, !tbaa !8
  %50 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %53 = load i32, ptr %2, align 4, !tbaa !11
  %54 = zext i32 %53 to i64
  %55 = call ptr @llvm.stacksave.p0()
  store ptr %55, ptr %4, align 8
  %56 = alloca i32, i64 %54, align 16
  store i64 %54, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #9
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %57

57:                                               ; preds = %78, %0
  %58 = load i32, ptr %7, align 4, !tbaa !11
  %59 = load i32, ptr %2, align 4, !tbaa !11
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %90

62:                                               ; preds = %57
  %63 = load i32, ptr %7, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %56, i64 %64
  %66 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %65)
          to label %67 unwind label %81

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %68 = load i32, ptr %7, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %56, i64 %69
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %70, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %71 unwind label %85

71:                                               ; preds = %67
  %72 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %73 unwind label %85

73:                                               ; preds = %71
  %74 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %75 = extractvalue { ptr, i8 } %72, 0
  store ptr %75, ptr %74, align 8
  %76 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %77 = extractvalue { ptr, i8 } %72, 1
  store i8 %77, ptr %76, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %78

78:                                               ; preds = %73
  %79 = load i32, ptr %7, align 4, !tbaa !11
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %7, align 4, !tbaa !11
  br label %57, !llvm.loop !13

81:                                               ; preds = %62
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %8, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %9, align 4
  br label %89

85:                                               ; preds = %71, %67
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %8, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  br label %89

89:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %330

90:                                               ; preds = %61
  %91 = load i32, ptr %3, align 4, !tbaa !11
  %92 = zext i32 %91 to i64
  %93 = alloca %"struct.std::pair.2", i64 %92, align 16
  store i64 %92, ptr %12, align 8
  %94 = icmp eq i64 %92, 0
  br i1 %94, label %102, label %95

95:                                               ; preds = %90
  %96 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %92
  br label %97

97:                                               ; preds = %99, %95
  %98 = phi ptr [ %93, %95 ], [ %100, %99 ]
  invoke void @_ZNSt4pairIS_IiiEiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12) %98)
          to label %99 unwind label %108

99:                                               ; preds = %97
  %100 = getelementptr inbounds %"struct.std::pair.2", ptr %98, i64 1
  %101 = icmp eq ptr %100, %96
  br i1 %101, label %102, label %97

102:                                              ; preds = %99, %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %132, %102
  %104 = load i32, ptr %13, align 4, !tbaa !11
  %105 = load i32, ptr %3, align 4, !tbaa !11
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %112, label %107

107:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %139

108:                                              ; preds = %150, %139, %97
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %8, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %9, align 4
  br label %330

112:                                              ; preds = %103
  %113 = load i32, ptr %13, align 4, !tbaa !11
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %114
  %116 = getelementptr inbounds %"struct.std::pair.2", ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %"struct.std::pair.0", ptr %116, i32 0, i32 0
  %118 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %117)
          to label %119 unwind label %135

119:                                              ; preds = %112
  %120 = load i32, ptr %13, align 4, !tbaa !11
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %121
  %123 = getelementptr inbounds %"struct.std::pair.2", ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %"struct.std::pair.0", ptr %123, i32 0, i32 1
  %125 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %118, ptr noundef nonnull align 4 dereferenceable(4) %124)
          to label %126 unwind label %135

126:                                              ; preds = %119
  %127 = load i32, ptr %13, align 4, !tbaa !11
  %128 = load i32, ptr %13, align 4, !tbaa !11
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %129
  %131 = getelementptr inbounds %"struct.std::pair.2", ptr %130, i32 0, i32 1
  store i32 %127, ptr %131, align 4, !tbaa !15
  br label %132

132:                                              ; preds = %126
  %133 = load i32, ptr %13, align 4, !tbaa !11
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %13, align 4, !tbaa !11
  br label %103, !llvm.loop !18

135:                                              ; preds = %119, %112
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %8, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %330

139:                                              ; preds = %107
  %140 = load i32, ptr %3, align 4, !tbaa !11
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %141
  invoke void @_ZSt4sortIPSt4pairIS0_IiiEiESt7greaterIS2_EEvT_S6_T0_(ptr noundef %93, ptr noundef %142)
          to label %143 unwind label %108

143:                                              ; preds = %139
  %144 = load i32, ptr %2, align 4, !tbaa !11
  %145 = zext i32 %144 to i64
  %146 = alloca %"struct.std::pair.0", i64 %145, align 16
  store i64 %145, ptr %15, align 8
  %147 = icmp eq i64 %145, 0
  br i1 %147, label %155, label %148

148:                                              ; preds = %143
  %149 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 %145
  br label %150

150:                                              ; preds = %152, %148
  %151 = phi ptr [ %146, %148 ], [ %153, %152 ]
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %151)
          to label %152 unwind label %108

152:                                              ; preds = %150
  %153 = getelementptr inbounds %"struct.std::pair.0", ptr %151, i64 1
  %154 = icmp eq ptr %153, %149
  br i1 %154, label %155, label %150

155:                                              ; preds = %152, %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %156

156:                                              ; preds = %171, %155
  %157 = load i32, ptr %16, align 4, !tbaa !11
  %158 = load i32, ptr %2, align 4, !tbaa !11
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %178

161:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  %162 = load i32, ptr %16, align 4, !tbaa !11
  %163 = sub nsw i32 %162, 1
  store i32 %163, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %164 = load i32, ptr %16, align 4, !tbaa !11
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %19, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %166 unwind label %174

166:                                              ; preds = %161
  %167 = load i32, ptr %16, align 4, !tbaa !11
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 %168
  %170 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %169, ptr noundef nonnull align 4 dereferenceable(8) %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  br label %171

171:                                              ; preds = %166
  %172 = load i32, ptr %16, align 4, !tbaa !11
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %16, align 4, !tbaa !11
  br label %156, !llvm.loop !19

174:                                              ; preds = %161
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %8, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %330

178:                                              ; preds = %160
  %179 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 0
  %180 = getelementptr inbounds %"struct.std::pair.0", ptr %179, i32 0, i32 0
  store i32 0, ptr %180, align 16, !tbaa !20
  %181 = load i32, ptr %2, align 4, !tbaa !11
  %182 = sub nsw i32 %181, 1
  %183 = load i32, ptr %2, align 4, !tbaa !11
  %184 = sub nsw i32 %183, 1
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 %185
  %187 = getelementptr inbounds %"struct.std::pair.0", ptr %186, i32 0, i32 1
  store i32 %182, ptr %187, align 4, !tbaa !21
  %188 = load i32, ptr %3, align 4, !tbaa !11
  %189 = zext i32 %188 to i64
  %190 = alloca i8, i64 %189, align 16
  store i64 %189, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 1, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %191

191:                                              ; preds = %299, %178
  %192 = load i32, ptr %22, align 4, !tbaa !11
  %193 = load i32, ptr %3, align 4, !tbaa !11
  %194 = icmp slt i32 %192, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %303

196:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  %197 = load i32, ptr %22, align 4, !tbaa !11
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %198
  %200 = getelementptr inbounds %"struct.std::pair.2", ptr %199, i32 0, i32 0
  %201 = getelementptr inbounds %"struct.std::pair.0", ptr %200, i32 0, i32 0
  %202 = load i32, ptr %201, align 4, !tbaa !22
  store i32 %202, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %203 = load i32, ptr %22, align 4, !tbaa !11
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %204
  %206 = getelementptr inbounds %"struct.std::pair.2", ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %"struct.std::pair.0", ptr %206, i32 0, i32 1
  %208 = load i32, ptr %207, align 4, !tbaa !23
  store i32 %208, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  store i32 2147483647, ptr %27, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %209 unwind label %250

209:                                              ; preds = %196
  %210 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE11upper_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(8) %26)
          to label %211 unwind label %250

211:                                              ; preds = %209
  %212 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %210, ptr %212, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %213

213:                                              ; preds = %247, %211
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %214 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #9
  %215 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %214, ptr %215, align 8
  %216 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br i1 %216, label %217, label %258

217:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  %218 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #9
  %219 = getelementptr inbounds %"struct.std::pair.0", ptr %218, i32 0, i32 1
  %220 = load i32, ptr %219, align 4, !tbaa !21
  store i32 %220, ptr %29, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  %221 = load i32, ptr %29, align 4, !tbaa !11
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 %222
  %224 = getelementptr inbounds %"struct.std::pair.0", ptr %223, i32 0, i32 0
  %225 = load i32, ptr %224, align 8, !tbaa !20
  store i32 %225, ptr %30, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  %226 = load i32, ptr %29, align 4, !tbaa !11
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 %227
  %229 = getelementptr inbounds %"struct.std::pair.0", ptr %228, i32 0, i32 1
  %230 = load i32, ptr %229, align 4, !tbaa !21
  store i32 %230, ptr %31, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %231 = load i32, ptr %31, align 4, !tbaa !11
  %232 = load i32, ptr %30, align 4, !tbaa !11
  %233 = sub nsw i32 %231, %232
  store i32 %233, ptr %32, align 4, !tbaa !11
  %234 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %235 unwind label %254

235:                                              ; preds = %217
  %236 = load i32, ptr %234, align 4, !tbaa !11
  store i32 %236, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  %237 = load i32, ptr %31, align 4, !tbaa !11
  %238 = load i32, ptr %30, align 4, !tbaa !11
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 %239
  %241 = getelementptr inbounds %"struct.std::pair.0", ptr %240, i32 0, i32 1
  store i32 %237, ptr %241, align 4, !tbaa !21
  %242 = load i32, ptr %30, align 4, !tbaa !11
  %243 = load i32, ptr %31, align 4, !tbaa !11
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds %"struct.std::pair.0", ptr %146, i64 %244
  %246 = getelementptr inbounds %"struct.std::pair.0", ptr %245, i32 0, i32 0
  store i32 %242, ptr %246, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %247

247:                                              ; preds = %235
  %248 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %25, i32 noundef 0) #9
  %249 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %33, i32 0, i32 0
  store ptr %248, ptr %249, align 8
  br label %213, !llvm.loop !24

250:                                              ; preds = %209, %196
  %251 = landingpad { ptr, i32 }
          cleanup
  %252 = extractvalue { ptr, i32 } %251, 0
  store ptr %252, ptr %8, align 8
  %253 = extractvalue { ptr, i32 } %251, 1
  store i32 %253, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %302

254:                                              ; preds = %217
  %255 = landingpad { ptr, i32 }
          cleanup
  %256 = extractvalue { ptr, i32 } %255, 0
  store ptr %256, ptr %8, align 8
  %257 = extractvalue { ptr, i32 } %255, 1
  store i32 %257, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %302

258:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  store i32 2147483647, ptr %36, align 4, !tbaa !11
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %35, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %36)
          to label %259 unwind label %290

259:                                              ; preds = %258
  %260 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE11upper_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(8) %35)
          to label %261 unwind label %290

261:                                              ; preds = %259
  %262 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %34, i32 0, i32 0
  store ptr %260, ptr %262, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %34, i64 8, i1 false), !tbaa.struct !25
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %25, i64 8, i1 false), !tbaa.struct !25
  %263 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #9
  %264 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %38, i32 0, i32 0
  store ptr %263, ptr %264, align 8
  %265 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %37, i32 0, i32 0
  %266 = load ptr, ptr %265, align 8
  %267 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %38, i32 0, i32 0
  %268 = load ptr, ptr %267, align 8
  %269 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_ES7_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr %266, ptr %268)
          to label %270 unwind label %294

270:                                              ; preds = %261
  %271 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %39, i32 0, i32 0
  store ptr %269, ptr %271, align 8
  %272 = load i32, ptr %22, align 4, !tbaa !11
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %273
  %275 = getelementptr inbounds %"struct.std::pair.2", ptr %274, i32 0, i32 1
  %276 = load i32, ptr %275, align 4, !tbaa !15
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds i8, ptr %190, i64 %277
  store i8 0, ptr %278, align 1, !tbaa !26
  %279 = load i32, ptr %24, align 4, !tbaa !11
  %280 = load i32, ptr %21, align 4, !tbaa !11
  %281 = icmp sge i32 %279, %280
  br i1 %281, label %282, label %298

282:                                              ; preds = %270
  %283 = load i32, ptr %22, align 4, !tbaa !11
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds %"struct.std::pair.2", ptr %93, i64 %284
  %286 = getelementptr inbounds %"struct.std::pair.2", ptr %285, i32 0, i32 1
  %287 = load i32, ptr %286, align 4, !tbaa !15
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds i8, ptr %190, i64 %288
  store i8 1, ptr %289, align 1, !tbaa !26
  br label %298

290:                                              ; preds = %259, %258
  %291 = landingpad { ptr, i32 }
          cleanup
  %292 = extractvalue { ptr, i32 } %291, 0
  store ptr %292, ptr %8, align 8
  %293 = extractvalue { ptr, i32 } %291, 1
  store i32 %293, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  br label %302

294:                                              ; preds = %261
  %295 = landingpad { ptr, i32 }
          cleanup
  %296 = extractvalue { ptr, i32 } %295, 0
  store ptr %296, ptr %8, align 8
  %297 = extractvalue { ptr, i32 } %295, 1
  store i32 %297, ptr %9, align 4
  br label %302

298:                                              ; preds = %282, %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %299

299:                                              ; preds = %298
  %300 = load i32, ptr %22, align 4, !tbaa !11
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %22, align 4, !tbaa !11
  br label %191, !llvm.loop !28

302:                                              ; preds = %294, %290, %254, %250
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %329

303:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  store i32 0, ptr %40, align 4, !tbaa !11
  br label %304

304:                                              ; preds = %319, %303
  %305 = load i32, ptr %40, align 4, !tbaa !11
  %306 = load i32, ptr %3, align 4, !tbaa !11
  %307 = icmp slt i32 %305, %306
  br i1 %307, label %309, label %308

308:                                              ; preds = %304
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %326

309:                                              ; preds = %304
  %310 = load i32, ptr %40, align 4, !tbaa !11
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds i8, ptr %190, i64 %311
  %313 = load i8, ptr %312, align 1, !tbaa !26, !range !29, !noundef !30
  %314 = trunc i8 %313 to i1
  %315 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i1 noundef zeroext %314)
          to label %316 unwind label %322

316:                                              ; preds = %309
  %317 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %315, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %318 unwind label %322

318:                                              ; preds = %316
  br label %319

319:                                              ; preds = %318
  %320 = load i32, ptr %40, align 4, !tbaa !11
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %40, align 4, !tbaa !11
  br label %304, !llvm.loop !31

322:                                              ; preds = %316, %309
  %323 = landingpad { ptr, i32 }
          cleanup
  %324 = extractvalue { ptr, i32 } %323, 0
  store ptr %324, ptr %8, align 8
  %325 = extractvalue { ptr, i32 } %323, 1
  store i32 %325, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %329

326:                                              ; preds = %308
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #9
  %327 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %327)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %328 = load i32, ptr %1, align 4
  ret i32 %328

329:                                              ; preds = %322, %302
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %330

330:                                              ; preds = %329, %174, %135, %108, %89
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %331

331:                                              ; preds = %330
  %332 = load ptr, ptr %8, align 8
  %333 = load i32, ptr %9, align 4
  %334 = insertvalue { ptr, i32 } poison, ptr %332, 0
  %335 = insertvalue { ptr, i32 } %334, i32 %333, 1
  resume { ptr, i32 } %335
}

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

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairIS_IiiEiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #5 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.0" = type { i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair.2" = type { %"struct.std::pair.0", i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 i32, align 4
  %3 = alloca %"class.std::set", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair.0", align 4
  %6 = alloca %"struct.std::pair.0", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::pair.0", align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair.0", align 4
  %17 = alloca i32, align 4
  %18 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = load ptr, ptr @stdin, align 8, !tbaa !8
  %25 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %24)
  %26 = load ptr, ptr @stdout, align 8, !tbaa !8
  %27 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %30 = load i32, ptr %1, align 4, !tbaa !11
  %31 = zext i32 %30 to i64
  %32 = call ptr @llvm.stacksave.p0()
  %33 = alloca i32, i64 %31, align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #8
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !11
  %34 = load i32, ptr %1, align 4, !tbaa !11
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %48, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %36 = load i32, ptr %2, align 4, !tbaa !11
  %37 = zext i32 %36 to i64
  %38 = alloca %"struct.std::pair.2", i64 %37, align 16
  %39 = icmp eq i32 %36, 0
  br i1 %39, label %.loopexit56.._crit_edge63_crit_edge, label %58

.lr.ph:                                           ; preds = %0, %48
  %storemerge59 = phi i32 [ %50, %48 ], [ 0, %0 ]
  %40 = sext i32 %storemerge59 to i64
  %41 = getelementptr inbounds i32, ptr %33, i64 %40
  %42 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %41)
          to label %43 unwind label %53

43:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %44 = load i32, ptr %4, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr %33, i64 %45
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %46, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %47 = invoke { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(8) %5)
          to label %48 unwind label %55

48:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %49 = load i32, ptr %4, align 4, !tbaa !11
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %4, align 4, !tbaa !11
  %51 = load i32, ptr %1, align 4, !tbaa !11
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph, label %._crit_edge, !llvm.loop !13

53:                                               ; preds = %.lr.ph
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %57

55:                                               ; preds = %43
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %57

57:                                               ; preds = %55, %53
  %.pn52 = phi { ptr, i32 } [ %56, %55 ], [ %54, %53 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %168

58:                                               ; preds = %._crit_edge
  %59 = getelementptr inbounds %"struct.std::pair.2", ptr %38, i64 %37
  br label %60

60:                                               ; preds = %62, %58
  %61 = phi ptr [ %38, %58 ], [ %63, %62 ]
  invoke void @_ZNSt4pairIS_IiiEiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12) %61)
          to label %62 unwind label %.loopexit55

62:                                               ; preds = %60
  %63 = getelementptr inbounds i8, ptr %61, i64 12
  %64 = icmp eq ptr %63, %59
  br i1 %64, label %.loopexit56, label %60

.loopexit56:                                      ; preds = %62
  %.pre = load i32, ptr %2, align 4, !tbaa !11
  %65 = icmp sgt i32 %.pre, 0
  br i1 %65, label %.lr.ph62, label %.loopexit56.._crit_edge63_crit_edge

.loopexit56.._crit_edge63_crit_edge:              ; preds = %._crit_edge, %.loopexit56
  %66 = phi i32 [ %.pre, %.loopexit56 ], [ 0, %._crit_edge ]
  %.pre91 = sext i32 %66 to i64
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %73, %.loopexit56.._crit_edge63_crit_edge
  %.pre-phi = phi i64 [ %.pre91, %.loopexit56.._crit_edge63_crit_edge ], [ %77, %73 ]
  %67 = getelementptr inbounds %"struct.std::pair.2", ptr %38, i64 %.pre-phi
  invoke void @_ZSt4sortIPSt4pairIS0_IiiEiESt7greaterIS2_EEvT_S6_T0_(ptr noundef nonnull %38, ptr noundef nonnull %67)
          to label %81 unwind label %.loopexit.split-lp

.loopexit55:                                      ; preds = %60
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %168

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

.lr.ph62:                                         ; preds = %.loopexit56, %73
  %indvars.iv = phi i64 [ %indvars.iv.next, %73 ], [ 0, %.loopexit56 ]
  %68 = getelementptr inbounds %"struct.std::pair.2", ptr %38, i64 %indvars.iv
  %69 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %68)
          to label %70 unwind label %79

70:                                               ; preds = %.lr.ph62
  %71 = getelementptr inbounds i8, ptr %68, i64 4
  %72 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %69, ptr noundef nonnull align 4 dereferenceable(4) %71)
          to label %73 unwind label %79

73:                                               ; preds = %70
  %74 = getelementptr inbounds i8, ptr %68, i64 8
  %75 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %75, ptr %74, align 4, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %76 = load i32, ptr %2, align 4, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next, %77
  br i1 %78, label %.lr.ph62, label %._crit_edge63, !llvm.loop !18

79:                                               ; preds = %70, %.lr.ph62
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %168

81:                                               ; preds = %._crit_edge63
  %82 = load i32, ptr %1, align 4, !tbaa !11
  %83 = zext i32 %82 to i64
  %84 = alloca %"struct.std::pair.0", i64 %83, align 16
  %85 = icmp eq i32 %82, 0
  br i1 %85, label %._crit_edge67, label %86

86:                                               ; preds = %81
  %87 = getelementptr inbounds %"struct.std::pair.0", ptr %84, i64 %83
  br label %88

88:                                               ; preds = %88, %86
  %89 = phi ptr [ %84, %86 ], [ %90, %88 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %89)
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = icmp eq ptr %90, %87
  br i1 %91, label %.loopexit, label %88

.loopexit:                                        ; preds = %88
  %.pre90 = load i32, ptr %1, align 4, !tbaa !11
  %92 = icmp sgt i32 %.pre90, 0
  br i1 %92, label %.lr.ph66, label %._crit_edge67

._crit_edge67:                                    ; preds = %.lr.ph66, %81, %.loopexit
  %.lcssa = phi i32 [ %.pre90, %.loopexit ], [ 0, %81 ], [ %105, %.lr.ph66 ]
  store i32 0, ptr %84, align 16, !tbaa !19
  %93 = add nsw i32 %.lcssa, -1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %"struct.std::pair.0", ptr %84, i64 %94, i32 1
  store i32 %93, ptr %95, align 4, !tbaa !20
  %96 = load i32, ptr %2, align 4, !tbaa !11
  %97 = zext i32 %96 to i64
  %98 = alloca i8, i64 %97, align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 1, ptr %9, align 4, !tbaa !11
  %99 = icmp sgt i32 %96, 0
  br i1 %99, label %.lr.ph74, label %._crit_edge77

.lr.ph66:                                         ; preds = %.loopexit, %.lr.ph66
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph66 ], [ 0, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  %100 = trunc i64 %indvars.iv81 to i32
  %101 = add i32 %100, -1
  store i32 %101, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %102 = trunc nuw nsw i64 %indvars.iv.next82 to i32
  store i32 %102, ptr %8, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %103 = getelementptr inbounds %"struct.std::pair.0", ptr %84, i64 %indvars.iv81
  %104 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %103, ptr noundef nonnull align 4 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %105 = load i32, ptr %1, align 4, !tbaa !11
  %106 = sext i32 %105 to i64
  %107 = icmp slt i64 %indvars.iv.next82, %106
  br i1 %107, label %.lr.ph66, label %._crit_edge67, !llvm.loop !21

.preheader:                                       ; preds = %141
  %108 = icmp sgt i32 %147, 0
  br i1 %108, label %.lr.ph76, label %._crit_edge77

.lr.ph74:                                         ; preds = %._crit_edge67, %141
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %141 ], [ 0, %._crit_edge67 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %109 = getelementptr inbounds %"struct.std::pair.2", ptr %38, i64 %indvars.iv84
  %110 = load i32, ptr %109, align 4, !tbaa !22
  store i32 %110, ptr %10, align 4, !tbaa !11
  %111 = getelementptr inbounds i8, ptr %109, i64 4
  %112 = load i32, ptr %111, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  store i32 2147483647, ptr %13, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %113 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE11upper_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %114 unwind label %135

114:                                              ; preds = %.lr.ph74
  store ptr %113, ptr %11, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  %115 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  store ptr %115, ptr %14, align 8
  %116 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  br i1 %116, label %.lr.ph70, label %._crit_edge71

.lr.ph70:                                         ; preds = %114, %.lr.ph70
  %117 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %118 = getelementptr inbounds i8, ptr %117, i64 4
  %119 = load i32, ptr %118, align 4, !tbaa !20
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %"struct.std::pair.0", ptr %84, i64 %120
  %122 = load i32, ptr %121, align 8, !tbaa !19
  %123 = getelementptr inbounds i8, ptr %121, i64 4
  %124 = load i32, ptr %123, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %125 = sub nsw i32 %124, %122
  store i32 %125, ptr %15, align 4, !tbaa !11
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %127 = load i32, ptr %126, align 4, !tbaa !11
  store i32 %127, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  %128 = sext i32 %122 to i64
  %129 = getelementptr inbounds %"struct.std::pair.0", ptr %84, i64 %128, i32 1
  store i32 %124, ptr %129, align 4, !tbaa !20
  %130 = sext i32 %124 to i64
  %131 = getelementptr inbounds %"struct.std::pair.0", ptr %84, i64 %130
  store i32 %122, ptr %131, align 8, !tbaa !19
  %132 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  %133 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  store ptr %133, ptr %14, align 8
  %134 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIiiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  br i1 %134, label %.lr.ph70, label %._crit_edge71, !llvm.loop !24

135:                                              ; preds = %.lr.ph74
  %136 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  br label %154

._crit_edge71:                                    ; preds = %.lr.ph70, %114
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  store i32 2147483647, ptr %17, align 4, !tbaa !11
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %137 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE11upper_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %138 unwind label %150

138:                                              ; preds = %._crit_edge71
  store ptr %137, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  %139 = call ptr @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  %140 = invoke ptr @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_ES7_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr %137, ptr %139)
          to label %141 unwind label %152

141:                                              ; preds = %138
  %142 = getelementptr inbounds i8, ptr %109, i64 8
  %143 = load i32, ptr %142, align 4, !tbaa !15
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i8, ptr %98, i64 %144
  %146 = load i32, ptr %9, align 4, !tbaa !11
  %.not = icmp sge i32 %112, %146
  %spec.store.select = zext i1 %.not to i8
  store i8 %spec.store.select, ptr %145, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %147 = load i32, ptr %2, align 4, !tbaa !11
  %148 = sext i32 %147 to i64
  %149 = icmp slt i64 %indvars.iv.next85, %148
  br i1 %149, label %.lr.ph74, label %.preheader, !llvm.loop !25

150:                                              ; preds = %._crit_edge71
  %151 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %154

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

154:                                              ; preds = %152, %150, %135
  %.pn = phi { ptr, i32 } [ %153, %152 ], [ %151, %150 ], [ %136, %135 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  br label %167

._crit_edge77:                                    ; preds = %161, %._crit_edge67, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #8
  call void @llvm.stackrestore.p0(ptr %32)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.lr.ph76:                                         ; preds = %.preheader, %161
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %161 ], [ 0, %.preheader ]
  %155 = getelementptr inbounds i8, ptr %98, i64 %indvars.iv87
  %156 = load i8, ptr %155, align 1, !tbaa !26, !range !28, !noundef !29
  %157 = trunc nuw i8 %156 to i1
  %158 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i1 noundef zeroext %157)
          to label %159 unwind label %165

159:                                              ; preds = %.lr.ph76
  %160 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %161 unwind label %165

161:                                              ; preds = %159
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %162 = load i32, ptr %2, align 4, !tbaa !11
  %163 = sext i32 %162 to i64
  %164 = icmp slt i64 %indvars.iv.next88, %163
  br i1 %164, label %.lr.ph76, label %._crit_edge77, !llvm.loop !30

165:                                              ; preds = %159, %.lr.ph76
  %166 = landingpad { ptr, i32 }
          cleanup
  br label %167

167:                                              ; preds = %165, %154
  %.pn.pn = phi { ptr, i32 } [ %.pn, %154 ], [ %166, %165 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  br label %168

168:                                              ; preds = %.loopexit55, %.loopexit.split-lp, %167, %79, %57
  %.pn52.pn = phi { ptr, i32 } [ %.pn52, %57 ], [ %80, %79 ], [ %.pn.pn, %167 ], [ %lpad.loopexit, %.loopexit55 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn52.pn
}

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

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr 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) #3

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairIS_IiiEiEC2IS0_iTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES4_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #5 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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


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