; LLVM IR from ShahjalalShohag/code-library :: Graph Theory/Dynamic MST Offline.ll (Z5solveiiSt6vectorIiSaIiEEx)

; 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.disj = type { [100009 x i32], [100009 x i32] }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@disj = external dso_local global %struct.disj, align 4
@st = external dso_local global [100009 x i32], align 16
@ed = external dso_local global [100009 x i32], align 16
@cost = external dso_local global [100009 x i32], align 16
@chk = external dso_local global [100009 x i32], align 16
@qr = external dso_local global [100009 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8contractiiSt6vectorIiSaIiEERS1_S2_(i32 noundef, i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4disj3uniEiiRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveiiSt6vectorIiSaIiEEx(i32 noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3) #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::vector", align 8
  %20 = alloca %"class.std::vector", align 8
  %21 = alloca i32, align 4
  %22 = alloca %"class.std::vector.0", align 8
  %23 = alloca %"class.std::vector", align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"class.std::vector", align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i64, align 8
  %33 = alloca %"class.std::vector", align 8
  %34 = alloca ptr, align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %37 = alloca ptr, align 8
  %38 = alloca %"class.std::vector", align 8
  %39 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  store i64 %3, ptr %8, align 8, !tbaa !11
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = icmp eq i32 %40, %41
  br i1 %42, label %43, label %107

43:                                               ; preds = %4
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %45
  %47 = getelementptr inbounds %"struct.std::pair", ptr %46, i32 0, i32 1
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %50
  %52 = getelementptr inbounds %"struct.std::pair", ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !15
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %54
  store i32 %48, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %57
  %59 = getelementptr inbounds %"struct.std::pair", ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 8, !tbaa !15
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %65
  %67 = getelementptr inbounds %"struct.std::pair", ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !15
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100009 x i32], ptr @ed, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp eq i32 %63, %71
  br i1 %72, label %73, label %76

73:                                               ; preds = %43
  %74 = load i64, ptr %8, align 8, !tbaa !11
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %74)
  br label %367

76:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %78
  %80 = getelementptr inbounds %"struct.std::pair", ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !13
  store i32 %81, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr %2, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %82 = load ptr, ptr %10, align 8, !tbaa !9
  %83 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #5
  %84 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %83, ptr %84, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %85 = load ptr, ptr %10, align 8, !tbaa !9
  %86 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %85) #5
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %86, ptr %87, align 8
  br label %88

88:                                               ; preds = %99, %76
  %89 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br i1 %89, label %91, label %90

90:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %101

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  store ptr %92, ptr %13, align 8, !tbaa !9
  %93 = load ptr, ptr %13, align 8, !tbaa !9
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %95
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %96)
  %98 = load i32, ptr %97, align 4, !tbaa !5
  store i32 %98, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %99

99:                                               ; preds = %91
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br label %88

101:                                              ; preds = %90
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = load i64, ptr %8, align 8, !tbaa !11
  %105 = add nsw i64 %103, %104
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %105)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %367

107:                                              ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = add nsw i32 %108, %109
  %111 = sdiv i32 %110, 2
  store i32 %111, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %112 unwind label %120

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %113 = load i32, ptr %14, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %21, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %154, %112
  %116 = load i32, ptr %21, align 4, !tbaa !5
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = icmp sle i32 %116, %117
  br i1 %118, label %124, label %119

119:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %157

120:                                              ; preds = %107
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %17, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %18, align 4
  br label %372

124:                                              ; preds = %115
  %125 = load i32, ptr %21, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %126
  %128 = getelementptr inbounds %"struct.std::pair", ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !15
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = add nsw i32 %132, -1
  store i32 %133, ptr %131, align 4, !tbaa !5
  %134 = load i32, ptr %21, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %135
  %137 = getelementptr inbounds %"struct.std::pair", ptr %136, i32 0, i32 0
  %138 = load i32, ptr %137, align 8, !tbaa !15
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %153

143:                                              ; preds = %124
  %144 = load i32, ptr %21, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %145
  %147 = getelementptr inbounds %"struct.std::pair", ptr %146, i32 0, i32 0
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 4 dereferenceable(4) %147)
          to label %148 unwind label %149

148:                                              ; preds = %143
  br label %153

149:                                              ; preds = %143
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %17, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %371

153:                                              ; preds = %148, %124
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %21, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %21, align 4, !tbaa !5
  br label %115, !llvm.loop !16

157:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %158 = load i32, ptr %5, align 4, !tbaa !5
  %159 = load i32, ptr %14, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %160 unwind label %172

160:                                              ; preds = %157
  invoke void @_Z8contractiiSt6vectorIiSaIiEERS1_S2_(i32 noundef %158, i32 noundef %159, ptr noundef %23, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %161 unwind label %176

161:                                              ; preds = %160
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %162 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %162, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store ptr %19, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %163 = load ptr, ptr %25, align 8, !tbaa !9
  %164 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %163) #5
  %165 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %164, ptr %165, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %166 = load ptr, ptr %25, align 8, !tbaa !9
  %167 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %166) #5
  %168 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  br label %169

169:                                              ; preds = %202, %161
  %170 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27) #5
  br i1 %170, label %180, label %171

171:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %208

172:                                              ; preds = %157
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %17, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %18, align 4
  br label %370

176:                                              ; preds = %160
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %17, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %18, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  br label %370

180:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  store ptr %181, ptr %28, align 8, !tbaa !9
  %182 = load ptr, ptr %28, align 8, !tbaa !9
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = load i64, ptr %24, align 8, !tbaa !11
  %189 = add nsw i64 %188, %187
  store i64 %189, ptr %24, align 8, !tbaa !11
  %190 = load ptr, ptr %28, align 8, !tbaa !9
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = load ptr, ptr %28, align 8, !tbaa !9
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [100009 x i32], ptr @ed, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = invoke noundef zeroext i1 @_ZN4disj3uniEiiRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, i32 noundef %194, i32 noundef %199, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %201 unwind label %204

201:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %202

202:                                              ; preds = %201
  %203 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  br label %169

204:                                              ; preds = %180
  %205 = landingpad { ptr, i32 }
          cleanup
  %206 = extractvalue { ptr, i32 } %205, 0
  store ptr %206, ptr %17, align 8
  %207 = extractvalue { ptr, i32 } %205, 1
  store i32 %207, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %369

208:                                              ; preds = %171
  %209 = load i32, ptr %5, align 4, !tbaa !5
  %210 = load i32, ptr %14, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %211 unwind label %222

211:                                              ; preds = %208
  %212 = load i64, ptr %24, align 8, !tbaa !11
  invoke void @_Z5solveiiSt6vectorIiSaIiEEx(i32 noundef %209, i32 noundef %210, ptr noundef %29, i64 noundef %212)
          to label %213 unwind label %226

213:                                              ; preds = %211
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  invoke void @_ZN4disj6revertERSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %214 unwind label %222

214:                                              ; preds = %213
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %215 = load i32, ptr %14, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %30, align 4, !tbaa !5
  br label %217

217:                                              ; preds = %240, %214
  %218 = load i32, ptr %30, align 4, !tbaa !5
  %219 = load i32, ptr %6, align 4, !tbaa !5
  %220 = icmp sle i32 %218, %219
  br i1 %220, label %230, label %221

221:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %243

222:                                              ; preds = %213, %208
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %17, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %18, align 4
  br label %369

226:                                              ; preds = %211
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %17, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %18, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  br label %369

230:                                              ; preds = %217
  %231 = load i32, ptr %30, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %232
  %234 = getelementptr inbounds %"struct.std::pair", ptr %233, i32 0, i32 0
  %235 = load i32, ptr %234, align 8, !tbaa !15
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %237, align 4, !tbaa !5
  br label %240

240:                                              ; preds = %230
  %241 = load i32, ptr %30, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %30, align 4, !tbaa !5
  br label %217, !llvm.loop !18

243:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %244 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %244, ptr %31, align 4, !tbaa !5
  br label %245

245:                                              ; preds = %280, %243
  %246 = load i32, ptr %31, align 4, !tbaa !5
  %247 = load i32, ptr %14, align 4, !tbaa !5
  %248 = icmp sle i32 %246, %247
  br i1 %248, label %250, label %249

249:                                              ; preds = %245
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %283

250:                                              ; preds = %245
  %251 = load i32, ptr %31, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %252
  %254 = getelementptr inbounds %"struct.std::pair", ptr %253, i32 0, i32 0
  %255 = load i32, ptr %254, align 8, !tbaa !15
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %256
  %258 = load i32, ptr %257, align 4, !tbaa !5
  %259 = add nsw i32 %258, -1
  store i32 %259, ptr %257, align 4, !tbaa !5
  %260 = load i32, ptr %31, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %261
  %263 = getelementptr inbounds %"struct.std::pair", ptr %262, i32 0, i32 0
  %264 = load i32, ptr %263, align 8, !tbaa !15
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %265
  %267 = load i32, ptr %266, align 4, !tbaa !5
  %268 = icmp eq i32 %267, 0
  br i1 %268, label %269, label %279

269:                                              ; preds = %250
  %270 = load i32, ptr %31, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %271
  %273 = getelementptr inbounds %"struct.std::pair", ptr %272, i32 0, i32 0
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(4) %273)
          to label %274 unwind label %275

274:                                              ; preds = %269
  br label %279

275:                                              ; preds = %269
  %276 = landingpad { ptr, i32 }
          cleanup
  %277 = extractvalue { ptr, i32 } %276, 0
  store ptr %277, ptr %17, align 8
  %278 = extractvalue { ptr, i32 } %276, 1
  store i32 %278, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %369

279:                                              ; preds = %274, %250
  br label %280

280:                                              ; preds = %279
  %281 = load i32, ptr %31, align 4, !tbaa !5
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %31, align 4, !tbaa !5
  br label %245, !llvm.loop !19

283:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %284 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %284, ptr %32, align 8, !tbaa !11
  %285 = load i32, ptr %14, align 4, !tbaa !5
  %286 = add nsw i32 %285, 1
  %287 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %288 unwind label %299

288:                                              ; preds = %283
  invoke void @_Z8contractiiSt6vectorIiSaIiEERS1_S2_(i32 noundef %286, i32 noundef %287, ptr noundef %33, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %289 unwind label %303

289:                                              ; preds = %288
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  store ptr %19, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %290 = load ptr, ptr %34, align 8, !tbaa !9
  %291 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %290) #5
  %292 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %291, ptr %292, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %293 = load ptr, ptr %34, align 8, !tbaa !9
  %294 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %293) #5
  %295 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  store ptr %294, ptr %295, align 8
  br label %296

296:                                              ; preds = %329, %289
  %297 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %36) #5
  br i1 %297, label %307, label %298

298:                                              ; preds = %296
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  br label %335

299:                                              ; preds = %341, %335, %283
  %300 = landingpad { ptr, i32 }
          cleanup
  %301 = extractvalue { ptr, i32 } %300, 0
  store ptr %301, ptr %17, align 8
  %302 = extractvalue { ptr, i32 } %300, 1
  store i32 %302, ptr %18, align 4
  br label %368

303:                                              ; preds = %288
  %304 = landingpad { ptr, i32 }
          cleanup
  %305 = extractvalue { ptr, i32 } %304, 0
  store ptr %305, ptr %17, align 8
  %306 = extractvalue { ptr, i32 } %304, 1
  store i32 %306, ptr %18, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #5
  br label %368

307:                                              ; preds = %296
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  %308 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #5
  store ptr %308, ptr %37, align 8, !tbaa !9
  %309 = load ptr, ptr %37, align 8, !tbaa !9
  %310 = load i32, ptr %309, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = load i64, ptr %32, align 8, !tbaa !11
  %316 = add nsw i64 %315, %314
  store i64 %316, ptr %32, align 8, !tbaa !11
  %317 = load ptr, ptr %37, align 8, !tbaa !9
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %319
  %321 = load i32, ptr %320, align 4, !tbaa !5
  %322 = load ptr, ptr %37, align 8, !tbaa !9
  %323 = load i32, ptr %322, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [100009 x i32], ptr @ed, i64 0, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !5
  %327 = invoke noundef zeroext i1 @_ZN4disj3uniEiiRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, i32 noundef %321, i32 noundef %326, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %328 unwind label %331

328:                                              ; preds = %307
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  br label %329

329:                                              ; preds = %328
  %330 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %35) #5
  br label %296

331:                                              ; preds = %307
  %332 = landingpad { ptr, i32 }
          cleanup
  %333 = extractvalue { ptr, i32 } %332, 0
  store ptr %333, ptr %17, align 8
  %334 = extractvalue { ptr, i32 } %332, 1
  store i32 %334, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  br label %368

335:                                              ; preds = %298
  %336 = load i32, ptr %14, align 4, !tbaa !5
  %337 = add nsw i32 %336, 1
  %338 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %339 unwind label %299

339:                                              ; preds = %335
  %340 = load i64, ptr %32, align 8, !tbaa !11
  invoke void @_Z5solveiiSt6vectorIiSaIiEEx(i32 noundef %337, i32 noundef %338, ptr noundef %38, i64 noundef %340)
          to label %341 unwind label %349

341:                                              ; preds = %339
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %38) #5
  invoke void @_ZN4disj6revertERSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %342 unwind label %299

342:                                              ; preds = %341
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #5
  %343 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %343, ptr %39, align 4, !tbaa !5
  br label %344

344:                                              ; preds = %363, %342
  %345 = load i32, ptr %39, align 4, !tbaa !5
  %346 = load i32, ptr %14, align 4, !tbaa !5
  %347 = icmp sle i32 %345, %346
  br i1 %347, label %353, label %348

348:                                              ; preds = %344
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #5
  br label %366

349:                                              ; preds = %339
  %350 = landingpad { ptr, i32 }
          cleanup
  %351 = extractvalue { ptr, i32 } %350, 0
  store ptr %351, ptr %17, align 8
  %352 = extractvalue { ptr, i32 } %350, 1
  store i32 %352, ptr %18, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %38) #5
  br label %368

353:                                              ; preds = %344
  %354 = load i32, ptr %39, align 4, !tbaa !5
  %355 = sext i32 %354 to i64
  %356 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %355
  %357 = getelementptr inbounds %"struct.std::pair", ptr %356, i32 0, i32 0
  %358 = load i32, ptr %357, align 8, !tbaa !15
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %359
  %361 = load i32, ptr %360, align 4, !tbaa !5
  %362 = add nsw i32 %361, 1
  store i32 %362, ptr %360, align 4, !tbaa !5
  br label %363

363:                                              ; preds = %353
  %364 = load i32, ptr %39, align 4, !tbaa !5
  %365 = add nsw i32 %364, 1
  store i32 %365, ptr %39, align 4, !tbaa !5
  br label %344, !llvm.loop !20

366:                                              ; preds = %348
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %367

367:                                              ; preds = %366, %101, %73
  ret void

368:                                              ; preds = %349, %331, %303, %299
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %369

369:                                              ; preds = %368, %275, %226, %222, %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %370

370:                                              ; preds = %369, %176, %172
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  br label %371

371:                                              ; preds = %370, %149
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br label %372

372:                                              ; preds = %371, %120
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %373

373:                                              ; preds = %372
  %374 = load ptr, ptr %17, align 8
  %375 = load i32, ptr %18, align 4
  %376 = insertvalue { ptr, i32 } poison, ptr %374, 0
  %377 = insertvalue { ptr, i32 } %376, i32 %375, 1
  resume { ptr, i32 } %377
}

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

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

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

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

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

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

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


; 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.disj = type { [100009 x i32], [100009 x i32] }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@disj = external dso_local global %struct.disj, align 4
@st = external dso_local local_unnamed_addr global [100009 x i32], align 16
@ed = external dso_local local_unnamed_addr global [100009 x i32], align 16
@cost = external dso_local global [100009 x i32], align 16
@chk = external dso_local local_unnamed_addr global [100009 x i32], align 16
@qr = external dso_local global [100009 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8contractiiSt6vectorIiSaIiEERS1_S2_(i32 noundef, i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4disj3uniEiiRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveiiSt6vectorIiSaIiEEx(i32 noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca %"class.std::vector.0", align 8
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca %"class.std::vector", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.std::vector", align 8
  %21 = icmp eq i32 %0, %1
  br i1 %21, label %22, label %53

22:                                               ; preds = %4
  %23 = sext i32 %0 to i64
  %24 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = load i32, ptr %24, align 8, !tbaa !10
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !11
  %30 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %28
  %31 = load i32, ptr %30, align 4, !tbaa !11
  %32 = getelementptr inbounds [100009 x i32], ptr @ed, i64 0, i64 %28
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = icmp eq i32 %31, %33
  br i1 %34, label %35, label %37

35:                                               ; preds = %22
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %3)
  br label %218

37:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 %26, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %38 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store ptr %38, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %39 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  store ptr %39, ptr %7, align 8
  %40 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %40, label %.lr.ph115, label %._crit_edge116

._crit_edge116.loopexit:                          ; preds = %.lr.ph115
  %.pre = load i32, ptr %5, align 4, !tbaa !11
  br label %._crit_edge116

._crit_edge116:                                   ; preds = %._crit_edge116.loopexit, %37
  %41 = phi i32 [ %.pre, %._crit_edge116.loopexit ], [ %26, %37 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %42 = sext i32 %41 to i64
  %43 = add nsw i64 %42, %3
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %43)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %218

.lr.ph115:                                        ; preds = %37, %.lr.ph115
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %47
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = load i32, ptr %49, align 4, !tbaa !11
  store i32 %50, ptr %5, align 4, !tbaa !11
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %52 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %52, label %.lr.ph115, label %._crit_edge116.loopexit

53:                                               ; preds = %4
  %54 = add nsw i32 %1, %0
  %55 = sdiv i32 %54, 2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %56 unwind label %60

56:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %57 = add nsw i32 %55, 1
  %.not91.not = icmp slt i32 %55, %1
  br i1 %.not91.not, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %56
  %narrow = add nsw i32 %55, 1
  %58 = sext i32 %narrow to i64
  %59 = add i32 %1, 1
  br label %.lr.ph

._crit_edge:                                      ; preds = %72, %56
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %73 unwind label %78

60:                                               ; preds = %53
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %221

.lr.ph:                                           ; preds = %.lr.ph.preheader, %72
  %indvars.iv = phi i64 [ %58, %.lr.ph.preheader ], [ %indvars.iv.next, %72 ]
  %62 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv
  %63 = load i32, ptr %62, align 8, !tbaa !10
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !11
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %65, align 4, !tbaa !11
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %72

69:                                               ; preds = %.lr.ph
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %62)
          to label %72 unwind label %70

70:                                               ; preds = %69
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %220

72:                                               ; preds = %.lr.ph, %69
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %59, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

73:                                               ; preds = %._crit_edge
  invoke void @_Z8contractiiSt6vectorIiSaIiEERS1_S2_(i32 noundef %0, i32 noundef %55, ptr noundef nonnull %13, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %74 unwind label %80

74:                                               ; preds = %73
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %75 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  store ptr %75, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %76 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  store ptr %76, ptr %15, align 8
  %77 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %77, label %.lr.ph95, label %._crit_edge96

._crit_edge96:                                    ; preds = %92, %74
  %.073.lcssa = phi i64 [ %3, %74 ], [ %94, %92 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %99 unwind label %114

78:                                               ; preds = %._crit_edge
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %219

80:                                               ; preds = %73
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %219

.lr.ph95:                                         ; preds = %74, %92
  %.07393 = phi i64 [ %94, %92 ], [ %3, %74 ]
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %83 = load i32, ptr %82, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %84
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = getelementptr inbounds [100009 x i32], ptr @ed, i64 0, i64 %84
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = invoke noundef zeroext i1 @_ZN4disj3uniEiiRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, i32 noundef %88, i32 noundef %90, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %92 unwind label %97

92:                                               ; preds = %.lr.ph95
  %93 = sext i32 %86 to i64
  %94 = add nsw i64 %.07393, %93
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %96, label %.lr.ph95, label %._crit_edge96

97:                                               ; preds = %.lr.ph95
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %219

99:                                               ; preds = %._crit_edge96
  invoke void @_Z5solveiiSt6vectorIiSaIiEEx(i32 noundef %0, i32 noundef %55, ptr noundef nonnull %16, i64 noundef %.073.lcssa)
          to label %100 unwind label %116

100:                                              ; preds = %99
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  invoke void @_ZN4disj6revertERSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %101 unwind label %114

101:                                              ; preds = %100
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  br i1 %.not91.not, label %.lr.ph100.preheader, label %.preheader88

.lr.ph100.preheader:                              ; preds = %101
  %narrow134 = add nsw i32 %55, 1
  %102 = sext i32 %narrow134 to i64
  %103 = add i32 %1, 1
  %104 = sub i32 %1, %55
  %xtraiter = and i32 %104, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph100.prol.loopexit, label %.lr.ph100.prol

.lr.ph100.prol:                                   ; preds = %.lr.ph100.preheader, %.lr.ph100.prol
  %indvars.iv119.prol = phi i64 [ %indvars.iv.next120.prol, %.lr.ph100.prol ], [ %102, %.lr.ph100.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph100.prol ], [ 0, %.lr.ph100.preheader ]
  %105 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv119.prol
  %106 = load i32, ptr %105, align 8, !tbaa !10
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !11
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %108, align 4, !tbaa !11
  %indvars.iv.next120.prol = add nsw i64 %indvars.iv119.prol, 1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph100.prol.loopexit, label %.lr.ph100.prol, !llvm.loop !14

.lr.ph100.prol.loopexit:                          ; preds = %.lr.ph100.prol, %.lr.ph100.preheader
  %indvars.iv119.unr = phi i64 [ %102, %.lr.ph100.preheader ], [ %indvars.iv.next120.prol, %.lr.ph100.prol ]
  %111 = sub i32 %55, %1
  %112 = icmp ugt i32 %111, -4
  br i1 %112, label %.preheader88, label %.lr.ph100

.preheader88:                                     ; preds = %.lr.ph100.prol.loopexit, %.lr.ph100, %101
  %.not79101 = icmp slt i32 %55, %0
  br i1 %.not79101, label %._crit_edge104, label %.lr.ph103.preheader

.lr.ph103.preheader:                              ; preds = %.preheader88
  %113 = sext i32 %0 to i64
  br label %.lr.ph103

114:                                              ; preds = %100, %._crit_edge96
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %219

116:                                              ; preds = %99
  %117 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br label %219

.lr.ph100:                                        ; preds = %.lr.ph100.prol.loopexit, %.lr.ph100
  %indvars.iv119 = phi i64 [ %indvars.iv.next120.3, %.lr.ph100 ], [ %indvars.iv119.unr, %.lr.ph100.prol.loopexit ]
  %118 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv119
  %119 = load i32, ptr %118, align 8, !tbaa !10
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !11
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %121, align 4, !tbaa !11
  %indvars.iv.next120 = add nsw i64 %indvars.iv119, 1
  %124 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv.next120
  %125 = load i32, ptr %124, align 8, !tbaa !10
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !11
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %127, align 4, !tbaa !11
  %indvars.iv.next120.1 = add nsw i64 %indvars.iv119, 2
  %130 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv.next120.1
  %131 = load i32, ptr %130, align 8, !tbaa !10
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %133, align 4, !tbaa !11
  %indvars.iv.next120.2 = add nsw i64 %indvars.iv119, 3
  %136 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv.next120.2
  %137 = load i32, ptr %136, align 8, !tbaa !10
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %139, align 4, !tbaa !11
  %indvars.iv.next120.3 = add nsw i64 %indvars.iv119, 4
  %lftr.wideiv122.3 = trunc i64 %indvars.iv.next120.3 to i32
  %exitcond123.not.3 = icmp eq i32 %103, %lftr.wideiv122.3
  br i1 %exitcond123.not.3, label %.preheader88, label %.lr.ph100, !llvm.loop !16

._crit_edge104:                                   ; preds = %152, %.preheader88
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %153 unwind label %158

.lr.ph103:                                        ; preds = %.lr.ph103.preheader, %152
  %indvars.iv124 = phi i64 [ %113, %.lr.ph103.preheader ], [ %indvars.iv.next125, %152 ]
  %142 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv124
  %143 = load i32, ptr %142, align 8, !tbaa !10
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !11
  %147 = add nsw i32 %146, -1
  store i32 %147, ptr %145, align 4, !tbaa !11
  %148 = icmp eq i32 %147, 0
  br i1 %148, label %149, label %152

149:                                              ; preds = %.lr.ph103
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %142)
          to label %152 unwind label %150

150:                                              ; preds = %149
  %151 = landingpad { ptr, i32 }
          cleanup
  br label %219

152:                                              ; preds = %.lr.ph103, %149
  %indvars.iv.next125 = add nsw i64 %indvars.iv124, 1
  %lftr.wideiv127 = trunc i64 %indvars.iv.next125 to i32
  %exitcond128.not = icmp eq i32 %57, %lftr.wideiv127
  br i1 %exitcond128.not, label %._crit_edge104, label %.lr.ph103, !llvm.loop !17

153:                                              ; preds = %._crit_edge104
  invoke void @_Z8contractiiSt6vectorIiSaIiEERS1_S2_(i32 noundef %57, i32 noundef %1, ptr noundef nonnull %17, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %154 unwind label %160

154:                                              ; preds = %153
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  %155 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  store ptr %155, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  %156 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  store ptr %156, ptr %19, align 8
  %157 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  br i1 %157, label %.lr.ph107, label %._crit_edge108

._crit_edge108:                                   ; preds = %172, %154
  %.069.lcssa = phi i64 [ %3, %154 ], [ %174, %172 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %179 unwind label %158

158:                                              ; preds = %180, %._crit_edge108, %._crit_edge104
  %159 = landingpad { ptr, i32 }
          cleanup
  br label %219

160:                                              ; preds = %153
  %161 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  br label %219

.lr.ph107:                                        ; preds = %154, %172
  %.069105 = phi i64 [ %174, %172 ], [ %3, %154 ]
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %163 = load i32, ptr %162, align 4, !tbaa !11
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100009 x i32], ptr @cost, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !11
  %167 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %164
  %168 = load i32, ptr %167, align 4, !tbaa !11
  %169 = getelementptr inbounds [100009 x i32], ptr @ed, i64 0, i64 %164
  %170 = load i32, ptr %169, align 4, !tbaa !11
  %171 = invoke noundef zeroext i1 @_ZN4disj3uniEiiRSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, i32 noundef %168, i32 noundef %170, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %172 unwind label %177

172:                                              ; preds = %.lr.ph107
  %173 = sext i32 %166 to i64
  %174 = add nsw i64 %.069105, %173
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %176 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  br i1 %176, label %.lr.ph107, label %._crit_edge108

177:                                              ; preds = %.lr.ph107
  %178 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %219

179:                                              ; preds = %._crit_edge108
  invoke void @_Z5solveiiSt6vectorIiSaIiEEx(i32 noundef %57, i32 noundef %1, ptr noundef nonnull %20, i64 noundef %.069.lcssa)
          to label %180 unwind label %192

180:                                              ; preds = %179
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  invoke void @_ZN4disj6revertERSt6vectorISt4pairIiiESaIS2_EE(ptr noundef nonnull align 4 dereferenceable(800072) @disj, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %.preheader unwind label %158

.preheader:                                       ; preds = %180
  br i1 %.not79101, label %._crit_edge113, label %.lr.ph112.preheader

.lr.ph112.preheader:                              ; preds = %.preheader
  %181 = sext i32 %0 to i64
  %182 = add nsw i32 %55, 1
  %183 = sub i32 %182, %0
  %184 = sub i32 %55, %0
  %xtraiter138 = and i32 %183, 3
  %lcmp.mod139.not = icmp eq i32 %xtraiter138, 0
  br i1 %lcmp.mod139.not, label %.lr.ph112.prol.loopexit, label %.lr.ph112.prol

.lr.ph112.prol:                                   ; preds = %.lr.ph112.preheader, %.lr.ph112.prol
  %indvars.iv129.prol = phi i64 [ %indvars.iv.next130.prol, %.lr.ph112.prol ], [ %181, %.lr.ph112.preheader ]
  %prol.iter140 = phi i32 [ %prol.iter140.next, %.lr.ph112.prol ], [ 0, %.lr.ph112.preheader ]
  %185 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv129.prol
  %186 = load i32, ptr %185, align 8, !tbaa !10
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !11
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %188, align 4, !tbaa !11
  %indvars.iv.next130.prol = add nsw i64 %indvars.iv129.prol, 1
  %prol.iter140.next = add i32 %prol.iter140, 1
  %prol.iter140.cmp.not = icmp eq i32 %prol.iter140.next, %xtraiter138
  br i1 %prol.iter140.cmp.not, label %.lr.ph112.prol.loopexit, label %.lr.ph112.prol, !llvm.loop !18

.lr.ph112.prol.loopexit:                          ; preds = %.lr.ph112.prol, %.lr.ph112.preheader
  %indvars.iv129.unr = phi i64 [ %181, %.lr.ph112.preheader ], [ %indvars.iv.next130.prol, %.lr.ph112.prol ]
  %191 = icmp ult i32 %184, 3
  br i1 %191, label %._crit_edge113, label %.lr.ph112

._crit_edge113:                                   ; preds = %.lr.ph112.prol.loopexit, %.lr.ph112, %.preheader
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %218

192:                                              ; preds = %179
  %193 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  br label %219

.lr.ph112:                                        ; preds = %.lr.ph112.prol.loopexit, %.lr.ph112
  %indvars.iv129 = phi i64 [ %indvars.iv.next130.3, %.lr.ph112 ], [ %indvars.iv129.unr, %.lr.ph112.prol.loopexit ]
  %194 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv129
  %195 = load i32, ptr %194, align 8, !tbaa !10
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !11
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %197, align 4, !tbaa !11
  %indvars.iv.next130 = add nsw i64 %indvars.iv129, 1
  %200 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv.next130
  %201 = load i32, ptr %200, align 8, !tbaa !10
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !11
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %203, align 4, !tbaa !11
  %indvars.iv.next130.1 = add nsw i64 %indvars.iv129, 2
  %206 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv.next130.1
  %207 = load i32, ptr %206, align 8, !tbaa !10
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !11
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %209, align 4, !tbaa !11
  %indvars.iv.next130.2 = add nsw i64 %indvars.iv129, 3
  %212 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @qr, i64 0, i64 %indvars.iv.next130.2
  %213 = load i32, ptr %212, align 8, !tbaa !10
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100009 x i32], ptr @chk, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !11
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %215, align 4, !tbaa !11
  %indvars.iv.next130.3 = add nsw i64 %indvars.iv129, 4
  %lftr.wideiv132.3 = trunc i64 %indvars.iv.next130.3 to i32
  %exitcond133.not.3 = icmp eq i32 %57, %lftr.wideiv132.3
  br i1 %exitcond133.not.3, label %._crit_edge113, label %.lr.ph112, !llvm.loop !19

218:                                              ; preds = %._crit_edge113, %._crit_edge116, %35
  ret void

219:                                              ; preds = %97, %114, %116, %150, %192, %177, %160, %158, %80, %78
  %.pn82.pn = phi { ptr, i32 } [ %81, %80 ], [ %79, %78 ], [ %98, %97 ], [ %151, %150 ], [ %115, %114 ], [ %117, %116 ], [ %178, %177 ], [ %159, %158 ], [ %193, %192 ], [ %161, %160 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  br label %220

220:                                              ; preds = %219, %70
  %.pn85 = phi { ptr, i32 } [ %71, %70 ], [ %.pn82.pn, %219 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br label %221

221:                                              ; preds = %220, %60
  %.pn85.pn = phi { ptr, i32 } [ %.pn85, %220 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  resume { ptr, i32 } %.pn85.pn
}

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

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

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

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

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

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

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


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