; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2017.02/visitfj.ll (Z3dijSt4pairIiiERA100_A100_i)

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

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

@N = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@a = external dso_local global [100 x [100 x i32]], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9get_movesii(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i32 noundef, i32 noundef) #0

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress 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 @_Z3dijSt4pairIiiERA100_A100_i(i64 %0, ptr noundef nonnull align 4 dereferenceable(40000) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::priority_queue", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca %"struct.std::pair.5", align 4
  %14 = alloca { i64, i32 }, align 8
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::vector", align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca %"struct.std::pair.5", align 4
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca { i64, i32 }, align 8
  store i64 %0, ptr %3, align 4
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #7
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  %25 = load i32, ptr @N, align 4, !tbaa !9
  %26 = zext i32 %25 to i64
  %27 = load i32, ptr @N, align 4, !tbaa !9
  %28 = zext i32 %27 to i64
  %29 = call ptr @llvm.stacksave.p0()
  store ptr %29, ptr %6, align 8
  %30 = mul nuw i64 %26, %28
  %31 = alloca i8, i64 %30, align 16
  store i64 %26, ptr %7, align 8
  store i64 %28, ptr %8, align 8
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds [100 x [100 x i32]], ptr %32, i64 0, i64 0
  %34 = getelementptr inbounds [100 x i32], ptr %33, i64 0, i64 0
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = load i32, ptr @N, align 4, !tbaa !9
  %37 = sub nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100 x [100 x i32]], ptr %35, i64 0, i64 %38
  %40 = getelementptr inbounds [100 x i32], ptr %39, i64 0, i64 0
  %41 = load i32, ptr @N, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 2147483647, ptr %9, align 4, !tbaa !9
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %34, ptr noundef %43, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %44 unwind label %98

44:                                               ; preds = %2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %45 = mul nsw i64 0, %28
  %46 = getelementptr inbounds i8, ptr %31, i64 %45
  %47 = load i32, ptr @N, align 4, !tbaa !9
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = mul nsw i64 %49, %28
  %51 = getelementptr inbounds i8, ptr %31, i64 %50
  %52 = load i32, ptr @N, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i8, ptr %51, i64 %53
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  store i8 0, ptr %12, align 1, !tbaa !11
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef %46, ptr noundef %54, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %55 unwind label %102

55:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !13
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100 x [100 x i32]], ptr %56, i64 0, i64 %59
  %61 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !15
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100 x i32], ptr %60, i64 0, i64 %63
  store i32 0, ptr %64, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #7
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 0
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100 x [100 x i32]], ptr %65, i64 0, i64 %68
  %70 = getelementptr inbounds %"struct.std::pair", ptr %3, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !15
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100 x i32], ptr %69, i64 0, i64 %72
  %74 = invoke { i64, i32 } @_ZSt9make_pairIRiRSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %73, ptr noundef nonnull align 4 dereferenceable(8) %3)
          to label %75 unwind label %106

75:                                               ; preds = %55
  store { i64, i32 } %74, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %14, i64 12, i1 false)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(12) %13)
          to label %76 unwind label %106

76:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  br label %77

77:                                               ; preds = %240, %238, %76
  %78 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %79 unwind label %110

79:                                               ; preds = %77
  %80 = xor i1 %78, true
  br i1 %80, label %81, label %243

81:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %82 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %83 unwind label %114

83:                                               ; preds = %81
  %84 = getelementptr inbounds %"struct.std::pair.5", ptr %82, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %84, i64 8, i1 false)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %85 unwind label %114

85:                                               ; preds = %83
  %86 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %87 = load i32, ptr %86, align 4, !tbaa !13
  %88 = sext i32 %87 to i64
  %89 = mul nsw i64 %88, %28
  %90 = getelementptr inbounds i8, ptr %31, i64 %89
  %91 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !15
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %90, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !11, !range !16, !noundef !17
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %118

97:                                               ; preds = %85
  store i32 2, ptr %16, align 4
  br label %238, !llvm.loop !18

98:                                               ; preds = %2
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %10, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %245

102:                                              ; preds = %44
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %10, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  br label %245

106:                                              ; preds = %75, %55
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %10, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  br label %245

110:                                              ; preds = %77
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %10, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %11, align 4
  br label %245

114:                                              ; preds = %83, %81
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %10, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %11, align 4
  br label %242

118:                                              ; preds = %85
  %119 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %120 = load i32, ptr %119, align 4, !tbaa !13
  %121 = sext i32 %120 to i64
  %122 = mul nsw i64 %121, %28
  %123 = getelementptr inbounds i8, ptr %31, i64 %122
  %124 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !15
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %123, i64 %126
  store i8 1, ptr %127, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #7
  %128 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %129 = load i32, ptr %128, align 4, !tbaa !13
  %130 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !15
  invoke void @_Z9get_movesii(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %17, i32 noundef %129, i32 noundef %131)
          to label %132 unwind label %142

132:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store ptr %17, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %133) #7
  %135 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %134, ptr %135, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %136 = load ptr, ptr %18, align 8, !tbaa !5
  %137 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #7
  %138 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  br label %139

139:                                              ; preds = %235, %132
  %140 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %140, label %146, label %141

141:                                              ; preds = %139
  store i32 4, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %237

142:                                              ; preds = %118
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %10, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %11, align 4
  br label %241

146:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %147 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %147, i64 8, i1 false)
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %150 = load i32, ptr %149, align 4, !tbaa !13
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [100 x [100 x i32]], ptr %148, i64 0, i64 %151
  %153 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %154 = load i32, ptr %153, align 4, !tbaa !15
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100 x i32], ptr %152, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %160 = load i32, ptr %159, align 4, !tbaa !13
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [100 x [100 x i32]], ptr %158, i64 0, i64 %161
  %163 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !15
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [100 x i32], ptr %162, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !9
  %168 = load i32, ptr @T, align 4, !tbaa !9
  %169 = mul nsw i32 3, %168
  %170 = add nsw i32 %167, %169
  %171 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %172 = load i32, ptr %171, align 4, !tbaa !13
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [100 x [100 x i32]], ptr @a, i64 0, i64 %173
  %175 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %176 = load i32, ptr %175, align 4, !tbaa !15
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [100 x i32], ptr %174, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !9
  %180 = add nsw i32 %170, %179
  %181 = icmp sgt i32 %157, %180
  br i1 %181, label %182, label %234

182:                                              ; preds = %146
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %185 = load i32, ptr %184, align 4, !tbaa !13
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100 x [100 x i32]], ptr %183, i64 0, i64 %186
  %188 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %189 = load i32, ptr %188, align 4, !tbaa !15
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100 x i32], ptr %187, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !9
  %193 = load i32, ptr @T, align 4, !tbaa !9
  %194 = mul nsw i32 3, %193
  %195 = add nsw i32 %192, %194
  %196 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %197 = load i32, ptr %196, align 4, !tbaa !13
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100 x [100 x i32]], ptr @a, i64 0, i64 %198
  %200 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %201 = load i32, ptr %200, align 4, !tbaa !15
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [100 x i32], ptr %199, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !9
  %205 = add nsw i32 %195, %204
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %208 = load i32, ptr %207, align 4, !tbaa !13
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [100 x [100 x i32]], ptr %206, i64 0, i64 %209
  %211 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %212 = load i32, ptr %211, align 4, !tbaa !15
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [100 x i32], ptr %210, i64 0, i64 %213
  store i32 %205, ptr %214, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #7
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %217 = load i32, ptr %216, align 4, !tbaa !13
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100 x [100 x i32]], ptr %215, i64 0, i64 %218
  %220 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %221 = load i32, ptr %220, align 4, !tbaa !15
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [100 x i32], ptr %219, i64 0, i64 %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %224 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 0
  %225 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(4) %224, ptr noundef nonnull align 4 dereferenceable(4) %225)
          to label %226 unwind label %230

226:                                              ; preds = %182
  %227 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %223, ptr noundef nonnull align 4 dereferenceable(8) %23)
          to label %228 unwind label %230

228:                                              ; preds = %226
  store { i64, i32 } %227, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %24, i64 12, i1 false)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(12) %22)
          to label %229 unwind label %230

229:                                              ; preds = %228
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #7
  br label %234

230:                                              ; preds = %228, %226, %182
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %10, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  br label %241

234:                                              ; preds = %229, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %235

235:                                              ; preds = %234
  %236 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br label %139

237:                                              ; preds = %141
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  store i32 0, ptr %16, align 4
  br label %238

238:                                              ; preds = %237, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  %239 = load i32, ptr %16, align 4
  switch i32 %239, label %251 [
    i32 0, label %240
    i32 2, label %77
  ]

240:                                              ; preds = %238
  br label %77, !llvm.loop !18

241:                                              ; preds = %230, %142
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #7
  br label %242

242:                                              ; preds = %241, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %245

243:                                              ; preds = %79
  %244 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %244)
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #7
  ret void

245:                                              ; preds = %242, %110, %106, %102, %98
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #7
  br label %246

246:                                              ; preds = %245
  %247 = load ptr, ptr %10, align 8
  %248 = load i32, ptr %11, align 4
  %249 = insertvalue { ptr, i32 } poison, ptr %247, 0
  %250 = insertvalue { ptr, i32 } %249, i32 %248, 1
  resume { ptr, i32 } %250

251:                                              ; preds = %238
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiRSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #0

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #6 align 2

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

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

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


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

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

@N = external dso_local local_unnamed_addr global i32, align 4
@T = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local local_unnamed_addr global [100 x [100 x i32]], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9get_movesii(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress 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 @_Z3dijSt4pairIiiERA100_A100_i(i64 %0, ptr noundef nonnull align 4 dereferenceable(40000) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"class.std::priority_queue", align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca %"struct.std::pair.5", align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::pair.5", align 8
  %13 = alloca %"struct.std::pair", align 4
  store i64 %0, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %14 = load i32, ptr @N, align 4, !tbaa !5
  %15 = zext i32 %14 to i64
  %16 = call ptr @llvm.stacksave.p0()
  %17 = mul nuw i64 %15, %15
  %18 = alloca i8, i64 %17, align 16
  %19 = load i32, ptr @N, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100 x [100 x i32]], ptr %1, i64 0, i64 %21
  %23 = sext i32 %19 to i64
  %24 = getelementptr inbounds i32, ptr %22, i64 %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 2147483647, ptr %5, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %1, ptr noundef nonnull %24, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %25 unwind label %53

25:                                               ; preds = %2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %26 = load i32, ptr @N, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  %28 = sext i32 %27 to i64
  %29 = mul nsw i64 %28, %15
  %30 = getelementptr inbounds i8, ptr %18, i64 %29
  %31 = sext i32 %26 to i64
  %32 = getelementptr inbounds i8, ptr %30, i64 %31
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  store i8 0, ptr %6, align 1, !tbaa !9
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull %18, ptr noundef nonnull %32, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %33 unwind label %55

33:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %sext = shl i64 %0, 32
  %34 = ashr exact i64 %sext, 32
  %35 = ashr i64 %0, 32
  %36 = getelementptr inbounds [100 x [100 x i32]], ptr %1, i64 0, i64 %34, i64 %35
  store i32 0, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  %37 = invoke { i64, i32 } @_ZSt9make_pairIRiRSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 4 dereferenceable(8) %3)
          to label %38 unwind label %57

38:                                               ; preds = %33
  %.fca.0.extract11 = extractvalue { i64, i32 } %37, 0
  %.fca.1.extract12 = extractvalue { i64, i32 } %37, 1
  store i64 %.fca.0.extract11, ptr %7, align 8
  %.sroa.214.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %.fca.1.extract12, ptr %.sroa.214.0..sroa_idx, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %39 unwind label %57

39:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  %40 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  br i1 %40, label %._crit_edge35, label %.lr.ph34

.lr.ph34:                                         ; preds = %39
  %41 = getelementptr inbounds i8, ptr %11, i64 4
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  br label %42

42:                                               ; preds = %.lr.ph34, %93
  %43 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %44 = getelementptr inbounds i8, ptr %43, i64 4
  %.sroa.02.0.copyload = load i32, ptr %44, align 4
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 8
  %.sroa.9.0.copyload = load i32, ptr %.sroa.9.0..sroa_idx, align 4
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %45 unwind label %59

45:                                               ; preds = %42
  %46 = sext i32 %.sroa.02.0.copyload to i64
  %47 = mul nsw i64 %46, %15
  %48 = getelementptr inbounds i8, ptr %18, i64 %47
  %49 = sext i32 %.sroa.9.0.copyload to i64
  %50 = getelementptr inbounds i8, ptr %48, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !9, !range !11, !noundef !12
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %93, label %61, !llvm.loop !13

53:                                               ; preds = %2
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %96

55:                                               ; preds = %25
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  br label %96

57:                                               ; preds = %38, %33
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  br label %96

59:                                               ; preds = %42
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %96

61:                                               ; preds = %45
  store i8 1, ptr %50, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  invoke void @_Z9get_movesii(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %8, i32 noundef %.sroa.02.0.copyload, i32 noundef %.sroa.9.0.copyload)
          to label %62 unwind label %67

62:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %63 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  store ptr %63, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %64 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  store ptr %64, ptr %10, align 8
  %65 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %65, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %62
  %66 = getelementptr inbounds [100 x [100 x i32]], ptr %1, i64 0, i64 %46, i64 %49
  br label %69

._crit_edge:                                      ; preds = %90, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %93

67:                                               ; preds = %61
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %95

69:                                               ; preds = %.lr.ph, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %70 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %71 = load i64, ptr %70, align 4
  store i64 %71, ptr %11, align 8
  %sext37 = shl i64 %71, 32
  %72 = ashr exact i64 %sext37, 32
  %73 = ashr i64 %71, 32
  %74 = getelementptr inbounds [100 x [100 x i32]], ptr %1, i64 0, i64 %72, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %66, align 4, !tbaa !5
  %77 = load i32, ptr @T, align 4, !tbaa !5
  %78 = mul nsw i32 %77, 3
  %79 = add nsw i32 %78, %76
  %80 = getelementptr inbounds [100 x [100 x i32]], ptr @a, i64 0, i64 %72, i64 %73
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %79, %81
  %83 = icmp sgt i32 %75, %82
  br i1 %83, label %84, label %90

84:                                               ; preds = %69
  store i32 %82, ptr %74, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %85 = invoke { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %74, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %86 unwind label %88

86:                                               ; preds = %84
  %.fca.0.extract = extractvalue { i64, i32 } %85, 0
  %.fca.1.extract = extractvalue { i64, i32 } %85, 1
  store i64 %.fca.0.extract, ptr %12, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %87 unwind label %88

87:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  br label %90

88:                                               ; preds = %86, %84
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  br label %95

90:                                               ; preds = %87, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %92 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %92, label %69, label %._crit_edge

93:                                               ; preds = %45, %._crit_edge
  %94 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %4)
  br i1 %94, label %._crit_edge35, label %42

95:                                               ; preds = %88, %67
  %.pn = phi { ptr, i32 } [ %89, %88 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  br label %96

._crit_edge35:                                    ; preds = %93, %39
  call void @llvm.stackrestore.p0(ptr %16)
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  ret void

96:                                               ; preds = %59, %95, %57, %55, %53
  %.pn.pn.pn = phi { ptr, i32 } [ %58, %57 ], [ %56, %55 ], [ %54, %53 ], [ %.pn, %95 ], [ %60, %59 ]
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiRSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt7greaterIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

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

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

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

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass