; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/MENU (A)

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::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 }

@INF = external dso_local global double, align 8
@dp = external dso_local global [22 x [101 x [51 x [3 x double]]]], align 16
@back = external dso_local global [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], align 16
@cost = external dso_local global [51 x i32], align 16
@ben = external dso_local global [51 x double], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca i32, align 4
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca %"struct.std::pair", align 4
  %30 = alloca i32, align 4
  %31 = alloca %"struct.std::pair", align 4
  %32 = alloca i32, align 4
  %33 = alloca double, align 8
  %34 = alloca %"struct.std::pair", align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca %"struct.std::pair", align 4
  %42 = alloca %"class.std::vector", align 8
  %43 = alloca i32, align 4
  %44 = alloca ptr, align 8
  %45 = alloca i32, align 4
  %46 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %47 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %48 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %49 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 0, ptr %1, align 4
  br label %50

50:                                               ; preds = %647, %645, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %52, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %63

56:                                               ; preds = %50
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %56
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  store i32 3, ptr %5, align 4
  br label %645

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

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

68:                                               ; preds = %64
  store i32 4, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %159

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

70:                                               ; preds = %152, %69
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = icmp sle i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %155

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %148, %75
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = icmp sle i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %151

81:                                               ; preds = %76
  %82 = load double, ptr @INF, align 8, !tbaa !9
  %83 = fneg double %82
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %85
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [51 x [3 x double]], ptr %89, i64 0, i64 %91
  %93 = getelementptr inbounds [3 x double], ptr %92, i64 0, i64 2
  store double %83, ptr %93, align 8, !tbaa !9
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %95
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [51 x [3 x double]], ptr %99, i64 0, i64 %101
  %103 = getelementptr inbounds [3 x double], ptr %102, i64 0, i64 1
  store double %83, ptr %103, align 8, !tbaa !9
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %105
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %106, i64 0, i64 %108
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [51 x [3 x double]], ptr %109, i64 0, i64 %111
  %113 = getelementptr inbounds [3 x double], ptr %112, i64 0, i64 0
  store double %83, ptr %113, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 -1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 -1, ptr %11, align 4, !tbaa !5
  %114 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i64 %114, ptr %9, align 4
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %116
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %117, i64 0, i64 %119
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %120, i64 0, i64 %122
  %124 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %123, i64 0, i64 2
  %125 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %124, ptr noundef nonnull align 4 dereferenceable(8) %9) #9
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %127
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %8, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %131, i64 0, i64 %133
  %135 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %134, i64 0, i64 1
  %136 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %135, ptr noundef nonnull align 4 dereferenceable(8) %125)
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %138
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %139, i64 0, i64 %141
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %142, i64 0, i64 %144
  %146 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %145, i64 0, i64 0
  %147 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %146, ptr noundef nonnull align 4 dereferenceable(8) %136)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %148

148:                                              ; preds = %81
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %8, align 4, !tbaa !5
  br label %76, !llvm.loop !11

151:                                              ; preds = %80
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %7, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %7, align 4, !tbaa !5
  br label %70, !llvm.loop !13

155:                                              ; preds = %74
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %6, align 4, !tbaa !5
  br label %64, !llvm.loop !14

159:                                              ; preds = %68
  store double 0.000000e+00, ptr @dp, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %174, %159
  %161 = load i32, ptr %12, align 4, !tbaa !5
  %162 = load i32, ptr %3, align 4, !tbaa !5
  %163 = icmp sle i32 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %177

165:                                              ; preds = %160
  %166 = load i32, ptr %12, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %167
  %169 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %168)
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [51 x double], ptr @ben, i64 0, i64 %171
  %173 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %169, ptr noundef nonnull align 8 dereferenceable(8) %172)
  br label %174

174:                                              ; preds = %165
  %175 = load i32, ptr %12, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %12, align 4, !tbaa !5
  br label %160, !llvm.loop !15

177:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %485, %177
  %179 = load i32, ptr %13, align 4, !tbaa !5
  %180 = load i32, ptr %2, align 4, !tbaa !5
  %181 = icmp sle i32 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %488

183:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %481, %183
  %185 = load i32, ptr %14, align 4, !tbaa !5
  %186 = load i32, ptr %4, align 4, !tbaa !5
  %187 = icmp sle i32 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %484

189:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %190

190:                                              ; preds = %477, %189
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = load i32, ptr %3, align 4, !tbaa !5
  %193 = icmp sle i32 %191, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %190
  store i32 22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %480

195:                                              ; preds = %190
  %196 = load i32, ptr %15, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = load i32, ptr %14, align 4, !tbaa !5
  %201 = icmp sle i32 %199, %200
  br i1 %201, label %202, label %328

202:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %203 = load double, ptr @INF, align 8, !tbaa !9
  %204 = fneg double %203
  store double %204, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 -1, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  store i32 -1, ptr %19, align 4, !tbaa !5
  %205 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  store i64 %205, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %206

206:                                              ; preds = %297, %202
  %207 = load i32, ptr %20, align 4, !tbaa !5
  %208 = load i32, ptr %3, align 4, !tbaa !5
  %209 = icmp sle i32 %207, %208
  br i1 %209, label %211, label %210

210:                                              ; preds = %206
  store i32 25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %300

211:                                              ; preds = %206
  %212 = load i32, ptr %15, align 4, !tbaa !5
  %213 = load i32, ptr %20, align 4, !tbaa !5
  %214 = icmp eq i32 %212, %213
  br i1 %214, label %215, label %216

215:                                              ; preds = %211
  br label %297

216:                                              ; preds = %211
  %217 = load i32, ptr %13, align 4, !tbaa !5
  %218 = sub nsw i32 %217, 1
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %219
  %221 = load i32, ptr %14, align 4, !tbaa !5
  %222 = load i32, ptr %15, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = sub nsw i32 %221, %225
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %220, i64 0, i64 %227
  %229 = load i32, ptr %20, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [51 x [3 x double]], ptr %228, i64 0, i64 %230
  %232 = getelementptr inbounds [3 x double], ptr %231, i64 0, i64 0
  %233 = load double, ptr %232, align 8, !tbaa !9
  %234 = load double, ptr %16, align 8, !tbaa !9
  %235 = fcmp ogt double %233, %234
  br i1 %235, label %236, label %256

236:                                              ; preds = %216
  %237 = load i32, ptr %13, align 4, !tbaa !5
  %238 = sub nsw i32 %237, 1
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %239
  %241 = load i32, ptr %14, align 4, !tbaa !5
  %242 = load i32, ptr %15, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = sub nsw i32 %241, %245
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %240, i64 0, i64 %247
  %249 = load i32, ptr %20, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [51 x [3 x double]], ptr %248, i64 0, i64 %250
  %252 = getelementptr inbounds [3 x double], ptr %251, i64 0, i64 0
  %253 = load double, ptr %252, align 8, !tbaa !9
  store double %253, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !5
  %254 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %22)
  store i64 %254, ptr %21, align 4
  %255 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %256

256:                                              ; preds = %236, %216
  %257 = load i32, ptr %13, align 4, !tbaa !5
  %258 = sub nsw i32 %257, 1
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %259
  %261 = load i32, ptr %14, align 4, !tbaa !5
  %262 = load i32, ptr %15, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = sub nsw i32 %261, %265
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %260, i64 0, i64 %267
  %269 = load i32, ptr %20, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [51 x [3 x double]], ptr %268, i64 0, i64 %270
  %272 = getelementptr inbounds [3 x double], ptr %271, i64 0, i64 1
  %273 = load double, ptr %272, align 8, !tbaa !9
  %274 = load double, ptr %16, align 8, !tbaa !9
  %275 = fcmp ogt double %273, %274
  br i1 %275, label %276, label %296

276:                                              ; preds = %256
  %277 = load i32, ptr %13, align 4, !tbaa !5
  %278 = sub nsw i32 %277, 1
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %279
  %281 = load i32, ptr %14, align 4, !tbaa !5
  %282 = load i32, ptr %15, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = sub nsw i32 %281, %285
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %280, i64 0, i64 %287
  %289 = load i32, ptr %20, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [51 x [3 x double]], ptr %288, i64 0, i64 %290
  %292 = getelementptr inbounds [3 x double], ptr %291, i64 0, i64 1
  %293 = load double, ptr %292, align 8, !tbaa !9
  store double %293, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 1, ptr %24, align 4, !tbaa !5
  %294 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %24)
  store i64 %294, ptr %23, align 4
  %295 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %23) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  br label %296

296:                                              ; preds = %276, %256
  br label %297

297:                                              ; preds = %296, %215
  %298 = load i32, ptr %20, align 4, !tbaa !5
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr %20, align 4, !tbaa !5
  br label %206, !llvm.loop !16

300:                                              ; preds = %210
  %301 = load double, ptr %16, align 8, !tbaa !9
  %302 = load i32, ptr %15, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [51 x double], ptr @ben, i64 0, i64 %303
  %305 = load double, ptr %304, align 8, !tbaa !9
  %306 = fadd double %301, %305
  %307 = load i32, ptr %13, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %308
  %310 = load i32, ptr %14, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %309, i64 0, i64 %311
  %313 = load i32, ptr %15, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [51 x [3 x double]], ptr %312, i64 0, i64 %314
  %316 = getelementptr inbounds [3 x double], ptr %315, i64 0, i64 0
  store double %306, ptr %316, align 8, !tbaa !9
  %317 = load i32, ptr %13, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %318
  %320 = load i32, ptr %14, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %319, i64 0, i64 %321
  %323 = load i32, ptr %15, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %322, i64 0, i64 %324
  %326 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %325, i64 0, i64 0
  %327 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %326, ptr noundef nonnull align 4 dereferenceable(8) %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %328

328:                                              ; preds = %300, %195
  %329 = load i32, ptr %15, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %330
  %332 = load i32, ptr %331, align 4, !tbaa !5
  %333 = mul nsw i32 2, %332
  %334 = load i32, ptr %14, align 4, !tbaa !5
  %335 = icmp sle i32 %333, %334
  br i1 %335, label %336, label %381

336:                                              ; preds = %328
  %337 = load i32, ptr %13, align 4, !tbaa !5
  %338 = sub nsw i32 %337, 1
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %339
  %341 = load i32, ptr %14, align 4, !tbaa !5
  %342 = load i32, ptr %15, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %343
  %345 = load i32, ptr %344, align 4, !tbaa !5
  %346 = sub nsw i32 %341, %345
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %340, i64 0, i64 %347
  %349 = load i32, ptr %15, align 4, !tbaa !5
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [51 x [3 x double]], ptr %348, i64 0, i64 %350
  %352 = getelementptr inbounds [3 x double], ptr %351, i64 0, i64 0
  %353 = load double, ptr %352, align 8, !tbaa !9
  %354 = load i32, ptr %15, align 4, !tbaa !5
  %355 = sext i32 %354 to i64
  %356 = getelementptr inbounds [51 x double], ptr @ben, i64 0, i64 %355
  %357 = load double, ptr %356, align 8, !tbaa !9
  %358 = call double @llvm.fmuladd.f64(double %357, double 5.000000e-01, double %353)
  %359 = load i32, ptr %13, align 4, !tbaa !5
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %360
  %362 = load i32, ptr %14, align 4, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %361, i64 0, i64 %363
  %365 = load i32, ptr %15, align 4, !tbaa !5
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [51 x [3 x double]], ptr %364, i64 0, i64 %366
  %368 = getelementptr inbounds [3 x double], ptr %367, i64 0, i64 1
  store double %358, ptr %368, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !5
  %369 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %26)
  store i64 %369, ptr %25, align 4
  %370 = load i32, ptr %13, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %371
  %373 = load i32, ptr %14, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %372, i64 0, i64 %374
  %376 = load i32, ptr %15, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %375, i64 0, i64 %377
  %379 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %378, i64 0, i64 1
  %380 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %379, ptr noundef nonnull align 4 dereferenceable(8) %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %381

381:                                              ; preds = %336, %328
  %382 = load i32, ptr %15, align 4, !tbaa !5
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %383
  %385 = load i32, ptr %384, align 4, !tbaa !5
  %386 = mul nsw i32 3, %385
  %387 = load i32, ptr %14, align 4, !tbaa !5
  %388 = icmp sle i32 %386, %387
  br i1 %388, label %389, label %476

389:                                              ; preds = %381
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %390 = load i32, ptr %13, align 4, !tbaa !5
  %391 = sub nsw i32 %390, 1
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %392
  %394 = load i32, ptr %14, align 4, !tbaa !5
  %395 = load i32, ptr %15, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %396
  %398 = load i32, ptr %397, align 4, !tbaa !5
  %399 = sub nsw i32 %394, %398
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %393, i64 0, i64 %400
  %402 = load i32, ptr %15, align 4, !tbaa !5
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds [51 x [3 x double]], ptr %401, i64 0, i64 %403
  %405 = getelementptr inbounds [3 x double], ptr %404, i64 0, i64 1
  %406 = load double, ptr %405, align 8, !tbaa !9
  store double %406, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %407 = load i32, ptr %13, align 4, !tbaa !5
  %408 = sub nsw i32 %407, 1
  %409 = sext i32 %408 to i64
  %410 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %409
  %411 = load i32, ptr %14, align 4, !tbaa !5
  %412 = load i32, ptr %15, align 4, !tbaa !5
  %413 = sext i32 %412 to i64
  %414 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %413
  %415 = load i32, ptr %414, align 4, !tbaa !5
  %416 = sub nsw i32 %411, %415
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %410, i64 0, i64 %417
  %419 = load i32, ptr %15, align 4, !tbaa !5
  %420 = sext i32 %419 to i64
  %421 = getelementptr inbounds [51 x [3 x double]], ptr %418, i64 0, i64 %420
  %422 = getelementptr inbounds [3 x double], ptr %421, i64 0, i64 2
  %423 = load double, ptr %422, align 8, !tbaa !9
  store double %423, ptr %28, align 8, !tbaa !9
  %424 = load double, ptr %27, align 8, !tbaa !9
  %425 = load double, ptr %28, align 8, !tbaa !9
  %426 = fcmp ogt double %424, %425
  br i1 %426, label %427, label %451

427:                                              ; preds = %389
  %428 = load double, ptr %27, align 8, !tbaa !9
  %429 = load i32, ptr %13, align 4, !tbaa !5
  %430 = sext i32 %429 to i64
  %431 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %430
  %432 = load i32, ptr %14, align 4, !tbaa !5
  %433 = sext i32 %432 to i64
  %434 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %431, i64 0, i64 %433
  %435 = load i32, ptr %15, align 4, !tbaa !5
  %436 = sext i32 %435 to i64
  %437 = getelementptr inbounds [51 x [3 x double]], ptr %434, i64 0, i64 %436
  %438 = getelementptr inbounds [3 x double], ptr %437, i64 0, i64 2
  store double %428, ptr %438, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  store i32 1, ptr %30, align 4, !tbaa !5
  %439 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %30)
  store i64 %439, ptr %29, align 4
  %440 = load i32, ptr %13, align 4, !tbaa !5
  %441 = sext i32 %440 to i64
  %442 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %441
  %443 = load i32, ptr %14, align 4, !tbaa !5
  %444 = sext i32 %443 to i64
  %445 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %442, i64 0, i64 %444
  %446 = load i32, ptr %15, align 4, !tbaa !5
  %447 = sext i32 %446 to i64
  %448 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %445, i64 0, i64 %447
  %449 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %448, i64 0, i64 2
  %450 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %449, ptr noundef nonnull align 4 dereferenceable(8) %29) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  br label %475

451:                                              ; preds = %389
  %452 = load double, ptr %28, align 8, !tbaa !9
  %453 = load i32, ptr %13, align 4, !tbaa !5
  %454 = sext i32 %453 to i64
  %455 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %454
  %456 = load i32, ptr %14, align 4, !tbaa !5
  %457 = sext i32 %456 to i64
  %458 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %455, i64 0, i64 %457
  %459 = load i32, ptr %15, align 4, !tbaa !5
  %460 = sext i32 %459 to i64
  %461 = getelementptr inbounds [51 x [3 x double]], ptr %458, i64 0, i64 %460
  %462 = getelementptr inbounds [3 x double], ptr %461, i64 0, i64 2
  store double %452, ptr %462, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  store i32 2, ptr %32, align 4, !tbaa !5
  %463 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %32)
  store i64 %463, ptr %31, align 4
  %464 = load i32, ptr %13, align 4, !tbaa !5
  %465 = sext i32 %464 to i64
  %466 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %465
  %467 = load i32, ptr %14, align 4, !tbaa !5
  %468 = sext i32 %467 to i64
  %469 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %466, i64 0, i64 %468
  %470 = load i32, ptr %15, align 4, !tbaa !5
  %471 = sext i32 %470 to i64
  %472 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %469, i64 0, i64 %471
  %473 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %472, i64 0, i64 2
  %474 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %473, ptr noundef nonnull align 4 dereferenceable(8) %31) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  br label %475

475:                                              ; preds = %451, %427
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  br label %476

476:                                              ; preds = %475, %381
  br label %477

477:                                              ; preds = %476
  %478 = load i32, ptr %15, align 4, !tbaa !5
  %479 = add nsw i32 %478, 1
  store i32 %479, ptr %15, align 4, !tbaa !5
  br label %190, !llvm.loop !17

480:                                              ; preds = %194
  br label %481

481:                                              ; preds = %480
  %482 = load i32, ptr %14, align 4, !tbaa !5
  %483 = add nsw i32 %482, 1
  store i32 %483, ptr %14, align 4, !tbaa !5
  br label %184, !llvm.loop !18

484:                                              ; preds = %188
  br label %485

485:                                              ; preds = %484
  %486 = load i32, ptr %13, align 4, !tbaa !5
  %487 = add nsw i32 %486, 1
  store i32 %487, ptr %13, align 4, !tbaa !5
  br label %178, !llvm.loop !19

488:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #9
  store double 0.000000e+00, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  store i32 -1, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  store i32 -1, ptr %36, align 4, !tbaa !5
  %489 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef nonnull align 4 dereferenceable(4) %36)
  store i64 %489, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #9
  store i32 0, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #9
  store i32 0, ptr %38, align 4, !tbaa !5
  br label %490

490:                                              ; preds = %548, %488
  %491 = load i32, ptr %38, align 4, !tbaa !5
  %492 = load i32, ptr %4, align 4, !tbaa !5
  %493 = icmp sle i32 %491, %492
  br i1 %493, label %495, label %494

494:                                              ; preds = %490
  store i32 28, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #9
  br label %551

495:                                              ; preds = %490
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #9
  store i32 1, ptr %39, align 4, !tbaa !5
  br label %496

496:                                              ; preds = %544, %495
  %497 = load i32, ptr %39, align 4, !tbaa !5
  %498 = load i32, ptr %3, align 4, !tbaa !5
  %499 = icmp sle i32 %497, %498
  br i1 %499, label %501, label %500

500:                                              ; preds = %496
  store i32 31, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %547

501:                                              ; preds = %496
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  store i32 0, ptr %40, align 4, !tbaa !5
  br label %502

502:                                              ; preds = %540, %501
  %503 = load i32, ptr %40, align 4, !tbaa !5
  %504 = icmp slt i32 %503, 3
  br i1 %504, label %506, label %505

505:                                              ; preds = %502
  store i32 34, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  br label %543

506:                                              ; preds = %502
  %507 = load i32, ptr %2, align 4, !tbaa !5
  %508 = sext i32 %507 to i64
  %509 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %508
  %510 = load i32, ptr %38, align 4, !tbaa !5
  %511 = sext i32 %510 to i64
  %512 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %509, i64 0, i64 %511
  %513 = load i32, ptr %39, align 4, !tbaa !5
  %514 = sext i32 %513 to i64
  %515 = getelementptr inbounds [51 x [3 x double]], ptr %512, i64 0, i64 %514
  %516 = load i32, ptr %40, align 4, !tbaa !5
  %517 = sext i32 %516 to i64
  %518 = getelementptr inbounds [3 x double], ptr %515, i64 0, i64 %517
  %519 = load double, ptr %518, align 8, !tbaa !9
  %520 = load double, ptr %33, align 8, !tbaa !9
  %521 = fcmp ogt double %519, %520
  br i1 %521, label %522, label %539

522:                                              ; preds = %506
  %523 = load i32, ptr %2, align 4, !tbaa !5
  %524 = sext i32 %523 to i64
  %525 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %524
  %526 = load i32, ptr %38, align 4, !tbaa !5
  %527 = sext i32 %526 to i64
  %528 = getelementptr inbounds [101 x [51 x [3 x double]]], ptr %525, i64 0, i64 %527
  %529 = load i32, ptr %39, align 4, !tbaa !5
  %530 = sext i32 %529 to i64
  %531 = getelementptr inbounds [51 x [3 x double]], ptr %528, i64 0, i64 %530
  %532 = load i32, ptr %40, align 4, !tbaa !5
  %533 = sext i32 %532 to i64
  %534 = getelementptr inbounds [3 x double], ptr %531, i64 0, i64 %533
  %535 = load double, ptr %534, align 8, !tbaa !9
  store double %535, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #9
  %536 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %40)
  store i64 %536, ptr %41, align 4
  %537 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %41) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #9
  %538 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %538, ptr %37, align 4, !tbaa !5
  br label %539

539:                                              ; preds = %522, %506
  br label %540

540:                                              ; preds = %539
  %541 = load i32, ptr %40, align 4, !tbaa !5
  %542 = add nsw i32 %541, 1
  store i32 %542, ptr %40, align 4, !tbaa !5
  br label %502, !llvm.loop !20

543:                                              ; preds = %505
  br label %544

544:                                              ; preds = %543
  %545 = load i32, ptr %39, align 4, !tbaa !5
  %546 = add nsw i32 %545, 1
  store i32 %546, ptr %39, align 4, !tbaa !5
  br label %496, !llvm.loop !21

547:                                              ; preds = %500
  br label %548

548:                                              ; preds = %547
  %549 = load i32, ptr %38, align 4, !tbaa !5
  %550 = add nsw i32 %549, 1
  store i32 %550, ptr %38, align 4, !tbaa !5
  br label %490, !llvm.loop !22

551:                                              ; preds = %494
  %552 = load double, ptr %33, align 8, !tbaa !9
  %553 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %552)
  %554 = load double, ptr %33, align 8, !tbaa !9
  %555 = fcmp oeq double %554, 0.000000e+00
  br i1 %555, label %556, label %558

556:                                              ; preds = %551
  %557 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %5, align 4
  br label %644, !llvm.loop !23

558:                                              ; preds = %551
  call void @llvm.lifetime.start.p0(i64 24, ptr %42) #9
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %42) #9
  br label %559

559:                                              ; preds = %592, %558
  %560 = load i32, ptr %2, align 4, !tbaa !5
  %561 = icmp sgt i32 %560, 0
  br i1 %561, label %562, label %605

562:                                              ; preds = %559
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #9
  %563 = getelementptr inbounds %"struct.std::pair", ptr %34, i32 0, i32 0
  %564 = load i32, ptr %563, align 4, !tbaa !24
  store i32 %564, ptr %43, align 4, !tbaa !5
  %565 = load i32, ptr %43, align 4, !tbaa !5
  %566 = icmp sle i32 1, %565
  br i1 %566, label %567, label %571

567:                                              ; preds = %562
  %568 = load i32, ptr %43, align 4, !tbaa !5
  %569 = load i32, ptr %3, align 4, !tbaa !5
  %570 = icmp sle i32 %568, %569
  br label %571

571:                                              ; preds = %567, %562
  %572 = phi i1 [ false, %562 ], [ %570, %567 ]
  br i1 %572, label %573, label %574

573:                                              ; preds = %571
  br label %576

574:                                              ; preds = %571
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 149, ptr noundef @__PRETTY_FUNCTION__.main) #10
  unreachable

575:                                              ; No predecessors!
  br label %576

576:                                              ; preds = %575, %573
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 4 dereferenceable(4) %43)
          to label %577 unwind label %601

577:                                              ; preds = %576
  %578 = load i32, ptr %2, align 4, !tbaa !5
  %579 = sext i32 %578 to i64
  %580 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %579
  %581 = load i32, ptr %37, align 4, !tbaa !5
  %582 = sext i32 %581 to i64
  %583 = getelementptr inbounds [101 x [51 x [3 x %"struct.std::pair"]]], ptr %580, i64 0, i64 %582
  %584 = load i32, ptr %43, align 4, !tbaa !5
  %585 = sext i32 %584 to i64
  %586 = getelementptr inbounds [51 x [3 x %"struct.std::pair"]], ptr %583, i64 0, i64 %585
  %587 = getelementptr inbounds %"struct.std::pair", ptr %34, i32 0, i32 1
  %588 = load i32, ptr %587, align 4, !tbaa !26
  %589 = sext i32 %588 to i64
  %590 = getelementptr inbounds [3 x %"struct.std::pair"], ptr %586, i64 0, i64 %589
  %591 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %590)
          to label %592 unwind label %601

592:                                              ; preds = %577
  %593 = load i32, ptr %43, align 4, !tbaa !5
  %594 = sext i32 %593 to i64
  %595 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %594
  %596 = load i32, ptr %595, align 4, !tbaa !5
  %597 = load i32, ptr %37, align 4, !tbaa !5
  %598 = sub nsw i32 %597, %596
  store i32 %598, ptr %37, align 4, !tbaa !5
  %599 = load i32, ptr %2, align 4, !tbaa !5
  %600 = add nsw i32 %599, -1
  store i32 %600, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  br label %559, !llvm.loop !27

601:                                              ; preds = %577, %576
  %602 = landingpad { ptr, i32 }
          cleanup
  %603 = extractvalue { ptr, i32 } %602, 0
  store ptr %603, ptr %44, align 8
  %604 = extractvalue { ptr, i32 } %602, 1
  store i32 %604, ptr %45, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  br label %648

605:                                              ; preds = %559
  %606 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #9
  %607 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %46, i32 0, i32 0
  store ptr %606, ptr %607, align 8
  %608 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #9
  %609 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %47, i32 0, i32 0
  store ptr %608, ptr %609, align 8
  %610 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %46, i32 0, i32 0
  %611 = load ptr, ptr %610, align 8
  %612 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %47, i32 0, i32 0
  %613 = load ptr, ptr %612, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %611, ptr %613)
          to label %614 unwind label %622

614:                                              ; preds = %605
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #9
  %615 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #9
  %616 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %48, i32 0, i32 0
  store ptr %615, ptr %616, align 8
  br label %617

617:                                              ; preds = %633, %614
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #9
  %618 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #9
  %619 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %49, i32 0, i32 0
  store ptr %618, ptr %619, align 8
  %620 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(8) %49) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #9
  br i1 %620, label %626, label %621

621:                                              ; preds = %617
  store i32 39, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #9
  br label %639

622:                                              ; preds = %641, %639, %605
  %623 = landingpad { ptr, i32 }
          cleanup
  %624 = extractvalue { ptr, i32 } %623, 0
  store ptr %624, ptr %44, align 8
  %625 = extractvalue { ptr, i32 } %623, 1
  store i32 %625, ptr %45, align 4
  br label %648

626:                                              ; preds = %617
  %627 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %48) #9
  %628 = load i32, ptr %627, align 4, !tbaa !5
  %629 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %628)
          to label %630 unwind label %635

630:                                              ; preds = %626
  %631 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %629, i8 noundef signext 32)
          to label %632 unwind label %635

632:                                              ; preds = %630
  br label %633

633:                                              ; preds = %632
  %634 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %48) #9
  br label %617, !llvm.loop !28

635:                                              ; preds = %630, %626
  %636 = landingpad { ptr, i32 }
          cleanup
  %637 = extractvalue { ptr, i32 } %636, 0
  store ptr %637, ptr %44, align 8
  %638 = extractvalue { ptr, i32 } %636, 1
  store i32 %638, ptr %45, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #9
  br label %648

639:                                              ; preds = %621
  %640 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %641 unwind label %622

641:                                              ; preds = %639
  %642 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %640, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %643 unwind label %622

643:                                              ; preds = %641
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %42) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #9
  store i32 0, ptr %5, align 4
  br label %644

644:                                              ; preds = %643, %556
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  br label %645

645:                                              ; preds = %644, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %646 = load i32, ptr %5, align 4
  switch i32 %646, label %655 [
    i32 0, label %647
    i32 3, label %649
    i32 2, label %50
  ]

647:                                              ; preds = %645
  br label %50, !llvm.loop !23

648:                                              ; preds = %635, %622, %601
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %42) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %650

649:                                              ; preds = %645
  ret i32 0

650:                                              ; preds = %648
  %651 = load ptr, ptr %44, align 8
  %652 = load i32, ptr %45, align 4
  %653 = insertvalue { ptr, i32 } poison, ptr %651, 0
  %654 = insertvalue { ptr, i32 } %653, i32 %652, 1
  resume { ptr, i32 } %654

655:                                              ; preds = %645
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare i32 @printf(ptr noundef, ...) #2

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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


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

%"struct.std::pair" = type { i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::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 }

@INF = external dso_local local_unnamed_addr global double, align 8
@dp = external dso_local local_unnamed_addr global [22 x [101 x [51 x [3 x double]]]], align 16
@back = external dso_local global [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], align 16
@cost = external dso_local global [51 x i32], align 16
@ben = external dso_local global [51 x double], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca i32, align 4
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca %"class.std::vector", align 8
  %29 = alloca i32, align 4
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %32 = getelementptr inbounds i8, ptr %22, i64 4
  br label %33

33:                                               ; preds = %292, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #10
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 0
  %39 = load i32, ptr %2, align 4
  %40 = icmp eq i32 %39, 0
  %or.cond = select i1 %38, i1 %40, i1 false
  %41 = load i32, ptr %3, align 4
  %42 = icmp eq i32 %41, 0
  %or.cond3 = select i1 %or.cond, i1 %42, i1 false
  br i1 %or.cond3, label %294, label %.preheader137

.preheader137:                                    ; preds = %33
  %.not143 = icmp slt i32 %37, 0
  %43 = icmp slt i32 %41, 0
  %or.cond260 = select i1 %.not143, i1 true, i1 %43
  br i1 %or.cond260, label %._crit_edge145, label %.preheader135

.preheader135:                                    ; preds = %.preheader137, %._crit_edge142
  %44 = phi i32 [ %54, %._crit_edge142 ], [ %37, %.preheader137 ]
  %45 = phi i32 [ %55, %._crit_edge142 ], [ %41, %.preheader137 ]
  %46 = phi i32 [ %56, %._crit_edge142 ], [ %39, %.preheader137 ]
  %47 = phi i32 [ %57, %._crit_edge142 ], [ %39, %.preheader137 ]
  %48 = phi i32 [ %58, %._crit_edge142 ], [ %41, %.preheader137 ]
  %indvars.iv203 = phi i64 [ %indvars.iv.next204, %._crit_edge142 ], [ 0, %.preheader137 ]
  %.not129140 = icmp slt i32 %48, 0
  %49 = icmp slt i32 %47, 0
  %or.cond261 = select i1 %.not129140, i1 true, i1 %49
  br i1 %or.cond261, label %._crit_edge142, label %.preheader

._crit_edge145:                                   ; preds = %._crit_edge142, %.preheader137
  %50 = phi i32 [ %37, %.preheader137 ], [ %54, %._crit_edge142 ]
  %51 = phi i32 [ %39, %.preheader137 ], [ %56, %._crit_edge142 ]
  store double 0.000000e+00, ptr @dp, align 16, !tbaa !9
  %.not115146 = icmp slt i32 %51, 1
  br i1 %.not115146, label %.preheader136, label %.lr.ph149

.preheader:                                       ; preds = %.preheader135, %._crit_edge
  %52 = phi i32 [ %60, %._crit_edge ], [ %45, %.preheader135 ]
  %53 = phi i32 [ %61, %._crit_edge ], [ %46, %.preheader135 ]
  %indvars.iv200 = phi i64 [ %indvars.iv.next201, %._crit_edge ], [ 0, %.preheader135 ]
  %.not130138 = icmp slt i32 %53, 0
  br i1 %.not130138, label %._crit_edge, label %.lr.ph

._crit_edge142.loopexit196:                       ; preds = %._crit_edge
  %.pre218 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge142

._crit_edge142:                                   ; preds = %._crit_edge142.loopexit196, %.preheader135
  %54 = phi i32 [ %.pre218, %._crit_edge142.loopexit196 ], [ %44, %.preheader135 ]
  %55 = phi i32 [ %60, %._crit_edge142.loopexit196 ], [ %45, %.preheader135 ]
  %56 = phi i32 [ %61, %._crit_edge142.loopexit196 ], [ %46, %.preheader135 ]
  %57 = phi i32 [ %61, %._crit_edge142.loopexit196 ], [ %47, %.preheader135 ]
  %58 = phi i32 [ %60, %._crit_edge142.loopexit196 ], [ %48, %.preheader135 ]
  %indvars.iv.next204 = add nuw nsw i64 %indvars.iv203, 1
  %59 = sext i32 %54 to i64
  %.not.not = icmp slt i64 %indvars.iv203, %59
  br i1 %.not.not, label %.preheader135, label %._crit_edge145, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %60 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %52, %.preheader ]
  %61 = phi i32 [ %75, %._crit_edge.loopexit ], [ %53, %.preheader ]
  %indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
  %62 = sext i32 %60 to i64
  %.not129.not = icmp slt i64 %indvars.iv200, %62
  br i1 %.not129.not, label %.preheader, label %._crit_edge142.loopexit196, !llvm.loop !14

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %63 = load double, ptr @INF, align 8, !tbaa !9
  %64 = fneg double %63
  %65 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %indvars.iv203, i64 %indvars.iv200, i64 %indvars.iv
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  store double %64, ptr %66, align 8, !tbaa !9
  %67 = getelementptr inbounds i8, ptr %65, i64 8
  store double %64, ptr %67, align 8, !tbaa !9
  store double %64, ptr %65, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #10
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #10
  store i32 -1, ptr %6, align 4, !tbaa !5
  %68 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %68, ptr %4, align 8
  %69 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %indvars.iv203, i64 %indvars.iv200, i64 %indvars.iv
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %70, ptr noundef nonnull align 4 dereferenceable(8) %4) #10
  %72 = getelementptr inbounds i8, ptr %69, i64 8
  %73 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %72, ptr noundef nonnull align 4 dereferenceable(8) %71)
  %74 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %69, ptr noundef nonnull align 4 dereferenceable(8) %73)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %.not130.not = icmp slt i64 %indvars.iv, %76
  br i1 %.not130.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !15

.preheader136.loopexit:                           ; preds = %.lr.ph149
  %.pre219 = load i32, ptr %1, align 4, !tbaa !5
  br label %.preheader136

.preheader136:                                    ; preds = %.preheader136.loopexit, %._crit_edge145
  %77 = phi i32 [ %85, %.preheader136.loopexit ], [ %51, %._crit_edge145 ]
  %78 = phi i32 [ %.pre219, %.preheader136.loopexit ], [ %50, %._crit_edge145 ]
  %.not116165 = icmp slt i32 %78, 1
  %79 = load i32, ptr %3, align 4
  %80 = icmp slt i32 %79, 1
  %or.cond263 = select i1 %.not116165, i1 true, i1 %80
  br i1 %or.cond263, label %._crit_edge167, label %.preheader134

.lr.ph149:                                        ; preds = %._crit_edge145, %.lr.ph149
  %indvars.iv206 = phi i64 [ %indvars.iv.next207, %.lr.ph149 ], [ 1, %._crit_edge145 ]
  %81 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %indvars.iv206
  %82 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %81)
  %83 = getelementptr inbounds [51 x double], ptr @ben, i64 0, i64 %indvars.iv206
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %82, ptr noundef nonnull align 8 dereferenceable(8) %83)
  %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %.not115.not = icmp slt i64 %indvars.iv206, %86
  br i1 %.not115.not, label %.lr.ph149, label %.preheader136.loopexit, !llvm.loop !16

.preheader134:                                    ; preds = %.preheader136, %._crit_edge164
  %87 = phi i32 [ %98, %._crit_edge164 ], [ %78, %.preheader136 ]
  %88 = phi i32 [ %99, %._crit_edge164 ], [ %79, %.preheader136 ]
  %89 = phi i32 [ %100, %._crit_edge164 ], [ %79, %.preheader136 ]
  %90 = phi i32 [ %101, %._crit_edge164 ], [ %77, %.preheader136 ]
  %91 = phi i32 [ %102, %._crit_edge164 ], [ %77, %.preheader136 ]
  %92 = phi i32 [ %103, %._crit_edge164 ], [ %79, %.preheader136 ]
  %indvars.iv212 = phi i64 [ %indvars.iv.next213, %._crit_edge164 ], [ 1, %.preheader136 ]
  %.not121161 = icmp slt i32 %92, 1
  br i1 %.not121161, label %._crit_edge164, label %.lr.ph163

.lr.ph163:                                        ; preds = %.preheader134
  %93 = add nsw i64 %indvars.iv212, -1
  %94 = icmp slt i32 %91, 1
  br i1 %94, label %._crit_edge164, label %.lr.ph163.split

._crit_edge167:                                   ; preds = %._crit_edge164, %.preheader136
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #10
  store i32 -1, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %24) #10
  store i32 -1, ptr %24, align 4, !tbaa !5
  %95 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  store i64 %95, ptr %22, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #10
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %.not117179 = icmp slt i32 %96, 0
  br i1 %.not117179, label %._crit_edge185.thread, label %.lr.ph184.preheader

._crit_edge185.thread:                            ; preds = %._crit_edge167
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef 0.000000e+00)
  br label %238

.lr.ph184.preheader:                              ; preds = %._crit_edge167
  %.pre235 = load i32, ptr %2, align 4, !tbaa !5
  br label %.lr.ph184

._crit_edge164.loopexit195:                       ; preds = %._crit_edge160
  %.pre234 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge164

._crit_edge164:                                   ; preds = %.lr.ph163, %._crit_edge164.loopexit195, %.preheader134
  %98 = phi i32 [ %.pre234, %._crit_edge164.loopexit195 ], [ %87, %.preheader134 ], [ %87, %.lr.ph163 ]
  %99 = phi i32 [ %111, %._crit_edge164.loopexit195 ], [ %88, %.preheader134 ], [ %88, %.lr.ph163 ]
  %100 = phi i32 [ %112, %._crit_edge164.loopexit195 ], [ %89, %.preheader134 ], [ %88, %.lr.ph163 ]
  %101 = phi i32 [ %113, %._crit_edge164.loopexit195 ], [ %90, %.preheader134 ], [ %90, %.lr.ph163 ]
  %102 = phi i32 [ %113, %._crit_edge164.loopexit195 ], [ %91, %.preheader134 ], [ %91, %.lr.ph163 ]
  %103 = phi i32 [ %112, %._crit_edge164.loopexit195 ], [ %92, %.preheader134 ], [ %88, %.lr.ph163 ]
  %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1
  %104 = sext i32 %98 to i64
  %.not116.not = icmp slt i64 %indvars.iv212, %104
  br i1 %.not116.not, label %.preheader134, label %._crit_edge167, !llvm.loop !17

.lr.ph163.split:                                  ; preds = %.lr.ph163, %._crit_edge160
  %105 = phi i32 [ %111, %._crit_edge160 ], [ %88, %.lr.ph163 ]
  %106 = phi i32 [ %112, %._crit_edge160 ], [ %89, %.lr.ph163 ]
  %107 = phi i32 [ %113, %._crit_edge160 ], [ %90, %.lr.ph163 ]
  %indvars.iv209 = phi i64 [ %indvars.iv.next210, %._crit_edge160 ], [ 1, %.lr.ph163 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #10
  store i32 1, ptr %7, align 4, !tbaa !5
  %.not123156 = icmp slt i32 %107, 1
  br i1 %.not123156, label %._crit_edge160, label %.lr.ph159

.lr.ph159:                                        ; preds = %.lr.ph163.split
  %108 = trunc nuw nsw i64 %indvars.iv209 to i32
  %109 = trunc nuw nsw i64 %indvars.iv209 to i32
  %110 = trunc nuw nsw i64 %indvars.iv209 to i32
  br label %115

._crit_edge160.loopexit:                          ; preds = %205
  %.pre233 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge160

._crit_edge160:                                   ; preds = %._crit_edge160.loopexit, %.lr.ph163.split
  %111 = phi i32 [ %.pre233, %._crit_edge160.loopexit ], [ %105, %.lr.ph163.split ]
  %112 = phi i32 [ %.pre233, %._crit_edge160.loopexit ], [ %106, %.lr.ph163.split ]
  %113 = phi i32 [ %208, %._crit_edge160.loopexit ], [ %107, %.lr.ph163.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #10
  %indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1
  %114 = sext i32 %112 to i64
  %.not121.not = icmp slt i64 %indvars.iv209, %114
  br i1 %.not121.not, label %.lr.ph163.split, label %._crit_edge164.loopexit195, !llvm.loop !18

115:                                              ; preds = %.lr.ph159, %205
  %storemerge122157 = phi i32 [ 1, %.lr.ph159 ], [ %207, %205 ]
  %116 = sext i32 %storemerge122157 to i64
  %117 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %.not124 = icmp slt i64 %indvars.iv209, %119
  br i1 %.not124, label %160, label %120

120:                                              ; preds = %115
  %121 = load double, ptr @INF, align 8, !tbaa !9
  %122 = fneg double %121
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #10
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #10
  store i32 -1, ptr %10, align 4, !tbaa !5
  %123 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %123, ptr %8, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #10
  store i32 0, ptr %11, align 4, !tbaa !5
  %124 = load i32, ptr %2, align 4, !tbaa !5
  %.not126150 = icmp slt i32 %124, 0
  br i1 %.not126150, label %._crit_edge155, label %.lr.ph154

._crit_edge155:                                   ; preds = %156, %120
  %.0100.lcssa = phi double [ %122, %120 ], [ %.2102, %156 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #10
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [51 x double], ptr @ben, i64 0, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !9
  %129 = fadd double %.0100.lcssa, %128
  %130 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %indvars.iv212, i64 %indvars.iv209, i64 %126
  store double %129, ptr %130, align 8, !tbaa !9
  %131 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %indvars.iv212, i64 %indvars.iv209, i64 %126
  %132 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %131, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  %.pre225 = load i32, ptr %7, align 4, !tbaa !5
  %.phi.trans.insert226 = sext i32 %.pre225 to i64
  %.phi.trans.insert227 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %.phi.trans.insert226
  %.pre228 = load i32, ptr %.phi.trans.insert227, align 4, !tbaa !5
  br label %160

.lr.ph154:                                        ; preds = %120, %156
  %.0100152 = phi double [ %.2102, %156 ], [ %122, %120 ]
  %storemerge125151 = phi i32 [ %158, %156 ], [ 0, %120 ]
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = icmp eq i32 %133, %storemerge125151
  br i1 %134, label %156, label %135

135:                                              ; preds = %.lr.ph154
  %136 = sext i32 %133 to i64
  %137 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sub nsw i32 %108, %138
  %140 = sext i32 %139 to i64
  %141 = sext i32 %storemerge125151 to i64
  %142 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %93, i64 %140, i64 %141
  %143 = load double, ptr %142, align 8, !tbaa !9
  %144 = fcmp ogt double %143, %.0100152
  br i1 %144, label %145, label %148

145:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #10
  store i32 0, ptr %13, align 4, !tbaa !5
  %146 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %146, ptr %12, align 8
  %147 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  %.pre220 = load i32, ptr %7, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre220 to i64
  %.phi.trans.insert221 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %.phi.trans.insert
  %.pre222 = load i32, ptr %.phi.trans.insert221, align 4, !tbaa !5
  %.pre223 = load i32, ptr %11, align 4, !tbaa !5
  %.pre238 = sext i32 %.pre223 to i64
  %.pre241 = sub nsw i32 %108, %.pre222
  %.pre243 = sext i32 %.pre241 to i64
  br label %148

148:                                              ; preds = %145, %135
  %.pre-phi244 = phi i64 [ %.pre243, %145 ], [ %140, %135 ]
  %.pre-phi = phi i64 [ %.pre238, %145 ], [ %141, %135 ]
  %149 = phi i32 [ %.pre223, %145 ], [ %storemerge125151, %135 ]
  %.1101 = phi double [ %143, %145 ], [ %.0100152, %135 ]
  %150 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %93, i64 %.pre-phi244, i64 %.pre-phi, i64 1
  %151 = load double, ptr %150, align 8, !tbaa !9
  %152 = fcmp ogt double %151, %.1101
  br i1 %152, label %153, label %156

153:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #10
  store i32 1, ptr %15, align 4, !tbaa !5
  %154 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i64 %154, ptr %14, align 8
  %155 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #10
  %.pre224 = load i32, ptr %11, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %148, %153, %.lr.ph154
  %157 = phi i32 [ %storemerge125151, %.lr.ph154 ], [ %.pre224, %153 ], [ %149, %148 ]
  %.2102 = phi double [ %.0100152, %.lr.ph154 ], [ %151, %153 ], [ %.1101, %148 ]
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %11, align 4, !tbaa !5
  %159 = load i32, ptr %2, align 4, !tbaa !5
  %.not126.not = icmp slt i32 %157, %159
  br i1 %.not126.not, label %.lr.ph154, label %._crit_edge155, !llvm.loop !19

160:                                              ; preds = %._crit_edge155, %115
  %.pre-phi239 = phi i64 [ %.phi.trans.insert226, %._crit_edge155 ], [ %116, %115 ]
  %161 = phi i32 [ %.pre228, %._crit_edge155 ], [ %118, %115 ]
  %162 = phi i32 [ %.pre225, %._crit_edge155 ], [ %storemerge122157, %115 ]
  %163 = shl nsw i32 %161, 1
  %164 = sext i32 %163 to i64
  %.not127 = icmp slt i64 %indvars.iv209, %164
  br i1 %.not127, label %._crit_edge245, label %165

._crit_edge245:                                   ; preds = %160
  %.pre246 = sext i32 %162 to i64
  br label %179

165:                                              ; preds = %160
  %166 = sub nsw i32 %109, %161
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %93, i64 %167, i64 %.pre-phi239
  %169 = load double, ptr %168, align 8, !tbaa !9
  %170 = getelementptr inbounds [51 x double], ptr @ben, i64 0, i64 %.pre-phi239
  %171 = load double, ptr %170, align 8, !tbaa !9
  %172 = call double @llvm.fmuladd.f64(double %171, double 5.000000e-01, double %169)
  %173 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %indvars.iv212, i64 %indvars.iv209, i64 %.pre-phi239, i64 1
  store double %172, ptr %173, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #10
  store i32 0, ptr %17, align 4, !tbaa !5
  %174 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %174, ptr %16, align 8
  %175 = load i32, ptr %7, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %indvars.iv212, i64 %indvars.iv209, i64 %176, i64 1
  %178 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %177, ptr noundef nonnull align 4 dereferenceable(8) %16) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #10
  %.pre229 = load i32, ptr %7, align 4, !tbaa !5
  %.phi.trans.insert230 = sext i32 %.pre229 to i64
  %.phi.trans.insert231 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %.phi.trans.insert230
  %.pre232 = load i32, ptr %.phi.trans.insert231, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %._crit_edge245, %165
  %.pre-phi247 = phi i64 [ %.pre246, %._crit_edge245 ], [ %.phi.trans.insert230, %165 ]
  %180 = phi i32 [ %161, %._crit_edge245 ], [ %.pre232, %165 ]
  %181 = mul nsw i32 %180, 3
  %182 = sext i32 %181 to i64
  %.not128 = icmp slt i64 %indvars.iv209, %182
  br i1 %.not128, label %205, label %183

183:                                              ; preds = %179
  %184 = sub nsw i32 %110, %180
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %93, i64 %185, i64 %.pre-phi247
  %187 = getelementptr inbounds i8, ptr %186, i64 8
  %188 = load double, ptr %187, align 8, !tbaa !9
  %189 = getelementptr inbounds i8, ptr %186, i64 16
  %190 = load double, ptr %189, align 8, !tbaa !9
  %191 = fcmp ogt double %188, %190
  %192 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %indvars.iv212, i64 %indvars.iv209, i64 %.pre-phi247, i64 2
  br i1 %191, label %193, label %199

193:                                              ; preds = %183
  store double %188, ptr %192, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #10
  store i32 1, ptr %19, align 4, !tbaa !5
  %194 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %19)
  store i64 %194, ptr %18, align 8
  %195 = load i32, ptr %7, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %indvars.iv212, i64 %indvars.iv209, i64 %196, i64 2
  %198 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %197, ptr noundef nonnull align 4 dereferenceable(8) %18) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #10
  br label %205

199:                                              ; preds = %183
  store double %190, ptr %192, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #10
  store i32 2, ptr %21, align 4, !tbaa !5
  %200 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %21)
  store i64 %200, ptr %20, align 8
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %indvars.iv212, i64 %indvars.iv209, i64 %202, i64 2
  %204 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %203, ptr noundef nonnull align 4 dereferenceable(8) %20) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #10
  br label %205

205:                                              ; preds = %193, %199, %179
  %206 = load i32, ptr %7, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %7, align 4, !tbaa !5
  %208 = load i32, ptr %2, align 4, !tbaa !5
  %.not123.not = icmp slt i32 %206, %208
  br i1 %.not123.not, label %115, label %._crit_edge160.loopexit, !llvm.loop !20

._crit_edge185:                                   ; preds = %._crit_edge176
  %209 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %.195.lcssa)
  %210 = fcmp oeq double %.195.lcssa, 0.000000e+00
  br i1 %210, label %238, label %240

.lr.ph184:                                        ; preds = %.lr.ph184.preheader, %._crit_edge176
  %211 = phi i32 [ %96, %.lr.ph184.preheader ], [ %214, %._crit_edge176 ]
  %212 = phi i32 [ %.pre235, %.lr.ph184.preheader ], [ %215, %._crit_edge176 ]
  %indvars.iv215 = phi i64 [ 0, %.lr.ph184.preheader ], [ %indvars.iv.next216, %._crit_edge176 ]
  %.092181 = phi i32 [ 0, %.lr.ph184.preheader ], [ %.193.lcssa, %._crit_edge176 ]
  %.094180 = phi double [ 0.000000e+00, %.lr.ph184.preheader ], [ %.195.lcssa, %._crit_edge176 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #10
  store i32 1, ptr %25, align 4, !tbaa !5
  %.not119171 = icmp slt i32 %212, 1
  br i1 %.not119171, label %._crit_edge176, label %.lr.ph175

.lr.ph175:                                        ; preds = %.lr.ph184
  %213 = trunc nuw nsw i64 %indvars.iv215 to i32
  br label %217

._crit_edge176.loopexit:                          ; preds = %218
  %.pre237 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge176

._crit_edge176:                                   ; preds = %._crit_edge176.loopexit, %.lr.ph184
  %214 = phi i32 [ %211, %.lr.ph184 ], [ %.pre237, %._crit_edge176.loopexit ]
  %215 = phi i32 [ %212, %.lr.ph184 ], [ %221, %._crit_edge176.loopexit ]
  %.195.lcssa = phi double [ %.094180, %.lr.ph184 ], [ %.397, %._crit_edge176.loopexit ]
  %.193.lcssa = phi i32 [ %.092181, %.lr.ph184 ], [ %.3, %._crit_edge176.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #10
  %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1
  %216 = sext i32 %214 to i64
  %.not117.not = icmp slt i64 %indvars.iv215, %216
  br i1 %.not117.not, label %.lr.ph184, label %._crit_edge185, !llvm.loop !21

217:                                              ; preds = %.lr.ph175, %218
  %.193173 = phi i32 [ %.092181, %.lr.ph175 ], [ %.3, %218 ]
  %.195172 = phi double [ %.094180, %.lr.ph175 ], [ %.397, %218 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #10
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %222

218:                                              ; preds = %234
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #10
  %219 = load i32, ptr %25, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %25, align 4, !tbaa !5
  %221 = load i32, ptr %2, align 4, !tbaa !5
  %.not119.not = icmp slt i32 %219, %221
  br i1 %.not119.not, label %217, label %._crit_edge176.loopexit, !llvm.loop !22

222:                                              ; preds = %217, %234
  %.2170 = phi i32 [ %.193173, %217 ], [ %.3, %234 ]
  %.296169 = phi double [ %.195172, %217 ], [ %.397, %234 ]
  %storemerge120168 = phi i32 [ 0, %217 ], [ %236, %234 ]
  %223 = load i32, ptr %1, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = load i32, ptr %25, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = sext i32 %storemerge120168 to i64
  %228 = getelementptr inbounds [22 x [101 x [51 x [3 x double]]]], ptr @dp, i64 0, i64 %224, i64 %indvars.iv215, i64 %226, i64 %227
  %229 = load double, ptr %228, align 8, !tbaa !9
  %230 = fcmp ogt double %229, %.296169
  br i1 %230, label %231, label %234

231:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %27) #10
  %232 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  store i64 %232, ptr %27, align 8
  %233 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(8) %27) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #10
  %.pre236 = load i32, ptr %26, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %222, %231
  %235 = phi i32 [ %.pre236, %231 ], [ %storemerge120168, %222 ]
  %.397 = phi double [ %229, %231 ], [ %.296169, %222 ]
  %.3 = phi i32 [ %213, %231 ], [ %.2170, %222 ]
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %26, align 4, !tbaa !5
  %237 = icmp slt i32 %235, 2
  br i1 %237, label %222, label %218, !llvm.loop !23

238:                                              ; preds = %._crit_edge185.thread, %._crit_edge185
  %239 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %292, !llvm.loop !24

240:                                              ; preds = %._crit_edge185
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %28) #10
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  %.pr = load i32, ptr %1, align 4, !tbaa !5
  %241 = icmp sgt i32 %.pr, 0
  br i1 %241, label %.lr.ph190, label %._crit_edge191

.lr.ph190:                                        ; preds = %240, %249
  %.4188 = phi i32 [ %263, %249 ], [ %.193.lcssa, %240 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #10
  %242 = load i32, ptr %22, align 8, !tbaa !25
  store i32 %242, ptr %29, align 4, !tbaa !5
  %243 = icmp sgt i32 %242, 0
  %244 = load i32, ptr %2, align 4
  %245 = icmp sle i32 %242, %244
  %246 = select i1 %243, i1 %245, i1 false
  br i1 %246, label %248, label %247

247:                                              ; preds = %.lr.ph190
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 149, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #11
  unreachable

248:                                              ; preds = %.lr.ph190
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %249 unwind label %267

249:                                              ; preds = %248
  %250 = load i32, ptr %1, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = sext i32 %.4188 to i64
  %253 = load i32, ptr %29, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = load i32, ptr %32, align 4, !tbaa !27
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [22 x [101 x [51 x [3 x %"struct.std::pair"]]]], ptr @back, i64 0, i64 %251, i64 %252, i64 %254, i64 %256
  %258 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(8) %257)
  %259 = load i32, ptr %29, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [51 x i32], ptr @cost, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = sub nsw i32 %.4188, %262
  %264 = load i32, ptr %1, align 4, !tbaa !5
  %265 = add nsw i32 %264, -1
  store i32 %265, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #10
  %266 = icmp sgt i32 %264, 1
  br i1 %266, label %.lr.ph190, label %._crit_edge191, !llvm.loop !28

267:                                              ; preds = %248
  %268 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #10
  br label %293

._crit_edge191:                                   ; preds = %249, %240
  %269 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  %270 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %269, ptr %270)
          to label %271 unwind label %276

271:                                              ; preds = %._crit_edge191
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #10
  %272 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  store ptr %272, ptr %30, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #10
  %273 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  store ptr %273, ptr %31, align 8
  %274 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #10
  br i1 %274, label %.lr.ph193, label %._crit_edge194

._crit_edge194:                                   ; preds = %283, %271
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #10
  %275 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %289 unwind label %276

276:                                              ; preds = %289, %._crit_edge194, %._crit_edge191
  %277 = landingpad { ptr, i32 }
          cleanup
  br label %293

.lr.ph193:                                        ; preds = %271, %283
  %278 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #10
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %279)
          to label %281 unwind label %287

281:                                              ; preds = %.lr.ph193
  %282 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %280, i8 noundef signext 32)
          to label %283 unwind label %287

283:                                              ; preds = %281
  %284 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #10
  %285 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  store ptr %285, ptr %31, align 8
  %286 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #10
  br i1 %286, label %.lr.ph193, label %._crit_edge194, !llvm.loop !29

287:                                              ; preds = %281, %.lr.ph193
  %288 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #10
  br label %293

289:                                              ; preds = %._crit_edge194
  %290 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %275, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %291 unwind label %276

291:                                              ; preds = %289
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #10
  br label %292

292:                                              ; preds = %238, %291
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  br label %33

293:                                              ; preds = %287, %276, %267
  %.pn = phi { ptr, i32 } [ %268, %267 ], [ %288, %287 ], [ %277, %276 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  resume { ptr, i32 } %.pn

294:                                              ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #8

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #7

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

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

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

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

; Function Attrs: mustprogress 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 #4 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 #4 align 2

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

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

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

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


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