; LLVM IR from DionysiosB/CodeForces :: 2061D-KevinAndNumbers (main)

; 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::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::greater<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::greater<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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 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 %"class.std::multiset", align 8
  %6 = alloca %"class.std::multiset", align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca i64, align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca i64, align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %26 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %27 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %28 = alloca %"struct.std::_Rb_tree_const_iterator", 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %35

35:                                               ; preds = %197, %195, %0
  %36 = load i64, ptr %2, align 8, !tbaa !5
  %37 = add nsw i64 %36, -1
  store i64 %37, ptr %2, align 8, !tbaa !5
  %38 = icmp ne i64 %36, 0
  br i1 %38, label %39, label %199

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %55, %39
  %42 = load i64, ptr %8, align 8, !tbaa !5
  %43 = load i64, ptr %3, align 8, !tbaa !5
  %44 = icmp slt i64 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %62

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %47 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %9)
          to label %48 unwind label %58

48:                                               ; preds = %46
  %49 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %50 unwind label %58

50:                                               ; preds = %48
  %51 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %12, i32 0, i32 0
  store ptr %49, ptr %51, align 8
  %52 = load i64, ptr %9, align 8, !tbaa !5
  %53 = load i64, ptr %7, align 8, !tbaa !9
  %54 = add nsw i64 %53, %52
  store i64 %54, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %55

55:                                               ; preds = %50
  %56 = load i64, ptr %8, align 8, !tbaa !5
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %8, align 8, !tbaa !5
  br label %41, !llvm.loop !11

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

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

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

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %98

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

70:                                               ; preds = %68
  %71 = invoke noundef i64 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %72 unwind label %83

72:                                               ; preds = %70
  %73 = icmp ne i64 %71, 0
  br i1 %73, label %74, label %87

74:                                               ; preds = %72
  %75 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE4findERKl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %76 unwind label %83

76:                                               ; preds = %74
  %77 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %75, ptr %77, align 8
  %78 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8
  %80 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr %79)
          to label %81 unwind label %83

81:                                               ; preds = %76
  %82 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %80, ptr %82, align 8
  br label %91

83:                                               ; preds = %87, %76, %74, %70, %68
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %10, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %198

87:                                               ; preds = %72
  %88 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %89 unwind label %83

89:                                               ; preds = %87
  %90 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %88, ptr %90, align 8
  br label %91

91:                                               ; preds = %89, %81
  %92 = load i64, ptr %14, align 8, !tbaa !5
  %93 = load i64, ptr %7, align 8, !tbaa !9
  %94 = sub nsw i64 %93, %92
  store i64 %94, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %95

95:                                               ; preds = %91
  %96 = load i64, ptr %13, align 8, !tbaa !5
  %97 = add nsw i64 %96, 1
  store i64 %97, ptr %13, align 8, !tbaa !5
  br label %63, !llvm.loop !13

98:                                               ; preds = %67
  %99 = load i64, ptr %7, align 8, !tbaa !9
  %100 = icmp ne i64 %99, 0
  br i1 %100, label %101, label %108

101:                                              ; preds = %98
  %102 = invoke i32 @puts(ptr noundef @.str.2)
          to label %103 unwind label %104

103:                                              ; preds = %101
  store i32 2, ptr %18, align 4
  br label %195, !llvm.loop !14

104:                                              ; preds = %189, %101
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %10, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %11, align 4
  br label %198

108:                                              ; preds = %98
  br label %109

109:                                              ; preds = %183, %108
  %110 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  br i1 %110, label %127, label %111

111:                                              ; preds = %109
  %112 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  br i1 %112, label %127, label %113

113:                                              ; preds = %111
  %114 = call noundef i64 @_ZNKSt8multisetIlSt7greaterIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %115 = call noundef i64 @_ZNKSt8multisetIlSt7greaterIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  %116 = icmp uge i64 %114, %115
  br i1 %116, label %117, label %127

117:                                              ; preds = %113
  %118 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  %119 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %118, ptr %119, align 8
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  %121 = load i64, ptr %120, align 8, !tbaa !5
  %122 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %123 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %122, ptr %123, align 8
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %125 = load i64, ptr %124, align 8, !tbaa !5
  %126 = icmp sge i64 %121, %125
  br label %127

127:                                              ; preds = %117, %113, %111, %109
  %128 = phi i1 [ false, %113 ], [ false, %111 ], [ false, %109 ], [ %126, %117 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br i1 %128, label %129, label %185

129:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %130 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  %131 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %133 = load i64, ptr %132, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  store i64 %133, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %134 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %135 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %134, ptr %135, align 8
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #5
  %137 = load i64, ptr %136, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  store i64 %137, ptr %23, align 8, !tbaa !5
  %138 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  %139 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %138, ptr %139, align 8
  %140 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8
  %142 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr %141)
          to label %143 unwind label %159

143:                                              ; preds = %129
  %144 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %26, i32 0, i32 0
  store ptr %142, ptr %144, align 8
  %145 = load i64, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %146 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %147 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #5
  %149 = load i64, ptr %148, align 8, !tbaa !5
  %150 = icmp eq i64 %145, %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br i1 %150, label %151, label %163

151:                                              ; preds = %143
  %152 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %153 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %152, ptr %153, align 8
  %154 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8
  %156 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr %155)
          to label %157 unwind label %159

157:                                              ; preds = %151
  %158 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %29, i32 0, i32 0
  store ptr %156, ptr %158, align 8
  br label %183

159:                                              ; preds = %151, %129
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %10, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %11, align 4
  br label %184

163:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %164 = load i64, ptr %21, align 8, !tbaa !5
  %165 = sdiv i64 %164, 2
  store i64 %165, ptr %30, align 8, !tbaa !5
  %166 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertEOl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %167 unwind label %175

167:                                              ; preds = %163
  %168 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %166, ptr %168, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %169 = load i64, ptr %21, align 8, !tbaa !5
  %170 = add nsw i64 %169, 1
  %171 = sdiv i64 %170, 2
  store i64 %171, ptr %32, align 8, !tbaa !5
  %172 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertEOl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %173 unwind label %179

173:                                              ; preds = %167
  %174 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %33, i32 0, i32 0
  store ptr %172, ptr %174, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %183

175:                                              ; preds = %163
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %10, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  br label %184

179:                                              ; preds = %167
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %10, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %184

183:                                              ; preds = %173, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %109, !llvm.loop !15

184:                                              ; preds = %179, %175, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %198

185:                                              ; preds = %127
  %186 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  br i1 %186, label %187, label %189

187:                                              ; preds = %185
  %188 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  br label %189

189:                                              ; preds = %187, %185
  %190 = phi i1 [ false, %185 ], [ %188, %187 ]
  %191 = zext i1 %190 to i64
  %192 = select i1 %190, ptr @.str.3, ptr @.str.2
  %193 = invoke i32 @puts(ptr noundef %192)
          to label %194 unwind label %104

194:                                              ; preds = %189
  store i32 0, ptr %18, align 4
  br label %195

195:                                              ; preds = %194, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, 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
  %196 = load i32, ptr %18, align 4
  switch i32 %196, label %206 [
    i32 0, label %197
    i32 2, label %35
  ]

197:                                              ; preds = %195
  br label %35, !llvm.loop !14

198:                                              ; preds = %184, %104, %83, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, 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 %201

199:                                              ; preds = %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %200 = load i32, ptr %1, align 4
  ret i32 %200

201:                                              ; preds = %198
  %202 = load ptr, ptr %10, align 8
  %203 = load i32, ptr %11, align 4
  %204 = insertvalue { ptr, i32 } poison, ptr %202, 0
  %205 = insertvalue { ptr, i32 } %204, i32 %203, 1
  resume { ptr, i32 } %205

206:                                              ; preds = %195
  unreachable
}

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare i32 @puts(ptr noundef) #2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertEOl(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 @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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

%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::greater<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::greater<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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 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 %"class.std::multiset", align 8
  %5 = alloca %"class.std::multiset", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %17 = add nsw i64 %16, -1
  store i64 %17, ptr %1, align 8, !tbaa !5
  %.not47 = icmp eq i64 %16, 0
  br i1 %.not47, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %0, %.thread
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %19 = load i64, ptr %2, align 8, !tbaa !5
  %20 = icmp sgt i64 %19, 0
  br i1 %20, label %.lr.ph, label %.preheader35

.preheader35:                                     ; preds = %25, %.lr.ph49
  %.0.lcssa = phi i64 [ 0, %.lr.ph49 ], [ %27, %25 ]
  %21 = load i64, ptr %3, align 8, !tbaa !5
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph42, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph49, %25
  %.039 = phi i64 [ %27, %25 ], [ 0, %.lr.ph49 ]
  %.02138 = phi i64 [ %28, %25 ], [ 0, %.lr.ph49 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %6)
  %24 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %25 unwind label %31

25:                                               ; preds = %.lr.ph
  %26 = load i64, ptr %6, align 8, !tbaa !5
  %27 = add nsw i64 %26, %.039
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %28 = add nuw nsw i64 %.02138, 1
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %.lr.ph, label %.preheader35, !llvm.loop !9

31:                                               ; preds = %.lr.ph
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %100

._crit_edge:                                      ; preds = %45, %.preheader35
  %.1.lcssa = phi i64 [ %.0.lcssa, %.preheader35 ], [ %47, %45 ]
  %.not28 = icmp eq i64 %.1.lcssa, 0
  br i1 %.not28, label %.preheader, label %.thread, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge
  %33 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  br i1 %33, label %.critedge, label %.lr.ph44

.lr.ph42:                                         ; preds = %.preheader35, %45
  %.141 = phi i64 [ %47, %45 ], [ %.0.lcssa, %.preheader35 ]
  %.02640 = phi i64 [ %48, %45 ], [ 0, %.preheader35 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %7)
  %35 = invoke noundef i64 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %36 unwind label %41

36:                                               ; preds = %.lr.ph42
  %.not32 = icmp eq i64 %35, 0
  br i1 %.not32, label %43, label %37

37:                                               ; preds = %36
  %38 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE4findERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %39 unwind label %41

39:                                               ; preds = %37
  %40 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr %38)
          to label %45 unwind label %41

41:                                               ; preds = %43, %39, %37, %.lr.ph42
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %100

43:                                               ; preds = %36
  %44 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %45 unwind label %41

45:                                               ; preds = %43, %39
  %46 = load i64, ptr %7, align 8, !tbaa !5
  %47 = sub nsw i64 %.141, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %48 = add nuw nsw i64 %.02640, 1
  %49 = load i64, ptr %3, align 8, !tbaa !5
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %.lr.ph42, label %._crit_edge, !llvm.loop !12

.lr.ph44:                                         ; preds = %.preheader, %92
  %51 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  br i1 %51, label %.critedge, label %52

52:                                               ; preds = %.lr.ph44
  %53 = call noundef i64 @_ZNKSt8multisetIlSt7greaterIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %54 = call noundef i64 @_ZNKSt8multisetIlSt7greaterIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %.not29 = icmp ult i64 %53, %54
  br i1 %.not29, label %.critedge, label %55

55:                                               ; preds = %52
  %56 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %56, ptr %8, align 8
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  store ptr %59, ptr %9, align 8
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %.not30 = icmp slt i64 %58, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br i1 %.not30, label %.loopexit, label %62

62:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %63 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %63, ptr %10, align 8
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %65 = load i64, ptr %64, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %66 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  store ptr %66, ptr %11, align 8
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  %68 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %69 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr %68)
          to label %70 unwind label %78

70:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %71 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  store ptr %71, ptr %12, align 8
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = icmp eq i64 %65, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br i1 %74, label %75, label %80

75:                                               ; preds = %70
  %76 = call ptr @_ZNKSt8multisetIlSt7greaterIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %77 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr %76)
          to label %92 unwind label %78

78:                                               ; preds = %75, %62
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %100

80:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %81 = sdiv i64 %65, 2
  store i64 %81, ptr %13, align 8, !tbaa !5
  %82 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertEOl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %83 unwind label %88

83:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %84 = add nsw i64 %65, 1
  %85 = sdiv i64 %84, 2
  store i64 %85, ptr %14, align 8, !tbaa !5
  %86 = invoke ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertEOl(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %87 unwind label %90

87:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %92

88:                                               ; preds = %80
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %100

90:                                               ; preds = %83
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %100

92:                                               ; preds = %75, %87
  %93 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  br i1 %93, label %.critedge, label %.lr.ph44, !llvm.loop !13

.critedge:                                        ; preds = %52, %.lr.ph44, %92, %.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %.loopexit

.loopexit:                                        ; preds = %55, %.critedge
  %94 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  br i1 %94, label %95, label %.thread

95:                                               ; preds = %.loopexit
  %96 = call noundef zeroext i1 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %spec.select = select i1 %96, ptr @.str.3, ptr @.str.2
  br label %.thread

.thread:                                          ; preds = %.loopexit, %95, %._crit_edge
  %.sink = phi ptr [ @.str.2, %._crit_edge ], [ @.str.2, %.loopexit ], [ %spec.select, %95 ]
  %97 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.sink)
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, 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
  %98 = load i64, ptr %1, align 8, !tbaa !5
  %99 = add nsw i64 %98, -1
  store i64 %99, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %98, 0
  br i1 %.not, label %._crit_edge50, label %.lr.ph49

100:                                              ; preds = %78, %88, %90, %41, %31
  %.pn33 = phi { ptr, i32 } [ %32, %31 ], [ %42, %41 ], [ %79, %78 ], [ %91, %90 ], [ %89, %88 ]
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, 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 } %.pn33

._crit_edge50:                                    ; preds = %.thread, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; 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 uwtable
declare dso_local noundef i64 @_ZNKSt8multisetIlSt7greaterIlESaIlEE5countERKl(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 @_ZNSt8multisetIlSt7greaterIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48), ptr) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE4findERKl(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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multisetIlSt7greaterIlESaIlEE6insertEOl(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 @_ZNSt8multisetIlSt7greaterIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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