; LLVM IR from eyangch/competitive-programming :: Codeforces/1194 (e)

; 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<line, std::allocator<line>>::_Vector_impl" }
%"struct.std::_Vector_base<line, std::allocator<line>>::_Vector_impl" = type { %"struct.std::_Vector_base<line, std::allocator<line>>::_Vector_impl_data" }
%"struct.std::_Vector_base<line, std::allocator<line>>::_Vector_impl_data" = type { 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" }
%struct.line = type { i64, i64, i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<long long, long long>, std::_Identity<std::pair<long long, long long>>, std::greater<std::pair<long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<long long, long long>, std::_Identity<std::pair<long long, long long>>, std::greater<std::pair<long long, 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 }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i64, align 8
@BIT = external dso_local global [30000 x i64], align 16
@v = external dso_local global %"class.std::vector", align 8
@h = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7line_sf4lineS_(ptr noundef byval(%struct.line) align 8, ptr noundef byval(%struct.line) align 8) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updxx(i64 noundef, i64 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3qryx(i64 noundef) #0

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

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

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

40:                                               ; preds = %86, %0
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %89

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %50 = load i64, ptr %3, align 8, !tbaa !8
  %51 = load i64, ptr %5, align 8, !tbaa !8
  %52 = icmp sgt i64 %50, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %45
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br label %54

54:                                               ; preds = %53, %45
  %55 = load i64, ptr %4, align 8, !tbaa !8
  %56 = load i64, ptr %6, align 8, !tbaa !8
  %57 = icmp sgt i64 %55, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br label %59

59:                                               ; preds = %58, %54
  %60 = load i64, ptr %3, align 8, !tbaa !8
  %61 = add nsw i64 %60, 5001
  store i64 %61, ptr %3, align 8, !tbaa !8
  %62 = load i64, ptr %5, align 8, !tbaa !8
  %63 = add nsw i64 %62, 5001
  store i64 %63, ptr %5, align 8, !tbaa !8
  %64 = load i64, ptr %4, align 8, !tbaa !8
  %65 = add nsw i64 %64, 5001
  store i64 %65, ptr %4, align 8, !tbaa !8
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = add nsw i64 %66, 5001
  store i64 %67, ptr %6, align 8, !tbaa !8
  %68 = load i64, ptr %3, align 8, !tbaa !8
  %69 = load i64, ptr %5, align 8, !tbaa !8
  %70 = icmp eq i64 %68, %69
  br i1 %70, label %71, label %78

71:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  %72 = getelementptr inbounds %struct.line, ptr %7, i32 0, i32 0
  %73 = load i64, ptr %3, align 8, !tbaa !8
  store i64 %73, ptr %72, align 8, !tbaa !11
  %74 = getelementptr inbounds %struct.line, ptr %7, i32 0, i32 1
  %75 = load i64, ptr %4, align 8, !tbaa !8
  store i64 %75, ptr %74, align 8, !tbaa !13
  %76 = getelementptr inbounds %struct.line, ptr %7, i32 0, i32 2
  %77 = load i64, ptr %6, align 8, !tbaa !8
  store i64 %77, ptr %76, align 8, !tbaa !14
  call void @_ZNSt6vectorI4lineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @v, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  br label %85

78:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  %79 = getelementptr inbounds %struct.line, ptr %8, i32 0, i32 0
  %80 = load i64, ptr %4, align 8, !tbaa !8
  store i64 %80, ptr %79, align 8, !tbaa !11
  %81 = getelementptr inbounds %struct.line, ptr %8, i32 0, i32 1
  %82 = load i64, ptr %3, align 8, !tbaa !8
  store i64 %82, ptr %81, align 8, !tbaa !13
  %83 = getelementptr inbounds %struct.line, ptr %8, i32 0, i32 2
  %84 = load i64, ptr %5, align 8, !tbaa !8
  store i64 %84, ptr %83, align 8, !tbaa !14
  call void @_ZNSt6vectorI4lineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @h, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  br label %85

85:                                               ; preds = %78, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %86

86:                                               ; preds = %85
  %87 = load i64, ptr %2, align 8, !tbaa !8
  %88 = add nsw i64 %87, 1
  store i64 %88, ptr %2, align 8, !tbaa !8
  br label %40, !llvm.loop !15

89:                                               ; preds = %44
  %90 = call ptr @_ZNSt6vectorI4lineSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %91 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %90, ptr %91, align 8
  %92 = call ptr @_ZNSt6vectorI4lineSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8
  %96 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4lineSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %95, ptr %97, ptr noundef @_Z7line_sf4lineS_)
  %98 = call ptr @_ZNSt6vectorI4lineSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @h) #7
  %99 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  %100 = call ptr @_ZNSt6vectorI4lineSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @h) #7
  %101 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %100, ptr %101, align 8
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8
  %104 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4lineSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %103, ptr %105, ptr noundef @_Z7line_sf4lineS_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %106

