; LLVM IR from eyangch/competitive-programming :: Codeforces/437 (c)

; 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" }
%"struct.std::greater" = type { i8 }
%"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::pair.3" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"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 }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::greater", align 1
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::set", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair.3", align 8
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = zext i32 %27 to i64
  %29 = call ptr @llvm.stacksave.p0()
  store ptr %29, ptr %4, align 8
  %30 = alloca %"struct.std::pair", i64 %28, align 16
  store i64 %28, ptr %5, align 8
  %31 = icmp eq i64 %28, 0
  br i1 %31, label %38, label %32

32:                                               ; preds = %0
  %33 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %28
  br label %34

34:                                               ; preds = %34, %32
  %35 = phi ptr [ %30, %32 ], [ %36, %34 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %35)
  %36 = getelementptr inbounds %"struct.std::pair", ptr %35, i64 1
  %37 = icmp eq ptr %36, %33
  br i1 %37, label %38, label %34

38:                                               ; preds = %34, %0
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = zext i32 %39 to i64
  %41 = alloca %"struct.std::pair", i64 %40, align 16
  store i64 %40, ptr %6, align 8
  %42 = icmp eq i64 %40, 0
  br i1 %42, label %49, label %43

43:                                               ; preds = %38
  %44 = getelementptr inbounds %"struct.std::pair", ptr %41, i64 %40
  br label %45

45:                                               ; preds = %45, %43
  %46 = phi ptr [ %41, %43 ], [ %47, %45 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %46)
  %47 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 1
  %48 = icmp eq ptr %47, %44
  br i1 %48, label %49, label %45

49:                                               ; preds = %45, %38
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = zext i32 %50 to i64
  %52 = alloca i32, i64 %51, align 16
  store i64 %51, ptr %7, align 8
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = zext i32 %53 to i64
  %55 = alloca %"class.std::vector", i64 %54, align 16
  store i64 %54, ptr %8, align 8
  %56 = icmp eq i64 %54, 0
  br i1 %56, label %63, label %57

57:                                               ; preds = %49
  %58 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %54
  br label %59

59:                                               ; preds = %59, %57
  %60 = phi ptr [ %55, %57 ], [ %61, %59 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %60) #7
  %61 = getelementptr inbounds %"class.std::vector", ptr %60, i64 1
  %62 = icmp eq ptr %61, %58
  br i1 %62, label %63, label %59

63:                                               ; preds = %59, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %89, %63
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %96

69:                                               ; preds = %64
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %71
  %73 = getelementptr inbounds %"struct.std::pair", ptr %72, i32 0, i32 0
  %74 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %73)
          to label %75 unwind label %92

75:                                               ; preds = %69
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %77
  %79 = getelementptr inbounds %"struct.std::pair", ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !9
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %52, i64 %82
  store i32 %80, ptr %83, align 4, !tbaa !5
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %86
  %88 = getelementptr inbounds %"struct.std::pair", ptr %87, i32 0, i32 1
  store i32 %84, ptr %88, align 4, !tbaa !11
  br label %89

89:                                               ; preds = %75
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !5
  br label %64, !llvm.loop !12

92:                                               ; preds = %69
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %10, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %273

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

97:                                               ; preds = %145, %96
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %161

102:                                              ; preds = %97
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %"struct.std::pair", ptr %41, i64 %104
  %106 = getelementptr inbounds %"struct.std::pair", ptr %105, i32 0, i32 0
  %107 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %106)
          to label %108 unwind label %148

108:                                              ; preds = %102
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds %"struct.std::pair", ptr %41, i64 %110
  %112 = getelementptr inbounds %"struct.std::pair", ptr %111, i32 0, i32 1
  %113 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %107, ptr noundef nonnull align 4 dereferenceable(4) %112)
          to label %114 unwind label %148

114:                                              ; preds = %108
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %"struct.std::pair", ptr %41, i64 %116
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !9
  %120 = sub nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds %"struct.std::pair", ptr %41, i64 %124
  %126 = getelementptr inbounds %"struct.std::pair", ptr %125, i32 0, i32 1
  %127 = load i32, ptr %126, align 4, !tbaa !11
  %128 = sub nsw i32 %127, 1
  store i32 %128, ptr %13, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %122, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %129 unwind label %152

129:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %"struct.std::pair", ptr %41, i64 %131
  %133 = getelementptr inbounds %"struct.std::pair", ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !11
  %135 = sub nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %138 = load i32, ptr %12, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds %"struct.std::pair", ptr %41, i64 %139
  %141 = getelementptr inbounds %"struct.std::pair", ptr %140, i32 0, i32 0
  %142 = load i32, ptr %141, align 8, !tbaa !9
  %143 = sub nsw i32 %142, 1
  store i32 %143, ptr %14, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %137, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %144 unwind label %156

144:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %12, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %12, align 4, !tbaa !5
  br label %97, !llvm.loop !14

148:                                              ; preds = %108, %102
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %10, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %11, align 4
  br label %160

152:                                              ; preds = %114
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %10, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %160

156:                                              ; preds = %129
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %10, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %160

160:                                              ; preds = %156, %152, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %273

161:                                              ; preds = %101
  %162 = load i32, ptr %2, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %163
  invoke void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef %30, ptr noundef %164)
          to label %165 unwind label %171

165:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %249, %165
  %167 = load i32, ptr %18, align 4, !tbaa !5
  %168 = load i32, ptr %2, align 4, !tbaa !5
  %169 = icmp slt i32 %167, %168
  br i1 %169, label %175, label %170

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

171:                                              ; preds = %161
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %10, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %11, align 4
  br label %273

175:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  %176 = load i32, ptr %18, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %177
  %179 = getelementptr inbounds %"struct.std::pair", ptr %178, i32 0, i32 1
  %180 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 4 dereferenceable(4) %179)
          to label %181 unwind label %199

181:                                              ; preds = %175
  %182 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 0
  %183 = extractvalue { ptr, i8 } %180, 0
  store ptr %183, ptr %182, align 8
  %184 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 1
  %185 = extractvalue { ptr, i8 } %180, 1
  store i8 %185, ptr %184, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %242, %181
  %187 = load i32, ptr %22, align 4, !tbaa !5
  %188 = load i32, ptr %18, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %189
  %191 = getelementptr inbounds %"struct.std::pair", ptr %190, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !11
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %193
  %195 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %194) #7
  %196 = trunc i64 %195 to i32
  %197 = icmp slt i32 %187, %196
  br i1 %197, label %203, label %198

198:                                              ; preds = %186
  store i32 11, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %245

199:                                              ; preds = %175
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %10, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %11, align 4
  br label %252

203:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %204 = load i32, ptr %18, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %205
  %207 = getelementptr inbounds %"struct.std::pair", ptr %206, i32 0, i32 1
  %208 = load i32, ptr %207, align 4, !tbaa !11
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %209
  %211 = load i32, ptr %22, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %210, i64 noundef %212) #7
  %214 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 4 dereferenceable(4) %213)
          to label %215 unwind label %221

215:                                              ; preds = %203
  %216 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %214, ptr %216, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %217 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %17) #7
  %218 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %217, ptr %218, align 8
  %219 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br i1 %219, label %220, label %225

220:                                              ; preds = %215
  br label %242

221:                                              ; preds = %203
  %222 = landingpad { ptr, i32 }
          cleanup
  %223 = extractvalue { ptr, i32 } %222, 0
  store ptr %223, ptr %10, align 8
  %224 = extractvalue { ptr, i32 } %222, 1
  store i32 %224, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %252

225:                                              ; preds = %215
  %226 = load i32, ptr %18, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %227
  %229 = getelementptr inbounds %"struct.std::pair", ptr %228, i32 0, i32 1
  %230 = load i32, ptr %229, align 4, !tbaa !11
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %231
  %233 = load i32, ptr %22, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %232, i64 noundef %234) #7
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds i32, ptr %52, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = load i32, ptr %20, align 4, !tbaa !5
  %241 = add nsw i32 %240, %239
  store i32 %241, ptr %20, align 4, !tbaa !5
  br label %242

242:                                              ; preds = %225, %220
  %243 = load i32, ptr %22, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %22, align 4, !tbaa !5
  br label %186, !llvm.loop !15

245:                                              ; preds = %198
  %246 = load i32, ptr %20, align 4, !tbaa !5
  %247 = load i32, ptr %16, align 4, !tbaa !5
  %248 = add nsw i32 %247, %246
  store i32 %248, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %249

249:                                              ; preds = %245
  %250 = load i32, ptr %18, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %18, align 4, !tbaa !5
  br label %166, !llvm.loop !16

252:                                              ; preds = %221, %199
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %265

253:                                              ; preds = %170
  %254 = load i32, ptr %16, align 4, !tbaa !5
  %255 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %254)
          to label %256 unwind label %261

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

258:                                              ; preds = %256
  store i32 0, ptr %1, align 4
  store i32 1, ptr %19, align 4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %259 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %54
  %260 = icmp eq ptr %55, %259
  br i1 %260, label %270, label %266

261:                                              ; preds = %256, %253
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %10, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %11, align 4
  br label %265

265:                                              ; preds = %261, %252
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %273

266:                                              ; preds = %266, %258
  %267 = phi ptr [ %259, %258 ], [ %268, %266 ]
  %268 = getelementptr inbounds %"class.std::vector", ptr %267, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %268) #7
  %269 = icmp eq ptr %268, %55
  br i1 %269, label %270, label %266

270:                                              ; preds = %266, %258
  %271 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %271)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %272 = load i32, ptr %1, align 4
  ret i32 %272

273:                                              ; preds = %265, %171, %160, %92
  %274 = getelementptr inbounds %"class.std::vector", ptr %55, i64 %54
  %275 = icmp eq ptr %55, %274
  br i1 %275, label %280, label %276

276:                                              ; preds = %276, %273
  %277 = phi ptr [ %274, %273 ], [ %278, %276 ]
  %278 = getelementptr inbounds %"class.std::vector", ptr %277, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %278) #7
  %279 = icmp eq ptr %278, %55
  br i1 %279, label %280, label %276

280:                                              ; preds = %276, %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %281

281:                                              ; preds = %280
  %282 = load ptr, ptr %10, align 8
  %283 = load i32, ptr %11, align 4
  %284 = insertvalue { ptr, i32 } poison, ptr %282, 0
  %285 = insertvalue { ptr, i32 } %284, i32 %283, 1
  resume { ptr, i32 } %285
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 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)) #5 align 2

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 #5 = { 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 = { 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, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !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::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" = type { i32, i32 }
%"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 }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::set", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = zext i32 %10 to i64
  %12 = call ptr @llvm.stacksave.p0()
  %13 = alloca %"struct.std::pair", i64 %11, align 16
  %14 = icmp eq i32 %10, 0
  br i1 %14, label %.loopexit60, label %15

15:                                               ; preds = %0
  %16 = getelementptr inbounds %"struct.std::pair", ptr %13, i64 %11
  br label %17

17:                                               ; preds = %17, %15
  %18 = phi ptr [ %13, %15 ], [ %19, %17 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %18)
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = icmp eq ptr %19, %16
  br i1 %20, label %.loopexit60, label %17

.loopexit60:                                      ; preds = %17, %0
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = zext i32 %21 to i64
  %23 = alloca %"struct.std::pair", i64 %22, align 16
  %24 = icmp eq i32 %21, 0
  br i1 %24, label %.loopexit59, label %25

25:                                               ; preds = %.loopexit60
  %26 = getelementptr inbounds %"struct.std::pair", ptr %23, i64 %22
  br label %27

27:                                               ; preds = %27, %25
  %28 = phi ptr [ %23, %25 ], [ %29, %27 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %28)
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = icmp eq ptr %29, %26
  br i1 %30, label %.loopexit59, label %27

.loopexit59:                                      ; preds = %27, %.loopexit60
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = zext i32 %31 to i64
  %33 = alloca i32, i64 %32, align 16
  %34 = alloca %"class.std::vector", i64 %32, align 16
  %35 = icmp eq i32 %31, 0
  br i1 %35, label %.preheader57, label %36

36:                                               ; preds = %.loopexit59
  %37 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %32
  br label %38

38:                                               ; preds = %38, %36
  %39 = phi ptr [ %34, %36 ], [ %40, %38 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %39) #7
  %40 = getelementptr inbounds i8, ptr %39, i64 24
  %41 = icmp eq ptr %40, %37
  br i1 %41, label %.loopexit58, label %38

.loopexit58:                                      ; preds = %38
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %42 = icmp sgt i32 %.pre, 0
  br i1 %42, label %.lr.ph, label %.preheader57

.preheader57:                                     ; preds = %48, %.loopexit59, %.loopexit58
  %43 = phi i32 [ %.pre, %.loopexit58 ], [ 0, %.loopexit59 ], [ %53, %48 ]
  %invariant.gep = getelementptr i8, ptr %34, i64 -24
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph68, label %._crit_edge

.lr.ph:                                           ; preds = %.loopexit58, %48
  %indvars.iv = phi i64 [ %indvars.iv.next, %48 ], [ 0, %.loopexit58 ]
  %46 = getelementptr inbounds %"struct.std::pair", ptr %13, i64 %indvars.iv
  %47 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %46)
          to label %48 unwind label %56

48:                                               ; preds = %.lr.ph
  %49 = load i32, ptr %46, align 8, !tbaa !9
  %50 = getelementptr inbounds i32, ptr %33, i64 %indvars.iv
  store i32 %49, ptr %50, align 4, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %46, i64 4
  %52 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %52, ptr %51, align 4, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next, %54
  br i1 %55, label %.lr.ph, label %.preheader57, !llvm.loop !12

56:                                               ; preds = %.lr.ph
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %143

._crit_edge.loopexit:                             ; preds = %76
  %.pre89 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader57
  %58 = phi i32 [ %.pre89, %._crit_edge.loopexit ], [ %43, %.preheader57 ]
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %"struct.std::pair", ptr %13, i64 %59
  invoke void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef nonnull %13, ptr noundef nonnull %60)
          to label %86 unwind label %90

.lr.ph68:                                         ; preds = %.preheader57, %76
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %76 ], [ 0, %.preheader57 ]
  %61 = getelementptr inbounds %"struct.std::pair", ptr %23, i64 %indvars.iv80
  %62 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %61)
          to label %63 unwind label %80

63:                                               ; preds = %.lr.ph68
  %64 = getelementptr inbounds i8, ptr %61, i64 4
  %65 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %62, ptr noundef nonnull align 4 dereferenceable(4) %64)
          to label %66 unwind label %80

66:                                               ; preds = %63
  %67 = load i32, ptr %61, align 8, !tbaa !9
  %68 = sext i32 %67 to i64
  %gep = getelementptr %"class.std::vector", ptr %invariant.gep, i64 %68
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %69 = load i32, ptr %64, align 4, !tbaa !11
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %3, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %gep, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %71 unwind label %82

71:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %72 = load i32, ptr %64, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %gep66 = getelementptr %"class.std::vector", ptr %invariant.gep, i64 %73
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %74 = load i32, ptr %61, align 8, !tbaa !9
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %4, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %gep66, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %76 unwind label %84

76:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next81, %78
  br i1 %79, label %.lr.ph68, label %._crit_edge.loopexit, !llvm.loop !14

80:                                               ; preds = %63, %.lr.ph68
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %143

82:                                               ; preds = %66
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %143

84:                                               ; preds = %71
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %143

86:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  %87 = load i32, ptr %1, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %.lr.ph76, label %._crit_edge77

._crit_edge77:                                    ; preds = %._crit_edge72, %86
  %.035.lcssa = phi i32 [ 0, %86 ], [ %100, %._crit_edge72 ]
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.035.lcssa)
          to label %133 unwind label %137

90:                                               ; preds = %._crit_edge
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %143

.lr.ph76:                                         ; preds = %86, %._crit_edge72
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge72 ], [ 0, %86 ]
  %.03573 = phi i32 [ %100, %._crit_edge72 ], [ 0, %86 ]
  %92 = getelementptr inbounds %"struct.std::pair", ptr %13, i64 %indvars.iv86, i32 1
  %93 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %92)
          to label %.preheader56 unwind label %104

.preheader56:                                     ; preds = %.lr.ph76
  %94 = load i32, ptr %92, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %95
  %97 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #7
  %98 = trunc i64 %97 to i32
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %.lr.ph71, label %._crit_edge72

._crit_edge72:                                    ; preds = %126, %.preheader56
  %.033.lcssa = phi i32 [ 0, %.preheader56 ], [ %.1, %126 ]
  %100 = add nsw i32 %.033.lcssa, %.03573
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %101 = load i32, ptr %1, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next87, %102
  br i1 %103, label %.lr.ph76, label %._crit_edge77, !llvm.loop !15

104:                                              ; preds = %.lr.ph76
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %139

.lr.ph71:                                         ; preds = %.preheader56, %126
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %126 ], [ 0, %.preheader56 ]
  %.03369 = phi i32 [ %.1, %126 ], [ 0, %.preheader56 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %106 = load i32, ptr %92, align 4, !tbaa !11
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %107
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %indvars.iv83) #7
  %110 = invoke ptr @_ZNSt3setIiSt4lessIiESaIiEE4findERKi(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %109)
          to label %111 unwind label %114

111:                                              ; preds = %.lr.ph71
  store ptr %110, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %112 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  store ptr %112, ptr %7, align 8
  %113 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br i1 %113, label %126, label %116

114:                                              ; preds = %.lr.ph71
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %139

116:                                              ; preds = %111
  %117 = load i32, ptr %92, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %118
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef %indvars.iv83) #7
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i32, ptr %33, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = add nsw i32 %124, %.03369
  br label %126

126:                                              ; preds = %111, %116
  %.1 = phi i32 [ %.03369, %111 ], [ %125, %116 ]
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %127 = load i32, ptr %92, align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %128
  %130 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %129) #7
  %sext = shl i64 %130, 32
  %131 = ashr exact i64 %sext, 32
  %132 = icmp slt i64 %indvars.iv.next84, %131
  br i1 %132, label %.lr.ph71, label %._crit_edge72, !llvm.loop !16

133:                                              ; preds = %._crit_edge77
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %135 unwind label %137

135:                                              ; preds = %133
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  br i1 %35, label %.loopexit55, label %.preheader54.preheader

.preheader54.preheader:                           ; preds = %135
  %136 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %32
  br label %.preheader54

137:                                              ; preds = %133, %._crit_edge77
  %138 = landingpad { ptr, i32 }
          cleanup
  br label %139

139:                                              ; preds = %104, %114, %137
  %.pn.pn = phi { ptr, i32 } [ %138, %137 ], [ %115, %114 ], [ %105, %104 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  br label %143

.preheader54:                                     ; preds = %.preheader54.preheader, %.preheader54
  %140 = phi ptr [ %141, %.preheader54 ], [ %136, %.preheader54.preheader ]
  %141 = getelementptr inbounds i8, ptr %140, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %141) #7
  %142 = icmp eq ptr %141, %34
  br i1 %142, label %.loopexit55, label %.preheader54

.loopexit55:                                      ; preds = %.preheader54, %135
  call void @llvm.stackrestore.p0(ptr %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

143:                                              ; preds = %80, %82, %84, %139, %90, %56
  %.pn52 = phi { ptr, i32 } [ %57, %56 ], [ %.pn.pn, %139 ], [ %91, %90 ], [ %85, %84 ], [ %83, %82 ], [ %81, %80 ]
  br i1 %35, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %143
  %144 = getelementptr inbounds %"class.std::vector", ptr %34, i64 %32
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %145 = phi ptr [ %146, %.preheader ], [ %144, %.preheader.preheader ]
  %146 = getelementptr inbounds i8, ptr %145, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %146) #7
  %147 = icmp eq ptr %146, %34
  br i1 %147, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn52
}

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

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 #2

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 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 #5 align 2

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

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

; 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 #5 align 2

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

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

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

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

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

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

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

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

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


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