; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Codeforces/Codeforces Round 283 (Div 2) (Distributing Parts)

; 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"

%struct.Record = type { i32, i32, i32, i32, i32 }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<Record, Record, std::_Identity<Record>, std::less<Record>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Record, Record, std::_Identity<Record>, std::less<Record>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@all = external dso_local global [200010 x %struct.Record], align 16
@actors = external dso_local global %"class.std::multiset", align 8
@ans = external dso_local global %"class.std::map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.Record, align 4
  %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 %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %45, %0
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %48

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %24
  %26 = getelementptr inbounds %struct.Record, ptr %25, i32 0, i32 0
  store i32 0, ptr %26, align 4, !tbaa !9
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.Record, ptr %31, i32 0, i32 1
  store i32 %28, ptr %32, align 4, !tbaa !11
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.Record, ptr %35, i32 0, i32 2
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %36)
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %39
  %41 = getelementptr inbounds %struct.Record, ptr %40, i32 0, i32 3
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %22
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %17, !llvm.loop !12

48:                                               ; preds = %21
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %83, %48
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %86

55:                                               ; preds = %50
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.Record, ptr %58, i32 0, i32 0
  store i32 1, ptr %59, align 4, !tbaa !9
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %63
  %65 = getelementptr inbounds %struct.Record, ptr %64, i32 0, i32 1
  store i32 %61, ptr %65, align 4, !tbaa !11
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %67
  %69 = getelementptr inbounds %struct.Record, ptr %68, i32 0, i32 2
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %69)
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.Record, ptr %73, i32 0, i32 3
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %70, ptr noundef nonnull align 4 dereferenceable(4) %74)
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.Record, ptr %78, i32 0, i32 4
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %75, ptr noundef nonnull align 4 dereferenceable(4) %79)
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %2, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %55
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  br label %50, !llvm.loop !14

86:                                               ; preds = %54
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %struct.Record, ptr @all, i64 %88
  call void @_ZSt4sortIP6RecordPFbS0_S0_EEvT_S4_T0_(ptr noundef @all, ptr noundef %89, ptr noundef @_Z14compare_Record6RecordS_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %142, %86
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr %2, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 8, ptr %8, align 4
  br label %145

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 20, ptr %9) #7
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %97
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %98, i64 20, i1 false), !tbaa.struct !15
  %99 = getelementptr inbounds %struct.Record, ptr %9, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = icmp eq i32 %100, 1
  br i1 %101, label %102, label %105

102:                                              ; preds = %95
  %103 = call ptr @_ZNSt8multisetI6RecordSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48) @actors, ptr noundef nonnull align 4 dereferenceable(20) %9)
  %104 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %103, ptr %104, align 8
  br label %138

105:                                              ; preds = %95
  %106 = call noundef i64 @_ZNKSt8multisetI6RecordSt4lessIS0_ESaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @actors) #7
  %107 = icmp ugt i64 %106, 0
  br i1 %107, label %108, label %134

108:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %109 = call ptr @_ZNSt8multisetI6RecordSt4lessIS0_ESaIS0_EE11lower_boundERKS0_(ptr noundef nonnull align 8 dereferenceable(48) @actors, ptr noundef nonnull align 4 dereferenceable(20) %9)
  %110 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %111 = call ptr @_ZNKSt8multisetI6RecordSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @actors) #7
  %112 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %12, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  %113 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI6RecordES3_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br i1 %113, label %114, label %133

114:                                              ; preds = %108
  %115 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNKSt23_Rb_tree_const_iteratorI6RecordEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @_ZN6Record12DecreaseNumsEv(ptr noundef nonnull align 4 dereferenceable(20) %115)
  %116 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI6RecordEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %117 = getelementptr inbounds %struct.Record, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !11
  %119 = getelementptr inbounds %struct.Record, ptr %9, i32 0, i32 1
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ans, ptr noundef nonnull align 4 dereferenceable(4) %119)
  store i32 %118, ptr %120, align 4, !tbaa !5
  %121 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI6RecordEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %122 = getelementptr inbounds %struct.Record, ptr %121, i32 0, i32 4
  %123 = load i32, ptr %122, align 4, !tbaa !16
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %132

125:                                              ; preds = %114
  %126 = call ptr @_ZNSt23_Rb_tree_const_iteratorI6RecordEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #7
  %127 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %126, ptr %127, align 8
  %128 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8
  %130 = call ptr @_ZNSt8multisetI6RecordSt4lessIS0_ESaIS0_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(48) @actors, ptr %129)
  %131 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %130, ptr %131, align 8
  br label %132

132:                                              ; preds = %125, %114
  br label %133

133:                                              ; preds = %132, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %137

134:                                              ; preds = %105
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %139

137:                                              ; preds = %133
  br label %138

138:                                              ; preds = %137, %102
  store i32 0, ptr %8, align 4
  br label %139

139:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 20, ptr %9) #7
  %140 = load i32, ptr %8, align 4
  switch i32 %140, label %145 [
    i32 0, label %141
  ]

141:                                              ; preds = %139
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %7, align 4, !tbaa !5
  br label %90, !llvm.loop !17

145:                                              ; preds = %139, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %146 = load i32, ptr %8, align 4
  switch i32 %146, label %173 [
    i32 8, label %147
  ]

147:                                              ; preds = %145
  %148 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @ans) #7
  %149 = load i32, ptr %3, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = icmp eq i64 %148, %150
  br i1 %151, label %152, label %169

152:                                              ; preds = %147
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %165, %152
  %156 = load i32, ptr %15, align 4, !tbaa !5
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = icmp sle i32 %156, %157
  br i1 %158, label %160, label %159

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

160:                                              ; preds = %155
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ans, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %162)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %163, ptr noundef @.str.5)
  br label %165

165:                                              ; preds = %160
  %166 = load i32, ptr %15, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %15, align 4, !tbaa !5
  br label %155, !llvm.loop !18

168:                                              ; preds = %159
  br label %172

169:                                              ; preds = %147
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %170, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %172

172:                                              ; preds = %169, %168
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %173

173:                                              ; preds = %172, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %174 = load i32, ptr %1, align 4
  ret i32 %174
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Record12DecreaseNumsEv(ptr noundef nonnull align 4 dereferenceable(20)) #0 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

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

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


; 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"

%struct.Record = type { i32, i32, i32, i32, i32 }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<Record, Record, std::_Identity<Record>, std::less<Record>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<Record, Record, std::_Identity<Record>, std::less<Record>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@all = external dso_local global [200010 x %struct.Record], align 16
@actors = external dso_local global %"class.std::multiset", align 8
@ans = external dso_local global %"class.std::map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Record, align 4
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.028.lcssa = phi i32 [ 0, %0 ], [ %indvars57, %.lr.ph ]
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  %13 = zext i32 %.028.lcssa to i64
  br i1 %12, label %.lr.ph44, label %._crit_edge45

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %indvars.iv
  store i32 0, ptr %14, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %indvars57 = trunc i64 %indvars.iv.next to i32
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  store i32 %indvars57, ptr %15, align 4, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %14, i64 8
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %18 = getelementptr inbounds i8, ptr %14, i64 12
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, %indvars57
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge45.thread:                             ; preds = %.lr.ph44
  %22 = and i64 %indvars.iv.next60, 4294967295
  %23 = getelementptr inbounds %struct.Record, ptr @all, i64 %22
  call void @_ZSt4sortIP6RecordPFbS0_S0_EEvT_S4_T0_(ptr noundef nonnull @all, ptr noundef nonnull %23, ptr noundef nonnull @_Z14compare_Record6RecordS_)
  br label %.lr.ph50

._crit_edge45:                                    ; preds = %._crit_edge
  %24 = getelementptr inbounds %struct.Record, ptr @all, i64 %13
  call void @_ZSt4sortIP6RecordPFbS0_S0_EEvT_S4_T0_(ptr noundef nonnull @all, ptr noundef nonnull %24, ptr noundef nonnull @_Z14compare_Record6RecordS_)
  %.not3547.not = icmp eq i32 %.028.lcssa, 0
  br i1 %.not3547.not, label %.critedge38, label %.lr.ph50

.lr.ph50:                                         ; preds = %._crit_edge45.thread, %._crit_edge45
  %25 = phi i64 [ %22, %._crit_edge45.thread ], [ %13, %._crit_edge45 ]
  %26 = getelementptr inbounds i8, ptr %3, i64 4
  br label %38

.lr.ph44:                                         ; preds = %._crit_edge, %.lr.ph44
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph44 ], [ %13, %._crit_edge ]
  %.03441 = phi i32 [ %28, %.lr.ph44 ], [ 0, %._crit_edge ]
  %27 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %indvars.iv59
  store i32 1, ptr %27, align 4, !tbaa !9
  %28 = add nuw nsw i32 %.03441, 1
  %29 = getelementptr inbounds i8, ptr %27, i64 4
  store i32 %28, ptr %29, align 4, !tbaa !11
  %30 = getelementptr inbounds i8, ptr %27, i64 8
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %30)
  %32 = getelementptr inbounds i8, ptr %27, i64 12
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %34 = getelementptr inbounds i8, ptr %27, i64 16
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 4 dereferenceable(4) %34)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp slt i32 %28, %36
  br i1 %37, label %.lr.ph44, label %._crit_edge45.thread, !llvm.loop !14

38:                                               ; preds = %.lr.ph50, %66
  %indvars.iv62 = phi i64 [ 0, %.lr.ph50 ], [ %indvars.iv.next63, %66 ]
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #7
  %39 = getelementptr inbounds [200010 x %struct.Record], ptr @all, i64 0, i64 %indvars.iv62
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %3, ptr noundef nonnull align 4 dereferenceable(20) %39, i64 20, i1 false), !tbaa.struct !15
  %40 = load i32, ptr %3, align 4, !tbaa !9
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %44

42:                                               ; preds = %38
  %43 = call ptr @_ZNSt8multisetI6RecordSt4lessIS0_ESaIS0_EE6insertERKS0_(ptr noundef nonnull align 8 dereferenceable(48) @actors, ptr noundef nonnull align 4 dereferenceable(20) %3)
  br label %66

44:                                               ; preds = %38
  %45 = call noundef i64 @_ZNKSt8multisetI6RecordSt4lessIS0_ESaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @actors) #7
  %.not = icmp eq i64 %45, 0
  br i1 %.not, label %.critedge, label %46

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %47 = call ptr @_ZNSt8multisetI6RecordSt4lessIS0_ESaIS0_EE11lower_boundERKS0_(ptr noundef nonnull align 8 dereferenceable(48) @actors, ptr noundef nonnull align 4 dereferenceable(20) %3)
  store ptr %47, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %48 = call ptr @_ZNKSt8multisetI6RecordSt4lessIS0_ESaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @actors) #7
  store ptr %48, ptr %5, align 8
  %49 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorI6RecordES3_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br i1 %49, label %50, label %63

50:                                               ; preds = %46
  %51 = call noundef nonnull align 4 dereferenceable(20) ptr @_ZNKSt23_Rb_tree_const_iteratorI6RecordEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @_ZN6Record12DecreaseNumsEv(ptr noundef nonnull align 4 dereferenceable(20) %51)
  %52 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI6RecordEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %53 = getelementptr inbounds i8, ptr %52, i64 4
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ans, ptr noundef nonnull align 4 dereferenceable(4) %26)
  store i32 %54, ptr %55, align 4, !tbaa !5
  %56 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorI6RecordEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load i32, ptr %57, align 4, !tbaa !16
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %50
  %61 = call ptr @_ZNSt23_Rb_tree_const_iteratorI6RecordEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #7
  %62 = call ptr @_ZNSt8multisetI6RecordSt4lessIS0_ESaIS0_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS0_E(ptr noundef nonnull align 8 dereferenceable(48) @actors, ptr %61)
  br label %63

63:                                               ; preds = %50, %60, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %66

.critedge:                                        ; preds = %44
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #7
  br label %85

66:                                               ; preds = %42, %63
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #7
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next63, %25
  br i1 %exitcond.not, label %.critedge38, label %38, !llvm.loop !17

.critedge38:                                      ; preds = %66, %._crit_edge45
  %67 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @ans) #7
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp eq i64 %67, %69
  br i1 %70, label %71, label %82

71:                                               ; preds = %.critedge38
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %.not3651 = icmp slt i32 %74, 1
  br i1 %.not3651, label %._crit_edge54, label %.lr.ph53

._crit_edge54:                                    ; preds = %.lr.ph53, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %85

.lr.ph53:                                         ; preds = %71, %.lr.ph53
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ans, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %76)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull @.str.5)
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %.not36.not = icmp slt i32 %79, %81
  br i1 %.not36.not, label %.lr.ph53, label %._crit_edge54, !llvm.loop !18

82:                                               ; preds = %.critedge38
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %85

85:                                               ; preds = %.critedge, %._crit_edge54, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Record12DecreaseNumsEv(ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

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

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


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