106:                                              ; preds = %248, %89
  %107 = load i64, ptr %14, align 8, !tbaa !8
  %108 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %109 = icmp slt i64 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %252

111:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 48, ptr %16) #7
  call void @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !17
  %112 = invoke noundef ptr @_ZSt6fill_nIPxiiET_S1_T0_RKT1_(ptr noundef @BIT, i32 noundef 30000, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %113 unwind label %119

113:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 0, ptr %20, align 8, !tbaa !8
  br label %114

114:                                              ; preds = %149, %113
  %115 = load i64, ptr %20, align 8, !tbaa !8
  %116 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @h) #7
  %117 = icmp slt i64 %115, %116
  br i1 %117, label %123, label %118

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

119:                                              ; preds = %111
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %18, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %251

123:                                              ; preds = %114
  %124 = load i64, ptr %20, align 8, !tbaa !8
  %125 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @h, i64 noundef %124) #7
  %126 = getelementptr inbounds %struct.line, ptr %125, i32 0, i32 1
  %127 = load i64, ptr %126, align 8, !tbaa !13
  %128 = load i64, ptr %14, align 8, !tbaa !8
  %129 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %128) #7
  %130 = getelementptr inbounds %struct.line, ptr %129, i32 0, i32 0
  %131 = load i64, ptr %130, align 8, !tbaa !11
  %132 = icmp sle i64 %127, %131
  br i1 %132, label %133, label %148

133:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %134 = load i64, ptr %20, align 8, !tbaa !8
  %135 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @h, i64 noundef %134) #7
  %136 = getelementptr inbounds %struct.line, ptr %135, i32 0, i32 2
  %137 = load i64, ptr %20, align 8, !tbaa !8
  %138 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @h, i64 noundef %137) #7
  %139 = getelementptr inbounds %struct.line, ptr %138, i32 0, i32 0
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %136, ptr noundef nonnull align 8 dereferenceable(8) %139)
          to label %140 unwind label %144

140:                                              ; preds = %133
  %141 = invoke ptr @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %142 unwind label %144

142:                                              ; preds = %140
  %143 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %141, ptr %143, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %148

144:                                              ; preds = %140, %133
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %18, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %251

148:                                              ; preds = %142, %123
  br label %149

149:                                              ; preds = %148
  %150 = load i64, ptr %20, align 8, !tbaa !8
  %151 = add nsw i64 %150, 1
  store i64 %151, ptr %20, align 8, !tbaa !8
  br label %114, !llvm.loop !19

152:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %153 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %154 = sub nsw i64 %153, 1
  store i64 %154, ptr %23, align 8, !tbaa !8
  br label %155

155:                                              ; preds = %229, %152
  %156 = load i64, ptr %23, align 8, !tbaa !8
  %157 = load i64, ptr %14, align 8, !tbaa !8
  %158 = icmp sgt i64 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %247

160:                                              ; preds = %155
  br label %161

