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

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

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

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@d1 = external dso_local global [300000 x %"class.std::vector"], align 16
@r = external dso_local global [300000 x [3 x i64]], align 16
@cm = external dso_local global %"class.std::map", align 8
@s = external dso_local global ptr, align 8
@dp = external dso_local global [300000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@_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 %"class.std::set", align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::pair.7", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"struct.std::pair.7", align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca %"struct.std::pair.7", align 8
  %29 = alloca i64, align 8
  %30 = alloca ptr, align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %33 = alloca %"struct.std::pair.7", align 8
  %34 = alloca %"class.std::set", align 8
  %35 = alloca i64, align 8
  %36 = alloca %"struct.std::pair", align 8
  %37 = alloca i64, align 8
  %38 = alloca i64, align 8
  %39 = alloca i64, align 8
  %40 = alloca i64, align 8
  %41 = alloca i64, align 8
  %42 = alloca i64, align 8
  %43 = alloca i64, align 8
  %44 = alloca i8, align 1
  %45 = alloca %"struct.std::pair.7", align 8
  %46 = alloca %"struct.std::pair.7", align 8
  %47 = alloca ptr, align 8
  %48 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %49 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %50 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %51 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %52 = getelementptr i8, ptr %51, i64 -24
  %53 = load i64, ptr %52, align 8
  %54 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %53
  %55 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %54, ptr noundef null)
  %56 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %57, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #11
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %59

59:                                               ; preds = %113, %0
  %60 = load i64, ptr %3, align 8, !tbaa !8
  %61 = load i64, ptr @M, align 8, !tbaa !8
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #11
  br label %120

64:                                               ; preds = %59
  %65 = load i64, ptr %3, align 8, !tbaa !8
  %66 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %65
  %67 = getelementptr inbounds [3 x i64], ptr %66, i64 0, i64 0
  %68 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %67)
          to label %69 unwind label %116

69:                                               ; preds = %64
  %70 = load i64, ptr %3, align 8, !tbaa !8
  %71 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %70
  %72 = getelementptr inbounds [3 x i64], ptr %71, i64 0, i64 1
  %73 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr noundef nonnull align 8 dereferenceable(8) %72)
          to label %74 unwind label %116

74:                                               ; preds = %69
  %75 = load i64, ptr %3, align 8, !tbaa !8
  %76 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %75
  %77 = getelementptr inbounds [3 x i64], ptr %76, i64 0, i64 2
  %78 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 8 dereferenceable(8) %77)
          to label %79 unwind label %116

79:                                               ; preds = %74
  %80 = load i64, ptr %3, align 8, !tbaa !8
  %81 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %80
  %82 = getelementptr inbounds [3 x i64], ptr %81, i64 0, i64 0
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = add nsw i64 %83, -1
  store i64 %84, ptr %82, align 8, !tbaa !8
  %85 = load i64, ptr %3, align 8, !tbaa !8
  %86 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %85
  %87 = getelementptr inbounds [3 x i64], ptr %86, i64 0, i64 1
  %88 = load i64, ptr %87, align 8, !tbaa !8
  %89 = add nsw i64 %88, -1
  store i64 %89, ptr %87, align 8, !tbaa !8
  %90 = load i64, ptr %3, align 8, !tbaa !8
  %91 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %90
  %92 = getelementptr inbounds [3 x i64], ptr %91, i64 0, i64 2
  %93 = load i64, ptr %92, align 8, !tbaa !8
  %94 = add nsw i64 %93, -1
  store i64 %94, ptr %92, align 8, !tbaa !8
  %95 = load i64, ptr %3, align 8, !tbaa !8
  %96 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %95
  %97 = getelementptr inbounds [3 x i64], ptr %96, i64 0, i64 1
  %98 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %97)
          to label %99 unwind label %116

99:                                               ; preds = %79
  %100 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %101 = extractvalue { ptr, i8 } %98, 0
  store ptr %101, ptr %100, align 8
  %102 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %103 = extractvalue { ptr, i8 } %98, 1
  store i8 %103, ptr %102, align 8
  %104 = load i64, ptr %3, align 8, !tbaa !8
  %105 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %104
  %106 = getelementptr inbounds [3 x i64], ptr %105, i64 0, i64 2
  %107 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %106)
          to label %108 unwind label %116

108:                                              ; preds = %99
  %109 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 0
  %110 = extractvalue { ptr, i8 } %107, 0
  store ptr %110, ptr %109, align 8
  %111 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 1
  %112 = extractvalue { ptr, i8 } %107, 1
  store i8 %112, ptr %111, align 8
  br label %113

113:                                              ; preds = %108
  %114 = load i64, ptr %3, align 8, !tbaa !8
  %115 = add nsw i64 %114, 1
  store i64 %115, ptr %3, align 8, !tbaa !8
  br label %59, !llvm.loop !11

116:                                              ; preds = %99, %79, %74, %69, %64
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %4, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #11
  br label %490

120:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #11
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #11
  store ptr %2, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #11
  %121 = load ptr, ptr %9, align 8, !tbaa !13
  %122 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %121) #11
  %123 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %122, ptr %123, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #11
  %124 = load ptr, ptr %9, align 8, !tbaa !13
  %125 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %124) #11
  %126 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %125, ptr %126, align 8
  br label %127

127:                                              ; preds = %138, %120
  %128 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #11
  br i1 %128, label %130, label %129

129:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #11
  br label %144

130:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #11
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #11
  %132 = load i64, ptr %131, align 8, !tbaa !8
  store i64 %132, ptr %12, align 8, !tbaa !8
  %133 = load i64, ptr %8, align 8, !tbaa !8
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cm, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %135 unwind label %140

135:                                              ; preds = %130
  store i64 %133, ptr %134, align 8, !tbaa !8
  %136 = load i64, ptr %8, align 8, !tbaa !8
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  br label %138

138:                                              ; preds = %135
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #11
  br label %127

140:                                              ; preds = %130
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %4, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #11
  br label %489

144:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #11
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %145

145:                                              ; preds = %168, %144
  %146 = load i64, ptr %13, align 8, !tbaa !8
  %147 = load i64, ptr @M, align 8, !tbaa !8
  %148 = icmp slt i64 %146, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  br label %175

150:                                              ; preds = %145
  %151 = load i64, ptr %13, align 8, !tbaa !8
  %152 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %151
  %153 = getelementptr inbounds [3 x i64], ptr %152, i64 0, i64 0
  %154 = load i64, ptr %153, align 8, !tbaa !8
  %155 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %154
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #11
  %156 = load i64, ptr %13, align 8, !tbaa !8
  %157 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %156
  %158 = getelementptr inbounds [3 x i64], ptr %157, i64 0, i64 1
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cm, ptr noundef nonnull align 8 dereferenceable(8) %158)
          to label %160 unwind label %171

