; LLVM IR from bqi343/cp-notebook :: Contests/USACO Training/Ch 4/4.3 buylow (main)

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

%"struct.std::pair" = type { i64, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_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 }
%"struct.std::pair.3" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>

@num = external dso_local global [5001 x i32], align 16
@N = external dso_local global i32, align 4
@best = external dso_local global [5000 x %"struct.std::pair"], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addSt6vectorIiSaIiEES1_(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printSt6vectorIiSaIiEE(ptr noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::initializer_list", align 8
  %8 = alloca [1 x i32], align 4
  %9 = alloca %"class.std::set", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::pair.3", align 8
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca %"class.std::vector", align 8
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca %"class.std::vector", align 8
  store i32 0, ptr %1, align 4
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %35, %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @N, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %32
  %34 = getelementptr inbounds %"struct.std::pair", ptr %33, i32 0, i32 0
  store i64 1, ptr %34, align 16, !tbaa !9
  br label %35

35:                                               ; preds = %26
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !17

38:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %198, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr @N, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %201

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %79, %45
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %82

51:                                               ; preds = %46
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = icmp sgt i32 %55, %59
  br i1 %60, label %61, label %78

61:                                               ; preds = %51
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %63
  %65 = getelementptr inbounds %"struct.std::pair", ptr %64, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %67
  %69 = getelementptr inbounds %"struct.std::pair", ptr %68, i32 0, i32 0
  %70 = load i64, ptr %69, align 16, !tbaa !9
  %71 = add nsw i64 %70, 1
  store i64 %71, ptr %6, align 8, !tbaa !19
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %73 = load i64, ptr %72, align 8, !tbaa !19
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %75
  %77 = getelementptr inbounds %"struct.std::pair", ptr %76, i32 0, i32 0
  store i64 %73, ptr %77, align 16, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %78

78:                                               ; preds = %61, %51
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %5, align 4, !tbaa !5
  br label %46, !llvm.loop !20

82:                                               ; preds = %50
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %84
  %86 = getelementptr inbounds %"struct.std::pair", ptr %85, i32 0, i32 0
  %87 = load i64, ptr %86, align 16, !tbaa !9
  %88 = icmp eq i64 %87, 1
  br i1 %88, label %89, label %101

89:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  %90 = getelementptr inbounds %"class.std::initializer_list", ptr %7, i32 0, i32 0
  store ptr %8, ptr %90, align 8, !tbaa !21
  %91 = getelementptr inbounds %"class.std::initializer_list", ptr %7, i32 0, i32 1
  store i64 1, ptr %91, align 8, !tbaa !24
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %93
  %95 = getelementptr inbounds %"struct.std::pair", ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8
  %98 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %99 = load i64, ptr %98, align 8
  %100 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) %95, ptr %97, i64 %99)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %197

101:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 1
  store i32 %103, ptr %10, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %192, %101
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = icmp sge i32 %105, 0
  br i1 %106, label %108, label %107

107:                                              ; preds = %104
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %196

108:                                              ; preds = %104
  %109 = load i32, ptr %3, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %110
  %112 = getelementptr inbounds %"struct.std::pair", ptr %111, i32 0, i32 0
  %113 = load i64, ptr %112, align 16, !tbaa !9
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %115
  %117 = getelementptr inbounds %"struct.std::pair", ptr %116, i32 0, i32 0
  %118 = load i64, ptr %117, align 16, !tbaa !9
  %119 = add nsw i64 %118, 1
  %120 = icmp eq i64 %113, %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  br i1 %120, label %121, label %141

121:                                              ; preds = %108
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp sgt i32 %125, %129
  br i1 %130, label %131, label %141

131:                                              ; preds = %121
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %133
  %135 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(4) %134)
          to label %136 unwind label %169

136:                                              ; preds = %131
  %137 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %135, ptr %137, align 8
  %138 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  %139 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %138, ptr %139, align 8
  %140 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br label %141

141:                                              ; preds = %136, %121, %108
  %142 = phi i1 [ false, %121 ], [ false, %108 ], [ %140, %136 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br i1 %142, label %143, label %191

143:                                              ; preds = %141
  %144 = load i32, ptr %10, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %145
  %147 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(4) %146)
          to label %148 unwind label %173

148:                                              ; preds = %143
  %149 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 0
  %150 = extractvalue { ptr, i8 } %147, 0
  store ptr %150, ptr %149, align 8
  %151 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 1
  %152 = extractvalue { ptr, i8 } %147, 1
  store i8 %152, ptr %151, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %154
  %156 = getelementptr inbounds %"struct.std::pair", ptr %155, i32 0, i32 1
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %156)
          to label %157 unwind label %177

157:                                              ; preds = %148
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %159
  %161 = getelementptr inbounds %"struct.std::pair", ptr %160, i32 0, i32 1
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %161)
          to label %162 unwind label %181

162:                                              ; preds = %157
  invoke void @_Z3addSt6vectorIiSaIiEES1_(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %16, ptr noundef %17, ptr noundef %18)
          to label %163 unwind label %185

163:                                              ; preds = %162
  %164 = load i32, ptr %3, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %165
  %167 = getelementptr inbounds %"struct.std::pair", ptr %166, i32 0, i32 1
  %168 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %167, ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  br label %191

169:                                              ; preds = %131
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %12, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %195

173:                                              ; preds = %143
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %12, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %13, align 4
  br label %195

177:                                              ; preds = %148
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %12, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %13, align 4
  br label %190

181:                                              ; preds = %157
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %12, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %13, align 4
  br label %189

185:                                              ; preds = %162
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %12, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %13, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #7
  br label %189

189:                                              ; preds = %185, %181
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  br label %190

190:                                              ; preds = %189, %177
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  br label %195

191:                                              ; preds = %163, %141
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %10, align 4, !tbaa !5
  %194 = add nsw i32 %193, -1
  store i32 %194, ptr %10, align 4, !tbaa !5
  br label %104, !llvm.loop !25

195:                                              ; preds = %190, %173, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %221

196:                                              ; preds = %107
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #7
  br label %197

197:                                              ; preds = %196, %89
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %3, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !26

201:                                              ; preds = %44
  %202 = load i32, ptr @N, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %203
  %205 = getelementptr inbounds %"struct.std::pair", ptr %204, i32 0, i32 0
  %206 = load i64, ptr %205, align 16, !tbaa !9
  %207 = sub nsw i64 %206, 1
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %207)
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %208, ptr noundef @.str)
  %210 = load i32, ptr @N, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %211
  %213 = getelementptr inbounds %"struct.std::pair", ptr %212, i32 0, i32 1
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %213)
  invoke void @_Z5printSt6vectorIiSaIiEE(ptr noundef %19)
          to label %214 unwind label %217

214:                                              ; preds = %201
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %216 = load i32, ptr %1, align 4
  ret i32 %216

217:                                              ; preds = %201
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %12, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %13, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  br label %221

221:                                              ; preds = %217, %195
  %222 = load ptr, ptr %12, align 8
  %223 = load i32, ptr %13, align 4
  %224 = insertvalue { ptr, i32 } poison, ptr %222, 0
  %225 = insertvalue { ptr, i32 } %224, i32 %223, 1
  resume { ptr, i32 } %225
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 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 = { 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 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 #4 = { "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 = { 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 #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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSSt4pairIxSt6vectorIiSaIiEEE", !11, i64 0, !12, i64 8}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !18}
!21 = !{!22, !16, i64 0}
!22 = !{!"_ZTSSt16initializer_listIiE", !16, i64 0, !23, i64 8}
!23 = !{!"long", !7, i64 0}
!24 = !{!22, !23, i64 8}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}


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

%"struct.std::pair" = type { i64, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_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 }

@num = external dso_local global [5001 x i32], align 16
@N = external dso_local global i32, align 4
@best = external dso_local global [5000 x %"struct.std::pair"], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addSt6vectorIiSaIiEES1_(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: 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 @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printSt6vectorIiSaIiEE(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca [1 x i32], align 4
  %3 = alloca %"class.std::set", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %11 = load i32, ptr @N, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %.preheader43

.preheader43:                                     ; preds = %.lr.ph, %0
  %13 = phi i32 [ %11, %0 ], [ %17, %.lr.ph ]
  %.not57 = icmp slt i32 %13, 0
  br i1 %.not57, label %.preheader43.._crit_edge59_crit_edge, label %.preheader

.preheader43.._crit_edge59_crit_edge:             ; preds = %.preheader43
  %.pre = sext i32 %13 to i64
  br label %._crit_edge59

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %indvars.iv
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %16 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %indvars.iv
  store i64 1, ptr %16, align 16, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr @N, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %.preheader43, !llvm.loop !17

.preheader:                                       ; preds = %.preheader43, %91
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %91 ], [ 0, %.preheader43 ]
  %.not60 = icmp eq i64 %indvars.iv67, 0
  br i1 %.not60, label %._crit_edge, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader
  %20 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %indvars.iv67
  %21 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %indvars.iv67
  br label %33

._crit_edge59:                                    ; preds = %91, %.preheader43.._crit_edge59_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader43.._crit_edge59_crit_edge ], [ %93, %91 ]
  %22 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %.pre-phi
  %23 = load i64, ptr %22, align 16, !tbaa !9
  %24 = add nsw i64 %23, -1
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %24)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @.str)
  %27 = load i32, ptr @N, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %28, i32 1
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %29)
  invoke void @_Z5printSt6vectorIiSaIiEE(ptr noundef nonnull %9)
          to label %94 unwind label %96

._crit_edge:                                      ; preds = %44, %.preheader
  %30 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %indvars.iv67
  %31 = load i64, ptr %30, align 16, !tbaa !9
  %32 = icmp eq i64 %31, 1
  br i1 %32, label %45, label %48

33:                                               ; preds = %.lr.ph51, %44
  %indvars.iv64 = phi i64 [ 0, %.lr.ph51 ], [ %indvars.iv.next65, %44 ]
  %34 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %indvars.iv64
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = load i32, ptr %20, align 4, !tbaa !5
  %37 = icmp sgt i32 %35, %36
  br i1 %37, label %38, label %44

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %39 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %indvars.iv64
  %40 = load i64, ptr %39, align 16, !tbaa !9
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %1, align 8, !tbaa !19
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %43 = load i64, ptr %42, align 8, !tbaa !19
  store i64 %43, ptr %21, align 16, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  br label %44

44:                                               ; preds = %33, %38
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next65, %indvars.iv67
  br i1 %exitcond.not, label %._crit_edge, label %33, !llvm.loop !20

45:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %30, i64 8
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSESt16initializer_listIiE(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr nonnull %2, i64 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %91

48:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  br i1 %.not60, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; preds = %48
  %49 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %indvars.iv67
  %50 = getelementptr inbounds i8, ptr %30, i64 8
  br label %51

._crit_edge56:                                    ; preds = %88, %48
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  br label %91

51:                                               ; preds = %.lr.ph55, %88
  %indvars.iv69 = phi i64 [ %indvars.iv67, %.lr.ph55 ], [ %indvars.iv.next70, %88 ]
  %indvars.iv.next70 = add nsw i64 %indvars.iv69, -1
  %52 = load i64, ptr %30, align 16, !tbaa !9
  %53 = and i64 %indvars.iv.next70, 4294967295
  %54 = getelementptr inbounds [5000 x %"struct.std::pair"], ptr @best, i64 0, i64 %53
  %55 = load i64, ptr %54, align 16, !tbaa !9
  %56 = add nsw i64 %55, 1
  %57 = icmp eq i64 %52, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  br i1 %57, label %58, label %.critedge

58:                                               ; preds = %51
  %59 = getelementptr inbounds [5001 x i32], ptr @num, i64 0, i64 %53
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %49, align 4, !tbaa !5
  %62 = icmp sgt i32 %60, %61
  br i1 %62, label %63, label %.critedge

63:                                               ; preds = %58
  %64 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %59)
          to label %65 unwind label %76

65:                                               ; preds = %63
  store ptr %64, ptr %4, align 8
  %66 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  store ptr %66, ptr %5, align 8
  %67 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %67, label %68, label %88

68:                                               ; preds = %65
  %69 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %59)
          to label %70 unwind label %78

70:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %50)
          to label %71 unwind label %80

71:                                               ; preds = %70
  %72 = getelementptr inbounds i8, ptr %54, i64 8
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %72)
          to label %73 unwind label %82

73:                                               ; preds = %71
  invoke void @_Z3addSt6vectorIiSaIiEES1_(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
          to label %74 unwind label %84

74:                                               ; preds = %73
  %75 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %88

76:                                               ; preds = %63
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %90

78:                                               ; preds = %68
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %90

80:                                               ; preds = %70
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %87

82:                                               ; preds = %71
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %86

84:                                               ; preds = %73
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  br label %86

86:                                               ; preds = %84, %82
  %.pn = phi { ptr, i32 } [ %85, %84 ], [ %83, %82 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %87

87:                                               ; preds = %86, %80
  %.pn.pn = phi { ptr, i32 } [ %.pn, %86 ], [ %81, %80 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  br label %90

.critedge:                                        ; preds = %51, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %88

88:                                               ; preds = %65, %74, %.critedge
  %89 = icmp sgt i64 %indvars.iv69, 1
  br i1 %89, label %51, label %._crit_edge56, !llvm.loop !21

90:                                               ; preds = %87, %78, %76
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %87 ], [ %79, %78 ], [ %77, %76 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  br label %98

91:                                               ; preds = %45, %._crit_edge56
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %92 = load i32, ptr @N, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %.not.not = icmp slt i64 %indvars.iv67, %93
  br i1 %.not.not, label %.preheader, label %._crit_edge59, !llvm.loop !22

94:                                               ; preds = %._crit_edge59
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  ret i32 0

96:                                               ; preds = %._crit_edge59
  %97 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  br label %98

98:                                               ; preds = %96, %90
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %90 ], [ %97, %96 ]
  resume { ptr, i32 } %.pn.pn.pn.pn
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

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

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

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

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

; 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 #0 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 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 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 #4 = { "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 = { 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 #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 = { nounwind }

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

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


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