; LLVM IR from AdarshGaur/Competitive-Programming :: Google/Kickstart 2022/Kickstart Round E 2022/Students and Mentors.ll (Z5solvev)

; 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, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { i8 }

@_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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::multiset", align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca i64, align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %26 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %28 = load i64, ptr %1, align 8, !tbaa !5
  %29 = call ptr @llvm.stacksave.p0()
  store ptr %29, ptr %2, align 8
  %30 = alloca i64, i64 %28, align 16
  store i64 %28, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #6
  call void @_ZNSt8multisetIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr %30, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  store ptr %31, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = mul nuw i64 8, %28
  %34 = udiv i64 %33, 8
  %35 = getelementptr inbounds i64, ptr %32, i64 %34
  store ptr %35, ptr %7, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %50, %0
  %37 = load ptr, ptr %6, align 8, !tbaa !9
  %38 = load ptr, ptr %7, align 8, !tbaa !9
  %39 = icmp ne ptr %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %42, ptr %8, align 8, !tbaa !9
  %43 = load ptr, ptr %8, align 8, !tbaa !9
  %44 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %43)
          to label %45 unwind label %53

45:                                               ; preds = %41
  %46 = load ptr, ptr %8, align 8, !tbaa !9
  %47 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %46)
          to label %48 unwind label %53

48:                                               ; preds = %45
  %49 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %47, ptr %49, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %50

50:                                               ; preds = %48
  %51 = load ptr, ptr %6, align 8, !tbaa !9
  %52 = getelementptr inbounds i64, ptr %51, i32 1
  store ptr %52, ptr %6, align 8, !tbaa !9
  br label %36

53:                                               ; preds = %45, %41
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %9, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %197

57:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %58 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %58, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %59 unwind label %65

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

60:                                               ; preds = %156, %59
  %61 = load i64, ptr %14, align 8, !tbaa !5
  %62 = load i64, ptr %1, align 8, !tbaa !5
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %69, label %64

64:                                               ; preds = %60
  store i32 4, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %165

65:                                               ; preds = %57
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %9, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %196

69:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %70 = load i64, ptr %14, align 8, !tbaa !5
  %71 = getelementptr inbounds i64, ptr %30, i64 %70
  %72 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE11lower_boundERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %71)
          to label %73 unwind label %89

73:                                               ; preds = %69
  %74 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %72, ptr %74, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %16, i64 8, i1 false), !tbaa.struct !11
  %75 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8
  %77 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr %76)
          to label %78 unwind label %89

78:                                               ; preds = %73
  %79 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %77, ptr %79, align 8
  %80 = call noundef zeroext i1 @_ZNKSt8multisetIlSt4lessIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  br i1 %80, label %81, label %93

81:                                               ; preds = %78
  %82 = load i64, ptr %14, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %82) #6
  store i64 -1, ptr %83, align 8, !tbaa !5
  %84 = load i64, ptr %14, align 8, !tbaa !5
  %85 = getelementptr inbounds i64, ptr %30, i64 %84
  %86 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %85)
          to label %87 unwind label %89

87:                                               ; preds = %81
  %88 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %86, ptr %88, align 8
  store i32 6, ptr %15, align 4
  br label %153

89:                                               ; preds = %81, %73, %69
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %9, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %10, align 4
  br label %164

93:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %94 = load i64, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds i64, ptr %30, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = mul nsw i64 2, %96
  store i64 %97, ptr %21, align 8, !tbaa !5
  %98 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE11lower_boundERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %99 unwind label %117

99:                                               ; preds = %93
  %100 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %98, ptr %100, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %101 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  %102 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %101, ptr %102, align 8
  %103 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br i1 %103, label %104, label %125

104:                                              ; preds = %99
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %106 = load i64, ptr %105, align 8, !tbaa !5
  %107 = load i64, ptr %14, align 8, !tbaa !5
  %108 = getelementptr inbounds i64, ptr %30, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !5
  %110 = mul nsw i64 2, %109
  %111 = icmp sle i64 %106, %110
  br i1 %111, label %112, label %121

112:                                              ; preds = %104
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %114 = load i64, ptr %113, align 8, !tbaa !5
  %115 = load i64, ptr %14, align 8, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %115) #6
  store i64 %114, ptr %116, align 8, !tbaa !5
  br label %124

117:                                              ; preds = %93
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %9, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %163

121:                                              ; preds = %104
  %122 = load i64, ptr %14, align 8, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %122) #6
  store i64 -1, ptr %123, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %121, %112
  br label %147

125:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %126 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  %127 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %126, ptr %127, align 8
  %128 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %23) #6
  br i1 %128, label %137, label %129

129:                                              ; preds = %125
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %131 = load i64, ptr %130, align 8, !tbaa !5
  %132 = load i64, ptr %14, align 8, !tbaa !5
  %133 = getelementptr inbounds i64, ptr %30, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !5
  %135 = mul nsw i64 2, %134
  %136 = icmp sgt i64 %131, %135
  br label %137

137:                                              ; preds = %129, %125
  %138 = phi i1 [ true, %125 ], [ %136, %129 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br i1 %138, label %139, label %142

139:                                              ; preds = %137
  %140 = call ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef 0) #6
  %141 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %140, ptr %141, align 8
  br label %142

142:                                              ; preds = %139, %137
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %144 = load i64, ptr %143, align 8, !tbaa !5
  %145 = load i64, ptr %14, align 8, !tbaa !5
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %145) #6
  store i64 %144, ptr %146, align 8, !tbaa !5
  br label %147

147:                                              ; preds = %142, %124
  %148 = load i64, ptr %14, align 8, !tbaa !5
  %149 = getelementptr inbounds i64, ptr %30, i64 %148
  %150 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(8) %149)
          to label %151 unwind label %159

151:                                              ; preds = %147
  %152 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %150, ptr %152, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  store i32 0, ptr %15, align 4
  br label %153

153:                                              ; preds = %151, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %154 = load i32, ptr %15, align 4
  switch i32 %154, label %203 [
    i32 0, label %155
    i32 6, label %156
  ]

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155, %153
  %157 = load i64, ptr %14, align 8, !tbaa !5
  %158 = add nsw i64 %157, 1
  store i64 %158, ptr %14, align 8, !tbaa !5
  br label %60, !llvm.loop !12

159:                                              ; preds = %147
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %9, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %10, align 4
  br label %163

163:                                              ; preds = %159, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %164

164:                                              ; preds = %163, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %195

165:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store i64 0, ptr %26, align 8, !tbaa !5
  br label %166

166:                                              ; preds = %186, %165
  %167 = load i64, ptr %26, align 8, !tbaa !5
  %168 = load i64, ptr %1, align 8, !tbaa !5
  %169 = icmp slt i64 %167, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %166
  store i32 7, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %193

171:                                              ; preds = %166
  %172 = load i64, ptr %26, align 8, !tbaa !5
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %172) #6
  %174 = load i64, ptr %173, align 8, !tbaa !5
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %174)
          to label %176 unwind label %189

176:                                              ; preds = %171
  %177 = load i64, ptr %26, align 8, !tbaa !5
  %178 = load i64, ptr %1, align 8, !tbaa !5
  %179 = sub nsw i64 %178, 1
  %180 = icmp eq i64 %177, %179
  %181 = zext i1 %180 to i64
  %182 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %181
  %183 = load i8, ptr %182, align 1, !tbaa !14
  %184 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %175, i8 noundef signext %183)
          to label %185 unwind label %189

185:                                              ; preds = %176
  br label %186

186:                                              ; preds = %185
  %187 = load i64, ptr %26, align 8, !tbaa !5
  %188 = add nsw i64 %187, 1
  store i64 %188, ptr %26, align 8, !tbaa !5
  br label %166, !llvm.loop !15

189:                                              ; preds = %176, %171
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %9, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %195

193:                                              ; preds = %170
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #6
  %194 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %194)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void

195:                                              ; preds = %189, %164
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  br label %196

196:                                              ; preds = %195, %65
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  br label %197

197:                                              ; preds = %196, %53
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  br label %198

198:                                              ; preds = %197
  %199 = load ptr, ptr %9, align 8
  %200 = load i32, ptr %10, align 4
  %201 = insertvalue { ptr, i32 } poison, ptr %199, 0
  %202 = insertvalue { ptr, i32 } %201, i32 %200, 1
  resume { ptr, i32 } %202

203:                                              ; preds = %153
  unreachable
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i64 0, i64 8, !9}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !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"

%"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, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.0" = type { i8 }
%"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
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::multiset", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator.0", align 1
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %10 = load i64, ptr %1, align 8, !tbaa !5
  %11 = call ptr @llvm.stacksave.p0()
  %12 = alloca i64, i64 %10, align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  %13 = getelementptr inbounds i64, ptr %12, i64 %10
  %.not48 = icmp eq i64 %10, 0
  br i1 %.not48, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %18, %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %14 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %14, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %22 unwind label %26

.lr.ph:                                           ; preds = %0, %18
  %.03249 = phi ptr [ %19, %18 ], [ %12, %0 ]
  %15 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %.03249)
          to label %16 unwind label %20

16:                                               ; preds = %.lr.ph
  %17 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %.03249)
          to label %18 unwind label %20

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %.03249, i64 8
  %.not = icmp eq ptr %19, %13
  br i1 %.not, label %._crit_edge, label %.lr.ph

20:                                               ; preds = %16, %.lr.ph
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %96

22:                                               ; preds = %._crit_edge
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph52, label %._crit_edge55

.preheader:                                       ; preds = %70
  %25 = icmp sgt i64 %72, 0
  br i1 %25, label %.lr.ph54, label %._crit_edge55

26:                                               ; preds = %._crit_edge
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  br label %95

.lr.ph52:                                         ; preds = %22, %70
  %.03950 = phi i64 [ %71, %70 ], [ 0, %22 ]
  %28 = getelementptr inbounds i64, ptr %12, i64 %.03950
  %29 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE11lower_boundERKl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %30 unwind label %37

30:                                               ; preds = %.lr.ph52
  %31 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIlE(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr %29)
          to label %32 unwind label %37

32:                                               ; preds = %30
  %33 = call noundef zeroext i1 @_ZNKSt8multisetIlSt4lessIlESaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  br i1 %33, label %34, label %39

34:                                               ; preds = %32
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03950) #5
  store i64 -1, ptr %35, align 8, !tbaa !5
  %36 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %70 unwind label %37

37:                                               ; preds = %34, %30, %.lr.ph52
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %94

39:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %40 = load i64, ptr %28, align 8, !tbaa !5
  %41 = shl nsw i64 %40, 1
  store i64 %41, ptr %6, align 8, !tbaa !5
  %42 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE11lower_boundERKl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %43 unwind label %51

43:                                               ; preds = %39
  store ptr %42, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %44 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  store ptr %44, ptr %7, align 8
  %45 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br i1 %45, label %46, label %53

46:                                               ; preds = %43
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = load i64, ptr %28, align 8, !tbaa !5
  %50 = shl nsw i64 %49, 1
  %.not40 = icmp sgt i64 %48, %50
  br i1 %.not40, label %66, label %.sink.split

51:                                               ; preds = %39
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %76

53:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %54 = call ptr @_ZNKSt8multisetIlSt4lessIlESaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  store ptr %54, ptr %8, align 8
  %55 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIlES2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %55, label %.critedge, label %56

56:                                               ; preds = %53
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = load i64, ptr %28, align 8, !tbaa !5
  %60 = shl nsw i64 %59, 1
  %61 = icmp sgt i64 %58, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br i1 %61, label %62, label %.sink.split

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

62:                                               ; preds = %.critedge, %56
  %63 = call ptr @_ZNSt23_Rb_tree_const_iteratorIlEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #5
  br label %.sink.split

.sink.split:                                      ; preds = %56, %62, %46
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %65 = load i64, ptr %64, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %.sink.split, %46
  %.sink = phi i64 [ -1, %46 ], [ %65, %.sink.split ]
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03950) #5
  store i64 %.sink, ptr %67, align 8, !tbaa !5
  %68 = invoke ptr @_ZNSt8multisetIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %69 unwind label %74

69:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %70

70:                                               ; preds = %34, %69
  %71 = add nuw nsw i64 %.03950, 1
  %72 = load i64, ptr %1, align 8, !tbaa !5
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %.lr.ph52, label %.preheader, !llvm.loop !9

74:                                               ; preds = %66
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %76

76:                                               ; preds = %74, %51
  %.pn = phi { ptr, i32 } [ %75, %74 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %94

._crit_edge55:                                    ; preds = %88, %22, %.preheader
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #5
  call void @llvm.stackrestore.p0(ptr %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret void

.lr.ph54:                                         ; preds = %.preheader, %88
  %.053 = phi i64 [ %89, %88 ], [ 0, %.preheader ]
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.053) #5
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %78)
          to label %80 unwind label %92

80:                                               ; preds = %.lr.ph54
  %81 = load i64, ptr %1, align 8, !tbaa !5
  %82 = add nsw i64 %81, -1
  %83 = icmp eq i64 %.053, %82
  %84 = zext i1 %83 to i64
  %85 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %79, i8 noundef signext %86)
          to label %88 unwind label %92

88:                                               ; preds = %80
  %89 = add nuw nsw i64 %.053, 1
  %90 = load i64, ptr %1, align 8, !tbaa !5
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %.lr.ph54, label %._crit_edge55, !llvm.loop !12

92:                                               ; preds = %80, %.lr.ph54
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %94

94:                                               ; preds = %37, %76, %92
  %.pn42.pn = phi { ptr, i32 } [ %93, %92 ], [ %38, %37 ], [ %.pn, %76 ]
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %95

95:                                               ; preds = %94, %26
  %.pn42.pn.pn = phi { ptr, i32 } [ %.pn42.pn, %94 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %96

96:                                               ; preds = %95, %20
  %.pn46 = phi { ptr, i32 } [ %21, %20 ], [ %.pn42.pn.pn, %95 ]
  call void @_ZNSt8multisetIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn46
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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