160:                                              ; preds = %150
  %161 = load i64, ptr %13, align 8, !tbaa !8
  %162 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %161
  %163 = getelementptr inbounds [3 x i64], ptr %162, i64 0, i64 2
  %164 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cm, ptr noundef nonnull align 8 dereferenceable(8) %163)
          to label %165 unwind label %171

165:                                              ; preds = %160
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %159, ptr noundef nonnull align 8 dereferenceable(8) %164)
          to label %166 unwind label %171

166:                                              ; preds = %165
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %155, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %167 unwind label %171

167:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #11
  br label %168

168:                                              ; preds = %167
  %169 = load i64, ptr %13, align 8, !tbaa !8
  %170 = add nsw i64 %169, 1
  store i64 %170, ptr %13, align 8, !tbaa !8
  br label %145, !llvm.loop !15

171:                                              ; preds = %166, %165, %160, %150
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %4, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  br label %489

175:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #11
  store i64 0, ptr %15, align 8, !tbaa !8
  br label %176

176:                                              ; preds = %195, %175
  %177 = load i64, ptr %15, align 8, !tbaa !8
  %178 = load i64, ptr @N, align 8, !tbaa !8
  %179 = icmp slt i64 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  br label %202

181:                                              ; preds = %176
  %182 = load i64, ptr %15, align 8, !tbaa !8
  %183 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %182
  %184 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %183) #11
  %185 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %184, ptr %185, align 8
  %186 = load i64, ptr %15, align 8, !tbaa !8
  %187 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %186
  %188 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %187) #11
  %189 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %188, ptr %189, align 8
  %190 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8
  %192 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %191, ptr %193)
          to label %194 unwind label %198

194:                                              ; preds = %181
  br label %195

195:                                              ; preds = %194
  %196 = load i64, ptr %15, align 8, !tbaa !8
  %197 = add nsw i64 %196, 1
  store i64 %197, ptr %15, align 8, !tbaa !8
  br label %176, !llvm.loop !16

198:                                              ; preds = %181
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %4, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  br label %489

202:                                              ; preds = %180
  %203 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 56) #12
          to label %204 unwind label %214

204:                                              ; preds = %202
  %205 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #11
  invoke void @_ZN4segtC2Exx(ptr noundef nonnull align 8 dereferenceable(56) %203, i64 noundef 0, i64 noundef %205)
          to label %206 unwind label %218

206:                                              ; preds = %204
  store ptr %203, ptr @s, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #11
  store ptr @d1, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #11
  %207 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @d1) #11
  %208 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %207, ptr %208, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #11
  %209 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @d1) #11
  %210 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %209, ptr %210, align 8
  br label %211

211:                                              ; preds = %230, %206
  %212 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #11
  br i1 %212, label %222, label %213

213:                                              ; preds = %211
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #11
  br label %236

214:                                              ; preds = %202
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %4, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %5, align 4
  br label %489

218:                                              ; preds = %204
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %4, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %203, i64 noundef 56) #13
  br label %489

222:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #11
  %223 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %223, i64 16, i1 false)
  %224 = load ptr, ptr @s, align 8, !tbaa !13
  %225 = getelementptr inbounds %"struct.std::pair.7", ptr %21, i32 0, i32 0
  %226 = load i64, ptr %225, align 8, !tbaa !17
  %227 = getelementptr inbounds %"struct.std::pair.7", ptr %21, i32 0, i32 1
  %228 = load i64, ptr %227, align 8, !tbaa !19
  invoke void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(56) %224, i64 noundef %226, i64 noundef %228, i64 noundef 1)
          to label %229 unwind label %232

229:                                              ; preds = %222
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #11
  br label %230

230:                                              ; preds = %229
  %231 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #11
  br label %211

232:                                              ; preds = %222
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %4, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #11
  br label %489

236:                                              ; preds = %213
  store i64 1, ptr @dp, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #11
  store i64 1, ptr %22, align 8, !tbaa !8
  br label %237

237:                                              ; preds = %306, %236
  %238 = load i64, ptr %22, align 8, !tbaa !8
  %239 = load i64, ptr @N, align 8, !tbaa !8
  %240 = icmp slt i64 %238, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %237
  store i32 15, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  br label %310

242:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #11
  store i64 0, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #11
  %243 = load i64, ptr %22, align 8, !tbaa !8
  %244 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %243
  store ptr %244, ptr %25, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #11
  %245 = load ptr, ptr %25, align 8, !tbaa !13
  %246 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %245) #11
  %247 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %246, ptr %247, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #11
  %248 = load ptr, ptr %25, align 8, !tbaa !13
  %249 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %248) #11
  %250 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %249, ptr %250, align 8
  br label %251

251:                                              ; preds = %266, %242
  %252 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #11
  br i1 %252, label %254, label %253

253:                                              ; preds = %251
  store i32 18, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #11
  br label %272

254:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #11
  %255 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %255, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #11
  %256 = load ptr, ptr @s, align 8, !tbaa !13
  %257 = getelementptr inbounds %"struct.std::pair.7", ptr %28, i32 0, i32 0
  %258 = load i64, ptr %257, align 8, !tbaa !17
  %259 = getelementptr inbounds %"struct.std::pair.7", ptr %28, i32 0, i32 1
  %260 = load i64, ptr %259, align 8, !tbaa !19
  %261 = invoke noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(56) %256, i64 noundef %258, i64 noundef %260)
          to label %262 unwind label %268

262:                                              ; preds = %254
  store i64 %261, ptr %29, align 8, !tbaa !8
  %263 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %29)
          to label %264 unwind label %268

264:                                              ; preds = %262
  %265 = load i64, ptr %263, align 8, !tbaa !8
  store i64 %265, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #11
  br label %266

266:                                              ; preds = %264
  %267 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #11
  br label %251

268:                                              ; preds = %262, %254
  %269 = landingpad { ptr, i32 }
          cleanup
  %270 = extractvalue { ptr, i32 } %269, 0
  store ptr %270, ptr %4, align 8
  %271 = extractvalue { ptr, i32 } %269, 1
  store i32 %271, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #11
  br label %309

272:                                              ; preds = %253
  %273 = load i64, ptr %24, align 8, !tbaa !8
  %274 = add nsw i64 %273, 1
  %275 = load i64, ptr %22, align 8, !tbaa !8
  %276 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %275
  store i64 %274, ptr %276, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #11
  %277 = load i64, ptr %22, align 8, !tbaa !8
  %278 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %277
  store ptr %278, ptr %30, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #11
  %279 = load ptr, ptr %30, align 8, !tbaa !13
  %280 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %279) #11
  %281 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %31, i32 0, i32 0
  store ptr %280, ptr %281, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #11
  %282 = load ptr, ptr %30, align 8, !tbaa !13
  %283 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %282) #11
  %284 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %32, i32 0, i32 0
  store ptr %283, ptr %284, align 8
  br label %285

285:                                              ; preds = %299, %272
  %286 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32) #11
  br i1 %286, label %288, label %287

287:                                              ; preds = %285
  store i32 20, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #11
  br label %305

288:                                              ; preds = %285
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #11
  %289 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %289, i64 16, i1 false)
  %290 = load ptr, ptr @s, align 8, !tbaa !13
  %291 = getelementptr inbounds %"struct.std::pair.7", ptr %33, i32 0, i32 0
  %292 = load i64, ptr %291, align 8, !tbaa !17
  %293 = getelementptr inbounds %"struct.std::pair.7", ptr %33, i32 0, i32 1
  %294 = load i64, ptr %293, align 8, !tbaa !19
  %295 = load i64, ptr %22, align 8, !tbaa !8
  %296 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %295
  %297 = load i64, ptr %296, align 8, !tbaa !8
  invoke void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(56) %290, i64 noundef %292, i64 noundef %294, i64 noundef %297)
          to label %298 unwind label %301

298:                                              ; preds = %288
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #11
  br label %299

299:                                              ; preds = %298
  %300 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #11
  br label %285

301:                                              ; preds = %288
  %302 = landingpad { ptr, i32 }
          cleanup
  %303 = extractvalue { ptr, i32 } %302, 0
  store ptr %303, ptr %4, align 8
  %304 = extractvalue { ptr, i32 } %302, 1
  store i32 %304, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #11
  br label %309

305:                                              ; preds = %287
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #11
  br label %306

306:                                              ; preds = %305
  %307 = load i64, ptr %22, align 8, !tbaa !8
  %308 = add nsw i64 %307, 1
  store i64 %308, ptr %22, align 8, !tbaa !8
  br label %237, !llvm.loop !20

309:                                              ; preds = %301, %268
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  br label %489

310:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 48, ptr %34) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %34) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #11
  store i64 0, ptr %35, align 8, !tbaa !8
  br label %311

311:                                              ; preds = %323, %310
  %312 = load i64, ptr %35, align 8, !tbaa !8
  %313 = load i64, ptr @N, align 8, !tbaa !8
  %314 = icmp slt i64 %312, %313
  br i1 %314, label %316, label %315

315:                                              ; preds = %311
  store i32 22, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #11
  br label %330

316:                                              ; preds = %311
  %317 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %34, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %318 unwind label %326

318:                                              ; preds = %316
  %319 = getelementptr inbounds { ptr, i8 }, ptr %36, i32 0, i32 0
  %320 = extractvalue { ptr, i8 } %317, 0
  store ptr %320, ptr %319, align 8
  %321 = getelementptr inbounds { ptr, i8 }, ptr %36, i32 0, i32 1
  %322 = extractvalue { ptr, i8 } %317, 1
  store i8 %322, ptr %321, align 8
  br label %323

323:                                              ; preds = %318
  %324 = load i64, ptr %35, align 8, !tbaa !8
  %325 = add nsw i64 %324, 1
  store i64 %325, ptr %35, align 8, !tbaa !8
  br label %311, !llvm.loop !21

326:                                              ; preds = %316
  %327 = landingpad { ptr, i32 }
          cleanup
  %328 = extractvalue { ptr, i32 } %327, 0
  store ptr %328, ptr %4, align 8
  %329 = extractvalue { ptr, i32 } %327, 1
  store i32 %329, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #11
  br label %488

330:                                              ; preds = %315
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #11
  store i64 0, ptr %37, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #11
  store i64 0, ptr %38, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #11
  store i64 0, ptr %39, align 8, !tbaa !8
  br label %331

331:                                              ; preds = %348, %330
  %332 = load i64, ptr %39, align 8, !tbaa !8
  %333 = load i64, ptr @N, align 8, !tbaa !8
  %334 = icmp slt i64 %332, %333
  br i1 %334, label %336, label %335

335:                                              ; preds = %331
  store i32 25, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #11
  br label %351

336:                                              ; preds = %331
  %337 = load i64, ptr %39, align 8, !tbaa !8
  %338 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %337
  %339 = load i64, ptr %338, align 8, !tbaa !8
  %340 = load i64, ptr %37, align 8, !tbaa !8
  %341 = icmp sgt i64 %339, %340
  br i1 %341, label %342, label %347

342:                                              ; preds = %336
  %343 = load i64, ptr %39, align 8, !tbaa !8
  %344 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %343
  %345 = load i64, ptr %344, align 8, !tbaa !8
  store i64 %345, ptr %37, align 8, !tbaa !8
  %346 = load i64, ptr %39, align 8, !tbaa !8
  store i64 %346, ptr %38, align 8, !tbaa !8
  br label %347

347:                                              ; preds = %342, %336
  br label %348

348:                                              ; preds = %347
  %349 = load i64, ptr %39, align 8, !tbaa !8
  %350 = add nsw i64 %349, 1
  store i64 %350, ptr %39, align 8, !tbaa !8
  br label %331, !llvm.loop !22

351:                                              ; preds = %335
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #11
  %352 = load i64, ptr %38, align 8, !tbaa !8
  store i64 %352, ptr %40, align 8, !tbaa !8
  br label %353

353:                                              ; preds = %452, %351
  br label %354

354:                                              ; preds = %353
  %355 = invoke noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48) %34, ptr noundef nonnull align 8 dereferenceable(8) %40)
          to label %356 unwind label %362

356:                                              ; preds = %354
  %357 = load i64, ptr %40, align 8, !tbaa !8
  %358 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %357
  %359 = load i64, ptr %358, align 8, !tbaa !8
  %360 = icmp eq i64 %359, 1
  br i1 %360, label %361, label %366

361:                                              ; preds = %356
  br label %453

362:                                              ; preds = %483, %456, %453, %354
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %4, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %5, align 4
  br label %487

366:                                              ; preds = %356
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #11
  %367 = load i64, ptr %40, align 8, !tbaa !8
  %368 = sub nsw i64 %367, 1
  store i64 %368, ptr %41, align 8, !tbaa !8
  br label %369

369:                                              ; preds = %448, %366
  br i1 true, label %371, label %370

370:                                              ; preds = %369
  store i32 30, ptr %23, align 4
  br label %451

371:                                              ; preds = %369
  %372 = load i64, ptr %41, align 8, !tbaa !8
  %373 = icmp sge i64 %372, 0
  br i1 %373, label %374, label %375

374:                                              ; preds = %371
  br label %377

375:                                              ; preds = %371
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 102, ptr noundef @__PRETTY_FUNCTION__.main) #14
  unreachable

376:                                              ; No predecessors!
  br label %377

377:                                              ; preds = %376, %374
  %378 = load i64, ptr %41, align 8, !tbaa !8
  %379 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %378
  %380 = load i64, ptr %379, align 8, !tbaa !8
  %381 = load i64, ptr %40, align 8, !tbaa !8
  %382 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %381
  %383 = load i64, ptr %382, align 8, !tbaa !8
  %384 = sub nsw i64 %383, 1
  %385 = icmp ne i64 %380, %384
  br i1 %385, label %386, label %387

386:                                              ; preds = %377
  br label %448

387:                                              ; preds = %377
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #11
  store i64 0, ptr %42, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #11
  store i64 0, ptr %43, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %44) #11
  store i8 0, ptr %44, align 1, !tbaa !23
  br label %388

388:                                              ; preds = %438, %387
  %389 = load i64, ptr %42, align 8, !tbaa !8
  %390 = load i64, ptr %40, align 8, !tbaa !8
  %391 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %390
  %392 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %391) #11
  %393 = icmp slt i64 %389, %392
  br i1 %393, label %394, label %400

394:                                              ; preds = %388
  %395 = load i64, ptr %43, align 8, !tbaa !8
  %396 = load i64, ptr %41, align 8, !tbaa !8
  %397 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %396
  %398 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %397) #11
  %399 = icmp slt i64 %395, %398
  br label %400

400:                                              ; preds = %394, %388
  %401 = phi i1 [ false, %388 ], [ %399, %394 ]
  br i1 %401, label %402, label %439

402:                                              ; preds = %400
  call void @llvm.lifetime.start.p0(i64 16, ptr %45) #11
  %403 = load i64, ptr %40, align 8, !tbaa !8
  %404 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %403
  %405 = load i64, ptr %42, align 8, !tbaa !8
  %406 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %404, i64 noundef %405) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %45, ptr align 8 %406, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %46) #11
  %407 = load i64, ptr %41, align 8, !tbaa !8
  %408 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %407
  %409 = load i64, ptr %43, align 8, !tbaa !8
  %410 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %408, i64 noundef %409) #11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %46, ptr align 8 %410, i64 16, i1 false)
  %411 = getelementptr inbounds %"struct.std::pair.7", ptr %45, i32 0, i32 0
  %412 = load i64, ptr %411, align 8, !tbaa !17
  %413 = getelementptr inbounds %"struct.std::pair.7", ptr %46, i32 0, i32 1
  %414 = load i64, ptr %413, align 8, !tbaa !19
  %415 = icmp sle i64 %412, %414
  br i1 %415, label %416, label %423

416:                                              ; preds = %402
  %417 = getelementptr inbounds %"struct.std::pair.7", ptr %45, i32 0, i32 1
  %418 = load i64, ptr %417, align 8, !tbaa !19
  %419 = getelementptr inbounds %"struct.std::pair.7", ptr %46, i32 0, i32 0
  %420 = load i64, ptr %419, align 8, !tbaa !17
  %421 = icmp sge i64 %418, %420
  br i1 %421, label %422, label %423

422:                                              ; preds = %416
  store i8 1, ptr %44, align 1, !tbaa !23
  store i32 34, ptr %23, align 4
  br label %436

423:                                              ; preds = %416, %402
  %424 = getelementptr inbounds %"struct.std::pair.7", ptr %45, i32 0, i32 0
  %425 = load i64, ptr %424, align 8, !tbaa !17
  %426 = getelementptr inbounds %"struct.std::pair.7", ptr %46, i32 0, i32 1
  %427 = load i64, ptr %426, align 8, !tbaa !19
  %428 = icmp sgt i64 %425, %427
  br i1 %428, label %429, label %432

429:                                              ; preds = %423
  %430 = load i64, ptr %43, align 8, !tbaa !8
  %431 = add nsw i64 %430, 1
  store i64 %431, ptr %43, align 8, !tbaa !8
  br label %435

432:                                              ; preds = %423
  %433 = load i64, ptr %42, align 8, !tbaa !8
  %434 = add nsw i64 %433, 1
  store i64 %434, ptr %42, align 8, !tbaa !8
  br label %435

435:                                              ; preds = %432, %429
  store i32 0, ptr %23, align 4
  br label %436

436:                                              ; preds = %435, %422
  call void @llvm.lifetime.end.p0(i64 16, ptr %46) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %45) #11
  %437 = load i32, ptr %23, align 4
  switch i32 %437, label %496 [
    i32 0, label %438
    i32 34, label %439
  ]

438:                                              ; preds = %436
  br label %388, !llvm.loop !25

439:                                              ; preds = %436, %400
  %440 = load i8, ptr %44, align 1, !tbaa !23, !range !26, !noundef !27
  %441 = trunc i8 %440 to i1
  br i1 %441, label %442, label %444

442:                                              ; preds = %439
  %443 = load i64, ptr %41, align 8, !tbaa !8
  store i64 %443, ptr %40, align 8, !tbaa !8
  store i32 30, ptr %23, align 4
  br label %445

444:                                              ; preds = %439
  store i32 0, ptr %23, align 4
  br label %445

445:                                              ; preds = %444, %442
  call void @llvm.lifetime.end.p0(i64 1, ptr %44) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #11
  %446 = load i32, ptr %23, align 4
  switch i32 %446, label %451 [
    i32 0, label %447
  ]

447:                                              ; preds = %445
  br label %448

448:                                              ; preds = %447, %386
  %449 = load i64, ptr %41, align 8, !tbaa !8
  %450 = add nsw i64 %449, -1
  store i64 %450, ptr %41, align 8, !tbaa !8
  br label %369, !llvm.loop !28

451:                                              ; preds = %445, %370
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #11
  br label %452

452:                                              ; preds = %451
  br label %353, !llvm.loop !29

453:                                              ; preds = %361
  %454 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %34) #11
  %455 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %454)
          to label %456 unwind label %362

