; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2012-13/Nov 2012 (12 Nov G2)

; 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_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, std::vector<int>>, std::_Select1st<std::pair<const std::vector<int>, std::vector<int>>>, std::less<std::vector<int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, std::vector<int>>, std::_Select1st<std::pair<const std::vector<int>, std::vector<int>>>, std::less<std::vector<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 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.3 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.3 = type { i64, [8 x i8] }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@cin = external dso_local global %"class.std::basic_ifstream", align 8
@cout = external dso_local global %"class.std::basic_ofstream", align 8
@K = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@cum = external dso_local global [10 x [50001 x i32]], align 16
@lst = external dso_local global [10 x [50001 x i32]], align 16
@ans = external dso_local global i32, align 4
@rec = external dso_local global %"class.std::map", 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 %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::stack", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %22

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

26:                                               ; preds = %22
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %96

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %29 unwind label %35

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

30:                                               ; preds = %88, %29
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = load i32, ptr @N, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %39, label %34

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

35:                                               ; preds = %27
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %5, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %6, align 4
  br label %95

39:                                               ; preds = %30
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %41)
          to label %43 unwind label %57

43:                                               ; preds = %39
  %44 = load i8, ptr %42, align 1, !tbaa !9
  %45 = sext i8 %44 to i32
  %46 = icmp eq i32 %45, 40
  br i1 %46, label %47, label %61

47:                                               ; preds = %43
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %49
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [50001 x i32], ptr %50, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %54, align 4, !tbaa !5
  br label %71

57:                                               ; preds = %39
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %95

61:                                               ; preds = %43
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [50001 x i32], ptr %64, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %68, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %61, %47
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %73
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [50001 x i32], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %80
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [50001 x i32], ptr %81, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, %78
  store i32 %87, ptr %85, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %71
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %7, align 4, !tbaa !5
  br label %30, !llvm.loop !10

91:                                               ; preds = %34
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !12

95:                                               ; preds = %57, %35
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %287

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

97:                                               ; preds = %203, %96
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = load i32, ptr @K, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %206

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %198, %102
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = load i32, ptr @N, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  %107 = icmp slt i32 %104, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %103
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %202

109:                                              ; preds = %103
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [10 x [50001 x i32]], ptr @lst, i64 0, i64 %111
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [50001 x i32], ptr %112, i64 0, i64 %114
  store i32 -1000000007, ptr %115, align 4, !tbaa !5
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %124

118:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %119 unwind label %120

119:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %198

120:                                              ; preds = %118
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %5, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %201

124:                                              ; preds = %109
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %126
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [50001 x i32], ptr %127, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %8, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %133
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [50001 x i32], ptr %134, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = icmp sgt i32 %131, %139
  br i1 %140, label %141, label %155

141:                                              ; preds = %124
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sub nsw i32 %142, 1
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [10 x [50001 x i32]], ptr @lst, i64 0, i64 %145
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [50001 x i32], ptr %146, i64 0, i64 %148
  store i32 %143, ptr %149, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %150 unwind label %151

150:                                              ; preds = %141
  br label %198

151:                                              ; preds = %196, %186, %182, %180, %160, %156, %141
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %5, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %6, align 4
  br label %201

155:                                              ; preds = %124
  br label %156

156:                                              ; preds = %181, %155
  %157 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %158 unwind label %151

158:                                              ; preds = %156
  %159 = icmp ne i64 %157, 0
  br i1 %159, label %160, label %178

160:                                              ; preds = %158
  %161 = load i32, ptr %8, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %162
  %164 = load i32, ptr %10, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [50001 x i32], ptr %163, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = load i32, ptr %8, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %169
  %171 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %172 unwind label %151

172:                                              ; preds = %160
  %173 = load i32, ptr %171, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [50001 x i32], ptr %170, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = icmp sle i32 %167, %176
  br label %178

178:                                              ; preds = %172, %158
  %179 = phi i1 [ false, %158 ], [ %177, %172 ]
  br i1 %179, label %180, label %182

180:                                              ; preds = %178
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %181 unwind label %151

181:                                              ; preds = %180
  br label %156, !llvm.loop !13

182:                                              ; preds = %178
  %183 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %184 unwind label %151

184:                                              ; preds = %182
  %185 = icmp ne i64 %183, 0
  br i1 %185, label %186, label %196

186:                                              ; preds = %184
  %187 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %188 unwind label %151

188:                                              ; preds = %186
  %189 = load i32, ptr %187, align 4, !tbaa !5
  %190 = load i32, ptr %8, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [10 x [50001 x i32]], ptr @lst, i64 0, i64 %191
  %193 = load i32, ptr %10, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [50001 x i32], ptr %192, i64 0, i64 %194
  store i32 %189, ptr %195, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %188, %184
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %197 unwind label %151

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197, %150, %119
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %10, align 4, !tbaa !5
  br label %103, !llvm.loop !14

201:                                              ; preds = %151, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %287

202:                                              ; preds = %108
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  br label %203

203:                                              ; preds = %202
  %204 = load i32, ptr %8, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %8, align 4, !tbaa !5
  br label %97, !llvm.loop !15

206:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %275, %206
  %208 = load i32, ptr %12, align 4, !tbaa !5
  %209 = load i32, ptr @N, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  %211 = icmp slt i32 %208, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %207
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %283

213:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 -1000000007, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %236, %213
  %215 = load i32, ptr %15, align 4, !tbaa !5
  %216 = load i32, ptr @K, align 4, !tbaa !5
  %217 = icmp slt i32 %215, %216
  br i1 %217, label %219, label %218

218:                                              ; preds = %214
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %243

219:                                              ; preds = %214
  %220 = load i32, ptr %15, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %221
  %223 = load i32, ptr %12, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [50001 x i32], ptr %222, i64 0, i64 %224
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(4) %225)
          to label %226 unwind label %239

226:                                              ; preds = %219
  %227 = load i32, ptr %15, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [10 x [50001 x i32]], ptr @lst, i64 0, i64 %228
  %230 = load i32, ptr %12, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [50001 x i32], ptr %229, i64 0, i64 %231
  %233 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %232)
          to label %234 unwind label %239

234:                                              ; preds = %226
  %235 = load i32, ptr %233, align 4, !tbaa !5
  store i32 %235, ptr %14, align 4, !tbaa !5
  br label %236

236:                                              ; preds = %234
  %237 = load i32, ptr %15, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %15, align 4, !tbaa !5
  br label %214, !llvm.loop !16

239:                                              ; preds = %226, %219
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %5, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %282

243:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %244 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapISt6vectorIiSaIiEES2_St4lessIS2_ESaISt4pairIKS2_S2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @rec, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %245 unwind label %255

245:                                              ; preds = %243
  store ptr %244, ptr %16, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %246 = load ptr, ptr %16, align 8, !tbaa !17
  %247 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %246) #6
  %248 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %247, ptr %248, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %249 = load ptr, ptr %16, align 8, !tbaa !17
  %250 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %249) #6
  %251 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %250, ptr %251, align 8
  br label %252

252:                                              ; preds = %269, %245
  %253 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  br i1 %253, label %259, label %254

254:                                              ; preds = %252
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %271

255:                                              ; preds = %243
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %5, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %282

259:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %260 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  %261 = load i32, ptr %260, align 4, !tbaa !5
  store i32 %261, ptr %19, align 4, !tbaa !5
  %262 = load i32, ptr %19, align 4, !tbaa !5
  %263 = load i32, ptr %14, align 4, !tbaa !5
  %264 = icmp sgt i32 %262, %263
  br i1 %264, label %265, label %268

265:                                              ; preds = %259
  %266 = load i32, ptr @ans, align 4, !tbaa !5
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr @ans, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %265, %259
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %269

269:                                              ; preds = %268
  %270 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  br label %252

271:                                              ; preds = %254
  %272 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapISt6vectorIiSaIiEES2_St4lessIS2_ESaISt4pairIKS2_S2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @rec, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %273 unwind label %278

273:                                              ; preds = %271
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %272, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %274 unwind label %278

274:                                              ; preds = %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  br label %275

275:                                              ; preds = %274
  %276 = load i32, ptr %12, align 4, !tbaa !5
  %277 = add nsw i32 %276, 1
  store i32 %277, ptr %12, align 4, !tbaa !5
  br label %207, !llvm.loop !19

278:                                              ; preds = %273, %271
  %279 = landingpad { ptr, i32 }
          cleanup
  %280 = extractvalue { ptr, i32 } %279, 0
  store ptr %280, ptr %5, align 8
  %281 = extractvalue { ptr, i32 } %279, 1
  store i32 %281, ptr %6, align 4
  br label %282

282:                                              ; preds = %278, %255, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %287

283:                                              ; preds = %212
  %284 = load i32, ptr @ans, align 4, !tbaa !5
  %285 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %284)
  %286 = load i32, ptr %1, align 4
  ret i32 %286

287:                                              ; preds = %282, %201, %95
  %288 = load ptr, ptr %5, align 8
  %289 = load i32, ptr %6, align 4
  %290 = insertvalue { ptr, i32 } poison, ptr %288, 0
  %291 = insertvalue { ptr, i32 } %290, i32 %289, 1
  resume { ptr, i32 } %291
}

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

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

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

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

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

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

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

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

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

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

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

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


; 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_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, std::vector<int>>, std::_Select1st<std::pair<const std::vector<int>, std::vector<int>>>, std::less<std::vector<int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, std::vector<int>>, std::_Select1st<std::pair<const std::vector<int>, std::vector<int>>>, std::less<std::vector<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 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.3 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.3 = type { i64, [8 x i8] }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@cin = external dso_local global %"class.std::basic_ifstream", align 8
@cout = external dso_local global %"class.std::basic_ofstream", align 8
@K = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@cum = external dso_local global [10 x [50001 x i32]], align 16
@lst = external dso_local global [10 x [50001 x i32]], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@rec = external dso_local global %"class.std::map", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::stack", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %12 = load i32, ptr @K, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph55, label %._crit_edge66

.preheader50:                                     ; preds = %._crit_edge
  %14 = icmp sgt i32 %18, 0
  br i1 %14, label %.lr.ph65, label %._crit_edge66

.lr.ph55:                                         ; preds = %0, %._crit_edge
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %15 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.preheader51 unwind label %21

.preheader51:                                     ; preds = %.lr.ph55
  %16 = load i32, ptr @N, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader51
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %18 = load i32, ptr @K, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next80, %19
  br i1 %20, label %.lr.ph55, label %.preheader50, !llvm.loop !9

21:                                               ; preds = %.lr.ph55
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  br label %128

.lr.ph:                                           ; preds = %.preheader51, %.lr.ph
  %indvars.iv = phi i64 [ %26, %.lr.ph ], [ 0, %.preheader51 ]
  %23 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %24 = load i8, ptr %23, align 1, !tbaa !11
  %25 = icmp eq i8 %24, 40
  %26 = add nuw nsw i64 %indvars.iv, 1
  %27 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv79, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %. = select i1 %25, i32 1, i32 -1
  %29 = add nsw i32 %28, %.
  store i32 %29, ptr %27, align 4, !tbaa !5
  %30 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv79, i64 %indvars.iv
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv79, i64 %26
  %33 = add nsw i32 %29, %31
  store i32 %33, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %26, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge66:                                    ; preds = %._crit_edge63, %0, %.preheader50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %.not74 = icmp slt i32 %37, 0
  br i1 %.not74, label %._crit_edge77, label %.lr.ph76

.lr.ph65:                                         ; preds = %.preheader50, %._crit_edge63
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %._crit_edge63 ], [ 0, %.preheader50 ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @N, align 4, !tbaa !5
  %.not4259 = icmp slt i32 %38, 0
  br i1 %.not4259, label %._crit_edge63, label %.lr.ph62

._crit_edge63:                                    ; preds = %79, %.lr.ph65
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %39 = load i32, ptr @K, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next83, %40
  br i1 %41, label %.lr.ph65, label %._crit_edge66, !llvm.loop !13

.lr.ph62:                                         ; preds = %.lr.ph65, %79
  %storemerge4160 = phi i32 [ %81, %79 ], [ 0, %.lr.ph65 ]
  %42 = sext i32 %storemerge4160 to i64
  %43 = getelementptr inbounds [10 x [50001 x i32]], ptr @lst, i64 0, i64 %indvars.iv82, i64 %42
  store i32 -1000000007, ptr %43, align 4, !tbaa !5
  %44 = icmp eq i32 %storemerge4160, 0
  br i1 %44, label %45, label %49

45:                                               ; preds = %.lr.ph62
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %46 unwind label %47

46:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %79

47:                                               ; preds = %45
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %83

49:                                               ; preds = %.lr.ph62
  %50 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv82, i64 %42
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %storemerge4160, -1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv82, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp sgt i32 %51, %55
  br i1 %56, label %58, label %.preheader

.preheader:                                       ; preds = %49
  %57 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not4356 = icmp eq i64 %57, 0
  br i1 %.not4356, label %.critedge, label %.lr.ph57

58:                                               ; preds = %49
  store i32 %52, ptr %43, align 4, !tbaa !5
  br label %.invoke

59:                                               ; preds = %.invoke
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %83

.lr.ph57:                                         ; preds = %.preheader, %70
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv82, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv82, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %.not44 = icmp sgt i32 %64, %69
  br i1 %.not44, label %.critedge, label %70

70:                                               ; preds = %.lr.ph57
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %71 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not43 = icmp eq i64 %71, 0
  br i1 %.not43, label %.critedge, label %.lr.ph57, !llvm.loop !14

.critedge:                                        ; preds = %.lr.ph57, %70, %.preheader
  %72 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not45 = icmp eq i64 %72, 0
  br i1 %.not45, label %.invoke, label %73

73:                                               ; preds = %.critedge
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10 x [50001 x i32]], ptr @lst, i64 0, i64 %indvars.iv82, i64 %77
  store i32 %75, ptr %78, align 4, !tbaa !5
  br label %.invoke

.invoke:                                          ; preds = %.critedge, %73, %58
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %79 unwind label %59

79:                                               ; preds = %.invoke, %46
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %3, align 4, !tbaa !5
  %82 = load i32, ptr @N, align 4, !tbaa !5
  %.not42.not = icmp slt i32 %80, %82
  br i1 %.not42.not, label %.lr.ph62, label %._crit_edge63, !llvm.loop !15

83:                                               ; preds = %59, %47
  %.pn46 = phi { ptr, i32 } [ %48, %47 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  br label %128

._crit_edge77:                                    ; preds = %121, %._crit_edge66
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %84 = load i32, ptr @ans, align 4, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %84)
  ret i32 0

.lr.ph76:                                         ; preds = %._crit_edge66, %121
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 -1000000007, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr @K, align 4, !tbaa !5
  %87 = icmp sgt i32 %86, 0
  br i1 %87, label %.lr.ph69, label %._crit_edge70

._crit_edge70:                                    ; preds = %92, %.lr.ph76
  %88 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapISt6vectorIiSaIiEES2_St4lessIS2_ESaISt4pairIKS2_S2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @rec, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %103 unwind label %108

.lr.ph69:                                         ; preds = %.lr.ph76, %92
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %92 ], [ 0, %.lr.ph76 ]
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [10 x [50001 x i32]], ptr @cum, i64 0, i64 %indvars.iv85, i64 %90
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %91)
          to label %92 unwind label %101

92:                                               ; preds = %.lr.ph69
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10 x [50001 x i32]], ptr @lst, i64 0, i64 %indvars.iv85, i64 %94
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %95)
  %97 = load i32, ptr %96, align 4, !tbaa !5
  store i32 %97, ptr %7, align 4, !tbaa !5
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %98 = load i32, ptr @K, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = icmp slt i64 %indvars.iv.next86, %99
  br i1 %100, label %.lr.ph69, label %._crit_edge70, !llvm.loop !16

101:                                              ; preds = %.lr.ph69
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %127

103:                                              ; preds = %._crit_edge70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %104 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #6
  store ptr %104, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %105 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #6
  store ptr %105, ptr %9, align 8
  %106 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %106, label %.lr.ph72, label %._crit_edge73

._crit_edge73:                                    ; preds = %117, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %107 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapISt6vectorIiSaIiEES2_St4lessIS2_ESaISt4pairIKS2_S2_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) @rec, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %120 unwind label %125

108:                                              ; preds = %._crit_edge70
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %127

.lr.ph72:                                         ; preds = %103, %117
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = icmp sgt i32 %111, %112
  br i1 %113, label %114, label %117

114:                                              ; preds = %.lr.ph72
  %115 = load i32, ptr @ans, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr @ans, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %114, %.lr.ph72
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %119 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %119, label %.lr.ph72, label %._crit_edge73

120:                                              ; preds = %._crit_edge73
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %107, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %121 unwind label %125

121:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %5, align 4, !tbaa !5
  %124 = load i32, ptr @N, align 4, !tbaa !5
  %.not.not = icmp slt i32 %122, %124
  br i1 %.not.not, label %.lr.ph76, label %._crit_edge77, !llvm.loop !17

125:                                              ; preds = %120, %._crit_edge73
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %127

127:                                              ; preds = %125, %108, %101
  %.pn = phi { ptr, i32 } [ %102, %101 ], [ %126, %125 ], [ %109, %108 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %128

128:                                              ; preds = %127, %83, %21
  %.pn48 = phi { ptr, i32 } [ %22, %21 ], [ %.pn46, %83 ], [ %.pn, %127 ]
  resume { ptr, i32 } %.pn48
}

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

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

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

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

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

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

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

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

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

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

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

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


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