; LLVM IR from DionysiosB/CodeForces :: 1300-1399 (1310A-Recommendations)

; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, std::multiset<long long>>, std::_Select1st<std::pair<const long long, std::multiset<long long>>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, std::multiset<long long>>, std::_Select1st<std::pair<const long long, std::multiset<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::map.3" = type { %"class.std::_Rb_tree.4" }
%"class.std::_Rb_tree.4" = 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" }
%"class.std::set" = type { %"class.std::_Rb_tree.8" }
%"class.std::_Rb_tree.8" = 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 }
%"class.std::multiset" = type { %"class.std::_Rb_tree.8" }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_const_iterator" }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::map", align 8
  %10 = alloca %"class.std::map.3", align 8
  %11 = alloca %"class.std::set", align 8
  %12 = alloca i64, align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"class.std::multiset", align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca %"class.std::multiset", 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 %"struct.std::_Rb_tree_const_iterator", align 8
  %29 = alloca i64, align 8
  %30 = alloca %"class.std::reverse_iterator", align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %33 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca %"class.std::reverse_iterator", align 8
  %37 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %38 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %39 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %40 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  %42 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %42, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %43 unwind label %51

43:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  %44 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %44, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %45 unwind label %55

45:                                               ; preds = %43
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #6
  call void @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #6
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %72, %45
  %47 = load i64, ptr %12, align 8, !tbaa !5
  %48 = load i64, ptr %2, align 8, !tbaa !5
  %49 = icmp slt i64 %47, %48
  br i1 %49, label %59, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %79

51:                                               ; preds = %0
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %5, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  br label %263

55:                                               ; preds = %43
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %5, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  br label %262

59:                                               ; preds = %46
  %60 = load i64, ptr %12, align 8, !tbaa !5
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %60) #6
  %62 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %61)
          to label %63 unwind label %75

63:                                               ; preds = %59
  %64 = load i64, ptr %12, align 8, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %64) #6
  %66 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(8) %65)
          to label %67 unwind label %75

67:                                               ; preds = %63
  %68 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 0
  %69 = extractvalue { ptr, i8 } %66, 0
  store ptr %69, ptr %68, align 8
  %70 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 1
  %71 = extractvalue { ptr, i8 } %66, 1
  store i8 %71, ptr %70, align 8
  br label %72

72:                                               ; preds = %67
  %73 = load i64, ptr %12, align 8, !tbaa !5
  %74 = add nsw i64 %73, 1
  store i64 %74, ptr %12, align 8, !tbaa !5
  br label %46, !llvm.loop !9

75:                                               ; preds = %63, %59
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %5, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %261

79:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %90, %79
  %81 = load i64, ptr %14, align 8, !tbaa !5
  %82 = load i64, ptr %2, align 8, !tbaa !5
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %97

85:                                               ; preds = %80
  %86 = load i64, ptr %14, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %86) #6
  %88 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %87)
          to label %89 unwind label %93

89:                                               ; preds = %85
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %14, align 8, !tbaa !5
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %14, align 8, !tbaa !5
  br label %80, !llvm.loop !11

93:                                               ; preds = %85
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %5, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %261

97:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %122, %97
  %99 = load i64, ptr %15, align 8, !tbaa !5
  %100 = load i64, ptr %2, align 8, !tbaa !5
  %101 = icmp slt i64 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %129

103:                                              ; preds = %98
  %104 = load i64, ptr %15, align 8, !tbaa !5
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %104) #6
  %106 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(8) %105)
          to label %107 unwind label %125

107:                                              ; preds = %103
  %108 = load i64, ptr %15, align 8, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %108) #6
  %110 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %106, ptr noundef nonnull align 8 dereferenceable(8) %109)
          to label %111 unwind label %125

111:                                              ; preds = %107
  %112 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %110, ptr %112, align 8
  %113 = load i64, ptr %15, align 8, !tbaa !5
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %113) #6
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = load i64, ptr %15, align 8, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %116) #6
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(8) %117)
          to label %119 unwind label %125

119:                                              ; preds = %111
  %120 = load i64, ptr %118, align 8, !tbaa !5
  %121 = add nsw i64 %120, %115
  store i64 %121, ptr %118, align 8, !tbaa !5
  br label %122

122:                                              ; preds = %119
  %123 = load i64, ptr %15, align 8, !tbaa !5
  %124 = add nsw i64 %123, 1
  store i64 %124, ptr %15, align 8, !tbaa !5
  br label %98, !llvm.loop !12

125:                                              ; preds = %111, %107, %103
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %5, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %261

129:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %130 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  %131 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  br label %132

132:                                              ; preds = %245, %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %133 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  %134 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  %135 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 11, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %251

137:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %139 = load i64, ptr %138, align 8, !tbaa !5
  store i64 %139, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %24) #6
  %140 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %141 unwind label %153

141:                                              ; preds = %137
  invoke void @_ZNSt8multisetIxSt4lessIxESaIxEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef nonnull align 8 dereferenceable(48) %140)
          to label %142 unwind label %153

142:                                              ; preds = %141
  %143 = load i64, ptr %18, align 8, !tbaa !5
  %144 = load i64, ptr %19, align 8, !tbaa !5
  %145 = add nsw i64 %144, %143
  store i64 %145, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %146 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %24) #6
  %147 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  br label %148

148:                                              ; preds = %162, %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %149 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %24) #6
  %150 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %26, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  %151 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br i1 %151, label %157, label %152

152:                                              ; preds = %148
  store i32 14, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %169

153:                                              ; preds = %141, %137
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %5, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %6, align 4
  br label %250

157:                                              ; preds = %148
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %159 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 8 dereferenceable(8) %158)
          to label %160 unwind label %165

160:                                              ; preds = %157
  %161 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %159, ptr %161, align 8
  br label %162

162:                                              ; preds = %160
  %163 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %25, i32 noundef 0) #6
  %164 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %163, ptr %164, align 8
  br label %148, !llvm.loop !13

165:                                              ; preds = %157
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %5, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %249

169:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  call void @_ZNKSt8multisetIxSt4lessIxESaIxEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %30, ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  %170 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIxEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %171 unwind label %219

171:                                              ; preds = %169
  %172 = load i64, ptr %170, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  store i64 %172, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %173 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  %174 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %32, i32 0, i32 0
  store ptr %173, ptr %174, align 8
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 8 %175, i64 8, i1 false), !tbaa.struct !14
  %176 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8
  %178 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr %177)
          to label %179 unwind label %223

179:                                              ; preds = %171
  %180 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %33, i32 0, i32 0
  store ptr %178, ptr %180, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  %181 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %182 unwind label %227

182:                                              ; preds = %179
  %183 = load i64, ptr %181, align 8, !tbaa !5
  %184 = load i64, ptr %29, align 8, !tbaa !5
  %185 = sub nsw i64 %183, %184
  %186 = load i64, ptr %18, align 8, !tbaa !5
  %187 = add nsw i64 %186, %185
  store i64 %187, ptr %18, align 8, !tbaa !5
  br label %188

188:                                              ; preds = %212, %182
  %189 = call noundef zeroext i1 @_ZNKSt8multisetIxSt4lessIxESaIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  br i1 %189, label %197, label %190

190:                                              ; preds = %188
  %191 = load i64, ptr %23, align 8, !tbaa !5
  %192 = add nsw i64 %191, 1
  store i64 %192, ptr %34, align 8, !tbaa !5
  %193 = invoke noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE5countERKx(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(8) %34)
          to label %194 unwind label %231

194:                                              ; preds = %190
  %195 = icmp ne i64 %193, 0
  %196 = xor i1 %195, true
  br label %197

197:                                              ; preds = %194, %188
  %198 = phi i1 [ false, %188 ], [ %196, %194 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br i1 %198, label %199, label %244

199:                                              ; preds = %197
  %200 = load i64, ptr %18, align 8, !tbaa !5
  %201 = load i64, ptr %19, align 8, !tbaa !5
  %202 = add nsw i64 %201, %200
  store i64 %202, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  call void @_ZNKSt8multisetIxSt4lessIxESaIxEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %36, ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  %203 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIxEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %204 unwind label %235

204:                                              ; preds = %199
  %205 = load i64, ptr %203, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  store i64 %205, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  %206 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  %207 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %38, i32 0, i32 0
  store ptr %206, ptr %207, align 8
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %208, i64 8, i1 false), !tbaa.struct !14
  %209 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %37, i32 0, i32 0
  %210 = load ptr, ptr %209, align 8
  %211 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr %210)
          to label %212 unwind label %239

212:                                              ; preds = %204
  %213 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %39, i32 0, i32 0
  store ptr %211, ptr %213, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  %214 = load i64, ptr %35, align 8, !tbaa !5
  %215 = load i64, ptr %18, align 8, !tbaa !5
  %216 = sub nsw i64 %215, %214
  store i64 %216, ptr %18, align 8, !tbaa !5
  %217 = load i64, ptr %23, align 8, !tbaa !5
  %218 = add nsw i64 %217, 1
  store i64 %218, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  br label %188, !llvm.loop !17

219:                                              ; preds = %169
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %5, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %248

223:                                              ; preds = %171
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %5, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %248

227:                                              ; preds = %179
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %5, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %6, align 4
  br label %248

231:                                              ; preds = %190
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %5, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  br label %248

235:                                              ; preds = %199
  %236 = landingpad { ptr, i32 }
          cleanup
  %237 = extractvalue { ptr, i32 } %236, 0
  store ptr %237, ptr %5, align 8
  %238 = extractvalue { ptr, i32 } %236, 1
  store i32 %238, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  br label %243

239:                                              ; preds = %204
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %5, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  br label %243

243:                                              ; preds = %239, %235
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  br label %248

244:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %24) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %245

245:                                              ; preds = %244
  %246 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef 0) #6
  %247 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %40, i32 0, i32 0
  store ptr %246, ptr %247, align 8
  br label %132, !llvm.loop !18

248:                                              ; preds = %243, %231, %227, %223, %219
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  br label %249

249:                                              ; preds = %248, %165
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %24) #6
  br label %250

250:                                              ; preds = %249, %153
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %260

251:                                              ; preds = %136
  %252 = load i64, ptr %19, align 8, !tbaa !5
  %253 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %252)
          to label %254 unwind label %256

254:                                              ; preds = %251
  store i32 0, ptr %1, align 4
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #6
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #6
  call void @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %255 = load i32, ptr %1, align 4
  ret i32 %255

256:                                              ; preds = %251
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %5, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %6, align 4
  br label %260

260:                                              ; preds = %256, %250
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #6
  br label %261

261:                                              ; preds = %260, %125, %93, %75
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #6
  call void @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %262

262:                                              ; preds = %261, %55
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %263

263:                                              ; preds = %262, %51
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %264

264:                                              ; preds = %263
  %265 = load ptr, ptr %5, align 8
  %266 = load i32, ptr %6, align 4
  %267 = insertvalue { ptr, i32 } poison, ptr %265, 0
  %268 = insertvalue { ptr, i32 } %267, i32 %266, 1
  resume { ptr, i32 } %268
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt8multisetIxSt4lessIxESaIxEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 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) #5

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{i64 0, i64 8, !15}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, std::multiset<long long>>, std::_Select1st<std::pair<const long long, std::multiset<long long>>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, std::multiset<long long>>, std::_Select1st<std::pair<const long long, std::multiset<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::map.3" = type { %"class.std::_Rb_tree.4" }
%"class.std::_Rb_tree.4" = 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" }
%"class.std::set" = type { %"class.std::_Rb_tree.8" }
%"class.std::_Rb_tree.8" = 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" }
%"class.std::multiset" = type { %"class.std::_Rb_tree.8" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_const_iterator" }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.std::map", align 8
  %7 = alloca %"class.std::map.3", align 8
  %8 = alloca %"class.std::set", align 8
  %9 = alloca %"class.std::multiset", 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 %"class.std::multiset", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"class.std::reverse_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca i64, align 8
  %19 = alloca %"class.std::reverse_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %22 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %22, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %23 unwind label %29

23:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %24 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %25 unwind label %31

25:                                               ; preds = %23
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #5
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #5
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  %26 = load i64, ptr %1, align 8, !tbaa !5
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %.lr.ph, label %._crit_edge

.preheader53:                                     ; preds = %37
  %28 = icmp sgt i64 %39, 0
  br i1 %28, label %.lr.ph70, label %._crit_edge

29:                                               ; preds = %0
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  br label %133

31:                                               ; preds = %23
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  br label %132

.lr.ph:                                           ; preds = %25, %37
  %.03868 = phi i64 [ %38, %37 ], [ 0, %25 ]
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03868) #5
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %33)
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03868) #5
  %36 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %37 unwind label %41

37:                                               ; preds = %.lr.ph
  %38 = add nuw nsw i64 %.03868, 1
  %39 = load i64, ptr %1, align 8, !tbaa !5
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %.lr.ph, label %.preheader53, !llvm.loop !9

41:                                               ; preds = %.lr.ph
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %131

.preheader:                                       ; preds = %.lr.ph70
  %43 = icmp sgt i64 %47, 0
  br i1 %43, label %.lr.ph72, label %._crit_edge

.lr.ph70:                                         ; preds = %.preheader53, %.lr.ph70
  %.03969 = phi i64 [ %46, %.lr.ph70 ], [ 0, %.preheader53 ]
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.03969) #5
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %44)
  %46 = add nuw nsw i64 %.03969, 1
  %47 = load i64, ptr %1, align 8, !tbaa !5
  %48 = icmp slt i64 %46, %47
  br i1 %48, label %.lr.ph70, label %.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %62, %25, %.preheader53, %.preheader
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #5
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %49 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  store ptr %49, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %50 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  store ptr %50, ptr %11, align 8
  %51 = 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) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br i1 %51, label %.lr.ph84, label %._crit_edge85

.lr.ph72:                                         ; preds = %.preheader, %62
  %.04071 = phi i64 [ %65, %62 ], [ 0, %.preheader ]
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04071) #5
  %53 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %52)
          to label %54 unwind label %68

54:                                               ; preds = %.lr.ph72
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.04071) #5
  %56 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %53, ptr noundef nonnull align 8 dereferenceable(8) %55)
          to label %57 unwind label %68

57:                                               ; preds = %54
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.04071) #5
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04071) #5
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %60)
          to label %62 unwind label %68

62:                                               ; preds = %57
  %63 = load i64, ptr %61, align 8, !tbaa !5
  %64 = add nsw i64 %63, %59
  store i64 %64, ptr %61, align 8, !tbaa !5
  %65 = add nuw nsw i64 %.04071, 1
  %66 = load i64, ptr %1, align 8, !tbaa !5
  %67 = icmp slt i64 %65, %66
  br i1 %67, label %.lr.ph72, label %._crit_edge, !llvm.loop !12

68:                                               ; preds = %57, %54, %.lr.ph72
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %131

._crit_edge85:                                    ; preds = %.loopexit, %._crit_edge
  %.043.lcssa = phi i64 [ 0, %._crit_edge ], [ %.14461, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.043.lcssa)
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #5
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #5
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #5
  call void @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

.lr.ph84:                                         ; preds = %._crit_edge, %.loopexit
  %.04182 = phi i64 [ %.14257, %.loopexit ], [ 0, %._crit_edge ]
  %.04381 = phi i64 [ %.14461, %.loopexit ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %72 = load i64, ptr %71, align 8, !tbaa !5
  store i64 %72, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %13) #5
  %73 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %74 unwind label %85

74:                                               ; preds = %.lr.ph84
  invoke void @_ZNSt8multisetIxSt4lessIxESaIxEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(48) %73)
          to label %75 unwind label %85

75:                                               ; preds = %74
  %76 = add nsw i64 %.04182, %.04381
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %77 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %77, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %78 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %78, ptr %15, align 8
  %79 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %79, label %.lr.ph74, label %._crit_edge75

._crit_edge75:                                    ; preds = %89, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  call void @_ZNKSt8multisetIxSt4lessIxESaIxEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %16, ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIxEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  %81 = load i64, ptr %80, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %82 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  store ptr %82, ptr %17, align 8
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %.sroa.04.0.copyload = load ptr, ptr %83, align 8, !tbaa !13
  %84 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr %.sroa.04.0.copyload)
          to label %95 unwind label %118

85:                                               ; preds = %74, %.lr.ph84
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %130

.lr.ph74:                                         ; preds = %75, %89
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %88 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 8 dereferenceable(8) %87)
          to label %89 unwind label %93

89:                                               ; preds = %.lr.ph74
  %90 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %91 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %91, ptr %15, align 8
  %92 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %92, label %.lr.ph74, label %._crit_edge75, !llvm.loop !15

93:                                               ; preds = %.lr.ph74
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %129

95:                                               ; preds = %._crit_edge75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %97 unwind label %120

97:                                               ; preds = %95
  %98 = load i64, ptr %96, align 8, !tbaa !5
  %99 = sub i64 %.04182, %81
  %100 = add i64 %99, %98
  %101 = call noundef zeroext i1 @_ZNKSt8multisetIxSt4lessIxESaIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  br i1 %101, label %.critedge, label %.lr.ph79

.lr.ph79:                                         ; preds = %97, %112
  %.14277 = phi i64 [ %114, %112 ], [ %100, %97 ]
  %.14476 = phi i64 [ %113, %112 ], [ %76, %97 ]
  %102 = load i64, ptr %12, align 8, !tbaa !5
  %103 = add nsw i64 %102, 1
  store i64 %103, ptr %18, align 8, !tbaa !5
  %104 = invoke noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE5countERKx(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %105 unwind label %122

105:                                              ; preds = %.lr.ph79
  %.not = icmp eq i64 %104, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br i1 %.not, label %106, label %.loopexit

106:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  call void @_ZNKSt8multisetIxSt4lessIxESaIxEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %19, ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt16reverse_iteratorISt23_Rb_tree_const_iteratorIxEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %108 = load i64, ptr %107, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #5
  %109 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  store ptr %109, ptr %20, align 8
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %.sroa.02.0.copyload = load ptr, ptr %110, align 8, !tbaa !13
  %111 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr %.sroa.02.0.copyload)
          to label %112 unwind label %124

112:                                              ; preds = %106
  %113 = add nsw i64 %.14277, %.14476
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  %114 = sub nsw i64 %.14277, %108
  %115 = load i64, ptr %12, align 8, !tbaa !5
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %12, align 8, !tbaa !5
  %117 = call noundef zeroext i1 @_ZNKSt8multisetIxSt4lessIxESaIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  br i1 %117, label %.critedge, label %.lr.ph79, !llvm.loop !16

118:                                              ; preds = %._crit_edge75
  %119 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  br label %129

120:                                              ; preds = %95
  %121 = landingpad { ptr, i32 }
          cleanup
  br label %129

122:                                              ; preds = %.lr.ph79
  %123 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %129

124:                                              ; preds = %106
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  br label %129

.critedge:                                        ; preds = %112, %97
  %.144.lcssa = phi i64 [ %76, %97 ], [ %113, %112 ]
  %.142.lcssa = phi i64 [ %100, %97 ], [ %114, %112 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %.loopexit

.loopexit:                                        ; preds = %105, %.critedge
  %.14461 = phi i64 [ %.144.lcssa, %.critedge ], [ %.14476, %105 ]
  %.14257 = phi i64 [ %.142.lcssa, %.critedge ], [ %.14277, %105 ]
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %126 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %127 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  store ptr %127, ptr %11, align 8
  %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) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br i1 %128, label %.lr.ph84, label %._crit_edge85, !llvm.loop !17

129:                                              ; preds = %118, %120, %122, %124, %93
  %.pn46 = phi { ptr, i32 } [ %94, %93 ], [ %125, %124 ], [ %123, %122 ], [ %121, %120 ], [ %119, %118 ]
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  br label %130

130:                                              ; preds = %129, %85
  %.pn46.pn = phi { ptr, i32 } [ %.pn46, %129 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #5
  br label %131

131:                                              ; preds = %130, %68, %41
  %.pn49 = phi { ptr, i32 } [ %42, %41 ], [ %69, %68 ], [ %.pn46.pn, %130 ]
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #5
  call void @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #5
  call void @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %132

132:                                              ; preds = %131, %31
  %.pn49.pn = phi { ptr, i32 } [ %.pn49, %131 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  br label %133

133:                                              ; preds = %132, %29
  %.pn49.pn.pn = phi { ptr, i32 } [ %.pn49.pn, %132 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn49.pn.pn
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local void @_ZNSt3mapIxSt8multisetIxSt4lessIxESaIxEES2_SaISt4pairIKxS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt8multisetIxSt4lessIxESaIxEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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