456:                                              ; preds = %453
  %457 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %455, i8 noundef signext 10)
          to label %458 unwind label %362

458:                                              ; preds = %456
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #11
  store ptr %34, ptr %47, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #11
  %459 = load ptr, ptr %47, align 8, !tbaa !13
  %460 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %459) #11
  %461 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %48, i32 0, i32 0
  store ptr %460, ptr %461, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #11
  %462 = load ptr, ptr %47, align 8, !tbaa !13
  %463 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %462) #11
  %464 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %49, i32 0, i32 0
  store ptr %463, ptr %464, align 8
  br label %465

465:                                              ; preds = %477, %458
  %466 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(8) %49) #11
  br i1 %466, label %468, label %467

467:                                              ; preds = %465
  store i32 35, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #11
  br label %483

468:                                              ; preds = %465
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #11
  %469 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %48) #11
  %470 = load i64, ptr %469, align 8, !tbaa !8
  store i64 %470, ptr %50, align 8, !tbaa !8
  %471 = load i64, ptr %50, align 8, !tbaa !8
  %472 = add nsw i64 %471, 1
  %473 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %472)
          to label %474 unwind label %479

474:                                              ; preds = %468
  %475 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %473, i8 noundef signext 32)
          to label %476 unwind label %479

476:                                              ; preds = %474
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #11
  br label %477

477:                                              ; preds = %476
  %478 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %48) #11
  br label %465

479:                                              ; preds = %474, %468
  %480 = landingpad { ptr, i32 }
          cleanup
  %481 = extractvalue { ptr, i32 } %480, 0
  store ptr %481, ptr %4, align 8
  %482 = extractvalue { ptr, i32 } %480, 1
  store i32 %482, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #11
  br label %487

483:                                              ; preds = %467
  %484 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %485 unwind label %362

485:                                              ; preds = %483
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %34) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr %34) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #11
  %486 = load i32, ptr %1, align 4
  ret i32 %486

487:                                              ; preds = %479, %362
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #11
  br label %488

488:                                              ; preds = %487, %326
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %34) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr %34) #11
  br label %489

489:                                              ; preds = %488, %309, %232, %218, %214, %198, %171, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #11
  br label %490

490:                                              ; preds = %489, %116
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #11
  br label %491

491:                                              ; preds = %490
  %492 = load ptr, ptr %4, align 8
  %493 = load i32, ptr %5, align 4
  %494 = insertvalue { ptr, i32 } poison, ptr %492, 0
  %495 = insertvalue { ptr, i32 } %494, i32 %493, 1
  resume { ptr, i32 } %495

496:                                              ; preds = %436
  unreachable
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segtC2Exx(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef) unnamed_addr #3 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #7

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i64 noundef) #3 align 2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #10

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 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 = { 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 #2 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nobuiltin allocsize(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 = { nobuiltin 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 #8 = { 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 #9 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { noreturn 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 #11 = { nounwind }
attributes #12 = { builtin allocsize(0) }
attributes #13 = { builtin nounwind }
attributes #14 = { noreturn nounwind }

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

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


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

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

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@d1 = external dso_local global [300000 x %"class.std::vector"], align 16
@r = external dso_local global [300000 x [3 x i64]], align 16
@cm = external dso_local global %"class.std::map", align 8
@s = external dso_local local_unnamed_addr global ptr, align 8
@dp = external dso_local local_unnamed_addr global [300000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@_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 %"class.std::set", align 8
  %2 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair.7", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.std::set", align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %26 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #11
  %27 = load i64, ptr @M, align 8, !tbaa !8
  %28 = icmp sgt i64 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %48, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #11
  %29 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #11
  store ptr %29, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #11
  %30 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #11
  store ptr %30, ptr %3, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #11
  br i1 %31, label %.lr.ph132, label %._crit_edge133

.lr.ph:                                           ; preds = %0, %48
  %.0129 = phi i64 [ %49, %48 ], [ 0, %0 ]
  %32 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %.0129
  %33 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %34 unwind label %52

34:                                               ; preds = %.lr.ph
  %35 = getelementptr inbounds i8, ptr %32, i64 8
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %37 unwind label %52

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %32, i64 16
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %40 unwind label %52

40:                                               ; preds = %37
  %41 = load <2 x i64>, ptr %32, align 8, !tbaa !8
  %42 = add nsw <2 x i64> %41, <i64 -1, i64 -1>
  store <2 x i64> %42, ptr %32, align 8, !tbaa !8
  %43 = load i64, ptr %38, align 8, !tbaa !8
  %44 = add nsw i64 %43, -1
  store i64 %44, ptr %38, align 8, !tbaa !8
  %45 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %46 unwind label %52

46:                                               ; preds = %40
  %47 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(8) %38)
          to label %48 unwind label %52

48:                                               ; preds = %46
  %49 = add nuw nsw i64 %.0129, 1
  %50 = load i64, ptr @M, align 8, !tbaa !8
  %51 = icmp slt i64 %49, %50
  br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !11

52:                                               ; preds = %46, %40, %37, %34, %.lr.ph
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %232

._crit_edge133:                                   ; preds = %59, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #11
  %54 = load i64, ptr @M, align 8, !tbaa !8
  %55 = icmp sgt i64 %54, 0
  br i1 %55, label %.lr.ph136, label %.preheader126

.lr.ph132:                                        ; preds = %._crit_edge, %59
  %.082130 = phi i64 [ %60, %59 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #11
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #11
  %57 = load i64, ptr %56, align 8, !tbaa !8
  store i64 %57, ptr %4, align 8, !tbaa !8
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cm, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %59 unwind label %63

59:                                               ; preds = %.lr.ph132
  store i64 %.082130, ptr %58, align 8, !tbaa !8
  %60 = add nuw nsw i64 %.082130, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #11
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #11
  %62 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #11
  br i1 %62, label %.lr.ph132, label %._crit_edge133

63:                                               ; preds = %.lr.ph132
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #11
  br label %232

.preheader126:                                    ; preds = %76, %._crit_edge133
  %65 = load i64, ptr @N, align 8, !tbaa !8
  %66 = icmp sgt i64 %65, 0
  br i1 %66, label %.lr.ph138, label %._crit_edge139

.lr.ph136:                                        ; preds = %._crit_edge133, %76
  %.083134 = phi i64 [ %77, %76 ], [ 0, %._crit_edge133 ]
  %67 = getelementptr inbounds [300000 x [3 x i64]], ptr @r, i64 0, i64 %.083134
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %68
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #11
  %70 = getelementptr inbounds i8, ptr %67, i64 8
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cm, ptr noundef nonnull align 8 dereferenceable(8) %70)
          to label %72 unwind label %80

72:                                               ; preds = %.lr.ph136
  %73 = getelementptr inbounds i8, ptr %67, i64 16
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @cm, ptr noundef nonnull align 8 dereferenceable(8) %73)
          to label %75 unwind label %80

75:                                               ; preds = %72
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull align 8 dereferenceable(8) %74)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %76 unwind label %80

76:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #11
  %77 = add nuw nsw i64 %.083134, 1
  %78 = load i64, ptr @M, align 8, !tbaa !8
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %.lr.ph136, label %.preheader126, !llvm.loop !13

80:                                               ; preds = %75, %72, %.lr.ph136
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #11
  br label %232

._crit_edge139:                                   ; preds = %86, %.preheader126
  %82 = invoke noalias noundef nonnull dereferenceable(56) ptr @_Znwm(i64 noundef 56) #12
          to label %92 unwind label %100

.lr.ph138:                                        ; preds = %.preheader126, %86
  %.084137 = phi i64 [ %87, %86 ], [ 0, %.preheader126 ]
  %83 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %.084137
  %84 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #11
  %85 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #11
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %84, ptr %85)
          to label %86 unwind label %90

86:                                               ; preds = %.lr.ph138
  %87 = add nuw nsw i64 %.084137, 1
  %88 = load i64, ptr @N, align 8, !tbaa !8
  %89 = icmp slt i64 %87, %88
  br i1 %89, label %.lr.ph138, label %._crit_edge139, !llvm.loop !14

90:                                               ; preds = %.lr.ph138
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %232

92:                                               ; preds = %._crit_edge139
  %93 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #11
  invoke void @_ZN4segtC2Exx(ptr noundef nonnull align 8 dereferenceable(56) %82, i64 noundef 0, i64 noundef %93)
          to label %94 unwind label %102

94:                                               ; preds = %92
  store ptr %82, ptr @s, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #11
  %95 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @d1) #11
  store ptr %95, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #11
  %96 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @d1) #11
  store ptr %96, ptr %7, align 8
  %97 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #11
  br i1 %97, label %.lr.ph141, label %._crit_edge142

._crit_edge142:                                   ; preds = %106, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  store i64 1, ptr @dp, align 16, !tbaa !8
  %98 = load i64, ptr @N, align 8, !tbaa !8
  %99 = icmp sgt i64 %98, 1
  br i1 %99, label %.lr.ph151, label %._crit_edge152

100:                                              ; preds = %._crit_edge139
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %232

102:                                              ; preds = %92
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %82, i64 noundef 56) #13
  br label %232

.lr.ph141:                                        ; preds = %94, %106
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #11
  %.sroa.042.0.copyload = load i64, ptr %104, align 8
  %.sroa.543.0..sroa_idx = getelementptr inbounds i8, ptr %104, i64 8
  %.sroa.543.0.copyload = load i64, ptr %.sroa.543.0..sroa_idx, align 8
  %105 = load ptr, ptr @s, align 8, !tbaa !15
  invoke void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(56) %105, i64 noundef %.sroa.042.0.copyload, i64 noundef %.sroa.543.0.copyload, i64 noundef 1)
          to label %106 unwind label %109

106:                                              ; preds = %.lr.ph141
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #11
  %108 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #11
  br i1 %108, label %.lr.ph141, label %._crit_edge142

109:                                              ; preds = %.lr.ph141
  %110 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  br label %232

._crit_edge152:                                   ; preds = %._crit_edge148, %._crit_edge142
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %14) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #11
  store i64 0, ptr %15, align 8, !tbaa !8
  %111 = load i64, ptr @N, align 8, !tbaa !8
  %112 = icmp sgt i64 %111, 0
  br i1 %112, label %.lr.ph154, label %._crit_edge155.thread

._crit_edge155.thread:                            ; preds = %._crit_edge152
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #11
  br label %._crit_edge161

.lr.ph151:                                        ; preds = %._crit_edge142, %._crit_edge148
  %.0100149 = phi i64 [ %133, %._crit_edge148 ], [ 1, %._crit_edge142 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #11
  store i64 0, ptr %8, align 8, !tbaa !8
  %113 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %.0100149
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #11
  %114 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %113) #11
  store ptr %114, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #11
  %115 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %113) #11
  store ptr %115, ptr %10, align 8
  %116 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #11
  br i1 %116, label %.lr.ph144, label %._crit_edge145

._crit_edge145:                                   ; preds = %126, %.lr.ph151
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #11
  %117 = load i64, ptr %8, align 8, !tbaa !8
  %118 = add nsw i64 %117, 1
  %119 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %.0100149
  store i64 %118, ptr %119, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #11
  %120 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %113) #11
  store ptr %120, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #11
  %121 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %113) #11
  store ptr %121, ptr %13, align 8
  %122 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #11
  br i1 %122, label %.lr.ph147, label %._crit_edge148

.lr.ph144:                                        ; preds = %.lr.ph151, %126
  %123 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #11
  %.sroa.030.0.copyload = load i64, ptr %123, align 8
  %.sroa.531.0..sroa_idx = getelementptr inbounds i8, ptr %123, i64 8
  %.sroa.531.0.copyload = load i64, ptr %.sroa.531.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #11
  %124 = load ptr, ptr @s, align 8, !tbaa !15
  %125 = invoke noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(56) %124, i64 noundef %.sroa.030.0.copyload, i64 noundef %.sroa.531.0.copyload)
          to label %126 unwind label %131

126:                                              ; preds = %.lr.ph144
  store i64 %125, ptr %11, align 8, !tbaa !8
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %128 = load i64, ptr %127, align 8, !tbaa !8
  store i64 %128, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #11
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #11
  %130 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #11
  br i1 %130, label %.lr.ph144, label %._crit_edge145

131:                                              ; preds = %.lr.ph144
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #11
  br label %144

._crit_edge148:                                   ; preds = %139, %._crit_edge145
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #11
  %133 = add nuw nsw i64 %.0100149, 1
  %134 = load i64, ptr @N, align 8, !tbaa !8
  %135 = icmp slt i64 %133, %134
  br i1 %135, label %.lr.ph151, label %._crit_edge152, !llvm.loop !17

.lr.ph147:                                        ; preds = %._crit_edge145, %139
  %136 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #11
  %.sroa.026.0.copyload = load i64, ptr %136, align 8
  %.sroa.527.0..sroa_idx = getelementptr inbounds i8, ptr %136, i64 8
  %.sroa.527.0.copyload = load i64, ptr %.sroa.527.0..sroa_idx, align 8
  %137 = load ptr, ptr @s, align 8, !tbaa !15
  %138 = load i64, ptr %119, align 8, !tbaa !8
  invoke void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(56) %137, i64 noundef %.sroa.026.0.copyload, i64 noundef %.sroa.527.0.copyload, i64 noundef %138)
          to label %139 unwind label %142

139:                                              ; preds = %.lr.ph147
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #11
  %141 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #11
  br i1 %141, label %.lr.ph147, label %._crit_edge148

142:                                              ; preds = %.lr.ph147
  %143 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #11
  br label %144

144:                                              ; preds = %142, %131
  %.pn109 = phi { ptr, i32 } [ %132, %131 ], [ %143, %142 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #11
  br label %232

._crit_edge155:                                   ; preds = %148
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #11
  %145 = icmp sgt i64 %151, 0
  br i1 %145, label %.lr.ph160.preheader, label %._crit_edge161

.lr.ph160.preheader:                              ; preds = %._crit_edge155
  %xtraiter = and i64 %151, 3
  %146 = icmp ult i64 %151, 4
  br i1 %146, label %._crit_edge161.loopexit.unr-lcssa, label %.lr.ph160.preheader.new

.lr.ph160.preheader.new:                          ; preds = %.lr.ph160.preheader
  %unroll_iter = and i64 %151, 9223372036854775804
  br label %.lr.ph160

.lr.ph154:                                        ; preds = %._crit_edge152, %148
  %147 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %148 unwind label %153

148:                                              ; preds = %.lr.ph154
  %149 = load i64, ptr %15, align 8, !tbaa !8
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %15, align 8, !tbaa !8
  %151 = load i64, ptr @N, align 8, !tbaa !8
  %152 = icmp slt i64 %150, %151
  br i1 %152, label %.lr.ph154, label %._crit_edge155, !llvm.loop !18

153:                                              ; preds = %.lr.ph154
  %154 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #11
  br label %231

._crit_edge161.loopexit.unr-lcssa:                ; preds = %.lr.ph160, %.lr.ph160.preheader
  %spec.select115.lcssa.ph = phi i64 [ poison, %.lr.ph160.preheader ], [ %spec.select115.3, %.lr.ph160 ]
  %.095158.unr = phi i64 [ 0, %.lr.ph160.preheader ], [ %174, %.lr.ph160 ]
  %.096157.unr = phi i64 [ 0, %.lr.ph160.preheader ], [ %spec.select115.3, %.lr.ph160 ]
  %.098156.unr = phi i64 [ 0, %.lr.ph160.preheader ], [ %spec.select.3, %.lr.ph160 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge161, label %.lr.ph160.epil

.lr.ph160.epil:                                   ; preds = %._crit_edge161.loopexit.unr-lcssa, %.lr.ph160.epil
  %.095158.epil = phi i64 [ %158, %.lr.ph160.epil ], [ %.095158.unr, %._crit_edge161.loopexit.unr-lcssa ]
  %.096157.epil = phi i64 [ %spec.select115.epil, %.lr.ph160.epil ], [ %.096157.unr, %._crit_edge161.loopexit.unr-lcssa ]
  %.098156.epil = phi i64 [ %spec.select.epil, %.lr.ph160.epil ], [ %.098156.unr, %._crit_edge161.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph160.epil ], [ 0, %._crit_edge161.loopexit.unr-lcssa ]
  %155 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %.095158.epil
  %156 = load i64, ptr %155, align 8, !tbaa !8
  %157 = icmp sgt i64 %156, %.098156.epil
  %spec.select.epil = call i64 @llvm.smax.i64(i64 %156, i64 %.098156.epil)
  %spec.select115.epil = select i1 %157, i64 %.095158.epil, i64 %.096157.epil
  %158 = add nuw nsw i64 %.095158.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge161, label %.lr.ph160.epil, !llvm.loop !19

._crit_edge161:                                   ; preds = %._crit_edge161.loopexit.unr-lcssa, %.lr.ph160.epil, %._crit_edge155.thread, %._crit_edge155
  %.096.lcssa = phi i64 [ 0, %._crit_edge155 ], [ 0, %._crit_edge155.thread ], [ %spec.select115.lcssa.ph, %._crit_edge161.loopexit.unr-lcssa ], [ %spec.select115.epil, %.lr.ph160.epil ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #11
  br label %.critedge.thread

.lr.ph160:                                        ; preds = %.lr.ph160, %.lr.ph160.preheader.new
  %.095158 = phi i64 [ 0, %.lr.ph160.preheader.new ], [ %174, %.lr.ph160 ]
  %.096157 = phi i64 [ 0, %.lr.ph160.preheader.new ], [ %spec.select115.3, %.lr.ph160 ]
  %.098156 = phi i64 [ 0, %.lr.ph160.preheader.new ], [ %spec.select.3, %.lr.ph160 ]
  %niter = phi i64 [ 0, %.lr.ph160.preheader.new ], [ %niter.next.3, %.lr.ph160 ]
  %159 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %.095158
  %160 = load i64, ptr %159, align 16, !tbaa !8
  %161 = icmp sgt i64 %160, %.098156
  %spec.select = call i64 @llvm.smax.i64(i64 %160, i64 %.098156)
  %spec.select115 = select i1 %161, i64 %.095158, i64 %.096157
  %162 = or disjoint i64 %.095158, 1
  %163 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !8
  %165 = icmp sgt i64 %164, %spec.select
  %spec.select.1 = call i64 @llvm.smax.i64(i64 %164, i64 %spec.select)
  %spec.select115.1 = select i1 %165, i64 %162, i64 %spec.select115
  %166 = or disjoint i64 %.095158, 2
  %167 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %166
  %168 = load i64, ptr %167, align 16, !tbaa !8
  %169 = icmp sgt i64 %168, %spec.select.1
  %spec.select.2 = call i64 @llvm.smax.i64(i64 %168, i64 %spec.select.1)
  %spec.select115.2 = select i1 %169, i64 %166, i64 %spec.select115.1
  %170 = or disjoint i64 %.095158, 3
  %171 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !8
  %173 = icmp sgt i64 %172, %spec.select.2
  %spec.select.3 = call i64 @llvm.smax.i64(i64 %172, i64 %spec.select.2)
  %spec.select115.3 = select i1 %173, i64 %170, i64 %spec.select115.2
  %174 = add nuw nsw i64 %.095158, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge161.loopexit.unr-lcssa, label %.lr.ph160, !llvm.loop !21

.critedge.thread:                                 ; preds = %195, %._crit_edge161
  %storemerge124 = phi i64 [ %.096.lcssa, %._crit_edge161 ], [ %.094168, %195 ]
  store i64 %storemerge124, ptr %16, align 8, !tbaa !8
  %175 = invoke noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %176 unwind label %.loopexit

176:                                              ; preds = %.critedge.thread
  %177 = load i64, ptr %16, align 8, !tbaa !8
  %178 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !8
  %180 = icmp eq i64 %179, 1
  br i1 %180, label %208, label %.preheader125

.preheader125:                                    ; preds = %176
  %181 = icmp sgt i64 %177, 0
  br i1 %181, label %.lr.ph170, label %.preheader125._crit_edge

.loopexit:                                        ; preds = %.critedge.thread
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %230

.loopexit.split-lp:                               ; preds = %208, %211, %._crit_edge174
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %230

.preheader125._crit_edge:                         ; preds = %.preheader125, %.critedge117
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, i32 noundef 102, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #14
  unreachable

.lr.ph170:                                        ; preds = %.preheader125, %.critedge117
  %.094168.in = phi i64 [ %.094168, %.critedge117 ], [ %177, %.preheader125 ]
  %.094168 = add nsw i64 %.094168.in, -1
  %182 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %.094168
  %183 = load i64, ptr %182, align 8, !tbaa !8
  %184 = load i64, ptr %16, align 8, !tbaa !8
  %185 = getelementptr inbounds [300000 x i64], ptr @dp, i64 0, i64 %184
  %186 = load i64, ptr %185, align 8, !tbaa !8
  %187 = add nsw i64 %186, -1
  %.not = icmp eq i64 %183, %187
  br i1 %.not, label %.preheader, label %.critedge117

.preheader:                                       ; preds = %.lr.ph170
  %188 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %184
  %189 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %188) #11
  %190 = icmp sgt i64 %189, 0
  br i1 %190, label %.lr.ph165, label %.critedge117

.lr.ph165:                                        ; preds = %.preheader
  %191 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %.094168
  br label %192

192:                                              ; preds = %.lr.ph165, %200
  %.088164 = phi i64 [ 0, %.lr.ph165 ], [ %.189, %200 ]
  %.091163 = phi i64 [ 0, %.lr.ph165 ], [ %.192, %200 ]
  %193 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %191) #11
  %194 = icmp slt i64 %.088164, %193
  br i1 %194, label %195, label %.critedge117

195:                                              ; preds = %192
  %196 = load i64, ptr %16, align 8, !tbaa !8
  %197 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %196
  %198 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %197, i64 noundef %.091163) #11
  %.sroa.03.0.copyload = load i64, ptr %198, align 8
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %198, i64 8
  %.sroa.5.0.copyload = load i64, ptr %.sroa.5.0..sroa_idx, align 8
  %199 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %191, i64 noundef %.088164) #11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %199, i64 8
  %.sroa.4.0.copyload = load i64, ptr %.sroa.4.0..sroa_idx, align 8
  %.not104 = icmp sgt i64 %.sroa.03.0.copyload, %.sroa.4.0.copyload
  %.sroa.0.0.copyload = load i64, ptr %199, align 8
  %.not105 = icmp slt i64 %.sroa.5.0.copyload, %.sroa.0.0.copyload
  %or.cond = select i1 %.not104, i1 true, i1 %.not105
  br i1 %or.cond, label %200, label %.critedge.thread, !llvm.loop !22

200:                                              ; preds = %195
  %not..not104 = xor i1 %.not104, true
  %201 = zext i1 %not..not104 to i64
  %.192 = add nuw nsw i64 %.091163, %201
  %202 = zext i1 %.not104 to i64
  %.189 = add nuw nsw i64 %.088164, %202
  %203 = load i64, ptr %16, align 8, !tbaa !8
  %204 = getelementptr inbounds [300000 x %"class.std::vector"], ptr @d1, i64 0, i64 %203
  %205 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %204) #11
  %206 = icmp slt i64 %.192, %205
  br i1 %206, label %192, label %.critedge117

.critedge117:                                     ; preds = %200, %192, %.preheader, %.lr.ph170
  %207 = icmp sgt i64 %.094168.in, 1
  br i1 %207, label %.lr.ph170, label %.preheader125._crit_edge, !llvm.loop !23

208:                                              ; preds = %176
  %209 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %14) #11
  %210 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %209)
          to label %211 unwind label %.loopexit.split-lp

211:                                              ; preds = %208
  %212 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %210, i8 noundef signext 10)
          to label %213 unwind label %.loopexit.split-lp

213:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #11
  %214 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %14) #11
  store ptr %214, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #11
  %215 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %14) #11
  store ptr %215, ptr %18, align 8
  %216 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #11
  br i1 %216, label %.lr.ph173, label %._crit_edge174

._crit_edge174:                                   ; preds = %224, %213
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #11
  %217 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %229 unwind label %.loopexit.split-lp

.lr.ph173:                                        ; preds = %213, %224
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #11
  %219 = load i64, ptr %218, align 8, !tbaa !8
  %220 = add nsw i64 %219, 1
  %221 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %220)
          to label %222 unwind label %227

222:                                              ; preds = %.lr.ph173
  %223 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %221, i8 noundef signext 32)
          to label %224 unwind label %227

224:                                              ; preds = %222
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #11
  %226 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #11
  br i1 %226, label %.lr.ph173, label %._crit_edge174

227:                                              ; preds = %222, %.lr.ph173
  %228 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #11
  br label %230

229:                                              ; preds = %._crit_edge174
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %14) #11
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #11
  ret i32 0

230:                                              ; preds = %.loopexit, %.loopexit.split-lp, %227
  %.pn = phi { ptr, i32 } [ %228, %227 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #11
  br label %231

231:                                              ; preds = %230, %153
  %.pn107 = phi { ptr, i32 } [ %154, %153 ], [ %.pn, %230 ]
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %14) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %14) #11
  br label %232

232:                                              ; preds = %63, %80, %90, %100, %102, %109, %144, %231, %52
  %.pn113 = phi { ptr, i32 } [ %53, %52 ], [ %64, %63 ], [ %81, %80 ], [ %91, %90 ], [ %110, %109 ], [ %.pn109, %144 ], [ %.pn107, %231 ], [ %103, %102 ], [ %101, %100 ]
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #11
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #11
  resume { ptr, i32 } %.pn113
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segtC2Exx(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef) unnamed_addr #3 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #7

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #9

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #10

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

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

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


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