; LLVM IR from DionysiosB/CodeForces :: 0400-0499 (446B-DZYLovesModification)

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

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = 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 i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca %"class.std::multiset", align 8
  %19 = alloca i64, align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"class.std::multiset", align 8
  %22 = alloca i64, align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %30 = alloca i64, align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca i64, align 8
  %33 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %34 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %35 = alloca i64, align 8
  %36 = alloca %"struct.std::_Rb_tree_const_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
  %41 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %42 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %43 = 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) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  %45 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %45, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %46 unwind label %54

46:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  %47 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %47, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %48 unwind label %58

48:                                               ; preds = %46
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %89, %48
  %50 = load i64, ptr %14, align 8, !tbaa !5
  %51 = load i64, ptr %2, align 8, !tbaa !5
  %52 = icmp slt i64 %50, %51
  br i1 %52, label %62, label %53

53:                                               ; preds = %49
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %92

54:                                               ; preds = %0
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %9, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %293

58:                                               ; preds = %46
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %9, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %292

62:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %81, %62
  %64 = load i64, ptr %16, align 8, !tbaa !5
  %65 = load i64, ptr %3, align 8, !tbaa !5
  %66 = icmp slt i64 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %88

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %69 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %17)
          to label %70 unwind label %84

70:                                               ; preds = %68
  %71 = load i64, ptr %17, align 8, !tbaa !5
  %72 = load i64, ptr %14, align 8, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %72) #5
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = add nsw i64 %74, %71
  store i64 %75, ptr %73, align 8, !tbaa !5
  %76 = load i64, ptr %17, align 8, !tbaa !5
  %77 = load i64, ptr %16, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %77) #5
  %79 = load i64, ptr %78, align 8, !tbaa !5
  %80 = add nsw i64 %79, %76
  store i64 %80, ptr %78, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %81

81:                                               ; preds = %70
  %82 = load i64, ptr %16, align 8, !tbaa !5
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %16, align 8, !tbaa !5
  br label %63, !llvm.loop !9

84:                                               ; preds = %68
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %9, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %291

88:                                               ; preds = %67
  br label %89

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

92:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 48, ptr %18) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %104, %92
  %94 = load i64, ptr %19, align 8, !tbaa !5
  %95 = load i64, ptr %2, align 8, !tbaa !5
  %96 = icmp slt i64 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %111

98:                                               ; preds = %93
  %99 = load i64, ptr %19, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %99) #5
  %101 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(8) %100)
          to label %102 unwind label %107

102:                                              ; preds = %98
  %103 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %101, ptr %103, align 8
  br label %104

104:                                              ; preds = %102
  %105 = load i64, ptr %19, align 8, !tbaa !5
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %19, align 8, !tbaa !5
  br label %93, !llvm.loop !12

107:                                              ; preds = %98
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %9, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %290

111:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 48, ptr %21) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store i64 0, ptr %22, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %123, %111
  %113 = load i64, ptr %22, align 8, !tbaa !5
  %114 = load i64, ptr %3, align 8, !tbaa !5
  %115 = icmp slt i64 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %130

117:                                              ; preds = %112
  %118 = load i64, ptr %22, align 8, !tbaa !5
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %118) #5
  %120 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(8) %119)
          to label %121 unwind label %126

121:                                              ; preds = %117
  %122 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %120, ptr %122, align 8
  br label %123

123:                                              ; preds = %121
  %124 = load i64, ptr %22, align 8, !tbaa !5
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %22, align 8, !tbaa !5
  br label %112, !llvm.loop !13

126:                                              ; preds = %117
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %9, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %289

130:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store i64 0, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store i64 0, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  store i64 0, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  store i64 0, ptr %27, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %275, %130
  %132 = load i64, ptr %27, align 8, !tbaa !5
  %133 = load i64, ptr %4, align 8, !tbaa !5
  %134 = icmp slt i64 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %279

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %137 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  %138 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %29, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %139) #5
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = load i64, ptr %5, align 8, !tbaa !5
  %143 = load i64, ptr %25, align 8, !tbaa !5
  %144 = mul nsw i64 %142, %143
  %145 = sub nsw i64 %141, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  store i64 %145, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %146 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  %147 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #5
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %148) #5
  %150 = load i64, ptr %149, align 8, !tbaa !5
  %151 = load i64, ptr %5, align 8, !tbaa !5
  %152 = load i64, ptr %24, align 8, !tbaa !5
  %153 = mul nsw i64 %151, %152
  %154 = sub nsw i64 %150, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  store i64 %154, ptr %30, align 8, !tbaa !5
  %155 = load i64, ptr %28, align 8, !tbaa !5
  %156 = load i64, ptr %30, align 8, !tbaa !5
  %157 = icmp sgt i64 %155, %156
  br i1 %157, label %166, label %158

158:                                              ; preds = %136
  %159 = load i64, ptr %28, align 8, !tbaa !5
  %160 = load i64, ptr %30, align 8, !tbaa !5
  %161 = icmp eq i64 %159, %160
  br i1 %161, label %162, label %191

162:                                              ; preds = %158
  %163 = load i64, ptr %2, align 8, !tbaa !5
  %164 = load i64, ptr %3, align 8, !tbaa !5
  %165 = icmp slt i64 %163, %164
  br i1 %165, label %166, label %191

166:                                              ; preds = %162, %136
  %167 = load i64, ptr %28, align 8, !tbaa !5
  %168 = load i64, ptr %26, align 8, !tbaa !5
  %169 = add nsw i64 %168, %167
  store i64 %169, ptr %26, align 8, !tbaa !5
  %170 = load i64, ptr %24, align 8, !tbaa !5
  %171 = add nsw i64 %170, 1
  store i64 %171, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %172 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  %173 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %33, i32 0, i32 0
  store ptr %172, ptr %173, align 8
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #5
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %174) #5
  %176 = load i64, ptr %175, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  store i64 %176, ptr %32, align 8, !tbaa !5
  %177 = invoke noundef i64 @_ZNSt8multisetIlSt4lessIlESaIlEE5eraseERKl(ptr noundef nonnull align 8 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %178 unwind label %187

178:                                              ; preds = %166
  %179 = load i64, ptr %2, align 8, !tbaa !5
  %180 = load i64, ptr %5, align 8, !tbaa !5
  %181 = mul nsw i64 %179, %180
  %182 = load i64, ptr %32, align 8, !tbaa !5
  %183 = sub nsw i64 %182, %181
  store i64 %183, ptr %32, align 8, !tbaa !5
  %184 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %185 unwind label %187

185:                                              ; preds = %178
  %186 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %34, i32 0, i32 0
  store ptr %184, ptr %186, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %216

187:                                              ; preds = %178, %166
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %9, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %278

191:                                              ; preds = %162, %158
  %192 = load i64, ptr %30, align 8, !tbaa !5
  %193 = load i64, ptr %26, align 8, !tbaa !5
  %194 = add nsw i64 %193, %192
  store i64 %194, ptr %26, align 8, !tbaa !5
  %195 = load i64, ptr %25, align 8, !tbaa !5
  %196 = add nsw i64 %195, 1
  store i64 %196, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %197 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  %198 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %36, i32 0, i32 0
  store ptr %197, ptr %198, align 8
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %36) #5
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %199) #5
  %201 = load i64, ptr %200, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  store i64 %201, ptr %35, align 8, !tbaa !5
  %202 = invoke noundef i64 @_ZNSt8multisetIlSt4lessIlESaIlEE5eraseERKl(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %203 unwind label %212

203:                                              ; preds = %191
  %204 = load i64, ptr %3, align 8, !tbaa !5
  %205 = load i64, ptr %5, align 8, !tbaa !5
  %206 = mul nsw i64 %204, %205
  %207 = load i64, ptr %35, align 8, !tbaa !5
  %208 = sub nsw i64 %207, %206
  store i64 %208, ptr %35, align 8, !tbaa !5
  %209 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %210 unwind label %212

210:                                              ; preds = %203
  %211 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %37, i32 0, i32 0
  store ptr %209, ptr %211, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %216

212:                                              ; preds = %203, %191
  %213 = landingpad { ptr, i32 }
          cleanup
  %214 = extractvalue { ptr, i32 } %213, 0
  store ptr %214, ptr %9, align 8
  %215 = extractvalue { ptr, i32 } %213, 1
  store i32 %215, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %278

216:                                              ; preds = %210, %185
  %217 = load i64, ptr %27, align 8, !tbaa !5
  %218 = load i64, ptr %26, align 8, !tbaa !5
  %219 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %217, i64 noundef %218)
          to label %220 unwind label %230

220:                                              ; preds = %216
  %221 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %222 unwind label %230

222:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #5
  %223 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  %224 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %38, i32 0, i32 0
  store ptr %223, ptr %224, align 8
  br label %225

225:                                              ; preds = %239, %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #5
  %226 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  %227 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %39, i32 0, i32 0
  store ptr %226, ptr %227, align 8
  %228 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull align 8 dereferenceable(8) %39) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #5
  br i1 %228, label %234, label %229

229:                                              ; preds = %225
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  br label %246

230:                                              ; preds = %270, %268, %246, %220, %216
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %9, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %10, align 4
  br label %278

234:                                              ; preds = %225
  %235 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #5
  %236 = load i64, ptr %235, align 8, !tbaa !5
  %237 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %236)
          to label %238 unwind label %242

238:                                              ; preds = %234
  br label %239

239:                                              ; preds = %238
  %240 = call ptr @_ZNSt23_Rb_tree_const_iteratorIlEppEi(ptr noundef nonnull align 8 dereferenceable(8) %38, i32 noundef 0) #5
  %241 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %40, i32 0, i32 0
  store ptr %240, ptr %241, align 8
  br label %225, !llvm.loop !14

242:                                              ; preds = %234
  %243 = landingpad { ptr, i32 }
          cleanup
  %244 = extractvalue { ptr, i32 } %243, 0
  store ptr %244, ptr %9, align 8
  %245 = extractvalue { ptr, i32 } %243, 1
  store i32 %245, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  br label %278

246:                                              ; preds = %229
  %247 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5)
          to label %248 unwind label %230

248:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #5
  %249 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  %250 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %41, i32 0, i32 0
  store ptr %249, ptr %250, align 8
  br label %251

251:                                              ; preds = %261, %248
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #5
  %252 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  %253 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %42, i32 0, i32 0
  store ptr %252, ptr %253, align 8
  %254 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(8) %42) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #5
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  store i32 20, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #5
  br label %268

256:                                              ; preds = %251
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %41) #5
  %258 = load i64, ptr %257, align 8, !tbaa !5
  %259 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %258)
          to label %260 unwind label %264

260:                                              ; preds = %256
  br label %261

261:                                              ; preds = %260
  %262 = call ptr @_ZNSt23_Rb_tree_const_iteratorIlEppEi(ptr noundef nonnull align 8 dereferenceable(8) %41, i32 noundef 0) #5
  %263 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %43, i32 0, i32 0
  store ptr %262, ptr %263, align 8
  br label %251, !llvm.loop !15

264:                                              ; preds = %256
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %9, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #5
  br label %278

268:                                              ; preds = %255
  %269 = invoke i32 @puts(ptr noundef @.str.6)
          to label %270 unwind label %230

270:                                              ; preds = %268
  %271 = load i64, ptr %24, align 8, !tbaa !5
  %272 = load i64, ptr %25, align 8, !tbaa !5
  %273 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.7, i64 noundef %271, i64 noundef %272)
          to label %274 unwind label %230

274:                                              ; preds = %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %275

275:                                              ; preds = %274
  %276 = load i64, ptr %27, align 8, !tbaa !5
  %277 = add nsw i64 %276, 1
  store i64 %277, ptr %27, align 8, !tbaa !5
  br label %131, !llvm.loop !16

278:                                              ; preds = %264, %242, %230, %212, %187
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %288

279:                                              ; preds = %135
  %280 = load i64, ptr %26, align 8, !tbaa !5
  %281 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.8, i64 noundef %280)
          to label %282 unwind label %284

282:                                              ; preds = %279
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %283 = load i32, ptr %1, align 4
  ret i32 %283

284:                                              ; preds = %279
  %285 = landingpad { ptr, i32 }
          cleanup
  %286 = extractvalue { ptr, i32 } %285, 0
  store ptr %286, ptr %9, align 8
  %287 = extractvalue { ptr, i32 } %285, 1
  store i32 %287, ptr %10, align 4
  br label %288

288:                                              ; preds = %284, %278
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %289

289:                                              ; preds = %288, %126
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #5
  br label %290

290:                                              ; preds = %289, %107
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #5
  br label %291

291:                                              ; preds = %290, %84
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  br label %292

292:                                              ; preds = %291, %58
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %293

293:                                              ; preds = %292, %54
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %294

294:                                              ; preds = %293
  %295 = load ptr, ptr %9, align 8
  %296 = load i32, ptr %10, align 4
  %297 = insertvalue { ptr, i32 } poison, ptr %295, 0
  %298 = insertvalue { ptr, i32 } %297, i32 %296, 1
  resume { ptr, i32 } %298
}

; 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 @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(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 ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(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 @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

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

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

declare i32 @puts(ptr noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(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 = { 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", !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 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !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, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<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::_Rb_tree_const_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::multiset", 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 i64, align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %25 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store i64 0, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %25, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %26 unwind label %38

26:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %27 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %27, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %28 unwind label %40

28:                                               ; preds = %26
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %30 = icmp sgt i64 %29, 0
  %31 = load i64, ptr %2, align 8
  %32 = icmp sgt i64 %31, 0
  %or.cond = select i1 %30, i1 %32, i1 false
  br i1 %or.cond, label %.preheader64, label %._crit_edge69

.preheader64:                                     ; preds = %28, %._crit_edge
  %33 = phi i64 [ %42, %._crit_edge ], [ %29, %28 ]
  %34 = phi i64 [ %43, %._crit_edge ], [ %31, %28 ]
  %.04368 = phi i64 [ %44, %._crit_edge ], [ 0, %28 ]
  %35 = icmp sgt i64 %34, 0
  br i1 %35, label %.lr.ph, label %._crit_edge

._crit_edge69:                                    ; preds = %._crit_edge, %28
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %12) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  %36 = load i64, ptr %1, align 8, !tbaa !5
  %37 = icmp sgt i64 %36, 0
  br i1 %37, label %.lr.ph72, label %._crit_edge73

38:                                               ; preds = %0
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %164

40:                                               ; preds = %26
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %163

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader64
  %42 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %33, %.preheader64 ]
  %43 = phi i64 [ %56, %._crit_edge.loopexit ], [ %34, %.preheader64 ]
  %44 = add nuw nsw i64 %.04368, 1
  %45 = icmp slt i64 %44, %42
  br i1 %45, label %.preheader64, label %._crit_edge69, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader64, %.lr.ph
  %.04467 = phi i64 [ %55, %.lr.ph ], [ 0, %.preheader64 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %11)
  %47 = load i64, ptr %11, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04368) #5
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = add nsw i64 %49, %47
  store i64 %50, ptr %48, align 8, !tbaa !5
  %51 = load i64, ptr %11, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %.04467) #5
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = add nsw i64 %53, %51
  store i64 %54, ptr %52, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  %55 = add nuw nsw i64 %.04467, 1
  %56 = load i64, ptr %2, align 8, !tbaa !5
  %57 = icmp slt i64 %55, %56
  br i1 %57, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge73:                                    ; preds = %62, %._crit_edge69
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %13) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  %58 = load i64, ptr %2, align 8, !tbaa !5
  %59 = icmp sgt i64 %58, 0
  br i1 %59, label %.lr.ph76, label %.preheader

.lr.ph72:                                         ; preds = %._crit_edge69, %62
  %.05270 = phi i64 [ %63, %62 ], [ 0, %._crit_edge69 ]
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.05270) #5
  %61 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %60)
          to label %62 unwind label %66

62:                                               ; preds = %.lr.ph72
  %63 = add nuw nsw i64 %.05270, 1
  %64 = load i64, ptr %1, align 8, !tbaa !5
  %65 = icmp slt i64 %63, %64
  br i1 %65, label %.lr.ph72, label %._crit_edge73, !llvm.loop !13

66:                                               ; preds = %.lr.ph72
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %162

.preheader:                                       ; preds = %72, %._crit_edge73
  %68 = load i64, ptr %3, align 8, !tbaa !5
  %69 = icmp sgt i64 %68, 0
  br i1 %69, label %.lr.ph87, label %._crit_edge88

.lr.ph76:                                         ; preds = %._crit_edge73, %72
  %.05374 = phi i64 [ %73, %72 ], [ 0, %._crit_edge73 ]
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %.05374) #5
  %71 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %70)
          to label %72 unwind label %76

72:                                               ; preds = %.lr.ph76
  %73 = add nuw nsw i64 %.05374, 1
  %74 = load i64, ptr %2, align 8, !tbaa !5
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %.lr.ph76, label %.preheader, !llvm.loop !14

76:                                               ; preds = %.lr.ph76
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %161

._crit_edge88:                                    ; preds = %._crit_edge82, %.preheader
  %.046.lcssa = phi i64 [ 0, %.preheader ], [ %.147, %._crit_edge82 ]
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i64 noundef %.046.lcssa)
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %13) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

.lr.ph87:                                         ; preds = %.preheader, %._crit_edge82
  %.04586 = phi i64 [ %152, %._crit_edge82 ], [ 0, %.preheader ]
  %.04685 = phi i64 [ %.147, %._crit_edge82 ], [ 0, %.preheader ]
  %.04884 = phi i64 [ %.149, %._crit_edge82 ], [ 0, %.preheader ]
  %.05083 = phi i64 [ %.151, %._crit_edge82 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %79 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  store ptr %79, ptr %14, align 8
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %80) #5
  %82 = load i64, ptr %81, align 8, !tbaa !5
  %83 = load i64, ptr %4, align 8, !tbaa !5
  %84 = mul nsw i64 %83, %.04884
  %85 = sub nsw i64 %82, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %86 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %86, ptr %15, align 8
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %87) #5
  %89 = load i64, ptr %88, align 8, !tbaa !5
  %90 = load i64, ptr %4, align 8, !tbaa !5
  %91 = mul nsw i64 %90, %.05083
  %92 = sub nsw i64 %89, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  %93 = icmp sgt i64 %85, %92
  br i1 %93, label %100, label %94

94:                                               ; preds = %.lr.ph87
  %95 = icmp eq i64 %85, %92
  br i1 %95, label %96, label %117

96:                                               ; preds = %94
  %97 = load i64, ptr %1, align 8, !tbaa !5
  %98 = load i64, ptr %2, align 8, !tbaa !5
  %99 = icmp slt i64 %97, %98
  br i1 %99, label %100, label %117

100:                                              ; preds = %96, %.lr.ph87
  %101 = add nsw i64 %.05083, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %102 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  store ptr %102, ptr %17, align 8
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %103) #5
  %105 = load i64, ptr %104, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  store i64 %105, ptr %16, align 8, !tbaa !5
  %106 = invoke noundef i64 @_ZNSt8multisetIlSt4lessIlESaIlEE5eraseERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %107 unwind label %115

107:                                              ; preds = %100
  %108 = load i64, ptr %1, align 8, !tbaa !5
  %109 = load i64, ptr %4, align 8, !tbaa !5
  %110 = mul nsw i64 %109, %108
  %111 = load i64, ptr %16, align 8, !tbaa !5
  %112 = sub nsw i64 %111, %110
  store i64 %112, ptr %16, align 8, !tbaa !5
  %113 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %114 unwind label %115

114:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  br label %134

115:                                              ; preds = %107, %100
  %116 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  br label %161

117:                                              ; preds = %96, %94
  %118 = add nsw i64 %.04884, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  %119 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %119, ptr %19, align 8
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %120) #5
  %122 = load i64, ptr %121, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  store i64 %122, ptr %18, align 8, !tbaa !5
  %123 = invoke noundef i64 @_ZNSt8multisetIlSt4lessIlESaIlEE5eraseERKl(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %124 unwind label %132

124:                                              ; preds = %117
  %125 = load i64, ptr %2, align 8, !tbaa !5
  %126 = load i64, ptr %4, align 8, !tbaa !5
  %127 = mul nsw i64 %126, %125
  %128 = load i64, ptr %18, align 8, !tbaa !5
  %129 = sub nsw i64 %128, %127
  store i64 %129, ptr %18, align 8, !tbaa !5
  %130 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %131 unwind label %132

131:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %134

132:                                              ; preds = %124, %117
  %133 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %161

134:                                              ; preds = %131, %114
  %.151 = phi i64 [ %101, %114 ], [ %.05083, %131 ]
  %.149 = phi i64 [ %.04884, %114 ], [ %118, %131 ]
  %.pn57 = phi i64 [ %85, %114 ], [ %92, %131 ]
  %.147 = add nsw i64 %.pn57, %.04685
  %135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.04586, i64 noundef %.147)
  %136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #5
  %137 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  store ptr %137, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #5
  %138 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  store ptr %138, ptr %21, align 8
  %139 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #5
  br i1 %139, label %.lr.ph78, label %._crit_edge79

._crit_edge79:                                    ; preds = %.lr.ph78, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  %140 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #5
  %141 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %141, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #5
  %142 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %142, ptr %23, align 8
  %143 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #5
  br i1 %143, label %.lr.ph81, label %._crit_edge82

.lr.ph78:                                         ; preds = %134, %.lr.ph78
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %145 = load i64, ptr %144, align 8, !tbaa !5
  %146 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %145)
  %147 = call ptr @_ZNSt23_Rb_tree_const_iteratorIlEppEi(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #5
  %148 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  store ptr %148, ptr %21, align 8
  %149 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #5
  br i1 %149, label %.lr.ph78, label %._crit_edge79, !llvm.loop !15

._crit_edge82:                                    ; preds = %.lr.ph81, %._crit_edge79
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #5
  %150 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.6)
  %151 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i64 noundef %.151, i64 noundef %.149)
  %152 = add nuw nsw i64 %.04586, 1
  %153 = load i64, ptr %3, align 8, !tbaa !5
  %154 = icmp slt i64 %152, %153
  br i1 %154, label %.lr.ph87, label %._crit_edge88, !llvm.loop !16

.lr.ph81:                                         ; preds = %._crit_edge79, %.lr.ph81
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %156 = load i64, ptr %155, align 8, !tbaa !5
  %157 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %156)
  %158 = call ptr @_ZNSt23_Rb_tree_const_iteratorIlEppEi(ptr noundef nonnull align 8 dereferenceable(8) %22, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #5
  %159 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  store ptr %159, ptr %23, align 8
  %160 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #5
  br i1 %160, label %.lr.ph81, label %._crit_edge82, !llvm.loop !17

161:                                              ; preds = %115, %132, %76
  %.pn58 = phi { ptr, i32 } [ %77, %76 ], [ %116, %115 ], [ %133, %132 ]
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %13) #5
  br label %162

162:                                              ; preds = %161, %66
  %.pn60 = phi { ptr, i32 } [ %67, %66 ], [ %.pn58, %161 ]
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  br label %163

163:                                              ; preds = %162, %40
  %.pn60.pn = phi { ptr, i32 } [ %.pn60, %162 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %164

164:                                              ; preds = %163, %38
  %.pn60.pn.pn = phi { ptr, i32 } [ %.pn60.pn, %163 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn60.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 @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt8multisetIlSt4lessIlESaIlEE5eraseERKl(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 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 ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE5beginEv(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_iteratorIlES2_(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 @_ZNSt23_Rb_tree_const_iteratorIlEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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