; LLVM IR from tangjz/acm-icpc :: lydsy (1571)

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

%struct.Node = 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 }
%"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 }

@b = external dso_local global [10001 x %struct.Node], align 16
@t = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@f = external dso_local global [10002 x [101 x i32]], align 16
@ans = external dso_local global i32, align 4
@m = external dso_local global [101 x i32], align 16
@l = external dso_local global [101 x i32], align 16
@a = external dso_local global [101 x i32], align 16
@cost = external dso_local global [10001 x i32], align 16
@lesson = external dso_local global [10001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::basic_ifstream", align 8
  %3 = alloca %"class.std::basic_ofstream", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr %2) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %2, ptr noundef @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr %3) #7
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef @.str.2, i32 noundef 16)
          to label %10 unwind label %49

10:                                               ; preds = %0
  %11 = invoke noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
          to label %12 unwind label %53

12:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @t)
          to label %14 unwind label %57

14:                                               ; preds = %12
  %15 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @s)
          to label %16 unwind label %57

16:                                               ; preds = %14
  %17 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %18 unwind label %57

18:                                               ; preds = %16
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %46, %18
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = load i32, ptr @s, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %23, label %61

23:                                               ; preds = %19
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [101 x i32], ptr @m, i64 0, i64 %25
  %27 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %28 unwind label %57

28:                                               ; preds = %23
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %30
  %32 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %33 unwind label %57

33:                                               ; preds = %28
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %35
  %37 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %36)
          to label %38 unwind label %57

38:                                               ; preds = %33
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [101 x i32], ptr @m, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %43
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %45 unwind label %57

45:                                               ; preds = %38
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %6, align 4, !tbaa !5
  br label %19, !llvm.loop !9

49:                                               ; preds = %0
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %4, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %5, align 4
  br label %389

53:                                               ; preds = %10
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %4, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %5, align 4
  br label %388

57:                                               ; preds = %383, %380, %366, %187, %96, %82, %72, %66, %38, %33, %28, %23, %16, %14, %12
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %4, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %5, align 4
  br label %387

61:                                               ; preds = %19
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %79, %61
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = icmp sle i32 %63, %64
  br i1 %65, label %66, label %82

66:                                               ; preds = %62
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.Node, ptr %69, i32 0, i32 0
  %71 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) %70)
          to label %72 unwind label %57

72:                                               ; preds = %66
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.Node, ptr %75, i32 0, i32 1
  %77 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull align 4 dereferenceable(4) %76)
          to label %78 unwind label %57

78:                                               ; preds = %72
  br label %79

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

82:                                               ; preds = %62
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %struct.Node, ptr @b, i64 %84
  %86 = getelementptr inbounds %struct.Node, ptr %85, i64 1
  invoke void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef getelementptr inbounds (%struct.Node, ptr @b, i64 1), ptr noundef %86)
          to label %87 unwind label %57

87:                                               ; preds = %82
  %88 = load i32, ptr getelementptr inbounds (%struct.Node, ptr getelementptr inbounds ([10001 x %struct.Node], ptr @b, i64 0, i64 1), i32 0, i32 1), align 4, !tbaa !12
  %89 = load i32, ptr getelementptr inbounds ([10001 x %struct.Node], ptr @b, i64 0, i64 1), align 8, !tbaa !14
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !5
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %119, %87
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %96, label %122

96:                                               ; preds = %92
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.Node, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 8, !tbaa !14
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %103
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.Node, ptr %107, i32 0, i32 1
  %109 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %104, ptr noundef nonnull align 4 dereferenceable(4) %108)
          to label %110 unwind label %57

110:                                              ; preds = %96
  %111 = load i32, ptr %109, align 4, !tbaa !5
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %113
  %115 = getelementptr inbounds %struct.Node, ptr %114, i32 0, i32 0
  %116 = load i32, ptr %115, align 8, !tbaa !14
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %117
  store i32 %111, ptr %118, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %110
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %6, align 4, !tbaa !5
  br label %92, !llvm.loop !15

122:                                              ; preds = %92
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %142, %122
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = icmp sle i32 %124, 10000
  br i1 %125, label %126, label %145

126:                                              ; preds = %123
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %141, label %132

132:                                              ; preds = %126
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %139
  store i32 %137, ptr %140, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %132, %126
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %6, align 4, !tbaa !5
  br label %123, !llvm.loop !16

145:                                              ; preds = %123
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %165, %145
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = load i32, ptr @t, align 4, !tbaa !5
  %149 = icmp sle i32 %147, %148
  br i1 %149, label %150, label %168

150:                                              ; preds = %146
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %161, %150
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = icmp sle i32 %152, 100
  br i1 %153, label %154, label %164

154:                                              ; preds = %151
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %156
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [101 x i32], ptr %157, i64 0, i64 %159
  store i32 -1, ptr %160, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %154
  %162 = load i32, ptr %7, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %7, align 4, !tbaa !5
  br label %151, !llvm.loop !17

164:                                              ; preds = %151
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %6, align 4, !tbaa !5
  br label %146, !llvm.loop !18

168:                                              ; preds = %146
  store i32 0, ptr getelementptr inbounds ([101 x i32], ptr getelementptr inbounds ([10002 x [101 x i32]], ptr @f, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %353, %168
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = load i32, ptr @t, align 4, !tbaa !5
  %172 = icmp sle i32 %170, %171
  br i1 %172, label %173, label %356

173:                                              ; preds = %169
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %349, %173
  %175 = load i32, ptr %7, align 4, !tbaa !5
  %176 = icmp sle i32 %175, 100
  br i1 %176, label %177, label %352

177:                                              ; preds = %174
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %179
  %181 = load i32, ptr %7, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [101 x i32], ptr %180, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = icmp eq i32 %184, -1
  br i1 %185, label %186, label %187

186:                                              ; preds = %177
  br label %349

187:                                              ; preds = %177
  %188 = load i32, ptr %6, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %190
  %192 = load i32, ptr %7, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [101 x i32], ptr %191, i64 0, i64 %193
  %195 = load i32, ptr %6, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %196
  %198 = load i32, ptr %7, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [101 x i32], ptr %197, i64 0, i64 %199
  %201 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %194, ptr noundef nonnull align 4 dereferenceable(4) %200)
          to label %202 unwind label %57

202:                                              ; preds = %187
  %203 = load i32, ptr %201, align 4, !tbaa !5
  %204 = load i32, ptr %6, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %206
  %208 = load i32, ptr %7, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [101 x i32], ptr %207, i64 0, i64 %209
  store i32 %203, ptr %210, align 4, !tbaa !5
  %211 = load i32, ptr %6, align 4, !tbaa !5
  %212 = load i32, ptr %7, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = add nsw i32 %211, %215
  %217 = load i32, ptr @t, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  %219 = icmp sle i32 %216, %218
  br i1 %219, label %220, label %258

220:                                              ; preds = %202
  %221 = load i32, ptr %6, align 4, !tbaa !5
  %222 = load i32, ptr %7, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = add nsw i32 %221, %225
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %227
  %229 = load i32, ptr %7, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [101 x i32], ptr %228, i64 0, i64 %230
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %232 = load i32, ptr %6, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %233
  %235 = load i32, ptr %7, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [101 x i32], ptr %234, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %8, align 4, !tbaa !5
  %240 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %231, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %241 unwind label %254

241:                                              ; preds = %220
  %242 = load i32, ptr %240, align 4, !tbaa !5
  %243 = load i32, ptr %6, align 4, !tbaa !5
  %244 = load i32, ptr %7, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = add nsw i32 %243, %247
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %249
  %251 = load i32, ptr %7, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [101 x i32], ptr %250, i64 0, i64 %252
  store i32 %242, ptr %253, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %258

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

258:                                              ; preds = %241, %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !19
  br label %259

259:                                              ; preds = %345, %258
  %260 = load i64, ptr %9, align 8, !tbaa !19
  %261 = load i32, ptr %6, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %262
  %264 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %263) #7
  %265 = icmp ult i64 %260, %264
  br i1 %265, label %267, label %266

266:                                              ; preds = %259
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %348

267:                                              ; preds = %259
  %268 = load i32, ptr %6, align 4, !tbaa !5
  %269 = load i32, ptr %6, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %270
  %272 = load i64, ptr %9, align 8, !tbaa !19
  %273 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %271, i64 noundef %272) #7
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  %278 = add nsw i32 %268, %277
  %279 = load i32, ptr @t, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  %281 = icmp sle i32 %278, %280
  br i1 %281, label %282, label %344

282:                                              ; preds = %267
  %283 = load i32, ptr %6, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %284
  %286 = load i32, ptr %7, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [101 x i32], ptr %285, i64 0, i64 %287
  %289 = load i32, ptr %6, align 4, !tbaa !5
  %290 = load i32, ptr %6, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %291
  %293 = load i64, ptr %9, align 8, !tbaa !19
  %294 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %292, i64 noundef %293) #7
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %296
  %298 = load i32, ptr %297, align 4, !tbaa !5
  %299 = add nsw i32 %289, %298
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %300
  %302 = load i32, ptr %6, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %303
  %305 = load i64, ptr %9, align 8, !tbaa !19
  %306 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %304, i64 noundef %305) #7
  %307 = load i32, ptr %306, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %308
  %310 = load i32, ptr %309, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [101 x i32], ptr %301, i64 0, i64 %311
  %313 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %288, ptr noundef nonnull align 4 dereferenceable(4) %312)
          to label %314 unwind label %340

314:                                              ; preds = %282
  %315 = load i32, ptr %313, align 4, !tbaa !5
  %316 = load i32, ptr %6, align 4, !tbaa !5
  %317 = load i32, ptr %6, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %318
  %320 = load i64, ptr %9, align 8, !tbaa !19
  %321 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %319, i64 noundef %320) #7
  %322 = load i32, ptr %321, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %323
  %325 = load i32, ptr %324, align 4, !tbaa !5
  %326 = add nsw i32 %316, %325
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %327
  %329 = load i32, ptr %6, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %330
  %332 = load i64, ptr %9, align 8, !tbaa !19
  %333 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %331, i64 noundef %332) #7
  %334 = load i32, ptr %333, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %335
  %337 = load i32, ptr %336, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [101 x i32], ptr %328, i64 0, i64 %338
  store i32 %315, ptr %339, align 4, !tbaa !5
  br label %344

340:                                              ; preds = %282
  %341 = landingpad { ptr, i32 }
          cleanup
  %342 = extractvalue { ptr, i32 } %341, 0
  store ptr %342, ptr %4, align 8
  %343 = extractvalue { ptr, i32 } %341, 1
  store i32 %343, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %387

344:                                              ; preds = %314, %267
  br label %345

345:                                              ; preds = %344
  %346 = load i64, ptr %9, align 8, !tbaa !19
  %347 = add i64 %346, 1
  store i64 %347, ptr %9, align 8, !tbaa !19
  br label %259, !llvm.loop !21

348:                                              ; preds = %266
  br label %349

349:                                              ; preds = %348, %186
  %350 = load i32, ptr %7, align 4, !tbaa !5
  %351 = add nsw i32 %350, 1
  store i32 %351, ptr %7, align 4, !tbaa !5
  br label %174, !llvm.loop !22

352:                                              ; preds = %174
  br label %353

353:                                              ; preds = %352
  %354 = load i32, ptr %6, align 4, !tbaa !5
  %355 = add nsw i32 %354, 1
  store i32 %355, ptr %6, align 4, !tbaa !5
  br label %169, !llvm.loop !23

356:                                              ; preds = %169
  %357 = load i32, ptr @t, align 4, !tbaa !5
  %358 = add nsw i32 %357, 1
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %359
  %361 = getelementptr inbounds [101 x i32], ptr %360, i64 0, i64 1
  %362 = load i32, ptr %361, align 4, !tbaa !5
  store i32 %362, ptr @ans, align 4, !tbaa !5
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %363

363:                                              ; preds = %377, %356
  %364 = load i32, ptr %6, align 4, !tbaa !5
  %365 = icmp sle i32 %364, 100
  br i1 %365, label %366, label %380

366:                                              ; preds = %363
  %367 = load i32, ptr @t, align 4, !tbaa !5
  %368 = add nsw i32 %367, 1
  %369 = sext i32 %368 to i64
  %370 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %369
  %371 = load i32, ptr %6, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [101 x i32], ptr %370, i64 0, i64 %372
  %374 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %373)
          to label %375 unwind label %57

375:                                              ; preds = %366
  %376 = load i32, ptr %374, align 4, !tbaa !5
  store i32 %376, ptr @ans, align 4, !tbaa !5
  br label %377

377:                                              ; preds = %375
  %378 = load i32, ptr %6, align 4, !tbaa !5
  %379 = add nsw i32 %378, 1
  store i32 %379, ptr %6, align 4, !tbaa !5
  br label %363, !llvm.loop !24

380:                                              ; preds = %363
  %381 = load i32, ptr @ans, align 4, !tbaa !5
  %382 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %381)
          to label %383 unwind label %57

383:                                              ; preds = %380
  %384 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %382, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %385 unwind label %57

385:                                              ; preds = %383
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  %386 = load i32, ptr %1, align 4
  ret i32 %386

387:                                              ; preds = %340, %254, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %388

388:                                              ; preds = %387, %53
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  br label %389

389:                                              ; preds = %388, %49
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  br label %390

390:                                              ; preds = %389
  %391 = load ptr, ptr %4, align 8
  %392 = load i32, ptr %5, align 4
  %393 = insertvalue { ptr, i32 } poison, ptr %391, 0
  %394 = insertvalue { ptr, i32 } %393, i32 %392, 1
  resume { ptr, i32 } %394
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #6 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) #6 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #6 align 2

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 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 4}
!13 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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

%struct.Node = 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 }
%"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 }

@b = external dso_local global [10001 x %struct.Node], align 16
@t = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@f = external dso_local global [10002 x [101 x i32]], align 16
@ans = external dso_local global i32, align 4
@m = external dso_local global [101 x i32], align 16
@l = external dso_local global [101 x i32], align 16
@a = external dso_local global [101 x i32], align 16
@cost = external dso_local global [10001 x i32], align 16
@lesson = external dso_local global [10001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::basic_ifstream", align 8
  %2 = alloca %"class.std::basic_ofstream", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %1) #8
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef nonnull @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #8
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.2, i32 noundef 16)
          to label %5 unwind label %39

5:                                                ; preds = %0
  %6 = invoke noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
          to label %7 unwind label %41

7:                                                ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %8 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @t)
          to label %9 unwind label %.loopexit.split-lp.loopexit.split-lp

9:                                                ; preds = %7
  %10 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) @s)
          to label %11 unwind label %.loopexit.split-lp.loopexit.split-lp

11:                                               ; preds = %9
  %12 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %.preheader58 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader58:                                     ; preds = %11
  store i32 1, ptr %3, align 4, !tbaa !5
  %13 = load i32, ptr @s, align 4, !tbaa !5
  %.not64 = icmp slt i32 %13, 1
  br i1 %.not64, label %.preheader56, label %.lr.ph

.preheader56:                                     ; preds = %35, %.preheader58
  store i32 1, ptr %3, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %.not3966 = icmp slt i32 %14, 1
  br i1 %.not3966, label %._crit_edge, label %.lr.ph68

.lr.ph:                                           ; preds = %.preheader58, %35
  %storemerge65 = phi i32 [ %37, %35 ], [ 1, %.preheader58 ]
  %15 = sext i32 %storemerge65 to i64
  %16 = getelementptr inbounds [101 x i32], ptr @m, i64 0, i64 %15
  %17 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %18 unwind label %.loopexit.split-lp.loopexit

18:                                               ; preds = %.lr.ph
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %20
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %23 unwind label %.loopexit.split-lp.loopexit

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %25
  %27 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %28 unwind label %.loopexit.split-lp.loopexit

28:                                               ; preds = %23
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [101 x i32], ptr @m, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %33
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %35 unwind label %.loopexit.split-lp.loopexit

35:                                               ; preds = %28
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @s, align 4, !tbaa !5
  %.not.not = icmp slt i32 %36, %38
  br i1 %.not.not, label %.lr.ph, label %.preheader56, !llvm.loop !9

39:                                               ; preds = %0
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %229

41:                                               ; preds = %5
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %228

.loopexit57:                                      ; preds = %.lr.ph68, %46
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %28, %23, %18, %.lr.ph
  %lpad.loopexit59 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %225, %223, %._crit_edge, %11, %9, %7
  %lpad.loopexit.split-lp60 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit57
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit57 ], [ %lpad.loopexit59, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp60, %.loopexit.split-lp.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %228

.lr.ph68:                                         ; preds = %.preheader56, %51
  %storemerge3867 = phi i32 [ %53, %51 ], [ 1, %.preheader56 ]
  %43 = sext i32 %storemerge3867 to i64
  %44 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %43
  %45 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %44)
          to label %46 unwind label %.loopexit57

46:                                               ; preds = %.lr.ph68
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %48, i32 1
  %50 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 4 dereferenceable(4) %49)
          to label %51 unwind label %.loopexit57

51:                                               ; preds = %46
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %3, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %.not39.not = icmp slt i32 %52, %54
  br i1 %.not39.not, label %.lr.ph68, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %51, %.preheader56
  %.lcssa62 = phi i32 [ %14, %.preheader56 ], [ %54, %51 ]
  %55 = sext i32 %.lcssa62 to i64
  %56 = getelementptr inbounds %struct.Node, ptr @b, i64 %55
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  invoke void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 8), ptr noundef nonnull %57)
          to label %58 unwind label %.loopexit.split-lp.loopexit.split-lp

58:                                               ; preds = %._crit_edge
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @b, i64 12), align 4, !tbaa !12
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8, !tbaa !14
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %61
  store i32 %59, ptr %62, align 4, !tbaa !5
  store i32 2, ptr %3, align 4, !tbaa !5
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %.not4169 = icmp slt i32 %63, 2
  br i1 %.not4169, label %.preheader55.preheader, label %.lr.ph72

.preheader55.preheader:                           ; preds = %.lr.ph72, %58
  br label %.preheader55

.lr.ph72:                                         ; preds = %58, %.lr.ph72
  %64 = phi i32 [ %74, %.lr.ph72 ], [ %60, %58 ]
  %storemerge4070 = phi i32 [ %77, %.lr.ph72 ], [ 2, %58 ]
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %65
  %67 = sext i32 %storemerge4070 to i64
  %68 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %67, i32 1
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %66, ptr noundef nonnull align 4 dereferenceable(4) %68)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10001 x %struct.Node], ptr @b, i64 0, i64 %72
  %74 = load i32, ptr %73, align 8, !tbaa !14
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %75
  store i32 %70, ptr %76, align 4, !tbaa !5
  %77 = add nsw i32 %71, 1
  store i32 %77, ptr %3, align 4, !tbaa !5
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %.not41.not = icmp slt i32 %71, %78
  br i1 %.not41.not, label %.lr.ph72, label %.preheader55.preheader, !llvm.loop !15

.preheader54:                                     ; preds = %87
  %79 = load i32, ptr @t, align 4, !tbaa !5
  %.not4475 = icmp slt i32 %79, 1
  br i1 %.not4475, label %._crit_edge77.thread, label %.preheader53.preheader

._crit_edge77.thread:                             ; preds = %.preheader54
  store i32 0, ptr getelementptr inbounds (i8, ptr @f, i64 408), align 8, !tbaa !5
  br label %._crit_edge84

.preheader53.preheader:                           ; preds = %.preheader54
  %wide.trip.count = zext nneg i32 %79 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %80 = icmp ult i32 %79, 8
  br i1 %80, label %._crit_edge77.unr-lcssa, label %.preheader53.preheader.new

.preheader53.preheader.new:                       ; preds = %.preheader53.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  br label %.preheader53

.preheader55:                                     ; preds = %93, %.preheader55.preheader
  %indvars.iv = phi i64 [ 2, %.preheader55.preheader ], [ %indvars.iv.next.1, %93 ]
  %81 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %indvars.iv
  %82 = load i32, ptr %81, align 8, !tbaa !5
  %.not50 = icmp eq i32 %82, 0
  br i1 %.not50, label %83, label %87

83:                                               ; preds = %.preheader55
  %84 = add nsw i64 %indvars.iv, -1
  %85 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  store i32 %86, ptr %81, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %.preheader55, %83
  %exitcond.not = icmp eq i64 %indvars.iv, 10000
  br i1 %exitcond.not, label %.preheader54, label %.preheader55.1, !llvm.loop !16

.preheader55.1:                                   ; preds = %87
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %88 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %indvars.iv.next
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %.not50.1 = icmp eq i32 %89, 0
  br i1 %.not50.1, label %90, label %93

90:                                               ; preds = %.preheader55.1
  %91 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %indvars.iv
  %92 = load i32, ptr %91, align 8, !tbaa !5
  store i32 %92, ptr %88, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %90, %.preheader55.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %.preheader55

.preheader53:                                     ; preds = %.preheader53, %.preheader53.preheader.new
  %indvar = phi i64 [ 0, %.preheader53.preheader.new ], [ %indvar.next.7, %.preheader53 ]
  %niter = phi i64 [ 0, %.preheader53.preheader.new ], [ %niter.next.7, %.preheader53 ]
  %94 = mul nuw nsw i64 %indvar, 404
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 %94
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(400) %gep, i8 -1, i64 400, i1 false), !tbaa !5
  %95 = mul nuw i64 %indvar, 404
  %gep113 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 404), i64 %95
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep113, i8 -1, i64 400, i1 false), !tbaa !5
  %96 = mul nuw i64 %indvar, 404
  %gep114 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 808), i64 %96
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %gep114, i8 -1, i64 400, i1 false), !tbaa !5
  %97 = mul nuw i64 %indvar, 404
  %gep115 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 1212), i64 %97
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep115, i8 -1, i64 400, i1 false), !tbaa !5
  %98 = mul nuw i64 %indvar, 404
  %gep116 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 1616), i64 %98
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(400) %gep116, i8 -1, i64 400, i1 false), !tbaa !5
  %99 = mul nuw i64 %indvar, 404
  %gep117 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 2020), i64 %99
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep117, i8 -1, i64 400, i1 false), !tbaa !5
  %100 = mul nuw i64 %indvar, 404
  %gep118 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 2424), i64 %100
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %gep118, i8 -1, i64 400, i1 false), !tbaa !5
  %101 = mul nuw i64 %indvar, 404
  %gep119 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 2828), i64 %101
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep119, i8 -1, i64 400, i1 false), !tbaa !5
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge77.unr-lcssa, label %.preheader53, !llvm.loop !17

._crit_edge77.unr-lcssa:                          ; preds = %.preheader53, %.preheader53.preheader
  %indvar.unr = phi i64 [ 0, %.preheader53.preheader ], [ %indvar.next.7, %.preheader53 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge77, label %.preheader53.epil

.preheader53.epil:                                ; preds = %._crit_edge77.unr-lcssa, %.preheader53.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader53.epil ], [ %indvar.unr, %._crit_edge77.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader53.epil ], [ 0, %._crit_edge77.unr-lcssa ]
  %102 = mul nuw nsw i64 %indvar.epil, 404
  %gep.epil = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 408), i64 %102
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(400) %gep.epil, i8 -1, i64 400, i1 false), !tbaa !5
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge77, label %.preheader53.epil, !llvm.loop !18

._crit_edge77:                                    ; preds = %.preheader53.epil, %._crit_edge77.unr-lcssa
  store i32 0, ptr getelementptr inbounds (i8, ptr @f, i64 408), align 8, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br i1 %.not4475, label %._crit_edge84, label %.preheader

.preheader:                                       ; preds = %._crit_edge77, %.preheader.backedge
  %indvars.iv96 = phi i64 [ %indvars.iv96.be, %.preheader.backedge ], [ 1, %._crit_edge77 ]
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %104, i64 %indvars.iv96
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = icmp eq i32 %106, -1
  br i1 %107, label %.loopexit, label %108

108:                                              ; preds = %.preheader
  %109 = add nsw i32 %103, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %110, i64 %indvars.iv96
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %111, ptr noundef nonnull align 4 dereferenceable(4) %105)
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %3, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %116, i64 %indvars.iv96
  store i32 %113, ptr %117, align 4, !tbaa !5
  %118 = getelementptr inbounds [10001 x i32], ptr @cost, i64 0, i64 %indvars.iv96
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = add nsw i32 %119, %114
  %121 = load i32, ptr @t, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %.not48 = icmp sgt i32 %120, %122
  br i1 %.not48, label %137, label %123

123:                                              ; preds = %108
  %124 = sext i32 %120 to i64
  %125 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %124, i64 %indvars.iv96
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %126 = sext i32 %114 to i64
  %127 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %126, i64 %indvars.iv96
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %4, align 4, !tbaa !5
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %125, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = load i32, ptr %118, align 4, !tbaa !5
  %134 = add nsw i32 %133, %132
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %135, i64 %indvars.iv96
  store i32 %131, ptr %136, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %137

137:                                              ; preds = %123, %108
  %138 = phi i32 [ %132, %123 ], [ %114, %108 ]
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %139
  %141 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %140) #8
  %.not = icmp eq i64 %141, 0
  br i1 %.not, label %.loopexit, label %.lr.ph81

.lr.ph81:                                         ; preds = %137, %197
  %.079 = phi i64 [ %198, %197 ], [ 0, %137 ]
  %142 = load i32, ptr %3, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %143
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %144, i64 noundef %.079) #8
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i32 %149, %142
  %151 = load i32, ptr @t, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  %.not49 = icmp sgt i32 %150, %152
  br i1 %.not49, label %197, label %153

153:                                              ; preds = %.lr.ph81
  %154 = load i32, ptr %3, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %155, i64 %indvars.iv96
  %157 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %155
  %158 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %157, i64 noundef %.079) #8
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = add nsw i32 %162, %154
  %164 = sext i32 %163 to i64
  %165 = load i32, ptr %3, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %166
  %168 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %167, i64 noundef %.079) #8
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %164, i64 %173
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %156, ptr noundef nonnull align 4 dereferenceable(4) %174)
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = load i32, ptr %3, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %178
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %179, i64 noundef %.079) #8
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [101 x i32], ptr @l, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = add nsw i32 %184, %177
  %186 = sext i32 %185 to i64
  %187 = load i32, ptr %3, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %188
  %190 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %189, i64 noundef %.079) #8
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %186, i64 %195
  store i32 %176, ptr %196, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %.lr.ph81, %153
  %198 = add nuw i64 %.079, 1
  %199 = load i32, ptr %3, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @lesson, i64 0, i64 %200
  %202 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %201) #8
  %203 = icmp ult i64 %198, %202
  br i1 %203, label %.lr.ph81, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %197, %137, %.preheader
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next97, 101
  br i1 %exitcond99.not, label %204, label %.preheader.backedge

.preheader.backedge:                              ; preds = %.loopexit, %204
  %indvars.iv96.be = phi i64 [ %indvars.iv.next97, %.loopexit ], [ 1, %204 ]
  br label %.preheader, !llvm.loop !21

204:                                              ; preds = %.loopexit
  %205 = load i32, ptr %3, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %3, align 4, !tbaa !5
  %207 = load i32, ptr @t, align 4, !tbaa !5
  %.not46.not = icmp slt i32 %205, %207
  br i1 %.not46.not, label %.preheader.backedge, label %._crit_edge84

._crit_edge84:                                    ; preds = %204, %._crit_edge77.thread, %._crit_edge77
  %.lcssa = phi i32 [ %79, %._crit_edge77 ], [ %79, %._crit_edge77.thread ], [ %207, %204 ]
  %208 = add nsw i32 %.lcssa, 1
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %209, i64 1
  %211 = load i32, ptr %210, align 4, !tbaa !5
  store i32 %211, ptr @ans, align 4, !tbaa !5
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %212

212:                                              ; preds = %._crit_edge84, %212
  %storemerge4786 = phi i32 [ 2, %._crit_edge84 ], [ %221, %212 ]
  %213 = load i32, ptr @t, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  %215 = sext i32 %214 to i64
  %216 = sext i32 %storemerge4786 to i64
  %217 = getelementptr inbounds [10002 x [101 x i32]], ptr @f, i64 0, i64 %215, i64 %216
  %218 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %217)
  %219 = load i32, ptr %218, align 4, !tbaa !5
  store i32 %219, ptr @ans, align 4, !tbaa !5
  %220 = load i32, ptr %3, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %3, align 4, !tbaa !5
  %222 = icmp slt i32 %220, 100
  br i1 %222, label %212, label %223, !llvm.loop !22

223:                                              ; preds = %212
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 noundef %219)
          to label %225 unwind label %.loopexit.split-lp.loopexit.split-lp

225:                                              ; preds = %223
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %224, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %227 unwind label %.loopexit.split-lp.loopexit.split-lp

227:                                              ; preds = %225
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #8
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #8
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #8
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #8
  ret i32 0

228:                                              ; preds = %.loopexit.split-lp, %41
  %.pn = phi { ptr, i32 } [ %lpad.phi, %.loopexit.split-lp ], [ %42, %41 ]
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #8
  br label %229

229:                                              ; preds = %228, %39
  %.pn.pn = phi { ptr, i32 } [ %.pn, %228 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #8
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #8
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6 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 #6 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #6 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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


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