161:                                              ; preds = %188, %160
  %162 = call noundef i64 @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %16) #7
  %163 = icmp ne i64 %162, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  br i1 %163, label %164, label %175

164:                                              ; preds = %161
  %165 = call ptr @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %16) #7
  %166 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %165, ptr %166, align 8
  %167 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  %168 = getelementptr inbounds %"struct.std::pair", ptr %167, i32 0, i32 0
  %169 = load i64, ptr %168, align 8, !tbaa !20
  %170 = load i64, ptr %23, align 8, !tbaa !8
  %171 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %170) #7
  %172 = getelementptr inbounds %struct.line, ptr %171, i32 0, i32 0
  %173 = load i64, ptr %172, align 8, !tbaa !11
  %174 = icmp sge i64 %169, %173
  br label %175

175:                                              ; preds = %164, %161
  %176 = phi i1 [ false, %161 ], [ %174, %164 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br i1 %176, label %177, label %194

177:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %178 = call ptr @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %16) #7
  %179 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %178, ptr %179, align 8
  %180 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  %181 = getelementptr inbounds %"struct.std::pair", ptr %180, i32 0, i32 1
  %182 = load i64, ptr %181, align 8, !tbaa !22
  call void @_Z3updxx(i64 noundef %182, i64 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  %183 = call ptr @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %16) #7
  %184 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %26, i32 0, i32 0
  store ptr %183, ptr %184, align 8
  %185 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %26, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8
  %187 = invoke ptr @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr %186)
          to label %188 unwind label %190

188:                                              ; preds = %177
  %189 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %187, ptr %189, align 8
  br label %161, !llvm.loop !23

190:                                              ; preds = %177
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %18, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %19, align 4
  br label %246

194:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %195 = load i64, ptr %14, align 8, !tbaa !8
  %196 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %195) #7
  %197 = getelementptr inbounds %struct.line, ptr %196, i32 0, i32 1
  %198 = load i64, ptr %23, align 8, !tbaa !8
  %199 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %198) #7
  %200 = getelementptr inbounds %struct.line, ptr %199, i32 0, i32 1
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %197, ptr noundef nonnull align 8 dereferenceable(8) %200)
          to label %202 unwind label %232

202:                                              ; preds = %194
  %203 = load i64, ptr %201, align 8, !tbaa !8
  store i64 %203, ptr %28, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %204 = load i64, ptr %14, align 8, !tbaa !8
  %205 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %204) #7
  %206 = getelementptr inbounds %struct.line, ptr %205, i32 0, i32 2
  %207 = load i64, ptr %23, align 8, !tbaa !8
  %208 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %207) #7
  %209 = getelementptr inbounds %struct.line, ptr %208, i32 0, i32 2
  %210 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %206, ptr noundef nonnull align 8 dereferenceable(8) %209)
          to label %211 unwind label %236

211:                                              ; preds = %202
  %212 = load i64, ptr %210, align 8, !tbaa !8
  store i64 %212, ptr %29, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  store i64 0, ptr %31, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %213 = load i64, ptr %29, align 8, !tbaa !8
  %214 = call noundef i64 @_Z3qryx(i64 noundef %213)
  %215 = load i64, ptr %28, align 8, !tbaa !8
  %216 = sub nsw i64 %215, 1
  %217 = call noundef i64 @_Z3qryx(i64 noundef %216)
  %218 = sub nsw i64 %214, %217
  store i64 %218, ptr %32, align 8, !tbaa !8
  %219 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %220 unwind label %240

220:                                              ; preds = %211
  %221 = load i64, ptr %219, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  store i64 %221, ptr %30, align 8, !tbaa !8
  %222 = load i64, ptr %30, align 8, !tbaa !8
  %223 = sub nsw i64 %222, 1
  %224 = load i64, ptr %30, align 8, !tbaa !8
  %225 = mul nsw i64 %223, %224
  %226 = sdiv i64 %225, 2
  %227 = load i64, ptr %13, align 8, !tbaa !8
  %228 = add nsw i64 %227, %226
  store i64 %228, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %229

229:                                              ; preds = %220
  %230 = load i64, ptr %23, align 8, !tbaa !8
  %231 = add nsw i64 %230, -1
  store i64 %231, ptr %23, align 8, !tbaa !8
  br label %155, !llvm.loop !24

232:                                              ; preds = %194
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %18, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %19, align 4
  br label %245

236:                                              ; preds = %202
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %18, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %19, align 4
  br label %244

240:                                              ; preds = %211
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %18, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %244

244:                                              ; preds = %240, %236
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %245

245:                                              ; preds = %244, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %246

246:                                              ; preds = %245, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %251

247:                                              ; preds = %159
  call void @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #7
  br label %248

248:                                              ; preds = %247
  %249 = load i64, ptr %14, align 8, !tbaa !8
  %250 = add nsw i64 %249, 1
  store i64 %250, ptr %14, align 8, !tbaa !8
  br label %106, !llvm.loop !25

251:                                              ; preds = %246, %144, %119
  call void @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %257

252:                                              ; preds = %110
  %253 = load i64, ptr %13, align 8, !tbaa !8
  %254 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %253)
  %255 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %254, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %256 = load i32, ptr %1, align 4
  ret i32 %256

257:                                              ; preds = %251
  %258 = load ptr, ptr %18, align 8
  %259 = load i32, ptr %19, align 4
  %260 = insertvalue { ptr, i32 } poison, ptr %258, 0
  %261 = insertvalue { ptr, i32 } %260, i32 %259, 1
  resume { ptr, i32 } %261
}

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

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #4 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 #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) #4 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)) #5

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

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

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

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

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


; 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<line, std::allocator<line>>::_Vector_impl" }
%"struct.std::_Vector_base<line, std::allocator<line>>::_Vector_impl" = type { %"struct.std::_Vector_base<line, std::allocator<line>>::_Vector_impl_data" }
%"struct.std::_Vector_base<line, std::allocator<line>>::_Vector_impl_data" = type { 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" }
%struct.line = type { i64, i64, i64 }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<long long, long long>, std::_Identity<std::pair<long long, long long>>, std::greater<std::pair<long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<long long, long long>, std::_Identity<std::pair<long long, long long>>, std::greater<std::pair<long long, 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 }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i64, align 8
@BIT = external dso_local global [30000 x i64], align 16
@v = external dso_local global %"class.std::vector", align 8
@h = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7line_sf4lineS_(ptr noundef byval(%struct.line) align 8, ptr noundef byval(%struct.line) align 8) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3qryx(i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %struct.line, align 8
  %6 = alloca %struct.line, align 8
  %7 = alloca %"class.std::multiset", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", 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 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %20 = 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)
  %21 = load i64, ptr @N, align 8, !tbaa !8
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %23 = getelementptr inbounds i8, ptr %6, i64 8
  %24 = getelementptr inbounds i8, ptr %6, i64 16
  %25 = getelementptr inbounds i8, ptr %5, i64 8
  %26 = getelementptr inbounds i8, ptr %5, i64 16
  br label %33

._crit_edge:                                      ; preds = %59, %0
  %27 = call ptr @_ZNSt6vectorI4lineSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %28 = call ptr @_ZNSt6vectorI4lineSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4lineSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %27, ptr %28, ptr noundef nonnull @_Z7line_sf4lineS_)
  %29 = call ptr @_ZNSt6vectorI4lineSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @h) #7
  %30 = call ptr @_ZNSt6vectorI4lineSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @h) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4lineSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %29, ptr %30, ptr noundef nonnull @_Z7line_sf4lineS_)
  %31 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %.lr.ph57, label %._crit_edge58

33:                                               ; preds = %.lr.ph, %59
  %.045 = phi i64 [ 0, %.lr.ph ], [ %60, %59 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %38 = load i64, ptr %1, align 8, !tbaa !8
  %39 = load i64, ptr %3, align 8, !tbaa !8
  %40 = icmp sgt i64 %38, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %33
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  br label %42

42:                                               ; preds = %41, %33
  %43 = load i64, ptr %2, align 8, !tbaa !8
  %44 = load i64, ptr %4, align 8, !tbaa !8
  %45 = icmp sgt i64 %43, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %42
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %.pre = load i64, ptr %2, align 8, !tbaa !8
  %.pre60 = load i64, ptr %4, align 8, !tbaa !8
  br label %47

47:                                               ; preds = %46, %42
  %48 = phi i64 [ %.pre60, %46 ], [ %44, %42 ]
  %49 = phi i64 [ %.pre, %46 ], [ %43, %42 ]
  %50 = load i64, ptr %1, align 8, !tbaa !8
  %51 = add nsw i64 %50, 5001
  store i64 %51, ptr %1, align 8, !tbaa !8
  %52 = load i64, ptr %3, align 8, !tbaa !8
  %53 = add nsw i64 %52, 5001
  store i64 %53, ptr %3, align 8, !tbaa !8
  %54 = add nsw i64 %49, 5001
  store i64 %54, ptr %2, align 8, !tbaa !8
  %55 = add nsw i64 %48, 5001
  store i64 %55, ptr %4, align 8, !tbaa !8
  %56 = icmp eq i64 %50, %52
  br i1 %56, label %57, label %58

57:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  store i64 %51, ptr %5, align 8, !tbaa !11
  store i64 %54, ptr %25, align 8, !tbaa !13
  store i64 %55, ptr %26, align 8, !tbaa !14
  call void @_ZNSt6vectorI4lineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @v, ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %59

58:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  store i64 %54, ptr %6, align 8, !tbaa !11
  store i64 %51, ptr %23, align 8, !tbaa !13
  store i64 %53, ptr %24, align 8, !tbaa !14
  call void @_ZNSt6vectorI4lineSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) @h, ptr noundef nonnull align 8 dereferenceable(24) %6)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %59

59:                                               ; preds = %58, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %60 = add nuw nsw i64 %.045, 1
  %61 = load i64, ptr @N, align 8, !tbaa !8
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %33, label %._crit_edge, !llvm.loop !15

._crit_edge58:                                    ; preds = %._crit_edge53, %._crit_edge
  %.032.lcssa = phi i64 [ 0, %._crit_edge ], [ %.1.lcssa, %._crit_edge53 ]
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.032.lcssa)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str)
  ret i32 0

.lr.ph57:                                         ; preds = %._crit_edge, %._crit_edge53
  %.03255 = phi i64 [ %.1.lcssa, %._crit_edge53 ], [ 0, %._crit_edge ]
  %.03354 = phi i64 [ %90, %._crit_edge53 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #7
  call void @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !17
  %65 = invoke noundef ptr @_ZSt6fill_nIPxiiET_S1_T0_RKT1_(ptr noundef nonnull @BIT, i32 noundef 30000, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %66 unwind label %71

66:                                               ; preds = %.lr.ph57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %67 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @h) #7
  %68 = icmp sgt i64 %67, 0
  br i1 %68, label %.lr.ph48, label %._crit_edge49

._crit_edge49:                                    ; preds = %86, %66
  %69 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %.03550 = add nsw i64 %69, -1
  %70 = icmp sgt i64 %.03550, %.03354
  br i1 %70, label %.preheader, label %._crit_edge53

71:                                               ; preds = %.lr.ph57
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %133

.lr.ph48:                                         ; preds = %66, %86
  %.03746 = phi i64 [ %87, %86 ], [ 0, %66 ]
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @h, i64 noundef %.03746) #7
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = load i64, ptr %74, align 8, !tbaa !13
  %76 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.03354) #7
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %.not39 = icmp sgt i64 %75, %77
  br i1 %.not39, label %86, label %78

78:                                               ; preds = %.lr.ph48
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %79 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @h, i64 noundef %.03746) #7
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %81 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @h, i64 noundef %.03746) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull align 8 dereferenceable(8) %81)
  %82 = invoke ptr @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %83 unwind label %84

83:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  br label %86

84:                                               ; preds = %78
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  br label %133

86:                                               ; preds = %.lr.ph48, %83
  %87 = add nuw nsw i64 %.03746, 1
  %88 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @h) #7
  %89 = icmp slt i64 %87, %88
  br i1 %89, label %.lr.ph48, label %._crit_edge49, !llvm.loop !19

.preheader:                                       ; preds = %._crit_edge49, %.loopexit
  %.03552 = phi i64 [ %.035, %.loopexit ], [ %.03550, %._crit_edge49 ]
  %.151 = phi i64 [ %131, %.loopexit ], [ %.03255, %._crit_edge49 ]
  br label %93

._crit_edge53:                                    ; preds = %.loopexit, %._crit_edge49
  %.1.lcssa = phi i64 [ %.03255, %._crit_edge49 ], [ %131, %.loopexit ]
  call void @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #7
  %90 = add nuw nsw i64 %.03354, 1
  %91 = call noundef i64 @_ZNKSt6vectorI4lineSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %92 = icmp slt i64 %90, %91
  br i1 %92, label %.lr.ph57, label %._crit_edge58, !llvm.loop !20

93:                                               ; preds = %.preheader, %101
  %94 = call noundef i64 @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #7
  %.not = icmp eq i64 %94, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  br i1 %.not, label %.critedge, label %95

95:                                               ; preds = %93
  %96 = call ptr @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #7
  store ptr %96, ptr %10, align 8
  %97 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %98 = load i64, ptr %97, align 8, !tbaa !21
  %99 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.03552) #7
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %.not38 = icmp slt i64 %98, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %.not38, label %.loopexit, label %101

101:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %102 = call ptr @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #7
  store ptr %102, ptr %11, align 8
  %103 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %104 = getelementptr inbounds i8, ptr %103, i64 8
  %105 = load i64, ptr %104, align 8, !tbaa !23
  call void @_Z3updxx(i64 noundef %105, i64 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  %106 = call ptr @_ZNKSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #7
  %107 = invoke ptr @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr %106)
          to label %93 unwind label %108, !llvm.loop !24

108:                                              ; preds = %101
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %133

.critedge:                                        ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %.loopexit

.loopexit:                                        ; preds = %95, %.critedge
  %110 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.03354) #7
  %111 = getelementptr inbounds i8, ptr %110, i64 8
  %112 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.03552) #7
  %113 = getelementptr inbounds i8, ptr %112, i64 8
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull align 8 dereferenceable(8) %113)
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %116 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.03354) #7
  %117 = getelementptr inbounds i8, ptr %116, i64 16
  %118 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4lineSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.03552) #7
  %119 = getelementptr inbounds i8, ptr %118, i64 16
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef nonnull align 8 dereferenceable(8) %119)
  %121 = load i64, ptr %120, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %122 = call noundef i64 @_Z3qryx(i64 noundef %121)
  %123 = add nsw i64 %115, -1
  %124 = call noundef i64 @_Z3qryx(i64 noundef %123)
  %125 = sub nsw i64 %122, %124
  store i64 %125, ptr %13, align 8, !tbaa !8
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %127 = load i64, ptr %126, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %128 = add nsw i64 %127, -1
  %129 = mul nsw i64 %128, %127
  %130 = sdiv i64 %129, 2
  %131 = add nsw i64 %130, %.151
  %.035 = add nsw i64 %.03552, -1
  %132 = icmp sgt i64 %.035, %.03354
  br i1 %132, label %.preheader, label %._crit_edge53, !llvm.loop !25

133:                                              ; preds = %108, %84, %71
  %.pn = phi { ptr, i32 } [ %85, %84 ], [ %109, %108 ], [ %72, %71 ]
  call void @_ZNSt8multisetISt4pairIxxESt7greaterIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn
}

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

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass