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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::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" }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_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 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

45:                                               ; preds = %40
  %46 = load i64, ptr %6, align 8, !tbaa !8
  %47 = getelementptr inbounds i64, ptr %39, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %47)
  br label %49

49:                                               ; preds = %45
  %50 = load i64, ptr %6, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %6, align 8, !tbaa !8
  br label %40, !llvm.loop !11

52:                                               ; preds = %44
  %53 = load i64, ptr %3, align 8, !tbaa !8
  %54 = load i64, ptr %2, align 8, !tbaa !8
  %55 = icmp sgt i64 %53, %54
  br i1 %55, label %56, label %75

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store i64 0, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %68, %56
  %58 = load i64, ptr %8, align 8, !tbaa !8
  %59 = load i64, ptr %2, align 8, !tbaa !8
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %71

62:                                               ; preds = %57
  %63 = load i64, ptr %8, align 8, !tbaa !8
  %64 = getelementptr inbounds i64, ptr %39, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = load i64, ptr %7, align 8, !tbaa !8
  %67 = add nsw i64 %66, %65
  store i64 %67, ptr %7, align 8, !tbaa !8
  br label %68

68:                                               ; preds = %62
  %69 = load i64, ptr %8, align 8, !tbaa !8
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr %8, align 8, !tbaa !8
  br label %57, !llvm.loop !13

71:                                               ; preds = %61
  %72 = load i64, ptr %7, align 8, !tbaa !8
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %72)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %263

75:                                               ; preds = %52
  %76 = load i64, ptr %2, align 8, !tbaa !8
  %77 = alloca i64, i64 %76, align 16
  store i64 %76, ptr %10, align 8
  %78 = load i64, ptr %2, align 8, !tbaa !8
  %79 = alloca i64, i64 %78, align 16
  store i64 %78, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 0, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #8
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %99, %75
  %81 = load i64, ptr %14, align 8, !tbaa !8
  %82 = load i64, ptr %3, align 8, !tbaa !8
  %83 = icmp slt i64 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %106

85:                                               ; preds = %80
  %86 = load i64, ptr %14, align 8, !tbaa !8
  %87 = getelementptr inbounds i64, ptr %39, i64 %86
  %88 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %87)
          to label %89 unwind label %102

89:                                               ; preds = %85
  %90 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %88, ptr %90, align 8
  %91 = load i64, ptr %14, align 8, !tbaa !8
  %92 = getelementptr inbounds i64, ptr %39, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !8
  %94 = load i64, ptr %12, align 8, !tbaa !8
  %95 = add nsw i64 %94, %93
  store i64 %95, ptr %12, align 8, !tbaa !8
  %96 = load i64, ptr %12, align 8, !tbaa !8
  %97 = load i64, ptr %14, align 8, !tbaa !8
  %98 = getelementptr inbounds i64, ptr %79, i64 %97
  store i64 %96, ptr %98, align 8, !tbaa !8
  br label %99

99:                                               ; preds = %89
  %100 = load i64, ptr %14, align 8, !tbaa !8
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %14, align 8, !tbaa !8
  br label %80, !llvm.loop !14

102:                                              ; preds = %85
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %15, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %262

106:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %107 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #8
  %108 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %107, ptr %108, align 8
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %110 = load i64, ptr %109, align 8, !tbaa !8
  %111 = load i64, ptr %3, align 8, !tbaa !8
  %112 = sub nsw i64 %111, 1
  %113 = getelementptr inbounds i64, ptr %77, i64 %112
  store i64 %110, ptr %113, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %114 = load i64, ptr %3, align 8, !tbaa !8
  store i64 %114, ptr %19, align 8, !tbaa !8
  br label %115

115:                                              ; preds = %159, %106
  %116 = load i64, ptr %19, align 8, !tbaa !8
  %117 = load i64, ptr %2, align 8, !tbaa !8
  %118 = icmp slt i64 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %166

120:                                              ; preds = %115
  %121 = load i64, ptr %19, align 8, !tbaa !8
  %122 = getelementptr inbounds i64, ptr %39, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !8
  %124 = load i64, ptr %12, align 8, !tbaa !8
  %125 = add nsw i64 %124, %123
  store i64 %125, ptr %12, align 8, !tbaa !8
  %126 = load i64, ptr %19, align 8, !tbaa !8
  %127 = load i64, ptr %3, align 8, !tbaa !8
  %128 = sub nsw i64 %126, %127
  %129 = getelementptr inbounds i64, ptr %39, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = load i64, ptr %12, align 8, !tbaa !8
  %132 = sub nsw i64 %131, %130
  store i64 %132, ptr %12, align 8, !tbaa !8
  %133 = load i64, ptr %12, align 8, !tbaa !8
  %134 = load i64, ptr %19, align 8, !tbaa !8
  %135 = getelementptr inbounds i64, ptr %79, i64 %134
  store i64 %133, ptr %135, align 8, !tbaa !8
  %136 = load i64, ptr %19, align 8, !tbaa !8
  %137 = load i64, ptr %3, align 8, !tbaa !8
  %138 = sub nsw i64 %136, %137
  %139 = getelementptr inbounds i64, ptr %39, i64 %138
  %140 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %139)
          to label %141 unwind label %162

141:                                              ; preds = %120
  %142 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %140, ptr %142, align 8
  %143 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8
  %145 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr %144)
          to label %146 unwind label %162

146:                                              ; preds = %141
  %147 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %145, ptr %147, align 8
  %148 = load i64, ptr %19, align 8, !tbaa !8
  %149 = getelementptr inbounds i64, ptr %39, i64 %148
  %150 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %149)
          to label %151 unwind label %162

151:                                              ; preds = %146
  %152 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %150, ptr %152, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %153 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #8
  %154 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %153, ptr %154, align 8
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #8
  %156 = load i64, ptr %155, align 8, !tbaa !8
  %157 = load i64, ptr %19, align 8, !tbaa !8
  %158 = getelementptr inbounds i64, ptr %77, i64 %157
  store i64 %156, ptr %158, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %159

159:                                              ; preds = %151
  %160 = load i64, ptr %19, align 8, !tbaa !8
  %161 = add nsw i64 %160, 1
  store i64 %161, ptr %19, align 8, !tbaa !8
  br label %115, !llvm.loop !15

162:                                              ; preds = %146, %141, %120
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %15, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %262

166:                                              ; preds = %119
  %167 = load i64, ptr %2, align 8, !tbaa !8
  %168 = alloca i64, i64 %167, align 16
  store i64 %167, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  store i64 0, ptr %25, align 8, !tbaa !8
  br label %169

169:                                              ; preds = %205, %166
  %170 = load i64, ptr %25, align 8, !tbaa !8
  %171 = load i64, ptr %3, align 8, !tbaa !8
  %172 = icmp slt i64 %170, %171
  br i1 %172, label %174, label %173

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

174:                                              ; preds = %169
  %175 = load i64, ptr %25, align 8, !tbaa !8
  %176 = getelementptr inbounds i64, ptr %39, i64 %175
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %178 = load i64, ptr %25, align 8, !tbaa !8
  %179 = getelementptr inbounds i64, ptr %168, i64 %178
  store i64 %177, ptr %179, align 8, !tbaa !8
  %180 = load i64, ptr %25, align 8, !tbaa !8
  %181 = icmp ne i64 %180, 0
  br i1 %181, label %182, label %191

182:                                              ; preds = %174
  %183 = load i64, ptr %25, align 8, !tbaa !8
  %184 = sub nsw i64 %183, 1
  %185 = getelementptr inbounds i64, ptr %168, i64 %184
  %186 = load i64, ptr %185, align 8, !tbaa !8
  %187 = load i64, ptr %25, align 8, !tbaa !8
  %188 = getelementptr inbounds i64, ptr %168, i64 %187
  %189 = load i64, ptr %188, align 8, !tbaa !8
  %190 = add nsw i64 %189, %186
  store i64 %190, ptr %188, align 8, !tbaa !8
  br label %191

191:                                              ; preds = %182, %174
  %192 = load i64, ptr %25, align 8, !tbaa !8
  %193 = load i64, ptr %3, align 8, !tbaa !8
  %194 = sub nsw i64 %193, 1
  %195 = icmp eq i64 %192, %194
  br i1 %195, label %196, label %204

196:                                              ; preds = %191
  %197 = load i64, ptr %25, align 8, !tbaa !8
  %198 = getelementptr inbounds i64, ptr %77, i64 %197
  %199 = load i64, ptr %198, align 8, !tbaa !8
  %200 = load i64, ptr %25, align 8, !tbaa !8
  %201 = getelementptr inbounds i64, ptr %168, i64 %200
  %202 = load i64, ptr %201, align 8, !tbaa !8
  %203 = sub nsw i64 %202, %199
  store i64 %203, ptr %201, align 8, !tbaa !8
  br label %204

204:                                              ; preds = %196, %191
  br label %205

205:                                              ; preds = %204
  %206 = load i64, ptr %25, align 8, !tbaa !8
  %207 = add nsw i64 %206, 1
  store i64 %207, ptr %25, align 8, !tbaa !8
  br label %169, !llvm.loop !16

208:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %209 = load i64, ptr %3, align 8, !tbaa !8
  store i64 %209, ptr %26, align 8, !tbaa !8
  br label %210

210:                                              ; preds = %242, %208
  %211 = load i64, ptr %26, align 8, !tbaa !8
  %212 = load i64, ptr %2, align 8, !tbaa !8
  %213 = icmp slt i64 %211, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %210
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %249

215:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %216 = load i64, ptr %26, align 8, !tbaa !8
  %217 = getelementptr inbounds i64, ptr %79, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !8
  %219 = load i64, ptr %26, align 8, !tbaa !8
  %220 = getelementptr inbounds i64, ptr %77, i64 %219
  %221 = load i64, ptr %220, align 8, !tbaa !8
  %222 = sub nsw i64 %218, %221
  %223 = load i64, ptr %26, align 8, !tbaa !8
  %224 = load i64, ptr %3, align 8, !tbaa !8
  %225 = sub nsw i64 %223, %224
  %226 = getelementptr inbounds i64, ptr %168, i64 %225
  %227 = load i64, ptr %226, align 8, !tbaa !8
  %228 = add nsw i64 %222, %227
  store i64 %228, ptr %27, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %229 = load i64, ptr %26, align 8, !tbaa !8
  %230 = sub nsw i64 %229, 1
  %231 = getelementptr inbounds i64, ptr %168, i64 %230
  %232 = load i64, ptr %231, align 8, !tbaa !8
  %233 = load i64, ptr %26, align 8, !tbaa !8
  %234 = getelementptr inbounds i64, ptr %39, i64 %233
  %235 = load i64, ptr %234, align 8, !tbaa !8
  %236 = add nsw i64 %232, %235
  store i64 %236, ptr %28, align 8, !tbaa !8
  %237 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %238 unwind label %245

238:                                              ; preds = %215
  %239 = load i64, ptr %237, align 8, !tbaa !8
  %240 = load i64, ptr %26, align 8, !tbaa !8
  %241 = getelementptr inbounds i64, ptr %168, i64 %240
  store i64 %239, ptr %241, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %242

242:                                              ; preds = %238
  %243 = load i64, ptr %26, align 8, !tbaa !8
  %244 = add nsw i64 %243, 1
  store i64 %244, ptr %26, align 8, !tbaa !8
  br label %210, !llvm.loop !17

245:                                              ; preds = %215
  %246 = landingpad { ptr, i32 }
          cleanup
  %247 = extractvalue { ptr, i32 } %246, 0
  store ptr %247, ptr %15, align 8
  %248 = extractvalue { ptr, i32 } %246, 1
  store i32 %248, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %262

249:                                              ; preds = %214
  %250 = load i64, ptr %2, align 8, !tbaa !8
  %251 = sub nsw i64 %250, 1
  %252 = getelementptr inbounds i64, ptr %168, i64 %251
  %253 = load i64, ptr %252, align 8, !tbaa !8
  %254 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %253)
          to label %255 unwind label %258

255:                                              ; preds = %249
  %256 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %254, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %257 unwind label %258

257:                                              ; preds = %255
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %263

258:                                              ; preds = %255, %249
  %259 = landingpad { ptr, i32 }
          cleanup
  %260 = extractvalue { ptr, i32 } %259, 0
  store ptr %260, ptr %15, align 8
  %261 = extractvalue { ptr, i32 } %259, 1
  store i32 %261, ptr %16, align 4
  br label %262

262:                                              ; preds = %258, %245, %162, %102
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %266

263:                                              ; preds = %257, %71
  %264 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %264)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %265 = load i32, ptr %1, align 4
  ret i32 %265

266:                                              ; preds = %262
  %267 = load ptr, ptr %15, align 8
  %268 = load i32, ptr %16, align 4
  %269 = insertvalue { ptr, i32 } poison, ptr %267, 0
  %270 = insertvalue { ptr, i32 } %269, i32 %268, 1
  resume { ptr, i32 } %270
}

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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::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" }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_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 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 %"class.std::multiset", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %16 = load i64, ptr %1, align 8, !tbaa !8
  %17 = call ptr @llvm.stacksave.p0()
  %18 = alloca i64, i64 %16, align 16
  %19 = load i64, ptr %1, align 8, !tbaa !8
  %20 = icmp sgt i64 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa71 = phi i64 [ %19, %0 ], [ %33, %.lr.ph ]
  %21 = load i64, ptr %2, align 8, !tbaa !8
  %22 = icmp sgt i64 %21, %.lcssa71
  br i1 %22, label %.preheader, label %41

.preheader:                                       ; preds = %._crit_edge
  %23 = icmp sgt i64 %.lcssa71, 0
  br i1 %23, label %.lr.ph95.preheader, label %._crit_edge96

.lr.ph95.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i64 %.lcssa71, 4
  br i1 %min.iters.check, label %.lr.ph95.preheader119, label %vector.ph

.lr.ph95.preheader119:                            ; preds = %middle.block, %.lr.ph95.preheader
  %.05394.ph = phi i64 [ 0, %.lr.ph95.preheader ], [ %29, %middle.block ]
  %.05493.ph = phi i64 [ 0, %.lr.ph95.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph95

vector.ph:                                        ; preds = %.lr.ph95.preheader
  %n.vec = and i64 %.lcssa71, 9223372036854775804
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
  %vec.phi117 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ]
  %24 = getelementptr inbounds i64, ptr %18, i64 %index
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %wide.load = load <2 x i64>, ptr %24, align 16, !tbaa !8
  %wide.load118 = load <2 x i64>, ptr %25, align 16, !tbaa !8
  %26 = add <2 x i64> %wide.load, %vec.phi
  %27 = add <2 x i64> %wide.load118, %vec.phi117
  %index.next = add nuw i64 %index, 4
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %27, %26
  %29 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %.lcssa71, %n.vec
  br i1 %cmp.n, label %._crit_edge96, label %.lr.ph95.preheader119

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.05272 = phi i64 [ %32, %.lr.ph ], [ 0, %0 ]
  %30 = getelementptr inbounds i64, ptr %18, i64 %.05272
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = add nuw nsw i64 %.05272, 1
  %33 = load i64, ptr %1, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge96:                                    ; preds = %.lr.ph95, %middle.block, %.preheader
  %.053.lcssa = phi i64 [ 0, %.preheader ], [ %29, %middle.block ], [ %39, %.lr.ph95 ]
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.053.lcssa)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %168

.lr.ph95:                                         ; preds = %.lr.ph95.preheader119, %.lr.ph95
  %.05394 = phi i64 [ %39, %.lr.ph95 ], [ %.05394.ph, %.lr.ph95.preheader119 ]
  %.05493 = phi i64 [ %40, %.lr.ph95 ], [ %.05493.ph, %.lr.ph95.preheader119 ]
  %37 = getelementptr inbounds i64, ptr %18, i64 %.05493
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = add nsw i64 %38, %.05394
  %40 = add nuw nsw i64 %.05493, 1
  %exitcond104.not = icmp eq i64 %40, %.lcssa71
  br i1 %exitcond104.not, label %._crit_edge96, label %.lr.ph95, !llvm.loop !16

41:                                               ; preds = %._crit_edge
  %42 = alloca i64, i64 %.lcssa71, align 16
  %43 = alloca i64, i64 %.lcssa71, align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #9
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  %44 = load i64, ptr %2, align 8, !tbaa !8
  %45 = icmp sgt i64 %44, 0
  br i1 %45, label %.lr.ph76, label %._crit_edge77

._crit_edge77:                                    ; preds = %56, %41
  %.059.lcssa = phi i64 [ 0, %41 ], [ %58, %56 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %46 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  store ptr %46, ptr %4, align 8
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  %48 = load i64, ptr %47, align 8, !tbaa !8
  %49 = load i64, ptr %2, align 8, !tbaa !8
  %50 = getelementptr i64, ptr %42, i64 %49
  %51 = getelementptr i8, ptr %50, i64 -8
  store i64 %48, ptr %51, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %52 = load i64, ptr %1, align 8, !tbaa !8
  %53 = icmp slt i64 %49, %52
  br i1 %53, label %.lr.ph82, label %._crit_edge83

.lr.ph76:                                         ; preds = %41, %56
  %.05874 = phi i64 [ %60, %56 ], [ 0, %41 ]
  %.05973 = phi i64 [ %58, %56 ], [ 0, %41 ]
  %54 = getelementptr inbounds i64, ptr %18, i64 %.05874
  %55 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %54)
          to label %56 unwind label %63

56:                                               ; preds = %.lr.ph76
  %57 = load i64, ptr %54, align 8, !tbaa !8
  %58 = add nsw i64 %57, %.05973
  %59 = getelementptr inbounds i64, ptr %43, i64 %.05874
  store i64 %58, ptr %59, align 8, !tbaa !8
  %60 = add nuw nsw i64 %.05874, 1
  %61 = load i64, ptr %2, align 8, !tbaa !8
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %.lr.ph76, label %._crit_edge77, !llvm.loop !17

63:                                               ; preds = %.lr.ph76
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %167

._crit_edge83.loopexit:                           ; preds = %91
  %.pre = load i64, ptr %2, align 8, !tbaa !8
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit, %._crit_edge77
  %65 = phi i64 [ %49, %._crit_edge77 ], [ %.pre, %._crit_edge83.loopexit ]
  %66 = phi i64 [ %52, %._crit_edge77 ], [ %97, %._crit_edge83.loopexit ]
  %67 = alloca i64, i64 %66, align 16
  %68 = icmp sgt i64 %65, 0
  br i1 %68, label %69, label %.preheader66

69:                                               ; preds = %._crit_edge83
  %70 = add nsw i64 %65, -1
  %71 = load i64, ptr %18, align 16, !tbaa !8
  store i64 %71, ptr %67, align 16, !tbaa !8
  %72 = icmp eq i64 %70, 0
  br i1 %72, label %.thread, label %.peel.next

.thread:                                          ; preds = %69
  %73 = load i64, ptr %42, align 16, !tbaa !8
  %74 = sub nsw i64 %71, %73
  store i64 %74, ptr %67, align 16, !tbaa !8
  br label %.preheader66

.peel.next:                                       ; preds = %69
  %75 = getelementptr inbounds i64, ptr %42, i64 %70
  %xtraiter = and i64 %70, 1
  %76 = icmp eq i64 %65, 2
  br i1 %76, label %.preheader66.loopexit.unr-lcssa, label %.peel.next.new

.peel.next.new:                                   ; preds = %.peel.next
  %unroll_iter = and i64 %70, -2
  br label %112

.lr.ph82:                                         ; preds = %._crit_edge77, %91
  %.05580 = phi i64 [ %96, %91 ], [ %49, %._crit_edge77 ]
  %.179 = phi i64 [ %84, %91 ], [ %.059.lcssa, %._crit_edge77 ]
  %77 = getelementptr inbounds i64, ptr %18, i64 %.05580
  %78 = load i64, ptr %77, align 8, !tbaa !8
  %79 = add nsw i64 %78, %.179
  %80 = load i64, ptr %2, align 8, !tbaa !8
  %81 = sub nsw i64 %.05580, %80
  %82 = getelementptr inbounds i64, ptr %18, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = sub i64 %79, %83
  %85 = getelementptr inbounds i64, ptr %43, i64 %.05580
  store i64 %84, ptr %85, align 8, !tbaa !8
  %86 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE4findERKx(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %82)
          to label %87 unwind label %99

87:                                               ; preds = %.lr.ph82
  %88 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIxE(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr %86)
          to label %89 unwind label %99

89:                                               ; preds = %87
  %90 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %77)
          to label %91 unwind label %99

91:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %92 = call ptr @_ZNKSt8multisetIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  store ptr %92, ptr %5, align 8
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = getelementptr inbounds i64, ptr %42, i64 %.05580
  store i64 %94, ptr %95, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  %96 = add nsw i64 %.05580, 1
  %97 = load i64, ptr %1, align 8, !tbaa !8
  %98 = icmp slt i64 %96, %97
  br i1 %98, label %.lr.ph82, label %._crit_edge83.loopexit, !llvm.loop !18

99:                                               ; preds = %89, %87, %.lr.ph82
  %100 = landingpad { ptr, i32 }
          cleanup
  br label %167

.preheader66.loopexit.unr-lcssa:                  ; preds = %135, %.peel.next
  %.05085.unr = phi i64 [ 1, %.peel.next ], [ %136, %135 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader66, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader66.loopexit.unr-lcssa
  %101 = getelementptr inbounds i64, ptr %18, i64 %.05085.unr
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = getelementptr inbounds i64, ptr %67, i64 %.05085.unr
  %104 = getelementptr i8, ptr %103, i64 -8
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = add nsw i64 %105, %102
  store i64 %106, ptr %103, align 8, !tbaa !8
  %107 = icmp eq i64 %.05085.unr, %70
  br i1 %107, label %108, label %.preheader66

108:                                              ; preds = %.epil.preheader
  %109 = load i64, ptr %75, align 8, !tbaa !8
  %110 = sub nsw i64 %106, %109
  store i64 %110, ptr %103, align 8, !tbaa !8
  br label %.preheader66

.preheader66:                                     ; preds = %.preheader66.loopexit.unr-lcssa, %108, %.epil.preheader, %.thread, %._crit_edge83
  %111 = icmp slt i64 %65, %66
  br i1 %111, label %.lr.ph90, label %._crit_edge91

112:                                              ; preds = %135, %.peel.next.new
  %.05085 = phi i64 [ 1, %.peel.next.new ], [ %136, %135 ]
  %niter = phi i64 [ 0, %.peel.next.new ], [ %niter.next.1, %135 ]
  %113 = getelementptr inbounds i64, ptr %18, i64 %.05085
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %115 = getelementptr inbounds i64, ptr %67, i64 %.05085
  %116 = getelementptr i8, ptr %115, i64 -8
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = add nsw i64 %117, %114
  store i64 %118, ptr %115, align 8, !tbaa !8
  %119 = icmp eq i64 %.05085, %70
  br i1 %119, label %120, label %123

120:                                              ; preds = %112
  %121 = load i64, ptr %75, align 8, !tbaa !8
  %122 = sub nsw i64 %118, %121
  store i64 %122, ptr %115, align 8, !tbaa !8
  br label %123

123:                                              ; preds = %112, %120
  %124 = add nuw nsw i64 %.05085, 1
  %125 = getelementptr inbounds i64, ptr %18, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !8
  %127 = getelementptr inbounds i64, ptr %67, i64 %124
  %128 = getelementptr i8, ptr %127, i64 -8
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %130 = add nsw i64 %129, %126
  store i64 %130, ptr %127, align 8, !tbaa !8
  %131 = icmp eq i64 %124, %70
  br i1 %131, label %132, label %135

132:                                              ; preds = %123
  %133 = load i64, ptr %75, align 8, !tbaa !8
  %134 = sub nsw i64 %130, %133
  store i64 %134, ptr %127, align 8, !tbaa !8
  br label %135

135:                                              ; preds = %132, %123
  %136 = add nuw nsw i64 %.05085, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader66.loopexit.unr-lcssa, label %112, !llvm.loop !19

._crit_edge91:                                    ; preds = %.lr.ph90, %.preheader66
  %.lcssa = phi i64 [ %66, %.preheader66 ], [ %160, %.lr.ph90 ]
  %137 = getelementptr i64, ptr %67, i64 %.lcssa
  %138 = getelementptr i8, ptr %137, i64 -8
  %139 = load i64, ptr %138, align 8, !tbaa !8
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %139)
          to label %162 unwind label %165

.lr.ph90:                                         ; preds = %.preheader66, %.lr.ph90
  %.089 = phi i64 [ %159, %.lr.ph90 ], [ %65, %.preheader66 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %141 = getelementptr inbounds i64, ptr %43, i64 %.089
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = getelementptr inbounds i64, ptr %42, i64 %.089
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %145 = sub i64 %142, %144
  %146 = load i64, ptr %2, align 8, !tbaa !8
  %147 = sub nsw i64 %.089, %146
  %148 = getelementptr inbounds i64, ptr %67, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = add nsw i64 %145, %149
  store i64 %150, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %151 = getelementptr i64, ptr %67, i64 %.089
  %152 = getelementptr i8, ptr %151, i64 -8
  %153 = load i64, ptr %152, align 8, !tbaa !8
  %154 = getelementptr inbounds i64, ptr %18, i64 %.089
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = add nsw i64 %155, %153
  store i64 %156, ptr %7, align 8, !tbaa !8
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %158 = load i64, ptr %157, align 8, !tbaa !8
  store i64 %158, ptr %151, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %159 = add nsw i64 %.089, 1
  %160 = load i64, ptr %1, align 8, !tbaa !8
  %161 = icmp slt i64 %159, %160
  br i1 %161, label %.lr.ph90, label %._crit_edge91, !llvm.loop !21

162:                                              ; preds = %._crit_edge91
  %163 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %164 unwind label %165

164:                                              ; preds = %162
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #9
  br label %168

165:                                              ; preds = %162, %._crit_edge91
  %166 = landingpad { ptr, i32 }
          cleanup
  br label %167

167:                                              ; preds = %165, %99, %63
  %.pn = phi { ptr, i32 } [ %64, %63 ], [ %100, %99 ], [ %166, %165 ]
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn

168:                                              ; preds = %164, %._crit_edge96
  call void @llvm.stackrestore.p0(ptr %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #8

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

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

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass